-
Notifications
You must be signed in to change notification settings - Fork 0
/
manageOrdersNotCompleted_databaseJCC.php
56 lines (43 loc) · 1.33 KB
/
manageOrdersNotCompleted_databaseJCC.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
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Επεξεργασία μη ολοκληρωμένων παραγγελιών</title>
</head>
<body>
<?php
$servername = "localhost";
$username = "cyfoodmuseum";
$password = "9m8ESxZD";
$dbname = "cyfoodmuseum";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
echo "Connection faild";
}
if (!$conn->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $conn->error);
die;
}
$code = $_POST['oloklirwsi'];
if(isset($_POST['oloklirwsi'])){
$code = $_POST['oloklirwsi'];
$_SESSION["code_order"] = $code;
mysqli_close($conn);
header("Location: manageOrdersSetCompletedJCC.php");
die;
}else{
$code = $_POST['akirwthike'];
$cancel = 1;
$sql="UPDATE `ORDERS` SET Canceled = '$cancel' WHERE Code = '$code'";
$result = $conn->query($sql);
mysqli_close($conn);
header("Location: manageOrdersNotCompletedJCC.php");
die;
}
?>
</body>
</html>