-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeletefixture_f.php
62 lines (28 loc) · 1007 Bytes
/
deletefixture_f.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
<?php
$now = mktime();
include 'mysql.php';
$fixt = $_POST["bar"];
$comment = $_POST["delete_comment"];
include 'inc/logging.php';
$user = $_COOKIE["user_login_cma"];
//Sprawdzamy uprawnienia użytkownika
//
// Uprawnienia 0 - Full Access
// Uprawnienia 1 - Zwykły user
$user_q = "SELECT * FROM `users` WHERE `login` = '$user' LIMIT 1";
$user_r = mysql_query($user_q);
while ($row_user = mysql_fetch_assoc($user_r)) {
$login = $row_user["login"];
$perm = $row_user["permissions"];
if ($perm == 0) {
$delete_q = "UPDATE `warehouse` SET `deleted` = '1', `deleted_comment` = '$comment' WHERE `id` = '$fixt'";
mysql_query($delete_q);
echo mysql_error();
$log = "INSERT INTO `log_fixtures` (`fixture_id`, `type`, `timestamp`, `user`) VALUES ('$fixt', '12', '$now', '$user')";
mysql_query($log);
echo mysql_error();
// header("Location: http://smietnik.prnet.pl/cma_service/?m=listasprzetu");
} else {
}
}
?>