141
استخدام ما تعلمناه في تطبيق سلة تسوق بسيط..
البرنامج النصي dbmanage.php (تابع)
<tr><td><?=$r["name"]?></td> <td><?=$r["code"]?></
td><td><?=$r["description"]?></td>
<td><?=$r["price"]?></
td><td><?=$r["picture"]?> </td>
<td><?=$r["qty"]?></td>
</tr>
54.
55.
56.
57.
58.
<?
59.
}
60.
}
61.
62.
63.
?></table><?
} // end display
64. function item_edit($cat, $limit) {
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
global $dbconn;
$sql = "select * from inventory where category = $cat'
order by id limit $limit, 20";
$result = $dbconn->query($sql);
errortrap ($result);
if ($result->numRows() > 0) {
?>
<p>Viewing inventory items <?=$limit?> through
<?= ($limit+=20) ?>.
<form action=dbmanage.php method=post>
<input type=hidden name="category" value="<?=$cat?>"> <input type=hidden name-limit value="<?=$limit ?>"> <input type="submit" name="choose_cat" value="View Next 20"> </form>
<table>
<tr class=tablehead><td>Name</td><td>Category</ td><td>Code</td><td>Description</td><td>Price</td><td>Picture</t
d><td>Qty</td><td>Action</td>
while($result->fetchinto ($r)) {
?>
79.
<?
80.
81.
82.
83.
value="<?=$r["id"]?>">
84.
?>">
<form action=dbmanage.php method=post> <input type=hidden name=id
<input type=hidden name=limit value="<?=$limit
ص١٤١