Revision 36ae8db4
Von Holger Lindemann vor mehr als 12 Jahren hinzugefügt
peppershop/BestellungShopToErp.php | ||
---|---|---|
11 | 11 |
$shopnr = $_GET["Shop"]; |
12 | 12 |
$nofiles = ( $_GET["nofiles"] == '1' )?true:false; |
13 | 13 |
} else { |
14 |
$p = array('shopnr','nofiles'); |
|
14 | 15 |
if ( $argc > 1 ) { |
15 |
$tmp = explode("=",trim($argv[1])); |
|
16 |
if ( count($tmp) != 2 ) { |
|
17 |
echo "Falscher Aufruf: php <scriptname.php> shop=1\n"; |
|
18 |
exit (-1); |
|
19 |
} else { |
|
20 |
$shopnr = $tmp[1]; |
|
16 |
for( $i=1; $i<count($argv); $i++) { |
|
17 |
$tmp = explode("=",trim($argv[$i])); |
|
18 |
if ( count($tmp) < 2 ) { |
|
19 |
echo "Falscher Aufruf: php ArtikelErpToShop.php shopnr=1 [nofiles=1]\n"; |
|
20 |
exit (-1); |
|
21 |
}; |
|
22 |
if ( ! in_array(strtolower($tmp[0]),$p) ) { |
|
23 |
echo "Falscher Aufruf: php ArtikelErpToShop.php shopnr=1 [nofiles=1]\n"; |
|
24 |
exit (-1); |
|
25 |
}; |
|
26 |
${$tmp[0]} = trim($tmp[1]); |
|
21 | 27 |
} |
28 |
} else { |
|
29 |
$shopnr=false; |
|
30 |
$nofiles=false; |
|
22 | 31 |
} |
23 | 32 |
} |
24 | 33 |
|
25 | 34 |
include_once("conf$shopnr.php"); |
26 | 35 |
include_once("error.php"); |
27 | 36 |
//Fehlerinstanz |
28 |
$err = new error(); |
|
37 |
$err = new error($api);
|
|
29 | 38 |
|
30 | 39 |
include_once("dblib.php"); |
31 | 40 |
include_once("pepper.php"); |
... | ... | |
43 | 52 |
} |
44 | 53 |
|
45 | 54 |
//Shop-Instanz |
46 |
$shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err); |
|
55 |
$shopdb = new mydb($SHOPhost,$SHOPdbname,$SHOPuser,$SHOPpass,$SHOPport,'mysql',$err,$debug);
|
|
47 | 56 |
if ($shopdb->db->connected_database_name == $SHOPdbname) { |
48 | 57 |
$shop = new pepper($shopdb,$err,$SHOPdbname,$divStd,$divVerm,$minder,$nachn,$versandS,$versandV,$paypal,$treuhand,$mwstLX,$mwstS,$variantnr); |
49 | 58 |
//echo "<pre>"; print_r($shopdb->db); print_r($shopnr); echo "</pre>"; |
Auch abrufbar als: Unified diff
Parameter frü Cli-Aufruf angepasst