2 // $Id: diff.php,v 1.1 2004/06/30 10:12:15 hli Exp $
4 require_once "shoplib.php";
5 foreach($_POST as $key=>$val) {
6 if ($key=="ok") continue;
7 if ($key=="alle") continue;
8 $sql="update products set products_status=0 where products_model='$key'";
11 if (query("shop",$sql,"diff")) { echo "deaktiviert<br>"; }
12 else { echo "konnte nicht deaktiviert werden<br>"; };
15 $sql="select partnumber from parts where shop='1' order by partnumber";
16 $erp=getAll("erp",$sql,"getPartnumber");
20 $sql="select * from languages L left join configuration C on L.code=C.configuration_value where configuration_key = 'DEFAULT_LANGUAGE'";
21 $rs=getAll("shop",$sql,"getLanguage");
23 $defLang=$rs[0]["languages_id"];
28 if ($erp) foreach ($erp as $zeile) { $arE[]=$zeile["partnumber"]; };
29 $sql="select products_model,P.products_id,products_name from products P left join products_description D on P.products_id=D.products_id where language_id=$defLang and products_status=1 order by products_model";
30 $shop=getAll("shop",$sql,"products_model");
31 if ($shop) foreach ($shop as $zeile) {
32 $arS[]=$zeile["products_model"];
33 $arID[$zeile["products_model"]]=array("id"=>$zeile["products_id"],"name"=>$zeile["products_name"]);
36 $result=@array_diff($arS,$arE);
40 <head><title>Artikelpflege</title>
41 <script language="JavaScript">
44 val=document.doppel.alle.checked;
45 cnt=document.doppel.length;
46 for (i=0; i<cnt; i++) {
47 document.doppel.elements[i].checked=val;
54 Folgende Artikel sind in der ERP nicht mehr als Shopartikel markiert.<br>
55 Markieren Sie die Artikel, die deaktiviert werden sollen.<br>
56 <form name='doppel' method='post' action='diff.php?login=<?= $login ?>'>
59 foreach ($result as $data) {
60 echo "\t<tr><td><input type='checkbox' name='".$data."' value='1'></td><td>".$data."</td><td>".$arID[$data]["name"]."</td></tr>\n";
63 <tr><td><input type='checkbox' name='alle' value='1' onClick="sel()"></td><td></td><td>alle Artikel</td></tr>
64 <tr><td colspan='3'><input type='submit' name='ok' value='ok'></td></tr>
68 else { echo "Artikelbestand identisch"; };
70 <!-- a href="trans.php">zurück</a -->