-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdateorder.php
129 lines (113 loc) · 3.58 KB
/
updateorder.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
session_start();
include_once 'include/config.php';
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
$oid=intval($_GET['oid']);
if(isset($_POST['submit2'])){
$status=$_POST['status'];
$remark=$_POST['remark'];//space char
$query=mysqli_query($con,"insert into ordertrackhistory(orderId,status,remark) values('$oid','$status','$remark')");
$sql=mysqli_query($con,"update orders set orderStatus='$status' where id='$oid'");
echo "<script>alert('Order updated sucessfully...');</script>";
//}
}
?>
<script language="javascript" type="text/javascript">
function f2()
{
window.close();
}ser
function f3()
{
window.print();
}
</script>
<!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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Update Compliant</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="anuj.css" rel="stylesheet" type="text/css">
</head>
<body>
<div style="margin-left:50px;">
<form name="updateticket" id="updateticket" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="50">
<td colspan="2" class="fontkink2" style="padding-left:0px;"><div class="fontpink2"> <b>Update Order !</b></div></td>
</tr>
<tr height="30">
<td class="fontkink1"><b>order Id:</b></td>
<td class="fontkink"><?php echo $oid;?></td>
</tr>
<?php
$ret = mysqli_query($con,"SELECT * FROM ordertrackhistory WHERE orderId='$oid'");
while($row=mysqli_fetch_array($ret))
{
?>
<tr height="20">
<td class="fontkink1" ><b>At Date:</b></td>
<td class="fontkink"><?php echo $row['postingDate'];?></td>
</tr>
<tr height="20">
<td class="fontkink1"><b>Status:</b></td>
<td class="fontkink"><?php echo $row['status'];?></td>
</tr>
<tr height="20">
<td class="fontkink1"><b>Remark:</b></td>
<td class="fontkink"><?php echo $row['remark'];?></td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<?php } ?>
<?php
$st='Delivered';
$rt = mysqli_query($con,"SELECT * FROM orders WHERE id='$oid'");
while($num=mysqli_fetch_array($rt))
{
$currrentSt=$num['orderStatus'];
}
if($st==$currrentSt)
{ ?>
<tr><td colspan="2"><b>
Product Delivered </b></td>
<?php }else {
?>
<tr height="50">
<td class="fontkink1">Status: </td>
<td class="fontkink"><span class="fontkink1" >
<select name="status" class="fontkink" required="required" >
<option value="">Select Status</option>
<option value="in Process">In Process</option>
<option value="Delivered">Delivered</option>
</select>
</span></td>
</tr>
<tr style=''>
<td class="fontkink1" >Remark:</td>
<td class="fontkink" align="justify" ><span class="fontkink">
<textarea cols="50" rows="7" name="remark" required="required" ></textarea>
</span></td>
</tr>
<tr>
<td class="fontkink1"> </td>
<td > </td>
</tr>
<tr>
<td class="fontkink"> </td>
<td class="fontkink"> <input type="submit" name="submit2" value="update" size="40" style="cursor: pointer;" />
<input name="Submit2" type="submit" class="txtbox4" value="Close this Window " onClick="return f2();" style="cursor: pointer;" /></td>
</tr>
<?php } ?>
</table>
</form>
</div>
</body>
</html>
<?php } ?>