<?php include("parent/callMe.php"); ?>

  
<?php


$branchID=$_SESSION['branch'];
$accountID=$_REQUEST['accountcode'];
$sql1 = "SELECT * FROM  eduportal_finance_account_details WHERE branch_id='$branchID' and account_id='$accountID' ORDER BY CAST(last_account_code as unsigned)  DESC LIMIT 1 "; 

$last_code = $m->query($sql1);

$codePlus=(explode("-",$last_code[0]['last_account_code']));

$codeIncreament;
if ($last_code>0) {
  
  $codeIncreament=$codePlus[3]+1;
} else {

  $codeIncreament=1;
}  


$m->where("account_name_id", $_REQUEST['accountcode']);	
$secondLevel = $m->get("eduportal_account_name");

echo $secondLevel[0]['account_code']."-0".$codeIncreament;
 ?>
  


