-
Notifications
You must be signed in to change notification settings - Fork 0
/
sal.php
194 lines (155 loc) · 8.78 KB
/
sal.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<div id="demo">
<?php
$bdd = new PDO('mysql:host=localhost;dbname=pharmacie;', 'root', '');
$allstoc = $bdd->query('SELECT * FROM sales ORDER BY id ASC');
if (isset($_GET['s']) and !empty($_GET['s'])) {
$recherche = htmlspecialchars($_GET['s']);
$allstoc = $bdd->query('SELECT customers_name FROM sales WHERE customers_name LIKE "%' . $recherche . '%" ORDER BY id ASC');
}
if ($allstoc->rowCount() > 0) {
?>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="table.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script src="./table.js"></script>
<form method="GET">
<input type="search" id="search" autocomplete="off" name="s" onkeyup="searchTable()">
<input type="submit" value="search" name="s">
</form>
<div class="container">
<div class="row pt-3">
<a href="formSal.php">
<button class="btn btn-primary">
Ajouter un produit
</button>
</a>
</div>
<table border="0" class="table table-striped mt-3 ">
<tr>
<th>Customers Name</th>
<th>Grand Total</th>
<th>Paid Amount</th>
<th>Added Date</th>
<th>#id</th>
<th colspan="2">Control</th>
</tr>
<?php
while ($stock = $allstoc->fetch()) {
?>
<tr>
<td scope="row">
<p><?= $stock['customers_name'] ?></p>
</td>
<td>
<p><?= $stock['grand_total'] ?></p>
</td>
<td>
<p><?= $stock['paid_amount'] ?></p>
</td>
<td>
<p><?= $stock['added_date'] ?></p>
</td>
<td>
<!-- <a href="update.php?id=<?= $stock['id'] ?>" class="m-2">
<i class="fa fa-edit fa-2x"></i>
<i class="fa fa-trash fa-2x red-icon" data-bs-toggle="modal" data-bs-target="#exempleModal<?= $stock['id'] ?>"></i>
<div class="modal fade" id="exempleModal<?= $stock['id'] ?>" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<p>Etes vous sur de sortir un produit?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">
Annuler
</button>
<a href="delete.php?id=<?= $stock['id'] ?>">
<button class="btn btn-danger">Confirmer</button>
</a>
</div>
</div>
</div>
</div>
</a> -->
<!-- <input type="button" class="editer" value="Editer">
<input type="button" class="trash" value="Supprimer" name="trash"> -->
<div class="container mt-3">
<a href="updateSal.php?id=<?= $stock['id'] ?>" class="m-2">
<i class="fa fa-edit fa-2x"></i>
<i class="fa fa-trash fa-2x red-icon" data-bs-toggle="modal" data-bs-target="#myModal<?= $stock['id'] ?>"></i>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModal<?= $stock['id']; ?>" role="dialog">
<span class="glyphicon glyphicon-pencil"></span>
</button>
edit
</div>
<!-- The Modal -->
<div class="modal" id="myModal<?= $stock['id']; ?>">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Dite moi</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<p>Etes vous sur de sortir un produit?</p>
<!-- Modal body -->
<div class="modal-body">
</div>
<!-- Modal footer -->
<div class="modal-footer">
<a href="admin.php">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">
Annuler
</button>
</a>
<a href="deleteSal.php?id=<?= $stock['id'] ?>">
<button class="btn btn-danger">Confirmer</button>
</a>
<!-- <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button> -->
</div>
</div>
</td>
<td>
<div class="container mt-3">
<span class="glyphicon glyphicon-trash">
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#myModal<?= $stock['id']; ?>">
</button>
Trash</span>
</div>
<!-- The Modal -->
<div class="modal fade" id="myModal<?= $stock['id'] ?>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Modal Heading</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<!-- Modal body -->
<p>Etes vous sur de sortir un produit?</p>
<div class="modal-body">
Modal body..
</div>
<!-- Modal footer -->
<div class="modal-footer">
</button>
<a href="deleteSal.php?id=<?= $stock['id'] ?>">
<button class="btn btn-danger">Confirmer</button>
</a>
</div>
</div>
</div>
</div>
</td>
<?php
}
?>
</tr>
</table>
<?php
} else {
?>
<p>Aucun stocks trouver</p>
<?php
}
?>
</div>