forked from kivitendo/kivitendo-crm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firmen3.php
51 lines (51 loc) · 1.87 KB
/
firmen3.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
require_once("inc/stdLib.php");
include("inc/template.inc");
include("inc/FirmenLib.php");
include_once("inc/UserLib.php");
$Q=($_GET["Q"])?$_GET["Q"]:$_POST["Q"];
$t = new Template($base);
doHeader($t);
$t->set_file(array("fa1" => "firmen3.tpl"));
if ($_POST["saveneu"]) {
$_POST["customernumber"]=false;
$_POST["vendornumber"]=false;
$rc=saveNeuFirmaStamm($_POST,$_FILES,$Q);
if ($rc[0]>0) { header("location:firmen3.php?Q=$Q&id=".$rc[0]."&edit=1");}
else { $msg="Fehler beim Sichern (".($rc[1]).")"; };
$btn1=""; $btn2=""; $_POST["id"]="";
vartpl ($t,$_POST,$Q,$msg,$btn1,$btn2,3);
} else if ($_POST["save"]) {
if ($_POST["id"]) {
$tabelle=($Q=="C")?"customer":"vendor";
if (chkTimeStamp($tabelle,$_POST["id"],$_POST["mtime"])) {
$rc=saveFirmaStamm($_POST,$_FILES,$Q);
if ($rc[0]>0) {
$msg="Daten gesichert.";
$_POST=getFirmenStamm($rc[0],false,$Q);
} else {
$msg="Fehler beim Sichern ( ".$rc[1]." )";
};
} else {
$msg="Daten wurden inzwischen modifiert";
$rc[0]=-1;
}
} else {
$rc[0]=-1; $rc[1]="Kein Bestandskunde";
}
$btn1="<input type='submit' class='sichern' name='save' value='sichern' tabindex='90'>";
$btn2="<input type='submit' class='anzeige' name='show' value='zur Anzeige' tabindex='91'>";
vartpl ($t,$_POST,$Q,$msg,$btn1,$btn2,3);
} else if ($_POST["show"]) {
header("location:firma1.php?Q=$Q&id=".$_POST["id"]);
} else if ($_GET["edit"]) {
$daten=getFirmenStamm($_GET["id"],false,$Q);
$msg="Edit: <b>".$_GET["id"]."</b>";
$btn1="<input type='submit' class='sichern' name='save' value='sichern' tabindex='90'>";
$btn2="<input type='submit' class='anzeige' name='show' value='zur Anzeige' tabindex='91'>";
vartpl ($t,$daten,$Q,$msg,$btn1,$btn2,3);
} else {
leertpl($t,3,$Q,"Neueingabe");
}
$t->Lpparse("out",array("fa1"),$_SESSION['countrycode'],"firma");
?>