الفصل الخامس
230.
231. 232.
233. 234. 235.
<td><?=$r["price"]?></td>
<td>
136
البرنامج النصي cart_inc.php (تابع)
<?
if ($r["qty"] > 1) {
?>
<a
href="<?=SECURE_URL?>cart.php?cat=<?=$r{"category"]?>&item=<?= $r
["id"]?>&action=add"><img src="<?=IMAGE_URL?>add.gif"
border=0></a>
<?
236.
237.
} else {
238.
?>
239.
Out of Stock
240.
<?
241.
}
242.
?>
243.
</td></tr>
244.
<?
245.
}
246.
?>
247.
</table>
248.
<?
249.
} else {
250.
251.
echo "<h3>Select A Category Above</h3>";
252. } //end display_items
253.
254. function edit_cart ($items) {
255.
256.
?>
257.
258.
global $dbconn;
<form action=cart.php method=post>
<table border=1 cellpadding=5 cellspacing=0>
259. <tr><td class=tablehead>Name</td><td class=tablehead>Price Each</td><td class=tablehead>Qty</td></tr>
foreach($items as $cat => $val) {
260.
<?
261.
262.
263.
$sql = "select * from inventory where id='$item'";
foreach($items[$cat] as $item => $qty) {
ص١٣٦