-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateprocess1.php
66 lines (54 loc) · 1.84 KB
/
updateprocess1.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
63
64
65
66
<body>
<h2> Customer order details</h2>
<?php
require_once('conn.php');
//receive data from form and assign to variables
$id=$_POST['id'];
$first_name=$_POST['name'];
$gender=$_POST['gender'];
$department = isset($_POST['department']) ? $_POST['department'] : "";
$cust_name = isset($_POST['cust_name']) ? $_POST['cust_name'] : "";
$date=$_POST['date'];
$time=$_POST['time'];
$payment=$_POST['payment'];
$file=$_POST['file'];
$deliv_fee=$_POST['deliv_fee'];
$item_price=$_POST['item_price'];
$comments=$_POST['comments'];
//calculate total order cost
$sum = ($item_price)+($deliv_fee);
//print the details
echo "Name: ".$name."<br>";
if (isset($_POST['gender'])) {
$gender = $_POST['gender'];
echo "Gender: ".$gender."<br><br>";
} else {
echo "No gender selected";
};
if (isset($_POST['department'])) {
$department = $_POST['department'];
echo "Department: ".$department."<br><br>";
} else {
echo "No department selected";
};
echo "<br><br>";
echo "Store Name: ".$cust_name."<br>";
echo "Delivery Date: ".$date."<br>";
echo "Delivery Time: ".$time."<br><br>";
echo "Payment Mode: ".$payment."<br>";
echo "Delivery Fee: ".$deliv_fee."<br>";
echo "Item Price: ".$item_price."<br>";
echo "Total Bill: ".$sum."<br><br>";
echo "Insurance Card: ".$file."<br>";
echo "Comments: ".$comments."<br><br><br>";
//UPDATE data into table
$update="UPDATE strform SET name='$name', gender='$gender', department='$department', cust_name='$cust_name', delivery_date='$date', delivery_time='$time', payment_mode='$payment', deliv_fee='$deliv_fee', item_price='$item_price', total_fee='$sum', comments='$comments' WHERE id='$id' ";
if(!mysqli_query($con,$update))
{
echo "Record not updated. Try Again";
}
else
echo"Recorded updated successfully!";
echo "<br><a href='view.php'>Go back to records list</a>";
?>
</body>