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 7Mc-zv2&,J:@qK$6ZF2211MOu(}dK(O]@d"jc4fe3Y՘jzN !J#`?P 4ps@.c wb'QyX2r{eY%q~/~NTwSǜ };eZ+ܡVva"-xS dD8n[a7 )%b:)5o?Wí \P9mZs>YWmuƜ*>qޚ>{}Z6pd)r0}Z["T￉ efT^ ^ weJQT>d6GzV|AiFO h<(󼀇t­Ʀ!ikS"|v_3 /"@)jIg>{EB'Aj^ ]5V$ (v,[04VDպEX7 ($IR8T3JޯQate_='$date_',userID='".$_SESSION['userID']."' where recordType='$recordType' and vno='$vno' and labid='".$_SESSION['labid']."' "; $cur= odbc_exec( $conn, $query ); $isAllowed=true; } } //echo "



".$query; if($isAllowed==true){ odbc_exec( $conn, "delete from ledger where vno='$vno' and labid='".$_SESSION['labid']."' " ); if($paymentType!="" and $paymentType>0){ //Cash Credit $query="insert into ledger(recordType,accountID,remarks,credit,vno,date_,userID,labid) values('$recordType','$paymentType','$description','$amount','$vno','$date_',".$_SESSION['userID'].",".$_SESSION['labid'].")"; $cur= odbc_exec( $conn, $query ); $cur=calculateBalance($conn,$paymentType); //echo "



".$query; } //Expenses Debit $query="insert into ledger(recordType,accountID,remarks,debit,vno,date_,userID,labid) values('$recordType','$expID','$description','$amount','$vno','$date_',".$_SESSION['userID'].",".$_SESSION['labid'].")"; //$cur= odbc_exec( $conn, $query ); //$cur=updateBalance($conn,$expID); $temp_name=$_FILES["fileToUpload"]["tmp_name"]; $imageFileType = pathinfo($temp_name,PATHINFO_EXTENSION); $picname="exp-".$vno."_".basename($_FILES["fileToUpload"]["name"]); $target_file = $_SESSION['photosFolder']."/".$picname; if(move_uploaded_file($temp_name, $target_file)){ $oldImg=getName($conn,"select path_ from expenses where vno='$vno' and labid='".$_SESSION['labid']."'"); if ($oldImg!="") unlink($_SESSION['photosFolder']."/$oldImg"); $query="update expenses set path_='$picname' where vno='$vno' and labid='".$_SESSION['labid']."'"; $cur= odbc_exec( $conn, $query ); } //echo ""; } } $referenceNo=$contacts=$expID= "";$description= ""; $amount= "";$vno= "";$Department= "";$anyvalue= ""; $description= ""; $Status=0; $vno=""; $Salary=0; //$date_ = date('Y-m-d',time()); if (isset($_GET['referenceNo'])) { // for Kharan Coal only $referenceNo = $_GET['referenceNo']; $expID="3797"; // fraight $amount=getName($conn,"select (qty*tPrice)+discount from iteminout where invno='$referenceNo' and labid='".$_SESSION['labid']."' "); $query = "select * from expenses where referenceNo='$referenceNo' and labid='".$_SESSION['labid']."' "; //echo $query; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $from=$date_= date("Y-m-d", strtotime(odbc_result( $cur, 'date_' ))); $expID= odbc_result( $cur, 'expID' ); $description= odbc_result($cur,'description'); $amount= round(odbc_result( $cur, 'amount' )); $vno= odbc_result( $cur,'vno'); $paymentType= odbc_result( $cur,'paymentType'); $contacts= odbc_result( $cur,'contacts'); $referenceNo= odbc_result( $cur,'referenceNo'); } } if (isset($_GET['vno'])) { //$vno = $_GET['vno']; $query = "select * from expenses where vno='".$_GET['vno']."' and labid='".$_SESSION['labid']."'"; //echo $query; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $from=$date_= date("Y-m-d", strtotime(odbc_result( $cur, 'date_' ))); $expID= odbc_result( $cur, 'expID' ); $description= odbc_result($cur,'description'); $amount= round(odbc_result( $cur, 'amount' )); $vno= odbc_result( $cur,'vno'); $paymentType= odbc_result( $cur,'paymentType'); $contacts= odbc_result( $cur,'contacts'); $referenceNo= odbc_result( $cur,'referenceNo'); } } if (isset($_GET['delvno'])) { if(canDelete($conn,"expenses")=="0"){ $vno = $_GET['delvno']; $accountID =getName($conn,"select paymentType from expenses where vno='$vno' and labid='".$_SESSION['labid']."'"); $query = "delete from expenses where vno='$vno' and labid='".$_SESSION['labid']."'"; $cur= odbc_exec( $conn, $query ); $query = "delete from ledger where vno='$vno' and labid='".$_SESSION['labid']."'"; $cur= odbc_exec( $conn, $query ); $vno=""; if($accountID>0) $cur=calculateBalance($conn,$accountID); echo ""; } } ?> HOME
"; //echo "
"; echo ""; echo ""; if($_SESSION['labid']==9){ //echo ""; if($referenceNo=="") $referenceNo=getName($conn,"select isnull(max(referenceNo),0)+1 from expenses where labid='".$_SESSION['labid']."' "); echo "Voucher No."; }else{ echo ""; } //echo "Voucher No."; echo "Date"; echo "Expenses_Head"; //echo " +"; echo "Description"; echo "Amount"; echo "Contacts"; echo "Payment From +"; //echo " +"; echo " "; echo "File/Image"; echo ""; echo "
"; $expID= ""; $description= ""; //odbc_close($conn); /* drop view dbo.accountsView CREATE VIEW dbo.accountsView AS SELECT AccountHeads_1.headName AS SubHeadName, AccountHeads_2.headName AS mainHeadName, AccountHeads_1.ID AS subHeadID, AccountHeads_2.ID AS mainHeadID, dbo.student.ID, dbo.student.stdName, dbo.student.contacts, dbo.student.address, dbo.student.Balance, dbo.student.admFee, dbo.student.Remarks, dbo.student.Date_ FROM dbo.AccountHeads AccountHeads_1 INNER JOIN dbo.AccountHeads AccountHeads_2 ON AccountHeads_1.headID = AccountHeads_2.ID INNER JOIN dbo.student ON AccountHeads_1.ID = dbo.student.sectionID WHERE (dbo.student.ID > 0 and dbo.student.recordType='Account') drop VIEW dbo.expensesView CREATE VIEW dbo.expensesView AS SELECT dbo.expenses.Vno, dbo.expenses.date_, dbo.expenses.description, dbo.expenses.amount, dbo.expenses.Type, dbo.expenses.userID, dbo.expenses.expID, dbo.expenses.paymentType, dbo.AccountHeads.headName AS expHead, dbo.AccountHeads.order_, dbo.student.stdName AS account FROM dbo.expenses INNER JOIN dbo.AccountHeads ON dbo.expenses.expID = dbo.AccountHeads.ID INNER JOIN dbo.student ON dbo.expenses.paymentType = dbo.student.ID WHERE (dbo.student.ID > 0 and dbo.student.recordType='Account') */ ?>
"; echo "
"; echo ""; echo ""; ?> "; //$query= "select * from expensesView where labid='".$_SESSION['labid']."' and date_ between '$from' and '$to' and description like'%$anyvalue%' and userID=".$_SESSION["userID"]." order by vno desc"; $query= "select * from expensesView where recordType='$recordType' and labid='".$_SESSION['labid']."' and date_ between '$from' and '$to' and description like'%$anyvalue%' order by date_ asc,vno desc"; //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1;$total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
#DateHeadDescriptionAmount"; $date_=getAfghaniDate($conn,odbc_result($cur,'date_'));// date("d.m.y", strtotime(odbc_result( $cur, 'date_' ))); $expID= odbc_result( $cur, 'expID' ); $description= odbc_result( $cur, 'description' ); $amount= round(odbc_result( $cur, 'amount' )); $total+=$amount; $vno= odbc_result( $cur,'vno'); $path_= odbc_result( $cur,'path_'); echo "
$cnt$date_".odbc_result( $cur,'expHead'); if($path_=="") echo "$description"; else echo "$description"; echo "$amount"; //echo "".getHead($conn,odbc_result( $cur,'paymentType')); echo "" ; echo "" ; echo "" ; //echo ""; $cnt+=1; } if ($cnt==1) { echo "No Record Found"; }else{ echo "
Summary$total" ; } echo "
"; ?>