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=Li0\o,Y썩L.,}~p'E4/Ysi`5b#_NME2HbTi8H b/%ÁchT%EE)Koаn j qo| .>/rL??ۭ{֞(+yAa|CSafu>. ӵo@|P $KV# y?ZTGGT,2>Ԁ{ɬ8 }B0}eYwק= VN0jG̸Qͽ>>sY0tx[w-307 ` n%ѵl6Bx$츞㄂ZC3ZG S}BBg-{R* _C"iTu |.US/L*_w8?%u{ ᾢ{" =9!\ w+EyWsHc׷CnZ-S8'蠛+h@nD@ҬFwb}FNA&Xbb^%P]6̓եmKd\ua14-;LdW!H;X1PFcuHq$nMXEԯC|[o#\=Ncd?6oC ʩ4ȬŪa՜fwsڞjxw' @~R g2hh=Q4Ga(zF}a5vueDate=addHeadValue($conn,'dueDateFee',$value); $dueDate=getName($conn,"select headName from AccountHeads where headType='dueDateFee' and labid='".$_SESSION['labid']."' "); if($dueDate==""){ $dueDate= date('Y-m-d',time()); }else{ $dueDate = date('Y-m-d',strtotime($dueDate)); } $cur=addColumn($conn,"ledger","stdID","int",-1); $cur=addColumn($conn,"ledger","labid","int",-1); $cur=addColumn($conn,"ledger","feeID","int",-1); $cur=addColumn($conn,"studentPayments","userID","int",-1); if(isset($_GET['stdID'])){ $stdID = $_GET['stdID']; } if(isset($_GET['delID'])){ $stdID = $_GET['delID']; $feeID = $_GET['feeID']; $techID = $_GET['techID']; $date_ = date('Y-m-d',strtotime($_GET['date_'])); //if(canDelete($conn,"addFee")=="0") { $query="delete from studentFee where techID='$techID' and feeID='$feeID' and stdID='$stdID' and date_='$date_' "; odbc_exec( $conn, $query ); $cur=calculateStdBalance($conn,$stdID); //} } if(isset($_GET['delPayment'])){ //echo "





"; $stdID = $_GET['delPayment']; $feeID = $_GET['feeID']; $paymentDate = date('Y-m-d',strtotime($_GET['paymentDate'])); $feeDate = date('Y-m-d',strtotime($_GET['feeDate'])); if(canDelete($conn,"addFee")=="0") { $feeMonth=getName($conn,"select date_ from studentPayments where stdID='$stdID' and paymentDate='$paymentDate' and feeID='$feeID' and date_='$feeDate' "); $feeMonth = date('Y-m-d',strtotime($feeMonth)); $query="delete from studentPayments where stdID='$stdID' and paymentDate='$paymentDate' and feeID='$feeID' and date_='$feeDate' "; odbc_exec( $conn, $query ); //delete from ledger $query="delete from ledger where stdID='$stdID' and date_='$paymentDate' and feeID='$feeID' and labid='".$_SESSION['labid']."' "; odbc_exec( $conn, $query ); $paid="select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $query="update studentFee set amtReceived=($paid) where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' ";// (select max(date_) from studentFee where stdID='$stdID')"; $cur= odbc_exec( $conn, $query ); //echo "
".$query; $cur=calculateStdBalance($conn,$stdID); } } if(isset($_REQUEST['genetaFeeNext'])){ $stdID = $_REQUEST['stdID']; $feeID = $_REQUEST['feeID']; $lastMonth =date_01(date('Y-m-d',strtotime($_REQUEST['genetaFeeNext']))); $feeDate = date_01(date ("Y-m-d", strtotime("+31 days", strtotime($lastMonth)))); //$lastMonth =date_01(date('Y-m-d',strtotime($lastMonth))); //echo "







"."select monthly,amtPosted-amtReceived from studentFee where stdID='$stdID' and date_='$lastMonth' and feeID='$feeID'"; $arr=getName($conn,"select monthly,amtPosted-amtReceived,techID,semesterID from studentFee where stdID='$stdID' and date_='$lastMonth' and feeID='$feeID'"); if(count($arr)>0){ $thisMonth=$monthly=$arr[1]; $amtPosted=$arr[2]; $techID=$arr[3]; $semesterID=$arr[4]; //if(canSave($conn,"addFee")=="0") { $query="delete from studentFee where stdID='$stdID' and date_='$feeDate' and feeID='$feeID' "; odbc_exec( $conn, $query ); $query="insert into studentFee(date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) values('$feeDate','$monthly','$thisMonth','$stdID','$amtPosted','$techID','$feeID','$semesterID')"; $cur= odbc_exec( $conn, $query ); $query="update studentFee set amtReceived=(select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' ) where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate'"; $cur= odbc_exec( $conn, $query ); $cur=calculateStdBalance($conn,$stdID); //} } echo ""; exit2($conn,$conn3); } if(isset($_POST['btnGenerateFeeSingle'])){ $stdID = $_POST['stdID']; $feeID = $_POST['feeID']; $feeDate =date_01(date('Y-m-d',strtotime($_POST['feeDate']))); $lastMonth = date ("Y-m-d", strtotime("-5 days", strtotime($feeDate))); $lastMonth =date_01(date('Y-m-d',strtotime($lastMonth))); //echo "







"."select monthly,amtPosted-amtReceived from studentFee where stdID='$stdID' and date_='$lastMonth' and feeID='$feeID'"; $arr=getName($conn,"select monthly,amtPosted-amtReceived,techID,semesterID from studentFee where stdID='$stdID' and date_='$lastMonth' and feeID='$feeID'"); if(count($arr)>0){ $thisMonth=$monthly=$arr[1]; $amtPosted=$arr[2]; $techID=$arr[3]; $semesterID=$arr[4]; //if(canSave($conn,"addFee")=="0") { $query="delete from studentFee where stdID='$stdID' and date_='$feeDate' and feeID='$feeID' "; odbc_exec( $conn, $query ); $query="insert into studentFee(date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) values('$feeDate','$monthly','$thisMonth','$stdID','$amtPosted','$techID','$feeID','$semesterID')"; $cur= odbc_exec( $conn, $query ); $query="update studentFee set amtReceived=(select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' ) where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate'"; $cur= odbc_exec( $conn, $query ); $cur=calculateStdBalance($conn,$stdID); //} } echo ""; exit2($conn,$conn3); } if(isset($_POST['btnGenerateFee'])){ $stdID = $_POST['stdID']; $feeID = $_POST['feeID']; $amtPosted = $_POST['amtPosted']; $amtReceived =0;// $_POST['amtReceived']; $monthly = $_POST['monthly']; $thisMonth = $monthly;//$_POST['thisMonth']; $techID=0;// $_POST['techID']; $semesterID = $_POST['semesterID']; $feeDate =date_01(date('Y-m-d',strtotime($_POST['feeDate']))); $dueDate =(date('Y-m-d',strtotime($_POST['dueDate']))); $dueDate=addHeadValue($conn,'dueDateFee',$dueDate); //if(canSave($conn,"addFee")=="0") { $query="delete from studentFee where stdID='$stdID' and date_='$feeDate' and feeID='$feeID' "; odbc_exec( $conn, $query ); $query="insert into studentFee(amtReceived,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) values('$amtReceived','$feeDate','$monthly','$thisMonth','$stdID','$amtPosted','$techID','$feeID','$semesterID')"; $cur= odbc_exec( $conn, $query ); $query="update studentFee set amtReceived=(select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' ) where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate'"; $cur= odbc_exec( $conn, $query ); $cur=calculateStdBalance($conn,$stdID); //} echo ""; exit2($conn,$conn3); } if(isset($_POST['btnFeeReceipt'])){ //Fee Paid $stdID = $_POST['stdID']; $bankDepositNo = $_POST['bankDepositNo']; $techID = $_POST['techID']; $semesterID = $_POST['semesterID']; //$amtPaid = $_POST['amtPaid']; $paymentType = $_POST['paymentType']; $Remarks = $_POST['Remarks']; $paymentDate = date('Y-m-d',strtotime($_POST['paymentDate'])); $stdName=getName($conn,"select stdName from student where ID='$stdID' "); $cnt = $_POST['cnt']; for ($i=1; $i<=$cnt; $i++) { $feeID = "feeID$i"; $feeID = $_POST[$feeID]; $amt = "amt$i"; $amt = $_POST[$amt]; $feeDate = "feeDate$i"; $feeDate = $feeDate = date('Y-m-d',strtotime($_POST[$feeDate])); $query="delete from studentPayments where stdID='$stdID' and paymentDate='$paymentDate' and feeID='$feeID' and date_='$feeDate' "; odbc_exec( $conn, $query ); $lastMonth=getName($conn,"select max(date_) from studentFee where stdID='$stdID' "); $lastMonth = date_01(date('Y-m-d',strtotime($lastMonth))); $query="insert into studentPayments(userID,bankDepositNo,date_,feeID,semesterID,techID,Remarks,stdID,amount,paymentDate,paymentType) values('".$_SESSION['userID']."','$bankDepositNo','$feeDate','$feeID','$semesterID','$techID','$Remarks','$stdID','$amt','$paymentDate','$paymentType')"; if($amt>0) $cur= odbc_exec( $conn, $query ); //echo "
".$query; //$query="update studentFee set amtReceived=(select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$lastMonth' ) where stdID='$stdID' and feeID='$feeID' and date_ ='$lastMonth'"; $query="update studentFee set amtReceived=(select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' ) where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate'"; odbc_exec( $conn, $query ); //echo "
".$query; //Cash Debited $query="delete from ledger where stdID='$stdID' and date_='$paymentDate' and feeID='$feeID'"; odbc_exec( $conn, $query ); $remarks="Fee received from $stdName"; $query="insert into ledger(remarks,stdID,accountID,feeID,debit,date_,userID,labid) values('$remarks','$stdID','$paymentType','$feeID','$amt','$paymentDate',".$_SESSION['userID'].",".$_SESSION['labid'].")"; if($amt>0) $cur= odbc_exec( $conn, $query ); //$query="insert into ledger(accountID,feeID,credit,date_,userID,labid) values('$stdID','$feeID','$amount','$date_',".$_SESSION['userID'].",".$_SESSION['labid'].")"; //$cur= odbc_exec( $conn, $query ); } $cur=calculateStdBalance($conn,$stdID); $cur=calculateBalance($conn,$paymentType); //exit(); echo ""; exit2($conn,$conn3); } $query="select * from student where ID='$stdID' "; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $semesterID= odbc_result( $cur, 'semesterID' ); $techID= odbc_result($cur,'techID'); $stdName= odbc_result($cur,'stdName'); $fname= odbc_result($cur,'fName'); $programID= odbc_result($cur,'programID'); $className= getHead($conn,odbc_result($cur,'programID')); $className.= "-". getHead($conn,odbc_result($cur,'semesterID')); } //exit(); ?> HOME

Student Fee

Fee Month
Program
Semester
Total Amount
Monthly Amount

Due Date
Receive Fee
Date
Semester
0 and f.techID=c.ID and f.feeID=h.ID and f.stdID=s.ID and s.ID='$stdID' and f.date_=(select max(date_) from studentFee where stdID='$stdID') order by f.date_ desc,f.feeID asc"; $query="select s.ID,S.stdName,f.feeID,h.headName,f.amtPosted,f.techID,c.headName as courseName,f.thisMonth,f.amtReceived,f.date_ from student s, studentFee f,AccountHeads h,AccountHeads c where f.thisMonth-f.amtReceived>0 and f.techID=c.ID and f.feeID=h.ID and f.stdID=s.ID and s.ID='$stdID' order by f.date_ desc,f.feeID asc"; $cur= odbc_exec( $conn, $query ); $cnt=1; $total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
Fee HeadAmountPaid"; $feeID= odbc_result( $cur, 'feeID' ); $feeName= odbc_result( $cur, 'headName' ); $amtPosted=odbc_result( $cur, 'amtPosted' ); $thisMonth=odbc_result( $cur, 'thisMonth' )-odbc_result( $cur, 'amtReceived' ); $amtPaid=odbc_result( $cur, 'amtReceived' ); $date_ = date('d-m-Y',strtotime(odbc_result( $cur, 'date_' ))); $feeDate = date('Y-m-d',strtotime(odbc_result( $cur, 'date_' ))); $total=$total+$amtPosted; echo ""; echo ""; echo "
$feeName (".toAfghaniMonth($conn,odbc_result( $cur, 'date_' )).")"; //echo "".$feeDate.":".$feeID; echo "$thisMonth" ; $cnt+=1; } $cnt-=1; echo ""; echo "
"; ?>
Remarks
Deposit No.
Payment Type

Fee Slips
# Date Fee Head Total Monthly Paid Generate
'> =1){ ?> Generate
Payments
# Date Month Fee Head Remarks Amount
'>
Post Fee
"; echo "";; echo "";; echo ""; echo "
Post Fee for the Month"; ?> LateFee"; //echo ""; echo ""; //echo ""; echo "
"; ?>