-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_table.php
58 lines (56 loc) · 1.86 KB
/
admin_table.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
<?php
include "header/functions.php";
redirect_if_logged_out();
echo '<br/>
<table class = "table table-hover">
<th class = "success">
<td><b>#</b></td>
<td><b>Nume</b></td>
<td><b>Pret</b></td>
<td><b>Actiune</b></td>
</th>';
while ($row = mysql_fetch_assoc($result))
{
if (isset($_GET["update_id"]) && $_GET["update_id"] != "")
if ($_GET["update_id"] != $row["id_product"])
{
$num++;
echo '<tr>
<td></td>
<td>'.$num.'</td>
<td>'.$row["name"].'</td>
<td>'.$row["price"].'</td>
<td><a href = "cauta.php?nume='.$_GET["nume"].'&pret='.$_GET["pret"].'&id_product='.$row["id_product"].'">Sterge</a>
<a href = "cauta.php?nume='.$_GET["nume"].'&pret='.$_GET["pret"].'&update_id='.$row["id_product"].'">Update</a></td>
</tr>';
}
else
{
$num++;
echo '<form method = "GET" action = "cauta.php"><tr>
<td></td>
<td>'.$num.'
<input type = "hidden" name = "confirmation_id" value = "'.$row["id_product"].'">
</td>
<td><input type = "text" name = "nume" value = "'.$row["name"].'" /></td>
<td><input type = "text" name = "pret" value = "'.$row["price"].'" /></td>
<td><a href = "cauta.php?nume='.$_GET["nume"].'&pret='.$_GET["pret"].'&id_product='.$row["id_product"].'">Sterge</a>
<input type = "submit" class = "btn" value = "Confirma" /></td>
</tr></form>';
}
else
{
$num++;
echo '<tr>
<td></td>
<td>'.$num.'</td>
<td>'.$row["name"].'</td>
<td>'.$row["price"].'</td>
<td><a href = "cauta.php?nume='.$_GET["nume"].'&pret='.$_GET["pret"].'&id_product='.$row["id_product"].'">Sterge</a>
<a href = "cauta.php?nume='.$_GET["nume"].'&pret='.$_GET["pret"].'&update_id='.$row["id_product"].'">Update</a></td>
</tr>';}
}
echo
'</table>
<br/>';
?>