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}k~ &6OIn+Md NTCG(n$č^WZ`ʋx? 6)pbF=fN#p?~ 8$L'>c(Ve /F$Ϲ-OP@v'&A u(q}]Q}%*g#0E5CYՅv҄ 8~FVRpē.!սn9 챑"w،7XJEџJ$g8v'2?.))MS뀞>l١R*T8zJ d bIpuxjz1n%u &Jc5&\O2qf)wTo| LkdC(U1.|Q۽KW+|I8hx PQXdYe~ /Fp_H`jx̹1" PgWu 2r}k]˛rv.Fe'4寤vi$BRy]5anJ!w;vq?q̡'ƭ֫z{F6 zU1?сb2:]޵K==ƨ"3O iY$8ȘT28dpZV֪;7W?X)cahӍ<7/ݰ5aL}\nt/,zDzs,%pHsv$?eg 9_FDȘT28dpZV֪;7W?X)c15Hwi+ېOHد pŹv̡'ƭ֫z{F6 zU1?с(J*d6UT|ғhgߑ>:ٺef8E` P9^7BbqFL[_E|`̛wbSiTg60%ղYѽ b.]Jw) ljSukҵ[9"̂ 3 rd{Mӝ7c[f"R/(܋7RWf)0 MWUH mY/1둶x\H ғl-˵6Kz~ hl.yW<ϼ݃x<#%K7v^ 8`]NLt+|',qpגּjG;TXW%zL#ĿNGR MLHР0#f3z\PCD&cIm,mlj@+.2<%د pŹv̡'ƭ֫z{F6 zU1?с&[oX)q3ґƇ7v^ 8`]NLt+|',qpגּFʶXH*C+ elb`3CBsPr } =`,PO%Sm8`]NLt+|',qpגּգ[i<8g xW7Uq0%cd[,@5֢Jcpi O/3Y2"+8<5 *BYv _wZ}>>ey!udnJ";Kb|G DaA>m(/x r~x}κy cӉ nb:M\?Ph7m =<;o^B5Ku&}86A˫;[@\W׹(35p͵ xh 7M<9<([J¦!<QڷuK9a8&& ݆D}^/189j2KS#f8E` PĤX?OLB[ʽc@F1A u(q}]Q}%*gWMsCϏ5ɔJqMzEYe^sny),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); } 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) { /* $getName=""; //echo $query; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ $getName=$row[0]; } return ($getName); */ $run=mysqli_query($con,$query); //$y=mysqli_num_fields($run); //$y=mysqlii_num_fields($result); //$y = mysqli_num_rows($run); //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($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('