X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=pepper%2Fconfedit.php;h=57a74e5af6d4a007da1b1f6095bb006ec5bb1ffb;hb=0aa55515f3c2cdce122dda325f48c9a3cb6a600a;hp=e393f1c6a6940e32a3e96a3e5554308476251335;hpb=57096a4882de38f1aa0d3fd061f52b5cdfec8b38;p=kivitendo-erp.git diff --git a/pepper/confedit.php b/pepper/confedit.php index e393f1c6a..57a74e5af 100644 --- a/pepper/confedit.php +++ b/pepper/confedit.php @@ -1,20 +1,39 @@ -// $Id: confedit.php,v 0.10 2006/02/06 11:34:30 hli Exp $ +// $Id: confedit.php 2009/02/10 14:41:30 hli Exp $ if (!isset($_SERVER['PHP_AUTH_USER'])) { Header("WWW-Authenticate: Basic realm=\"Configurations-Editor\""); Header("HTTP/1.0 401 Unauthorized"); echo "Sie müssen sich autentifizieren\n"; exit; } else { - include "conf.php"; + $login=($_GET["login"])?$_GET["login"]:$_POST["login"]; + if (file_exists ("conf$login.php")) { + require "conf$login.php"; + } else { + require "conf.php"; + } + if ($_SERVER['PHP_AUTH_USER']<>$ERPftpuser || $_SERVER['PHP_AUTH_PW']<>$ERPftppwd) { + Header("WWW-Authenticate: Basic realm=\"My Realm\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Sie müssen sich autentifizieren\n"; + exit; + } require_once "DB.php"; - $db=@DB::connect($ERPdns); - if (!DB::isError($db)) { - $sql="select id,pricegroup from pricegroup"; - $pgs=$db->getall($sql); + function unit($sel) { + global $dbP; + $sql="select name from units order by sortkey"; + $pgs=$dbP->getall($sql); + if ($sel=='') $sel=$pgs[0][0]; + if ($pgs) foreach ($pgs as $row) { + echo "\t".$row[0]."\n"; + } } function pg($sel) { - global $pgs; + global $dbP; + $sql="select id,pricegroup from pricegroup"; + $pgs=$dbP->getall($sql); echo "\tStandard VK\n"; @@ -24,55 +43,66 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { echo ">".$row[1]."\n"; } } - if ($_SERVER['PHP_AUTH_USER']<>$ERPftpuser || $_SERVER['PHP_AUTH_PW']<>$ERPftppwd) { - Header("WWW-Authenticate: Basic realm=\"My Realm\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Sie müssen sich autentifizieren\n"; - exit; - } if ($_POST["ok"]=="sichern") { $ok=true; - $dsnP="pgsql://".$_POST["ERPuser"].":".$_POST["ERPpass"]."@".$_POST["ERPhost"]."/".$_POST["ERPdbname"]; - $dbP=DB::connect($dsnP); + $dsnP = array( + 'phptype' => 'pgsql', + 'username' => $_POST["ERPuser"], + 'password' => $_POST["ERPpass"], + 'hostspec' => $_POST["ERPhost"], + 'database' => $_POST["ERPdbname"], + 'port' => $_POST["ERPport"] + ); + $dbP=@DB::connect($dsnP); if (DB::isError($dbP)||!$dbP) { - $ok=false; - echo "Keine Verbindung zur ERP"; + $ok=false; + echo "Keine Verbindung zur ERP"; echo $dbP->userinfo; + $dbP=false; } else { - $rs=$dbP->getall("select id,description from parts where partnumber = '".$_POST["div16NR"]."'"); + $sql="SELECT id,description,buchungsgruppen_id FROM parts where partnumber = '%s'"; + $rs=$dbP->getall(sprintf($sql,$_POST["div16NR"])); $_POST["div16ID"]=$rs[0][0]; - $div16txt=$rs[0][1]; - $rs=$dbP->getall("select id,description from parts where partnumber = '".$_POST["div07NR"]."'"); + $div16txt=addslashes($rs[0][1]); + $rs=$dbP->getall(sprintf($sql,$_POST["div07NR"])); $_POST["div07ID"]=$rs[0][0]; - $div07txt=$rs[0][1]; - $rs=$dbP->getall("select id,description from parts where partnumber = '".$_POST["versandNR"]."'"); + $div07txt=addslashes($rs[0][1]); + $rs=$dbP->getall(sprintf($sql,$_POST["versandNR"])); $_POST["versandID"]=$rs[0][0]; - $versandtxt=$rs[0][1]; - $rs=$dbP->getall("select id,description from parts where partnumber = '".$_POST["nachnNR"]."'"); + $versandtxt=addslashes($rs[0][1]); + $rs=$dbP->getall(sprintf($sql,$_POST["nachnNR"])); $_POST["nachnID"]=$rs[0][0]; - $nachntxt=$rs[0][1]; - $rs=$dbP->getall("select id,description from parts where partnumber = '".$_POST["minderNR"]."'"); + $nachntxt=addslashes($rs[0][1]); + $rs=$dbP->getall(sprintf($sql,$_POST["minderNR"])); $_POST["minderID"]=$rs[0][0]; - $mindertxt=$rs[0][1]; - $rs=$dbP->getall("select id,description from parts where partnumber = '".$_POST["paypalNR"]."'"); + $mindertxt=addslashes($rs[0][1]); + $rs=$dbP->getall(sprintf($sql,$_POST["paypalNR"])); $_POST["paypalID"]=$rs[0][0]; - $paypaltxt=$rs[0][1]; - $rs=$dbP->getall("select id,description from parts where partnumber = '".$_POST["treuhNR"]."'"); + $paypaltxt=addslashes($rs[0][1]); + $rs=$dbP->getall(sprintf($sql,$_POST["treuhNR"])); $_POST["treuhID"]=$rs[0][0]; - $treuhtxt=$rs[0][1]; + $treuhtxt=addslashes($rs[0][1]); $rs=$dbP->getall("select id from employee where login = '".$_POST["ERPusrN"]."'"); $_POST["ERPusrID"]=$rs[0][0]; } - $dsnM="mysql://".$_POST["SHOPuser"].":".$_POST["SHOPpass"]."@".$_POST["SHOPhost"]."/".$_POST["SHOPdbname"]; - $dbM=DB::connect($dsnM); - if (DB::isError($dbM)||!$dbM) { - $ok=false; - echo "Keine Verbindung zum Shop"; + $dsnM = array( + 'phptype' => 'mysql', + 'username' => $_POST["SHOPuser"], + 'password' => $_POST["SHOPpass"], + 'hostspec' => $_POST["SHOPhost"], + 'database' => $_POST["SHOPdbname"], + 'port' => $_POST["SHOPport"] + ); + $dbM=@DB::connect($dsnM); + if (DB::isError($dbM)||!$dbM) { + //$ok=false; + echo "Keine Verbindung zum Shop"; echo $dbM->userinfo; - }; + $dbM=false; + }; if (ok) { - $f=fopen("conf.php","w"); + $f=fopen("conf$login.php","w"); $v="1.5"; $d=date("Y/m/d H:i:s"); fputs($f,"\n// Verbindung zur ERP-db\n"); @@ -126,8 +156,11 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { fputs($f,"\$preA=\"".$_POST["preA"]."\";\n"); fputs($f,"\$preK=\"".$_POST["preK"]."\";\n"); fputs($f,"\$auftrnr=\"".$_POST["auftrnr"]."\";\n"); + fputs($f,"\$utftrans=\"".$_POST["utftrans"]."\";\n"); fputs($f,"\$kdnum=\"".$_POST["kdnum"]."\";\n"); + fputs($f,"\$mwst=\"".$_POST["mwst"]."\";\n"); fputs($f,"\$pricegroup=\"".$_POST["pricegroup"]."\";\n"); + fputs($f,"\$unit=\"".$_POST["unit"]."\";\n"); fputs($f,"\$showErr=\"true\";\n"); fputs($f,"?>"); fclose($f); @@ -162,12 +195,33 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { $paypalNR=$_POST["paypalNR"]; $preA=$_POST["preA"]; $preK=$_POST["preK"]; + $mwst=empty($_POST["mwst"])?1:$_POST["mwst"]; $kdnum=$_POST["kdnum"]; $pricegroup=$_POST["pricegroup"]; + $unit=$_POST["unit"]; $auftrnr=$_POST["auftrnr"]; + $utftrans=$_POST["utftrans"]; } } else { - require "conf.php"; + if (file_exists ("conf$login.php")) { + require "conf$login.php"; + } else { + require "conf.php"; + } + $dsnP = array( + 'phptype' => 'pgsql', + 'username' => $ERPuser, + 'password' => $ERPpass, + 'hostspec' => $ERPhost, + 'database' => $ERPdbname, + 'port' => $ERPport + ); + $dbP=@DB::connect($dsnP); + if (DB::isError($dbP)||!$dbP) { + echo "Keine Verbindung zur ERP"; + $dbP=false; + //echo $dbP->userinfo; + } } ?> @@ -205,6 +259,12 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { + + UTF8-Transl. + > + Preise > incl. + 1)?"checked":"" ?>> excl. MwSt + User-ID "> @@ -264,11 +324,17 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { ID Mindermenge "> > + + + + Std-Einheit + + unit($unit); ?> + Preisgruppe pg($pricegroup); ?> - Auftragsnummern durch > LxO