-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathpersonen3.php
73 lines (72 loc) · 3.15 KB
/
personen3.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
require_once("inc/stdLib.php");
include("inc/template.inc");
include("inc/laender.php");
include("inc/crmLib.php");
include_once("inc/UserLib.php");
include("inc/persLib.php");
include("inc/FirmenLib.php");
$t = new Template($base);
$menu = $_SESSION['menu'];
doHeader($t);
$Q = (isset($_GET["Quelle"]))?$_GET["Quelle"]:$_POST["Quelle"];
if ( isset( $_POST["show"] ) ) {
header("location:firma2.php?Q=$Q&id=".$_POST["PID"]);
} else if ( $_POST["save"]||$_POST["neu"] ) {
if ( isset( $_POST["neu"] ) ) {
$_POST["PID"] = 0;
$rc = savePersonStamm($_POST,$_FILES);
} else {
if ( chkTimeStamp("contacts",$_POST["PID"],$_POST["mtime"]) ) {
$rc = savePersonStamm($_POST,$_FILES);
} else {
$rc = -10;
}
}
if ( preg_match('/^[0-9]+$/',$rc) ) {
$msg = "Daten gesichert.";
$daten = getKontaktStamm(($_POST["PID"])?$_POST["PID"]:$rc);
$daten["Quelle"]=$Q;
$btn3 = "<input type='submit' class='sichern' name='save' value='.:save:. .:update:.' tabindex='25'>";
$btn1 = "<input type='submit' class='anzeige' name='show' value='.:view:.'>";
$btn2 = "<input type='submit' class='sichernneu' name='neu' value='.:save:. .:new:.'>";
vartplP ($t,$daten,$msg,$btn1,$btn2,$btn3,"cp_givenname","white",0,3);
} else {
if ( $_POST["PID"] ) {
$_POST["cp_id"] = $_POST["PID"];
$btn3 = "<input type='submit' class='sichern' name='save' value='.:save:. .:update:.' tabindex='25'>";
$btn1 = "<input type='submit' class='anzeige' name='show' value='.:view:.'>";
} else {
$btn1 = "";
$btn3 = "";
}
if ( $rc == -10 ) {
$msg = "Daten wurden inzwischen modifiziert";
} else {
$msgtmp = explode('::',$rc);
$rc = $msgtmp[1];
$msg = ".:error:. .:save:. ($msgtmp[0])";
};
$btn2 = "<input type='submit' class='sichernneu' name='neu' value='.:save:. .:new:.'>";
vartplP ($t,$_POST,$msg,$btn1,$btn2,$btn3,$rc,"red",1,3);
}
} else if ( $_POST["edit"] > 0 || $_GET["edit"] > 0 ) {
if ( $_POST["id"] ) {
$id = $_POST["id"];
} else {
$id = $_GET["id"];
}
if (!$id) header("location:".$_SESSION['baseurl']."crm/personen1.php?Q=$Q");
$daten = getKontaktStamm($id);
$daten["Quelle"] = $Q;
$msg = "Edit: <b>$id</b>";
$btn3 = "<input type='submit' class='sichern' name='save' value='.:save:. .:update:.' tabindex='25'>";
$btn1 = "<input type='submit' class='anzeige' name='show' value='.:view:.'>";
$btn2 = "<input type='submit' class='sichernneu' name='neu' value='.:save:. .:new:.'>";
vartplP ($t,$daten,$msg,$btn1,$btn2,$btn3,"cp_givenname","white",0,3);
} else {
$msg = ".:person:. .:new:.";
leertplP($t,$_GET,$msg,3,true,$Q);
}
$t->Lpparse("out",array("pers1"),$_SESSION['countrycode'],"firma");
?>