$shopnr = $_GET["Shop"];
$nofiles = ( $_GET["nofiles"] == '1' )?true:false;
} else {
+ $p = array('shopnr','nofiles');
if ( $argc > 1 ) {
- $tmp = explode("=",trim($argv[1]));
- if ( count($tmp) != 2 ) {
- echo "Falscher Aufruf: php <scriptname.php> shop=1\n";
- exit (-1);
- } else {
- $shopnr = $tmp[1];
+ for( $i=1; $i<count($argv); $i++) {
+ $tmp = explode("=",trim($argv[$i]));
+ if ( count($tmp) < 2 ) {
+ echo "Falscher Aufruf: php ArtikelErpToShop.php shopnr=1 [nofiles=1]\n";
+ exit (-1);
+ };
+ if ( ! in_array(strtolower($tmp[0]),$p) ) {
+ echo "Falscher Aufruf: php ArtikelErpToShop.php shopnr=1 [nofiles=1]\n";
+ exit (-1);
+ };
+ ${$tmp[0]} = trim($tmp[1]);
}
+ } else {
+ $shopnr=false;
+ $nofiles=false;
}
}
exit();
}
//Shop-Instanz
-$shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err);
+$shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err,$debug);
+
if ($shopdb->db->connected_database_name == $SHOPdbname) {
$shop = new pepper($shopdb,$err,$SHOPdbname,$divStd,$divVerm,$minder,$nachn,$versandS,$versandV,$paypal,$treuhand,$mwstLX,$mwstS,$variantnr,$pict,$nopic,$nopicerr,$nofiles);
} else {
$shopnr = $_GET["Shop"];
$nofiles = ( $_GET["nofiles"] == '1' )?true:false;
} else {
+ $p = array('shopnr','nofiles');
if ( $argc > 1 ) {
- $tmp = explode("=",trim($argv[1]));
- if ( count($tmp) != 2 ) {
- echo "Falscher Aufruf: php <scriptname.php> shop=1\n";
- exit (-1);
- } else {
- $shopnr = $tmp[1];
- }
+ for( $i=1; $i<count($argv); $i++) {
+ $tmp = explode("=",trim($argv[$i]));
+ if ( count($tmp) < 2 ) {
+ echo "Falscher Aufruf: php ArtikelErpToShop.php shopnr=1 [nofiles=1]\n";
+ exit (-1);
+ };
+ if ( ! in_array(strtolower($tmp[0]),$p) ) {
+ echo "Falscher Aufruf: php ArtikelErpToShop.php shopnr=1 [nofiles=1]\n";
+ exit (-1);
+ };
+ ${$tmp[0]} = trim($tmp[1]);
+ }
+ } else {
+ $shopnr=false;
+ $nofiles=false;
}
}
$shopnr = $_GET["Shop"];
$nofiles = ( $_GET["nofiles"] == '1' )?true:false;
} else {
+ $p = array('shopnr','nofiles');
if ( $argc > 1 ) {
- $tmp = explode("=",trim($argv[1]));
- if ( count($tmp) != 2 ) {
- echo "Falscher Aufruf: php <scriptname.php> shop=1\n";
- exit (-1);
- } else {
- $shopnr = $tmp[1];
+ for( $i=1; $i<count($argv); $i++) {
+ $tmp = explode("=",trim($argv[$i]));
+ if ( count($tmp) < 2 ) {
+ echo "Falscher Aufruf: php ArtikelErpToShop.php shopnr=1 [nofiles=1]\n";
+ exit (-1);
+ };
+ if ( ! in_array(strtolower($tmp[0]),$p) ) {
+ echo "Falscher Aufruf: php ArtikelErpToShop.php shopnr=1 [nofiles=1]\n";
+ exit (-1);
+ };
+ ${$tmp[0]} = trim($tmp[1]);
}
+ } else {
+ $shopnr=false;
+ $nofiles=false;
}
}
include_once("conf$shopnr.php");
include_once("error.php");
//Fehlerinstanz
-$err = new error();
+$err = new error($api);
include_once("dblib.php");
include_once("pepper.php");
}
//Shop-Instanz
-$shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err);
+$shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err,$debug);
if ($shopdb->db->connected_database_name == $SHOPdbname) {
$shop = new pepper($shopdb,$err,$SHOPdbname,$divStd,$divVerm,$minder,$nachn,$versandS,$versandV,$paypal,$treuhand,$mwstLX,$mwstS,$variantnr);
//echo "<pre>"; print_r($shopdb->db); print_r($shopnr); echo "</pre>";