-
Notifications
You must be signed in to change notification settings - Fork 0
/
myproductD.php
143 lines (90 loc) · 3.89 KB
/
myproductD.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
ob_start();
session_start();
include 'css/style.css';
include 'connection1.php';
include 'staff_header.php';
$user = $_SESSION['login'];
$sql = "select * from addpdis where user = '$user' or type='stock' ";
$result = $conn->query($sql);
?>
<html>
<head>
<title>products </title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<a href="distributorhome.php"><h3> <font color="#0000FF" > <span class="material-icons" >arrow_circle_left</span></font></h3></a>
<div class="div-center"><font color="#0000FF"><b><h1>Product Details</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">
<tr>
<th>Id</th>
<th>Name </th>
<th>Price </th>
<th>Description </th>
<th>Offer </th>
<th>Stock </th>
<th>Specification</th>
<th>Shipping Days</th>
<th>Shipping Charges</th>
<th>action </th>
</tr>
<tr >
<?php
if($result->num_rows > 0){
while($row=$result->fetch_assoc()){
?>
<td class="center"><?php echo $row['id']; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['price']; ?></td>
<td><?php echo $row['description']; ?></td>
<td><?php echo $row['offer']; ?></td>
<td><?php echo $row['stock']; ?></td>
<td><?php echo $row['specification']; ?></td>
<td><?php echo $row['shippingdays']; ?></td>
<td><?php echo $row['charges']; ?></td>
<td >
<div class="btn-group-vertical">
<a href="upload.php?id=<?php echo $row['id']?>" onClick="return confirm('Are you sure you want to add image?')">
<button class="btn btn-warning btn-xs" name='add1' type="submit"><i class="material-icons">addimage</i></button>
</a>
<br><form></form>
<a href="editproductdi.php?id=<?php echo $row['id']?>" onClick="return confirm('Are you sure you want to edit?')">
<button class="btn btn-info btn-xs" name='edit' type="submit"><i class="material-icons">edit</i></button></a>
<br><form></form>
<form method="post">
<button class="btn btn-danger btn-xs" type="submit" name='prescribe1'><i class="material-icons">delete</i></button>
<input type='hidden' name='prescribe1' value="<?php echo $row['id'];?>" >
<?php if(isset($_POST['prescribe1'])){
$sl=$_POST['prescribe1'];
//echo $sl;
$_SESSION['sl']= $sl;
$sql= "delete from addpdis where id ='$sl' ";
$result1 = $conn->query($sql);
if($result1){
header("Location:myproductD.php");
}
}
?>
</form>
</td>
</tr>
</div>
<?php
}
}
if(isset($_POST['delete'])){
$id = $_POST['delete'];
}
?>
</table>
</div>
</body>
</html>