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a^vtܶp-J~<leU4[k/샐qOw9m #C O&> Kr=>}P6DJB;hpLlLd@>d5BgHe#K+zeoԖG* ^1ܭ Fti2朮=b/y+ fylmg }trOIQ>1ٝ3i"Xu6\H~60?l{(' fxr;f#ttyܹz'zOWXE֒1:Qm2'$+*- l(Bj(-2Zpyڄmذ9-_Es>ISOnhtfqQfM'3͹ d0V3rk4hH@bխ1ğV,yAT0?V+*m$9Rut*=c쭳>\xډtS0ûpolXp 'ЩbT!0I]|ȿiBRԋN<\(mKΣѧMke8X+qI%sTwU՝;xh [[1 z^wU͊+(6ĭIXn|#!C&lUy/:})ejXڟXbۈxcpM.~֠--yB8;lͲ `7^l_&TƗ;:,lB<[;;K}Zγ 9%Y~IV˯`SA3@ibD婮w(k fqkUDkJ[)*tw֦<F2S:/v7-ZGv Qΐ)li\Ea[1.'!`ROKvnl̩>_… |翷(8:پBy9"]wk .Dч% 49'HeID='$feeID' and date_ ='$lastMonth' ) where stdID='$stdID' and feeID='$feeID' and date_ ='$lastMonth'"; $cur= odbc_exec( $conn, $query ); } $cur=calculateBalance($conn,$stdID); } if(isset($_POST['btnPostFee'])){ $stdID = $_POST['stdID']; $lateFee = round($_POST['lateFee']); $feeDate = date_01(date('Y-m-d',strtotime($_POST['feeDate']))); $feeDate = date_01($feeDate); $lastMonth=getName($conn,"select max(date_) from studentFee where date_<'$feeDate' "); $lastMonth = date_01(date('Y-m-d',strtotime($lastMonth))); $query="delete from studentFee where amtReceived=0 and date_='$feeDate' "; odbc_exec( $conn, $query ); //not paid Last Month $query="insert into studentFee (amtReceived,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) "; $query.=" select 0,'$feeDate',monthly,monthly+thisMonth,stdID,amtPosted-amtReceived,techID,feeID,semesterID from studentFee where amtReceived=0 and amtPosted-amtReceived>0 and date_='$lastMonth' "; $query.=" and stdID not in(select stdID from studentFee where date_='$feeDate' )"; odbc_exec( $conn, $query ); $query="insert into studentFee (amtReceived,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) "; $query.=" select 0,'$feeDate',monthly,monthly-(amtReceived-thisMonth),stdID,amtPosted-amtReceived,techID,feeID,semesterID from studentFee where amtPosted-amtReceived>0 and date_='$lastMonth' "; $query.=" and stdID not in(select stdID from studentFee where date_='$feeDate')"; //$query.=" and stdID not in(select stdID from studentFee where date_='$feeDate' or stdID in(select stdID from student where admDate>'$feeDate') )"; odbc_exec( $conn, $query ); //$query=" update studentFee set monthly=amtPosted where monthly>amtPosted and date_='$feeDate'"; $query=" update studentFee set thisMonth=amtPosted where thisMonth>amtPosted and date_='$feeDate'"; odbc_exec( $conn, $query ); //Calculate Arrears/Late Fee //$lateFee=300; $ArrearsID=getName($conn,"select ID from accountHeads where headName='Arrears' "); $tuitionFeeID=getName($conn,"select ID from accountHeads where headName='Tuition Fee' "); $query="insert into studentFee (amtReceived,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) "; $query.=" select 0,'$feeDate','$lateFee','$lateFee',stdID,'$lateFee',techID,'$ArrearsID',semesterID from studentFee "; $query.=" where feeID='$tuitionFeeID' and amtReceived=0 and thisMonth>0 and date_='$lastMonth' "; $query.=" and stdID not in(select stdID from studentFee where feeID='$ArrearsID' and date_='$feeDate')"; odbc_exec( $conn, $query ); $query="update student set balance=(select sum(monthly)-sum(amtReceived) from studentFee where studentFee.stdID=student.stdID and date_='$feeDate' group by stdID) "; odbc_exec( $conn, $query ); // lateFee Fine Updation $ID=getName($conn,"select ID from AccountHeads where headType='lateFee'"); if($ID==""){ $ID=getName($conn,"select max(ID)+1 from AccountHeads"); $query="insert into AccountHeads(headDescription,openingBalance,headType,ID,headID,headName,headLevel) values('lateFee','$lateFee','lateFee','$ID',0,'lateFee',2) "; }else{ $query="update AccountHeads set openingBalance='$lateFee' where ID='$ID'"; } odbc_exec( $conn, $query ); } if(isset($_POST['btnDeleteFee'])){ $stdID = $_POST['stdID']; $lateFee = round($_POST['lateFee']); $feeDate = date_01(date('Y-m-d',strtotime($_POST['feeDate']))); $query="delete from studentFee where amtReceived=0 and date_='$feeDate' "; odbc_exec( $conn, $query ); } if(isset($_POST['btnPostFeeThis'])){ $stdID = $_POST['stdID']; $lateFee = round($_POST['lateFee']); $feeDate = date_01(date('Y-m-d',strtotime($_POST['feeDate']))); $lastMonth=getName($conn,"select max(date_) from studentFee where date_<'$feeDate' "); $lastMonth = date_01(date('Y-m-d',strtotime($lastMonth))); $query="delete from studentFee where amtReceived=0 and date_='$feeDate' and stdID='$stdID' "; odbc_exec( $conn, $query ); //not paid Last Month $query="insert into studentFee (amtReceived,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) "; $query.=" select 0,'$feeDate',monthly,monthly+thisMonth,stdID,amtPosted-amtReceived,techID,feeID,semesterID from studentFee where amtReceived=0 and amtPosted-amtReceived>0 and date_='$lastMonth' "; $query.=" and stdID='$stdID' "; odbc_exec( $conn, $query ); $query="insert into studentFee (amtReceived,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) "; $query.=" select 0,'$feeDate',monthly,monthly-(amtReceived-thisMonth),stdID,amtPosted-amtReceived,techID,feeID,semesterID from studentFee where amtPosted-amtReceived>0 and date_='$lastMonth' "; $query.=" and stdID not in(select stdID from studentFee where date_='$feeDate')"; //odbc_exec( $conn, $query ); $query=" update studentFee set monthly=amtPosted where monthly>amtPosted and date_='$feeDate' and stdID='$stdID'"; odbc_exec( $conn, $query ); //Calculate Arrears/Late Fee //$lateFee=300; $ArrearsID=getName($conn,"select ID from accountHeads where headName='Arrears' "); $tuitionFeeID=getName($conn,"select ID from accountHeads where headName='Tuition Fee' "); $query="insert into studentFee (amtReceived,date_,monthly,thisMonth,stdID,amtPosted,techID,feeID,semesterID) "; $query.=" select 0,'$feeDate','$lateFee','$lateFee',stdID,'$lateFee',techID,'$ArrearsID',semesterID from studentFee "; $query.=" where feeID='$tuitionFeeID' and amtReceived=0 and thisMonth>0 and date_='$lastMonth' "; $query.=" and stdID not in(select stdID from studentFee where feeID='$ArrearsID' and date_='$feeDate')"; //odbc_exec( $conn, $query ); $query="update student set balance=(select sum(monthly)-sum(amtReceived) from studentFee where stdID='$stdID') where stdID='$stdID' "; odbc_exec( $conn, $query ); // lateFee Fine Updation $ID=getName($conn,"select ID from AccountHeads where headType='lateFee'"); if($ID==""){ $ID=getName($conn,"select max(ID)+1 from AccountHeads"); $query="insert into AccountHeads(headDescription,openingBalance,headType,ID,headID,headName,headLevel) values('lateFee','$lateFee','lateFee','$ID',0,'lateFee',2) "; }else{ $query="update AccountHeads set openingBalance='$lateFee' where ID='$ID'"; } odbc_exec( $conn, $query ); } $query="select * from student where stdID='$stdID' "; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $semesterID= odbc_result( $cur, 'semesterID' ); echo $techID= odbc_result( $cur, 'techID' ); $stdName= odbc_result( $cur, 'stdName' ); } //$stdName=getName($conn,"select stdName from student where stdID='$stdID' "); echo "
"; echo ""; echo "
Name"; echo "
Date"; echo "
Technology "; echo "
Semester"; $query="select s.stdID,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.techID=c.ID and f.feeID=h.ID and f.stdID=s.stdID and s.stdID='$stdID' and f.date_=(select max(date_) from studentFee where stdID='$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
HeadsAmountPaid"; $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_' ))); $total=$total+$amtPosted; echo ""; echo "
$feeName$thisMonth" ; $cnt+=1; } $cnt-=1; echo ""; echo "
"; echo "
Remarks"; //echo "
Amount Paid"; echo "
Payment Type +"; echo "
"; echo "
"; $query="select s.stdID,s.stdName,sp.amount,sp.paymentDate,h.headName,sp.Remarks,f.headName as feeHead from student s,studentPayments sp,AccountHeads h,AccountHeads f where sp.feeID=f.ID and sp.paymentType=h.ID and s.stdid=sp.stdID and s.stdID='$stdID' order by sp.paymentDate asc"; $cur= odbc_exec( $conn, $query ); $cnt=1; $total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
SerialDateFee HeadRemarksAmountDelete"; //$paymentDate=odbc_result( $cur, 'paymentDate' ); $paymentDate = date('Y-m-d',strtotime(odbc_result( $cur, 'paymentDate' ))); $paymentType=odbc_result( $cur, 'headName' ); $feeHead=odbc_result( $cur, 'feeHead' ); $amtPaid=odbc_result( $cur, 'amount' ); $Remarks=odbc_result( $cur, 'Remarks' ); $total=$total+$amtPaid; echo "
". $cnt++ . "$paymentDate$feeHead$Remarks$amtPaidDelete" ; } echo "
Total$total
"; echo "
"; echo ""; echo "
Name"; echo "
Date Month"; echo "
Semester"; echo "
Technology "; echo "
Fee Head +"; echo "
Total Amount"; //echo "
Paid Amount"; echo "
Monthly"; echo "
This Month"; echo "
"; echo "
"; $query="select s.stdID,S.stdName,f.feeID,h.headName,f.amtPosted,f.techID,c.headName as courseName,f.monthly,f.amtReceived,f.date_,f.thisMonth from student s, studentFee f,AccountHeads h,AccountHeads c where f.techID=c.ID and f.feeID=h.ID and f.stdID=s.stdID and s.stdID='$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 "
SerialFee MonthCourseAccountHeadsAmountPaidMonthlythisMonthDeletePrint"; $feeID= odbc_result( $cur, 'feeID' ); $feeName= odbc_result( $cur, 'headName' ); $techID= odbc_result( $cur, 'techID' ); $courseName= odbc_result( $cur, 'courseName' ); $amtPosted=odbc_result( $cur, 'amtPosted' ); $monthly=odbc_result( $cur, 'monthly' ); $thisMonth=odbc_result( $cur, 'thisMonth' ); $amtPaid=odbc_result( $cur, 'amtReceived' ); $date_ = date('d-m-Y',strtotime(odbc_result( $cur, 'date_' ))); $total=$total+$amtPosted; echo "
". $cnt++ . "$date_$courseName$feeName$amtPosted$amtPaid$monthly$thisMonthDeletePrintSlip" ; } echo "
Total$total"; echo "
"; $lateFee=getName($conn,"select openingBalance from AccountHeads where headType='lateFee'"); if($lateFee=="") $lateFee="300"; // /* echo "
"; echo ""; echo "
Post Fee for the MonthLateFee"; echo ""; echo "
"; //*/ echo "
"; echo ""; echo "
Post Fee for the MonthLateFee"; echo ""; echo ""; echo "
"; odbc_close($conn); ?>