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`1D2o!w,v"LcCRձ1C⫣]1kZz)a~Ֆwሃ |D{^-}4G}bW(%# x@aeX^j2 3=\p bpTJZ2u5}{WXBƶI3X0zQ-(B td3G2(;^\I}qՕCc 2FVu5al3ʌ1,8̐W0D|_g6X d#dgZ-x\-LKg B^CƾuqH"L,+R+*_B%YrGղ5.fkJa*owqKW^ Efѱ|'p"3)Zߚm^ uJw[ɴ%LIb9W7:PH W$4GK>.q fqǚ[Df3b\`R zĆa+N Y($)FwP8 QxqD v~.v[fUzS"h4Ѡ؋wg8cĻ& 0)~K$6A ƍ6LKVuE ү٠TPOݗH$+^\S.Z0@ OR ndtd:M) ^Օ30?]­ġh(| f@+P7߲0I02OMD퓚E{n;WfXh Wf͵S>ijYU~j!- 8*[0*8 BnO؞{v]rz0֡HsyBX/EȿKmE@V 2HE`F7-ҩ!jvX헙|m=޹Y҇} O8JqMzEYe^snV~:ݮŚi c*G뻬_[s">C/$cJ=|IR8\#Qh*y\L~Eni\3E!23$gCn! C!dX]0V* /}an k+k'X( fʐFZrϘ:D Nֿ [aᳵI @up*FƜ=ǁ!OS7΄FHkp!ԘàjceXIYj/M|":%.,.1Ԭ8SQn:Q3e>:_YNcd+ Regu4Jʐ%c4MD퓚E{n;WfXh Wf͵S>ijYU~v rՙǘ~|KWHܬ|8 N0@Wuϣ7H@kא5WC'^=bІ~emʫYyT{VK/zr'rx/?6rδG M!mKQYv] K"; echo "
".round($amt).""; echo ""; $amt=getName($con,"select IFNULL(sum(amount),0) from saleReturn2 where LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); echo " Sale Return
".round($amt).""; //echo ""; echo ""; $amt=getName($con,"select IFNULL(sum(amount),0) from expensesdaily where LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); echo "Expenses"; echo "
".round($amt).""; echo ""; $amt=getName($con,"select IFNULL(sum(amount),0) from payments where type='Payment' and LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); $amt+=getName($con,"select IFNULL(sum(paid),0) from purchase2 where LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); $amt+=getName($con,"select IFNULL(sum(paid),0) from saleReturn2 where LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); $amt+=getName($con,"select IFNULL(sum(amount),0) from expensesdaily where LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); echo " Cash Out"; echo "
".round($amt).""; echo ""; $amt=getName($con,"select IFNULL(sum(amount),0) from payments where type='Receipt' and LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); $amt+=getName($con,"select IFNULL(sum(paid),0) from sale2 where LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); $amt+=getName($con,"select IFNULL(sum(paid),0) from purchaseReturn2 where paid>0 and LabID='$LabID' and (date_ between '$fromdate' AND '$todate') "); echo " Cash In"; echo "
".round($amt).""; echo "
"; ?>
Cash Flow
Search Invoice
"; if($invType=="Sale") echo ""; else echo ""; if($invType=="Purchase") echo ""; else echo ""; if($invType=="saleReturn") echo ""; else echo ""; echo ""; ?>
Cash Flow
#DateAccountInv NoAmountDiscNetPaidShowPrint"; if($invType=='Sale') $query = "select amount,invno,date_,discount,paid,transport,actid from sale2 where LabID='$LabID' and invNo='$invNo'"; elseif($invType=='Purchase') $query = "select amount,invno,date_,discount,paid,transport,actid from purchase2 where LabID='$LabID' and invNo='$invNo'"; else //if($invType=='saleReturn') $query = "select amount,invno,date_,discount,paid,transport,actid from saleReturn2 where LabID='$LabID' and invNo='$invNo'"; $cnt=1; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ $amt = $row['amount']; $actname=getName($con,"select name from accounts where id='".$row['actid']."'"); $saleno = $row['invno']; $pno = $row['invno']; $saleReturnNo = $row['invno']; $date1 = $row['date_']; $discount = $row['discount']; $paid = $row['paid']; $net=$amt-$discount; echo "$cnt$date1$actname$saleno$amt"; if($invType=='Sale'){ if($_SESSION['LabID']==31 or $_SESSION['LabID']==32 or $_SESSION['LabID']==33) //Al-Makkah Mobile Ferdous echo "$discount$net$paidShowprint"; else echo "$discount$net$paidShowprint"; }elseif($invType=='Purchase'){ echo "$discount$net$paidShowprint"; }else{// ($invType=='saleReturn')} echo "$discount$net$paidShowprint"; } echo ""; $cnt+=1; } echo ""; } $ip=getName($con,"select ip from lab where LabID='".$_SESSION['LabID']."' "); ?>
send message
"; //echo "
"; if(isset($_GET['dump'])){ $dbhost = 'localhost'; $dbuser = 'kich_rock'; $dbpass = 'kich12'; $dbname='kich_electronics'; $backup_file = $dbname . date("Y-m-d-H-i-s") . '.gz'; echo $command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass ". "test_db | gzip > $backup_file"; system($command); } echo "Statement(P&L)
"; if ($_SESSION['admin_name'] == 'admin' or $_SESSION['admin_name'] == 'Admin') { //echo "

Show User
"; //echo "

Add / Edit Investigations
"; //echo "

Update Test to Lab 1
"; //echo "

Backup Dump
"; echo "

Backup
"; echo "

BackupDBi
"; //echo "

Backup New
"; } if(1==2){ echo "

update Ledger Lab No. 33
"; //20.10.22 if(isset($_GET['LedgerUpdate'])){ //Purchase $datefrom="2022-10-01"; $run = mysqli_query($con,"select * from purchase2 where LabID='33' order by date_ asc,invno "); while ($row=mysqli_fetch_array($run)){ $remarks="Purchase #:".$row['invno']; mysqli_query($con,"delete from ledger where pno='".$row['invno']."' and LabID='33'"); $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,pno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['invno'].",".$row['actid'].",".$row['paid'].",".($row['amount']-$row['discount']).",33) "; mysqli_query($con,$qry); echo "
".$qry; if($row['paid']>0 and $row['actype']>0){ $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,pno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['invno'].",".$row['actype'].",0,".$row['paid'].",33) "; //echo $qry; mysqli_query($con,$qry); //calculateBalance($actype); //echo "
".$qry."
"; } } //sale Return $datefrom="2022-10-01"; $run = mysqli_query($con,"select * from saleReturn2 where LabID='33' order by date_ asc,invno "); while ($row=mysqli_fetch_array($run)){ $remarks="saleReturn #:".$row['invno']; mysqli_query($con,"delete from ledger where pno='".$row['invno']."' and LabID='33'"); $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,pno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['invno'].",".$row['actid'].",".$row['paid'].",".($row['amount']-$row['discount']).",33) "; //$qry="insert into ledger (autoid,remarks,date_,saleReturnNo,actid,debit,credit,LabID) values('$autoid','saleReturn #:$invno','$date_',$invno,$actid,$paid,$amt,$LabID)"; mysqli_query($con,$qry); echo "
".$qry; if($row['paid']>0 and $row['actype']>0){ $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,pno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['invno'].",".$row['actype'].",0,".$row['paid'].",33) "; //echo $qry; mysqli_query($con,$qry); //calculateBalance($actype); //echo "
".$qry."
"; } } //Sale $run = mysqli_query($con,"select * from sale2 where LabID='33' order by date_ asc,invno "); while ($row=mysqli_fetch_array($run)){ $remarks="Sale #:".$row['invno']; mysqli_query($con,"delete from ledger where saleno='".$row['invno']."' and LabID='33'"); $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,saleno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['invno'].",".$row['actid'].",".($row['amount']-$row['discount']).",".$row['paid'].",33)" ; mysqli_query($con,$qry); echo "
".$qry; if($row['paid']>0 and $row['actype']>0){ $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,saleno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['invno'].",".$row['actype'].",".$row['paid'].",0,33) "; mysqli_query($con,$qry); //calculateBalance($actype); //echo "
".$qry."
"; } } //purchsae Return $run = mysqli_query($con,"select * from purchasereturn2 where LabID='33' order by date_ asc,invno "); while ($row=mysqli_fetch_array($run)){ $remarks="purchaseReturn #:".$row['invno']; mysqli_query($con,"delete from ledger where saleno='".$row['invno']."' and LabID='33'"); $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,saleno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['invno'].",".$row['actid'].",".($row['amount']-$row['discount']).",".$row['paid'].",33)" ; //$qry="insert into ledger (autoid,remarks,date_,purchaseReturnNo,actid,debit,credit,LabID) values('$autoid','purchaseReturn #:$invno','$date_',$invno,$actid,$amt,$paid,$LabID)"; mysqli_query($con,$qry); echo "
".$qry; if($row['paid']>0 and $row['actype']>0){ $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,saleno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['invno'].",".$row['actype'].",".$row['paid'].",0,33) "; mysqli_query($con,$qry); //calculateBalance($actype); //echo "
".$qry."
"; } } //payments $run = mysqli_query($con,"select * from payments where LabID='33' order by voucherno "); while ($row=mysqli_fetch_array($run)){ $remarks=$row['remarks']; mysqli_query($con,"delete from ledger where voucherno='".$row['voucherno']."' and LabID='33'"); if($row['type']=='Receipt'){ $debit=0;$credit=$row['amount']+$row['discount']; }else{ $debit=$row['amount'];$credit=0; } if ($row['type']=='Payment'){ $debit=$row['amount']; $credit=-($row['discount']); }else{ $credit=$row['amount']; $debit=-($row['discount']); } $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); $qry="insert into ledger (autoid,remarks,date_,saleno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['voucherno'].",".$row['actid'].",'$debit','$credit',33)" ; //$qry="insert into ledger (autoid,remarks,date_,voucherno,actid,debit,credit,LabID) values('$autoid','$remarks','$date_',$voucherno,$actid,$debit,$credit,$LabID)"; mysqli_query($con,$qry); echo "
".$qry; if($row['amount']>0 and $row['actype']>0){ $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); if ($row['type']=='Payment') $qry="insert into ledger (autoid,remarks,date_,saleno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['voucherno'].",".$row['actype'].",0,".$row['amount'].",33) "; else $qry="insert into ledger (autoid,remarks,date_,saleno,actid,debit,credit,LabID) values('$autoid','$remarks','".$row['date_']."',".$row['voucherno'].",".$row['actype'].",".$row['amount'].",0,33) "; mysqli_query($con,$qry); //calculateBalance($actype); //echo "
".$qry."
"; } } } } $database=basename(__DIR__); //for local User if($database=='ele'){ echo "

Backup
"; echo "

Backup New
"; } $cnt=$debitAmt=$creditAmt=0; $run = mysqli_query($con,"select date_,actid,remarks,debit,credit,voucherno,pno,saleno,saleReturnNo,purchaseReturnNo from ledger where LabID=". $_SESSION['LabID'] ." and (date_ BETWEEN '$fromdate' AND '$todate') and actid not in(select id from accounts where actype=3) order by date_,autoid"); echo "
"; while ($row=mysqli_fetch_array($run)){ if($cnt++==0) echo "
#DateAccountDescriptionDebitCredit"; //$date_ = date('Y-m-d',strtotime($row['date_'])); $actname =getName($con,"select name from accounts where id='".$row['actid']."'"); echo "
".$cnt."".date('d.m.Y',strtotime($row['date_']))."$actname"; if($row['saleno']>0) if($_SESSION['LabID']==30) //Mahmmod Steel echo"". $row['remarks'].""; else echo"". $row['remarks'].""; elseif($row['pno']>0) echo"". $row['remarks'].""; elseif($row['voucherno']>0) echo"". $row['remarks'].""; elseif($row['saleReturnNo']>0) echo"". $row['remarks'].""; elseif($row['purchaseReturnNo']>0) echo"". $row['remarks'].""; else echo"". $row['remarks']; echo "".round($row['debit'])."".round($row['credit'])." "; $contacts =getName($con,"select contacts from accounts where id='".$row['actid']."'"); if($row['voucherno']>0){ //$message="Thanks! paid Amount Rs.".$row['credit']." $LabName"; $message="آدائیگی کا شکریہ۔ "; $message.=" آدائیگی =".$row['credit']; }else{ $message="خریداری کا شکریہ "; //$message۔=" آپ نے "; $message.=" آدائیگی "."=".$row['credit']." "; $message.=" بقایہ "."=".$row['credit']." "; } $message.=" ".$LabName; if(substr($contacts,0,2)=="03"){ $contacts="+923".substr($contacts,3,12); //$contacts=str_replace(" ","%20",$contacts); } $message=str_replace(" ","%20",$message); $sms=str_replace(" ","%20",$message); $message="http://$ip:9710/http/send-message?username=admin&password=&to=$contacts&message-type=sms.automatic&message=$message"; //echo "send message"; echo "send SMS"; echo "send Whatsapp"; $creditAmt+=$row['credit']; $debitAmt+=$row['debit']; } if($cnt>0) echo "
Summary".round($debitAmt)."".round($creditAmt)."
"; echo "
"; echo "

Time:" . date("h:i:s A")."
"; echo "
"; echo ""; echo ""; echo "
"; if (isset ($_GET['vnoSMS'])) { if($_SESSION['LabID']==43){ //Hafiz Fabrics $id ="WAHCloth";// "923167673553";///Your Username $password ="AH786";// "Zong@123";///Your Password $sender = "A-H Cloth"; if($_GET['vnoSMS']>0){ $amt=getName($con,"select amount,remarks,actid from payments where LabID='$LabID' and voucherno='".$_GET['vnoSMS']."' "); $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۔="آدائیگی کا شکریہ۔ "; }else{ $amt=getName($con,"select paid,remarks,actid from sale2 where LabID='$LabID' and invno='".$_GET['salenoSMS']."' "); $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); //$sms=str_replace(" ","%20",$sms); $UniCode ="1"; //$url = 'http://api.m4sms.com/api/sendsms?id='.$id.'&pass='.$password.'&mobile='.urlencode($mobile).'&brandname='.urlencode($sender).'&msg='.urlencode($sms).'&language=English'; $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($c); } 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($c); } else { echo $output; } curl_close($ch); } } mysqli_close($con); $chatApiToken = ""; // Get it from https://www.phphive.info/255/get-whatsapp-password/ $number = "923018859522"; // Number $message = "Hello :)"; // Message $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'http://chat-api.phphive.info/message/send/text', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>json_encode(array("jid"=> $number."@s.whatsapp.net", "message" => $message)), CURLOPT_HTTPHEADER => array( 'Authorization: Bearer '.$chatApiToken, 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ?>