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