forked from che0/greybox
-
Notifications
You must be signed in to change notification settings - Fork 3
/
clovek.self.exec.inc
75 lines (68 loc) · 1.36 KB
/
clovek.self.exec.inc
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
74
75
<?php
/*
* greybox
* $Id: clovek.self.exec.inc,v 1.3 2005/01/09 00:47:32 che0 Exp $
*/
$clovek_id = $_REQUEST["clovek_id"];
$nick = $_REQUEST["nick"];
$email = $_REQUEST["email"];
$komentar = $_REQUEST["komentar"];
$narozen = $_REQUEST["narozen"];
$ulice = $_REQUEST["ulice"];
$mesto = $_REQUEST["mesto"];
$psc = $_REQUEST["psc"];
$prukaz = $_REQUEST["prukaz"];
$cislo = $_REQUEST["cislo"];
if ($_SESSION["user_clovek_ID"] != $clovek_id) {
pg_achtung($lang["access denied"]);
return;
}
if (isset($_REQUEST["save"])) {
// update
if (cpdb_exec("
update clovek set
nick = :nick,
email = :email,
komentar = :komentar,
ulice = :ulice,
mesto = :mesto,
psc = :psc,
prukaz = :prukaz,
cislo = :cislo
where
clovek_ID = :clovek_id
",
array(
":clovek_id"=>$clovek_id,
":nick"=>$nick,
":email"=>$email,
":komentar"=>$komentar,
":ulice"=>$ulice,
":mesto"=>$mesto,
":psc"=>$psc,
":prukaz"=>$prukaz,
":cislo"=>$cislo
)
)) {
pg_achtung($lang["person update ok"]);
include("clovek.inc");
}
} elseif (isset($_REQUEST["born"])) {
// delete
if (cpdb_exec("
update clovek set
narozen = :narozen
where
clovek_ID = :clovek_id
and isnull(narozen)
",
array(
":clovek_id"=>$clovek_id,
":narozen"=>deformat_date($narozen),
)
)) {
pg_achtung($lang["person update ok"]);
include("clovek.inc");
}
}
?>