-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmark.php
39 lines (33 loc) · 940 Bytes
/
mark.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
<?php
require 'app/init.php';
if(isset($_GET['as'], $_GET['item'])) {
$as = $_GET['as'];
$item = $_GET['item'];
switch($as) {
case 'done':
$doneQuery = $db->prepare("
UPDATE items
SET done = 1
WHERE id = :item
AND user = :user
");
$doneQuery->execute([
'item' => $item,
'user' => $_SESSION['user_id']
]);
break;
case 'undone':
$undoneQuery = $db->prepare("
UPDATE items
SET done = 0
WHERE id = :item
AND user = :user
");
$undoneQuery->execute([
'item' => $item,
'user' => $_SESSION['user_id']
]);
break;
}
}
header('Location: index.php');