??? Completely remove a department from the database by clicking the Delete button (this
works only if the department has no related categories).
CHAPTER 10 ?– CATALOG ADMINISTRATION: DEPARTMENTS AND CATEGORIES 268
Figure 10-2. The TShirtShop departments Admin page
When clicking the Edit button, the corresponding row from the table enters edit mode,
and its fields become editable, as shown in Figure 10-3. Also, as you can see, instead of the Edit
button, you get Update and Cancel buttons. Clicking Update submits the changes to the database,
whereas clicking Cancel simply quits edit mode and reverts the data table to its original state.
Figure 10-3. Editing department information
CHAPTER 10 ?– CATALOG ADMINISTRATION: DEPARTMENTS AND CATEGORIES 269
The administrator can add new departments by entering the new department??™s name and
description in the text boxes below the table and clicking the Add button.
When the administrator clicks the Edit Categories button, the admin.php page is reloaded
with an additional parameter in the query string: DepartmentId. This parameter tells admin.php
to load the admin_categories Smarty template, which lets the administrator edit the categories
that belong to the selected department (see Figure 10-4).
Figure 10-4. The TShirtShop categories Admin page
This page works similar to the one for editing departments.
Pages:
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385