Add php files
This commit is contained in:
30
modules/EcmStockStates/check_products.php
Executable file
30
modules/EcmStockStates/check_products.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
set_time_limit(9999999999);
|
||||
|
||||
include_once("class.dbf.php");
|
||||
include_once("helper.php");
|
||||
|
||||
$sql=mysql_connect("localhost","root","");
|
||||
mysql_select_db("saascrm");
|
||||
mysql_query("set names utf8");
|
||||
|
||||
//$w=mysql_query("select id,name,dir from ecmstocks where deleted='0'");
|
||||
//while($r=mysql_fetch_array($w)){
|
||||
$dbf = new dbf_class("klk/".$r['dir']."/_stany.dbf");
|
||||
$num_rec=$dbf->dbf_num_rec;
|
||||
$n=0;
|
||||
for($i=0;$i<$num_rec;$i++){
|
||||
$row = $dbf->getRowAssoc($i);
|
||||
$index=iconv("CP852","UTF-8",$row['INDEKS']);
|
||||
$nazwa=$row['NAZWA'];
|
||||
|
||||
if(mysql_num_rows(mysql_query("select name from ecmproducts where code like '".$index."' and deleted='0'"))==0){
|
||||
echo $index." ".$nazwa."\n";
|
||||
addProduct($index,$nazwa);
|
||||
$n++;
|
||||
}
|
||||
}
|
||||
echo $n;
|
||||
//}
|
||||
mysql_close($sql);
|
||||
?>
|
||||
Reference in New Issue
Block a user