145
استخدام ما تعلمناه في تطبيق سلة تسوق بسيط...
البرنامج النصي dbmanage.php (تابع)
172.
173.
174.
<table border="1" cellspacing="0" cellpadding="5"> <tr class=tablehead> <td colspan="2"><h2>Add A
Category</h2></td></tr>
<tr><td>Name</td><td><input type="text" name="name"
size="32" maxlength="32"></td></tr>
175. <tr><td>Description</td><td><textarea name="description"
176.
177.
178.
179.
cols=30 rows=5></textarea></td></tr>
<tr><td colspan="2"> <input type="submit" name="add_cat" value="Add Category"></td></tr>
<?
</table>
</form>
180. } //end add_cat_form
181.
182. function add_item_form() {
<form action=dbmanage.php method=post>
183.
?>
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
<table border="1" cellspacing="0" cellpadding="5">
<tr class=tablehead> <td colspan="2"><h2>Add An Inventory
Item</h2></td></tr>
<tr><td>Name</td><td><input type="text" name="name"
size="32" maxlength="32"></td></tr>
<tr><td>Category</td><td><select name="category"> <? build_menu("name", "category"); ?></select></td></tr>
<tr><td>Code</td><td><input type="text" name="code"
size="32" maxlength="32"></td></tr>
<tr><td>Description</td><td><textarea name="description"
cols=30 rows=5></textarea></td></tr>
<tr><td>Price</td><td><input type="text" name="price" size="8" maxlength="8"></td></tr>
<tr><td>Picture</td><td><input type="text"
name="picture"></td></tr>
<tr><td>Qty In Stock</td><td><input type="text" name="qty" size="5"></td></tr>
<tr><td colspan="2"> <input type="submit" name="add_item" value="Add Item"></td></tr>
</table>
194.
195.
196.
</form>
197.
<?
198. } //end add_item_form
*
ص١٤٥