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<09Mԣ:9_; !o&(^ !sWllxM{,9gY?s ɚ.Qe=ђ89ZXeU(B8w 춅Yk-BH׼yd‹4~5z> P]?Sid!Jc9#|U¨[BVwo4.[(slg ;:xj5}hZ7牉@A1Xua]~k~մfLG$K2#(0}۽KW+|I8hS IeW\ݍ-zOtC"9_,UGBRn=D.b$*`^-J]Y5{ aVG`Ŧ;gb$)Q+PNZ2)M=fD"{:q|\͂\ ( ۦBKyhcL?j ̘V \8#n6^{TQ*Tg #q${j%H=5%b/j"O 9)cpt-H|ZB >q>z!sUTw_= \<&HLߥYKw/`ýjahNK!?!C@9_!CEl{xwOrbjOp㯇X=pt+?唆/-!7;&gB`~er[8 >歲]8r%3iD܇S&p5n&-ZjR'RrETR`Kʴ{͉.ۜuSHNր}LEZiO[NLCע}zDhREH֛o9pA j jyC/Ggu./zH={v>d','$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($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.=" %~ %~*$LabName* %~$LabAddress %~$Contacts"; } 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()); } //$ret=getName($con,"select name,balance from accounts where id='$actid' and LabID='$LabID' "); //echo "

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

" ; ?> Payments
".$query."" ; ?>
ADD/UPDATE INVOICE
Date
Type :
Description
Amount
Discount from/to Account"; ?>
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 "
#DateTypeRemarksAmountDiscountEditDelete"; $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"; 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); ?>