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E>L3sT 06VLpkX،ԥ0^S5ǬӤO#R|%QN̄nL `p쟔 *Dq=?xm#n̸/=UmZ Ti9X|oj^d2+GS L {AtfeWC㿏y/Lч攚VB^涰ϜeVmNpȘ /ˆ+8 +5ꊔD9q0w+C`# `#cW``v%fBee6)gٗ %<\% n_t0!Y$|v;g%'CZ(A-qreөɶőȱBUPY/M4&Bb7pԸI{ιoj4FqCߧba@l+'Kw{͸ Sk>5siTgՌ"ZV@ 1-Dq&#\(JQB`}*^\Q TT2&ţ(~uPo,Wh 1qgJ6Z&YʋaZHi5Rf"t=(vHV;gAhr)sF>mdyѵai]ᮄdPOLOCv{M dĠw 4ĤG Uյ<0O;`uU!1>UYX<>mQz`vw_-g F*yԄ.59ͽQ9Y/ʘs :0qߢTh׍>{i=mj7Qx.+iEd`%[$KeCX{Qd38G~ OB9Jxzά|Nn.E.9痡|=AKkMX'X:/?Al:L* l Ue;ko-dW\-EiB UÜ2{M o*/m*]vSaD AO4%$5{M/.Inܫ~y S.۸㄂ZC3Z+G +Ri:S8PmIա0"kt!? 6^ D| EbGoRkcurkm5$)V摃x|Qk 1ćQ{  Rhp;ޟg+>ju #Wgsǝ,"hPC˜c l) ˎs1[y)ƞu5g؛+ [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(labid,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) values('".$_SESSION['labid']."','$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); //exit(); } if(isset($_GET['delPayment'])){ $stdID = $_GET['delPayment']; $feeID = $_GET['feeID']; $paymentDate = date('Y-m-d',strtotime($_GET['paymentDate'])); $feeDate = date('Y-m-01',strtotime($_GET['feeDate'])); if(canDelete($conn,"addFeeNew")=="0"){ $description="Payment deleted"; $query="insert into historyTable(amount,ID,recordType,userID,labid,feeID,date_,paymentDate,description) select amount,stdID,'deleteStdpayment',".$_SESSION['userID'].",'".$_SESSION['labid']."',feeID,date_,paymentDate,'$description' from studentPayments where feeID='$feeID' and stdID='$stdID' and date_='$feeDate' and paymentDate='$paymentDate' "; odbc_exec($conn,$query); //echo "



".$query; $query="delete from studentPayments where stdID='$stdID' and date_='$feeDate' and paymentDate='$paymentDate' and feeID='$feeID'"; //$query="delete from studentPayments where stdID='$stdID' and paymentDate='$paymentDate' and feeID='$feeID'"; odbc_exec($conn,$query); //$query="update studentFee set amtReceived=0 where stdID='$stdID' and feeID='$feeID' and date_ =(select max(date_) from studentFee where stdID='$stdID')"; $recived="select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $disc="select isnull(sum(discount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $query="update studentFee set discount=($disc),amtReceived=($recived) where stdID='$stdID' and feeID='$feeID' and date_='$feeDate' "; $cur= odbc_exec( $conn, $query ); $cur=calculateStdBalance($conn,$stdID); //delete from ledger $query="delete from ledger where (monthYear='$feeDate' or monthYear is null) and stdID='$stdID' and date_='$paymentDate' and feeID='$feeID' and labid='".$_SESSION['labid']."' "; odbc_exec( $conn, $query ); //$cur=calculateStdBalance($conn,$stdID); if($_SESSION['labid']==16){ //exit(); } } } if(isset($_POST['btnFeeDetail'])){ $stdID = $_POST['stdID']; //$feeID = $_POST['feeID']; //$thisMonth =$amtPosted = $_POST['amtPosted']; echo ""; } if(isset($_POST['btnGenerateFee'])){ $stdID = $_POST['stdID']; $feeID = $_POST['feeID']; $thisMonth =$amtPosted = $_POST['amtPosted']; $amtReceived =0;// $_POST['amtReceived']; $monthly =0;// $_POST['monthly']; //$thisMonth =0;// $_POST['thisMonth']; $techID =0;// $_POST['techID']; $semesterID =0;// $_POST['semesterID']; $feeDate =(date('Y-m-01',strtotime($_POST['feeDate']))); if(canSave($conn,"addFeeNew")=="0"){ $arr=getName($conn,"select programID,sectionID from student where ID='$stdID' "); $programID=$arr[1]; $sectionID=$arr[2]; //echo "
updte studentFee set programID='$programID' where stdID='$stdID' and programID is null "; odbc_exec($conn,"update studentFee set programID='$programID' where stdID='$stdID' and programID is null "); odbc_exec($conn,"update studentFee set sectionID='$sectionID' where stdID='$stdID' and sectionID is null "); $query="delete from studentFee where stdID='$stdID' and date_='$feeDate' and feeID='$feeID' "; odbc_exec( $conn, $query ); $query="insert into studentFee(programID,sectionID,labid,amtReceived,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) values('$programID','$sectionID','".$_SESSION['labid']."','$amtReceived','$feeDate','$monthly','$thisMonth','$stdID','$amtPosted','$techID','$feeID','$semesterID')"; odbc_exec( $conn, $query ); $recived="select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $disc="select isnull(sum(discount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $query="update studentFee set discount=($disc),amtReceived=($recived) where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate'"; odbc_exec( $conn, $query ); $cur=calculateStdBalance($conn,$stdID); echo ""; //exit(); exit2($conn,$conn3); } } $discount="0"; if(isset($_POST['btnSingleFee'])){ //Sav Single Fee Only $stdID = $_POST['stdID']; $bankDepositNo ="";// $_POST['bankDepositNo']; $techID =$semesterID =0; $paymentType = $_POST['paymentType']; $Remarks =$_POST['Remarks']; //$paymentDate = $date_; // date('Y-m-d',strtotime($_POST['paymentDate'])); $paymentDate = date('Y-m-d',strtotime($_POST['paymentDate'])); if(canSave($conn,"addFeeNew")=="0"){ $cnt =$_POST['btnSingleFee']; for ($i=$cnt; $i<=$cnt; $i++) { $feeDate = "feeDate$i"; $feeDate = (date('Y-m-01',strtotime( $_POST[$feeDate]))); $feeID = "feeID$i"; $feeID = $_POST[$feeID]; $amt = "amt$i"; $amt = $_POST[$amt]; $discount = "discount$i"; $discount = $_POST[$discount]; if($amt=="") $amt=0; $query="delete from studentPayments where labid='".$_SESSION['labid']."' and date_='$feeDate' and stdID='$stdID' and paymentDate='$paymentDate' and feeID='$feeID' "; odbc_exec( $conn, $query ); //$lastMonth=getName($conn,"select max(date_) from studentFee where stdID='$stdID' "); $lastMonth = $feeDate ;// date_01(date('Y-m-d',strtotime($lastMonth))); $query="insert into studentPayments(discount,labid,userID,bankDepositNo,date_,feeID,semesterID,techID,Remarks,stdID,amount,paymentDate,paymentType) values('$discount','".$_SESSION['labid']."','".$_SESSION['userID']."','$bankDepositNo','$lastMonth','$feeID','$semesterID','$techID','$Remarks','$stdID','$amt','$paymentDate','$paymentType')"; if($amt>0) $cur= odbc_exec( $conn, $query ); //echo "
".$query; $recived="select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $disc="select isnull(sum(discount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $query="update studentFee set discount=($disc),amtReceived=($recived) where stdID='$stdID' and feeID='$feeID' and date_ ='$lastMonth'"; $cur= odbc_exec( $conn, $query ); //echo "
".$query; //Cash Debited $query="delete from ledger where (monthYear='$feeDate' or monthYear is null) and stdID='$stdID' and date_='$paymentDate' and feeID='$feeID'"; odbc_exec( $conn, $query ); //echo "
".$query; if($amt>0 and $paymentType>0){ $stdName=getName($conn,"select stdName from student where ID='$stdID' "); $remarks="Fee received from $stdName"; $query="insert into ledger(monthYear,remarks,stdID,accountID,feeID,debit,date_,userID,labid) values('$feeDate','$remarks','$stdID','$paymentType','$feeID','$amt','$paymentDate',".$_SESSION['userID'].",".$_SESSION['labid'].")"; $cur= odbc_exec( $conn, $query ); $cur=calculateBalance($conn,$paymentType); } } $arr=getName($conn,"select programID,sectionID from student where ID='$stdID' "); $programID=$arr[1]; $sectionID=$arr[2]; odbc_exec($conn,"update studentPayments set programID='$programID' where stdID='$stdID' and programID is null "); odbc_exec($conn,"update studentPayments set sectionID='$sectionID' where stdID='$stdID' and sectionID is null "); $cur=calculateStdBalance($conn,$stdID); if($_SESSION['labid']==16){ //exit(); } echo ""; exit2($conn,$conn3); } } if(isset($_POST['btnFeeReceipt'])){ //Fee Paid //echo "





"; $stdID = $_POST['stdID']; $bankDepositNo = $_POST['bankDepositNo']; $techID =0;// $_POST['techID']; $semesterID =0;// $_POST['semesterID']; //$amtPaid = $_POST['amtPaid']; $paymentType = $_POST['paymentType']; $Remarks = $_POST['Remarks']; $paymentDate = date('Y-m-d',strtotime($_POST['paymentDate'])); $cnt = $_POST['cnt']; if(canSave($conn,"addFeeNew")=="0"){ for ($i=1; $i<=$cnt; $i++) { $feeDate = "feeDate$i"; $feeDate = (date('Y-m-01',strtotime( $_POST[$feeDate]))); $feeID = "feeID$i"; $feeID = $_POST[$feeID]; $amt = "amt$i"; $amt = $_POST[$amt]; $discount = "discount$i"; $discount = $_POST[$discount]; if($amt=="") $amt=0; $query="delete from studentPayments where labid='".$_SESSION['labid']."' and date_='$feeDate' and stdID='$stdID' and paymentDate='$paymentDate' and feeID='$feeID' "; odbc_exec( $conn, $query ); //$lastMonth=getName($conn,"select max(date_) from studentFee where stdID='$stdID' "); $lastMonth = $feeDate ;// date_01(date('Y-m-d',strtotime($lastMonth))); $query="insert into studentPayments(discount,labid,userID,bankDepositNo,date_,feeID,semesterID,techID,Remarks,stdID,amount,paymentDate,paymentType) values('$discount','".$_SESSION['labid']."','".$_SESSION['userID']."','$bankDepositNo','$lastMonth','$feeID','$semesterID','$techID','$Remarks','$stdID','$amt','$paymentDate','$paymentType')"; if($amt>0) $cur= odbc_exec( $conn, $query ); //echo "
".$query; $recived="select isnull(sum(amount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $disc="select isnull(sum(discount),0) from studentPayments where stdID='$stdID' and feeID='$feeID' and date_ ='$feeDate' "; $query="update studentFee set discount=($disc),amtReceived=($recived) where stdID='$stdID' and feeID='$feeID' and date_ ='$lastMonth'"; $cur= odbc_exec( $conn, $query ); //echo "
".$query; //Cash Debited $query="delete from ledger where (monthYear='$feeDate' or monthYear is null) and stdID='$stdID' and date_='$paymentDate' and feeID='$feeID'"; odbc_exec( $conn, $query ); if($amt>0 and $paymentType>0){ $stdName=getName($conn,"select stdName from student where ID='$stdID' "); $remarks="Fee received from $stdName"; $query="insert into ledger(monthYear,remarks,stdID,accountID,feeID,debit,date_,userID,labid) values('$feeDate','$remarks','$stdID','$paymentType','$feeID','$amt','$paymentDate',".$_SESSION['userID'].",".$_SESSION['labid'].")"; $cur= odbc_exec( $conn, $query ); $cur=calculateBalance($conn,$paymentType); //$ret=updateCashAccount($conn,$date_,$paymentType,$feeID,"dailyFeeRecovery"); } } $arr=getName($conn,"select programID,sectionID from student where ID='$stdID' "); $programID=$arr[1]; $sectionID=$arr[2]; odbc_exec($conn,"update studentPayments set programID='$programID' where stdID='$stdID' and programID is null "); odbc_exec($conn,"update studentPayments set sectionID='$sectionID' where stdID='$stdID' and sectionID is null "); $cur=calculateStdBalance($conn,$stdID); if($_SESSION['labid']==16){ //exit(); } echo ""; exit2($conn,$conn3); } } if($stdID=="") $stdID=0; $className=$stdName=""; $query="select * from student where ID='$stdID' and labid='".$_SESSION['labid']."' "; $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,'sectionID')); } //exit(); ?> Fee
0) $familyNo=$arr[7]; else $familyNo=""; if($arr[8]==0) { $status="Active"; $color="Green";} else{ $status="in-Active"; $color="Red";} echo "
"; echo ""; echo "
Student ID:".$arr[4]." (".$status.")"; echo "
Father Name:".$arr[1]; echo "
Address: ".$arr[2]; echo "
Contacts: ".$arr[3]; echo "
Balance: ".$arr[6]; echo "
"; echo "
"; echo "".$arr[5]." "; echo "
"; ?>
Fee Month
'>
Amount

"; if($familyNo!=""){ $query="select ID,stdName,fname,programID,sectionID,balance from student where recordType='Std' and labid='".$_SESSION['labid']."' and ID<>'$stdID' and Designation='$familyNo' "; }else{ $query="select ID,stdName,fname,programID,sectionID,balance from student where 1=2 and recordType='Std' and status=0 and labid='".$_SESSION['labid']."' and ID<>'$stdID' and contacts=(select contacts from student where ID='$stdID' and labid='".$_SESSION['labid']."') "; } $cur= odbc_exec( $conn, $query ); echo "
Other Family Members"; echo "Add Members"; echo ""; echo ""; while( odbc_fetch_row( $cur ) ){ echo "
".odbc_result($cur,'stdName').""; echo "".odbc_result($cur,'fname'); echo "".getHead($conn,odbc_result($cur,'programID')); echo "".getHead($conn,odbc_result($cur,'sectionID')); echo "".odbc_result($cur,'balance'); echo "" ; } echo "
"; ?>
Fee Receipt
Date
Deposit No.
Remarks
Payment Type
(f.amtReceived) and f.techID=c.ID and f.feeID=h.ID and f.stdID=s.ID and s.ID='$stdID' order by f.date_ asc,f.feeID asc"; $query="select f.discount,s.ID,S.stdName,f.feeID,h.headName,f.amtPosted,f.techID,f.thisMonth,f.amtReceived,f.date_ from student s, studentFee f,AccountHeads h where (f.amtPosted-f.discount)<>(f.amtReceived) and f.feeID=h.ID and f.stdID=s.ID and s.ID='$stdID' order by f.date_ asc,f.feeID asc"; $cur= odbc_exec( $conn, $query ); $cnt=1; $totalpaid=$total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1){ if($_SESSION['labid']==57) echo "
GenMonthFee HeadTotalDiscountPaidBalance"; else echo "
GenMonthFee HeadAmountPaidBalanceDiscount"; } $feeID= odbc_result($cur,'feeID' ); $feeName= odbc_result($cur,'headName' ); $amtPosted=odbc_result($cur,'amtPosted'); //$thisMonth=odbc_result($cur,'thisMonth')-(odbc_result($cur,'amtReceived')+odbc_result($cur,'discount')); $thisMonth=odbc_result($cur,'amtPosted')-(odbc_result($cur,'amtReceived')+odbc_result($cur,'discount')); $amtPaid=odbc_result($cur,'amtReceived'); //$month = date('M-y',strtotime(odbc_result( $cur, 'date_' ))); $month = toAfghaniMonth($conn,odbc_result( $cur, 'date_' )); $feeDate = date('Y-m-d',strtotime(odbc_result( $cur, 'date_' ))); $total=$total+$amtPosted; $totalpaid+=odbc_result($cur,'amtReceived' ); echo ""; echo ""; echo "
"; //echo ""; if($cnt>=1){ ?> Gen $month$feeName"; echo "".odbc_result($cur,'amtPosted'); if($_SESSION['labid']==57){ echo "" ; echo "" ; echo "".odbc_result($cur,'amtReceived'); }else{ echo "".odbc_result($cur,'amtReceived'); echo "" ; echo "" ; } if($_SESSION['labid']!=""){ echo ""; } $cnt+=1; } $cnt-=1; echo ""; if($cnt>1){ echo "
Total$total$totalpaid".($total-$totalpaid); } echo "
"; ?>



Add Fee Slip Instructions
Fee Slips
# Month Fee Head Amout Disc Paid Generate
=1){ ?> Generate
Payments
# Date Fee Head Remarks Amout Disc