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K1]{7]%AqK[')=$a)) 7M<9<(?L/VmeGn-Z#<7/ݰ5aL}\nt/,zDzs,%pHsv$?e}]{+(x~tx8MLHР0#f3Vvw T疛]mo`gefA u(q}]Q}%*g#0E5CYՇц!q<؉Ѐ6`u@] [^kɫ ;pvi :^H[B1\ciCA[>Egtۧ" mV?R(ߡ雇7v^ 8`]NLt+|',qpגּ- EM ?&XRA u(q}]Q}%*g#0E5CYՇц!q<؉D mYTS%wN3䜜ZLmeZV E&y`{ eHAT`C~,7'X#0E5CYՇц!q<؉;abZq֪Ჸ &]F6z'+Aۓ^,F񐘩/X+켵^ ^6 =Gê>-1MVnmeVix)a‰ Lc'<]X!_(J|}Lfc-EӜ*P:3A;J__|81DZiMo,Oq)3Ɇʐ> RQdwęYIJ]ijsN{y]*ToU)n>$u6_RƉc0RLO؞{v]rly}vࡼr'(YJ%Nf"l]&R%aG&EFS]a>Ts$s@cVV52QfyM&vYV['ᬊ8n}i-x+ښm{텱Sk9"̂ 3 rd{M 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); } function maxno($tablename, $fieldname) { $query = "select max($fieldname) from $tablename "; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ $maxno=$row[0]; } return ($maxno + 1); } function getName($con,$query) { //if((isset($_SESSION['LabID'])) and $_SESSION['LabID']==22) echo "
".$query; $run=mysqli_query($con,$query); //echo "
y=$y ".$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]; } } mysqli_free_result($run); return $query; } function calculateBalance($con,$accountID) { //mysqli_query($con,"CALL updateBalance('".$_SESSION['LabID']."','$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' "); //calculateBalance } function protect($con,$strg){ //$strg = mysqli_real_escape_string(trim(strip_tags(addslashes($strg)))); $search = array(';','insert into','=','<=','<','>','=','select * from','SYSTEMROOT','.xml','.ini','etc/passwd','.write','Windows','alert','javascript','WAITFOR DELAY','xsl:vendor','system-property',"schema", "table_name","sleep"); $replace =[];// array("SAID", "MUHAMMAD", "KHAN","PAKISTAN"); $strg = str_ireplace($search, $replace, $strg); return mysqli_real_escape_string($con,$strg); } ?>