Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<?php
include("../../config.php");
$sql=mysql_connect("localhost","e5crm.more7.com","5z#JaL");
mysql_select_db("e5crm_more7_com");
$w=$GLOBALS['db']->query("select id,product_code,quantity,price,parent_name from ecmstockoperations where (used=0 or used is null) and type=0 and deleted='0'");
while($r=$GLOBALS['db']->fetchByAssoc($w)){;
$qty=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select sum(quantity) as qty from ecmstockoperations where type=1 and in_id='".$r['id']."' and deleted='0'"));
if($qty['qty']>=$r['quantity']){
echo $r['product_code']." ".$r['parent_name']." ".$r['quantity']." ".$qty['qty']."\n";
$GLOBALS['db']->query("update ecmstockoperations set used=1 where id='".$r['id']."'");
}
}
mysql_close($sql);
?>