2 // $Id: diff.php,v 1.1 2004/06/30 10:12:15 hli Exp $
4 require_once "conf.php";
5 if ($dbprefix<>"") { define("PREFIX",$dbprefix."_"); } else { define("PREFIX",""); }
8 $db=DB::connect($SHOPdns);
9 if (!$db) dbFehler("",$db->getDebugInfo());
10 if (DB::isError($db)) {
11 dbFehler("",$db->getDebugInfo());
12 die ($db->getDebugInfo());
14 $db2=DB::connect($ERPdns);
15 if (!$db2) dbFehler("",$db2->getDebugInfo());
16 if (DB::isError($db2)) {
17 dbFehler("",$db2->getDebugInfo());
18 die ($db2->getDebugInfo());
22 foreach($_POST as $key=>$val) {
23 if ($key=="ok") continue;
24 if ($key=="alle") continue;
25 $sql="update ".PREFIX."products set products_status=0 where products_model=$key";
27 if ($db->query($sql)) { echo "deaktiviert<br>"; }
28 else { echo "konnte nicht deaktiviert werden<br>"; };
31 $sql="select partnumber from parts where shop='1' order by partnumber";
32 $erp=$db2->getAll($sql,DB_FETCHMODE_ASSOC);
33 if ($erp) foreach ($erp as $zeile) { $arE[]=$zeile["partnumber"]; };
38 $sql="select * from ".PREFIX."languages L left join ".PREFIX."configuration C on L.code=C.configuration_value where configuration_key = 'DEFAULT_LANGUAGE'";
39 $rs=$db->getAll($sql,DB_FETCHMODE_ASSOC);
41 $defLang=$rs[0]["languages_id"];
47 $sql="select products_model,P.products_id,products_name from ".PREFIX."products P left join ".PREFIX."products_description D on P.products_id=D.products_id where language_id=$defLang and products_status=1 order by products_model";
48 $shop=$db->getAll($sql,DB_FETCHMODE_ASSOC);
49 if ($shop) foreach ($shop as $zeile) {
50 $arS[]=$zeile["products_model"];
51 $arID[$zeile["products_model"]]=array("id"=>$zeile["products_id"],"name"=>$zeile["products_name"]);
53 $result=@array_diff($arS,$arE);
57 <head><title>Artikelpflege</title>
58 <script language="JavaScript">
61 val=document.doppel.alle.checked;
62 cnt=document.doppel.length;
63 for (i=0; i<cnt; i++) {
64 document.doppel.elements[i].checked=val;
71 Folgende Artikel sind in der ERP nicht mehr als Shopartikel markiert.<br>
72 Markieren Sie die Artikel, die deaktiviert werden sollen.<br>
73 <form name='doppel' method='post' action='diff.php'>
76 foreach ($result as $data) {
77 echo "\t<tr><td><input type='checkbox' name='".$data."' value='1'></td><td>".$data."</td><td>".$arID[$data]["name"]."</td></tr>\n";
80 <tr><td><input type='checkbox' name='alle' value='1' onClick="sel()"></td><td></td><td>alle Artikel</td></tr>
81 <tr><td colspan='3'><input type='submit' name='ok' value='ok'></td></tr>
85 else { "Artikelbestand identisch"; };
87 <!--a href="trans.php">zurück</a-->