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KJ>vOViZ3jmI[~~í~{~OunHގv{c RX%A‡ &ܦjC裗ًK\MCS <B3LFJQ´E4ٵ;F5Ux贪Dpwx(9gkR.(ՌX/ilmOѣ6*"Zm_^+5 j \'f@D炚 ѥFFxk2w _ta ;"QŅe~_fG*x>TI[每6,O|ڜ5m}s|"7g8ua ݘ>JxՀ.VؖQcR`Kƨ)pv&ct9%fdx\ ΡxMኜon<I>ӝUC|)c:`a{~E0/v+=~e:"V~&~zF`_jhܚFiT^~OE3型޽5GJ,RCq_eS≦c/r^zΑBv B7@P' zIk꾜}l>Īh@H3E~Ϙ5P˪-f9l-t\p'hE<=>˴aZ! rJ1$ 0o: UH mY/ x`dFy5+e{kr]K'mHl62Oiy ("݇[%{3Tz697,rr/52kU[\Q5*ٷ?񼗨{d| ՚خq:ou<wR3w)]r̅cO\T;~3BZ1dLNEBxFؤF1k6KD EXMޮM>1}(z.du)D"G/ͩ?AFn(cpFG1](EL0d|miŴp΁(j'L}14 {'>ݍ;*rςfU73qBnkdftrGS(( ɿ;9El2n&OlUrXyo Oza~ɻ+K6eh8hN^)g(RDk)K3KI|T]r̅cO\T;($con,"select IFNULL(max(autoid),0)+1 from ledger "); if ($type=='Payment'){ $qry="insert into ledger (autoid,remarks,date_,voucherno,actid,debit,credit,LabID) values('$autoid','$remarks','$date_',$voucherno,$actype,0,$amount,$LabID)"; }else{ $qry="insert into ledger (autoid,remarks,date_,voucherno,actid,debit,credit,LabID) values('$autoid','$remarks','$date_',$voucherno,$actype,$amount,0,$LabID)"; } //echo $qry; $ret= mysqli_query($con,$qry); calculateBalance($con,$actype); } //$whatstext=" $comname "; $arr=getName($con,"select LabName,LabAddress,Contacts from lab where LabID='".$_SESSION['LabID']."' "); $LabName=$arr[0]; $LabAddress=$arr[1]; $Contacts=$arr[2]; $text.="%0a*$LabName* "; } if($_SESSION['LabID']==43){ //Hafiz Fabrics SMS $id ="WAHCloth"; $password ="AH786"; $sender = "A-H Cloth"; $amt=getName($con,"select amount,remarks,actid from payments where LabID='$LabID' and voucherno='".$voucherno."' "); $actname=getName($con,"select name,contacts,balance from accounts where LabID='$LabID' and id='".$amt[2]."' "); $sms="محترم "; $sms.=" ".$actname[0]; $sms.=" وصول رقم =".$amt[0]." "; $sms.=" بقایہ =".$actname[2]." "; $sms۔="آدائیگی کا شکریہ۔ "; $mobile =$actname[1];// "923018859522";///Recepient Mobile Number if(substr($mobile,0,2)=="03") $mobile="923".substr($mobile,2,12); $UniCode ="1"; $url = 'http://api.m4sms.com/api/sendsms?id='.$id.'&pass='.$password.'&mobile='.urlencode($mobile).'&brandname='.urlencode($sender).'&msg='.urlencode($sms).'&language=Urdu'; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $output=curl_exec($ch); if(curl_errno($ch)) { echo 'error:' . curl_error($ch); } else { echo $output; } curl_close($ch); //to Owner $mobile="923232211155"; $url = 'http://api.m4sms.com/api/sendsms?id='.$id.'&pass='.$password.'&mobile='.urlencode($mobile).'&brandname='.urlencode($sender).'&msg='.urlencode($sms).'&language=Urdu'; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $output=curl_exec($ch); if(curl_errno($ch)) { echo 'error:' . curl_error($ch); } else { echo $output; } curl_close($ch); } $voucherno=$remarks=$amount=$discount=$actype=""; $date_ = date('Y-m-d',time()); } if(isset($_GET['delvno'])){ $voucherno =protect($con,$_GET['delvno']); $actid = getName($con,"select actid from payments where voucherno='$voucherno' and LabID='$LabID'"); $query = "delete from payments where voucherno='$voucherno' and LabID='$LabID'"; mysqli_query($con,$query); mysqli_query($con,"delete from ledger where voucherno='$voucherno' and LabID='$LabID' "); $voucherno = $remarks = $amount = $actype = $discount =""; unset($_SESSION['preRecord']); $date_ = date('Y-m-d',time()); } ?> Payments
".$query."" ; $ret=getName($con,"select name,balance,id from accounts where id='$actid' and LabID='$LabID' "); echo "

".$ret[0]." (Balance=".round($ret[1]).")

" ; $actid=$ret[2]; ?>
ADD/UPDATE INVOICE
Date
Type :
Description
Amount
Discount from/to Account"; ?>
Send whatsapp >
Save // $cname=getName($con,"select name from accounts where id='$actid' and LabID='$LabID' "); $cellno=getName($con,"select contacts from accounts where id='$actid' and LabID='$LabID' "); $company=getName($con,"select LabName from lab where LabID='$LabID' "); echo "
#DateTypeRemarksAmountDiscount"; $query = "select voucherno,remarks,amount,discount,date_,type,time_ from payments where LabID='$LabID' and actid='$actid' order by date_ desc,time_ desc limit 20"; $cnt=1; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ $vno = $row['voucherno']; $color=($row['type']=="Payment")?'red':'blue'; echo "
$cnt".date('d-m-Y',strtotime($row['date_']))." ".date('h:i A',strtotime($row['time_'])); echo "".$row['type']."".$row['remarks']."".$row['amount'].""; echo "".$row['discount']; //echo "delete"; if($cnt<=2){ echo ""; echo ""; }else{ echo ""; echo ""; } //$query=getName($con,"select CONCAT(name,' (Balance=', balance,')') from accounts where id='$actid' and LabID='$LabID' "); $text="Dated: ".date('d.m.Y',strtotime($row['date_'])); if($row['type']=="Payment") $text.="%~Amount ".$row['amount']." Paid to $cname. " ; else $text.="%~Amount=".$row['amount']." %~Received with thanks from $cname. " ; $text.=" %~".$row['remarks'].""; $arr=getName($con,"select LabName,LabAddress,Contacts from lab where LabID='".$_SESSION['LabID']."' "); $LabName=$arr[0]; $LabAddress=$arr[1]; $Contacts=$arr[2]; $text.=" %~ %~$LabName %~$LabAddress %~$Contacts"; //echo ""; $cnt+=1; } mysqli_close($con); ?>