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sWllxM{,9g%Cg3]Jm zFeˍ-`ٍr2(pкE[6UX[DFz@9pTpL# FvAq.eeGK=gª ?~U}ŋ?R1;[@\W׹ `:;R 'n9J M7^<*Z) (McCDtpc٬2on<I>7Ofq8D^T!{(܋7RWf)0 MWUH mY/>TOB8+݇[%{3Tz-K ~ʞH, TrZRapY0#4 }&LHƋ$6 zU1?с:"X:EݼӍ4̍!k n}:ihD^.>Fy+yV3Ġt/8|qvkktrTYѽ b,b 7op w[n~B:BdwVVN?|_cy !tP+TԼ{G?x⏕¬;HYyB N!EvH`iT0c`[8D2,Y3.V;x'1=z c_ZZ(TځA u(q}]Q}%*gID=labid1)-(select IFNULL(sum(qty),0) from purchaseReturn where itemid='$itemid' and LabID=labid1)+(select IFNULL(sum(qty),0) from saleReturn where itemid='$itemid' and LabID=labid1)-(select IFNULL(sum(qty),0) from sale where itemid='$itemid' and LabID=labid1) where itemid=itemid1 and LabID=labid1; END$$ DELIMITER ; */ $qty="(select IFNULL(sum(qty),0) from purchase where itemid='$itemid' and LabID='".$_SESSION['LabID']."')"; $qty.="-(select IFNULL(sum(qty),0) from purchaseReturn where itemid='$itemid' and LabID='".$_SESSION['LabID']."')"; $qty.="+(select IFNULL(sum(qty),0) from saleReturn where itemid='$itemid' and LabID='".$_SESSION['LabID']."') "; $qty.="-(select IFNULL(sum(qty),0) from sale where itemid='$itemid' and LabID='".$_SESSION['LabID']."')"; mysqli_query($con,"update item set qty=$qty where itemid='$itemid' and LabID='".$_SESSION['LabID']."'"); /* $qty=getName("select IFNULL(sum(qty),0) from purchase where itemid='$itemid' and LabID='".$_SESSION['LabID']."'"); $qty-=getName("select IFNULL(sum(qty),0) from purchaseReturn where itemid='$itemid' and LabID='".$_SESSION['LabID']."'"); $qty+=getName("select IFNULL(sum(qty),0) from saleReturn where itemid='$itemid' and LabID='".$_SESSION['LabID']."'"); $qty-=getName("select IFNULL(sum(qty),0) from sale where itemid='$itemid' and LabID='".$_SESSION['LabID']."'"); mysqli_query($con,"update item set qty='$qty' where itemid='$itemid' and LabID='".$_SESSION['LabID']."'"); */ } function fillList($con,$query) { $opt= ""; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ $opt.=""; else $opt.=""; } return ($opt); mysqli_free_result($run); } function getName($con,$query) { //echo "
".$query; $run=mysqli_query($con,$query); if(mysqli_num_fields($run)>1){ $query=array(); while ($row=mysqli_fetch_array($run)){ for ($x=0; $x x=$x=".$row[$x]; } } //return $query; }else{ $query=""; while ($row=mysqli_fetch_array($run)){ $query= $row[0]; } } return $query; //echo "
".$query; mysqli_free_result($run); } function calculateBalance($con,$accountID) { mysqli_query($con,"update accounts set balance=openingBalance+(select ifnull(sum(debit),0)-ifnull(sum(credit),0) from ledger where actid='$accountID') where id='$accountID' "); } function protect($con,$strg){ //$strg = mysqli_real_escape_string(trim(strip_tags(addslashes($strg)))); $strg = str_replace('=','',$strg); $strg = str_replace('>','',$strg); $strg = str_replace('<','',$strg); $strg = str_replace('<=','',$strg); $strg = str_replace('>=','',$strg); $strg = str_replace('!=','',$strg); $strg = str_replace('drop database','',$strg); $strg = str_replace('drop table','',$strg); $strg = str_replace('delete from','',$strg); $strg = str_replace(';','',$strg); $strg = str_replace('--','',$strg); $strg = str_replace("'","",$strg); $strg = str_replace('