-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_approve_stock.php
113 lines (89 loc) · 3.41 KB
/
admin_approve_stock.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
<?php
ob_start();
session_start();
include 'connection1.php';
include 'header.php';
include 'css/style.css';
include('checklogin.php');
check_login();
if(isset($_GET['del']))
{
mysqli_query($conn,"delete from stockiest where id = '".$_GET['id']."'");
$_SESSION['msg']="Data deleted !!";
}
if(isset($_GET['appr']))
{
mysqli_query($conn,"update stockiest set status='Approved' where id = '".$_GET['id']."'");
$_SESSION['msg']="Data Approved !!";
}
if(isset($_GET['rej']))
{
mysqli_query($conn,"update stockiest set status='Rejected' where id = '".$_GET['id']."'");
$_SESSION['msg']="Data Rejected !!";
}
?>
<html>
<head><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
</style>
</head>
<title>Admin|Approve</title>
<body>
<a href="approval1.php"><h3> <font color="#0000FF" > <span class="material-icons" >arrow_circle_left</span></font></h3></a>
<font color="#0000FF"><b><h4><span> Welcome : <?php
$name=$_SESSION['login'];
echo $name;
?>
</span></h4></b></font>
<div class="div-center"><font color="#0000FF"><b><h1>Approve Stockiest</h1></b></font></div>
<div class="div-center">
<div class="div-center">
<div class="row">
<div class="col-md-12">
<table class="table table-hover" id="list">
<thead>
<tr>
<th class="center">#</th>
<th>User Name</th>
<th>Address</th>
<th>Phone Number</th>
<th>Email</th>
<th>Status</th>
<th>Approve</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql=mysqli_query($conn,"select * from stockiest");
$cnt=1;
while($row=mysqli_fetch_array($sql))
{
?>
<tr>
<td class="center"><?php echo $cnt;?>.</td>
<td class="hidden-xs"><?php echo $row['name'];?></td>
<td><?php echo $row['address'];?></td>
<td><?php echo $row['phone'];?></td>
<td><?php echo $row['email'];?></td>
<td><?php if($row['status'] == "Approved"){echo '<p style="color:green">Approved</p>';}else{echo '<p style="color:red">Rejected</p>';}?></td>
<td>
<a href="admin_approve_stock.php?id=<?php echo $row['id']?>&appr=approve" onClick="return confirm('Are you sure you want to Approve?')"><p style="color:green">Approve</p></a>
<a href="admin_approve_stock.php?id=<?php echo $row['id']?>&rej=rejected" onClick="return confirm('Are you sure you want to Reject?')"><p style="color:red">Reject</p></a>
<td >
<div class="center">
<a href="admin_approve_stock.php?id=<?php echo $row['id']?>&del=delete" onClick="return confirm('Are you sure you want to delete?')"><p style="color:red">Delete</P></i></a>
</div>
</td>
</tr>
<?php
$cnt=$cnt+1;
}?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>