-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransaction_process.php
More file actions
89 lines (78 loc) · 2.46 KB
/
Copy pathtransaction_process.php
File metadata and controls
89 lines (78 loc) · 2.46 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Submission</title>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-color: #f4f4f4;
}
.message-container {
background-color: #fff;
border-radius: 5px;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
max-width: 400px;
margin: 20px auto;
}
.message-container img {
width: 100px;
height: auto;
margin-bottom: 20px;
}
.success-message {
color: #4CAF50;
font-weight: bold;
}
.error-message {
color: #f44336;
font-weight: bold;
}
.back-btn {
background-color: #333;
color: #fff;
padding: 8px 16px;
border: none;
border-radius: 4px;
text-decoration: none;
margin-top: 20px;
display: inline-block;
}
.back-btn:hover {
background-color: #555;
}
</style>
</head>
<body>
<div class="message-container">
<?php
require("connector.php");
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$transaction_id = $_POST["trasnaction_id"];
$item_id = $_POST["item_id"];
$supplier_id = $_POST["supplier_id"];
$user_id = $_POST["user_id"];
$quantity = $_POST["quantity"];
$transaction_date = $_POST["transaction_date"];
$db = new DBConnection;
$success = $db->updateTransaction($transaction_id, $item_id, $supplier_id, $user_id, $quantity, $transaction_date);
if ($success) {
echo "<img src='aset/agree.png' alt='Success'>";
echo "<p class='success-message'>Transaction data added successfully!</p>";
echo "<a href='index.php' class='back-btn'>Back</a>";
} else {
echo "<p class='error-message'>Transaction addition failed!</p>";
}
} else {
header("Location: index.php");
exit;
}
?>
</div>
</body>
</html>