Review
PHP processing pictures: with GD extension
Processing steps: Preparing the canvas, assigning colors (background, text, interference), manipulating the canvas (interference + writing), saving the canvas (output + save), destroying resources.
Verification code: With Session technology commodity classification management product Classification display
1. First thing: Be sure to first consider how to enable the user to operate. Added a menu option for product categories, where users can click to view all product categories. /admin/templates/menu.html
2. Create a Product Classification module to handle all requests related to commodity classification. /admin/category.php
3. Remove all data from the product category and display it in the template.
A) Create a class that corresponds to a commodity classification table. /admin/includes/category.class.php
b) The object of the classification of commodities, the operation of the database to obtain all the information of the classification of goods. /admin/category.php?act=list
c) Add a method to obtain the classification of all commodities. /admin/includes/category.class.php
d) Display all product classification information in the template. /admin/templates/category_list.html
4. Infinite class Classification: In category class, the data is processed infinitely. /admin/includes/category.class.php
5. Use the Level property to determine the indentation information for the current product classification. /admin/templates/category_list.html
Add Product Categories
1. Add an entry that adds a product category to the user. /admin/templates/category_list.html
2. After receiving the action, handle the action. /admin/category.php?act=add
3. Get all the product classification information. /admin/category.php?act=add
4. Display all product categories. /admin/templates/category_add.html
5. Determine the whereabouts of the form. /admin/templates/category_add.html
6. Receive user actions and process requests. /admin/category.php|act=insert
A) Modify the way you receive user actions
b) Handling actions
c) Validation: The same name is not allowed.
d) Add a validation method. /admin/includes/category.class.php
e) Verify the results. /admin/category.php?act=insert
f) Insert the database.
g) New method for inserting product classifications. /admin/includes/category.class.php
h) Determine the insertion result. /admin/category.php?act=insert
Delete Product Categories
1. Provide the user with an operation interface that can delete the product classification. /admin/templates/category_list.html
2. Receive the request and process the request. /admin/category.php?act=del
3. Validation of the data to be deleted: The current product classification can only be deleted if there is no subcategory of the product category.
4. Create a method that determines whether a node is a leaf node. /admin/includes/category.class.php
5. Determine the results of the verification. /admin/category.php?act=del
6. Delete the product category.
7. Create a method to delete the product classification. /admin/inclucdes/category.class.php
8. Add the base method of the deletion. /includes/db.class.php
20150119--Infinite class category + Product Category 01