Beginning PHP and Postgre SQL E-Commerce From Novice to Professional phần 5

Các mã mà bạn vừa thêm vào tầng trình bày là một sửa đổi lần Smarty. Việc sửa đổi lần Smarty được sử dụng như thể hiện bởi những sửa đổi mà bạn đã thực hiện : lớp chứa trong tập tin này, SymmetricCrypt, được sử dụng bởi SecureCard dữ liệu mã hóa và giải mã. | CHAPTER 7 CATALOG ADMINISTRATION 231 Get the category id targeted by submit button the number at the end of submit button name 1 from submit_edit_categ_1 this- mActionedCategoryId int substr key last_underscore 1 break public function init If adding a new category . if this- mAction add_categ category_name _POST category_name category_description _POST category_description if category_name null this- mErrorMessage Category name is empty if this- mErrorMessage null Catalog AddCategory this- mDepartmentId category_name category_description If editing an existing category . if this- mAction edit_categ this- mEditItem this- mActionedCategoryId If updating a category . if this- mAction update_categ category_name _POST name category_description _POST description if category_name null this- mErrorMessage Category name is empty if this- mErrorMessage null Catalog UpdateCategory this- mActionedCategoryId category_name category_description If deleting a category . if this- mAction delete_categ 232 CHAPTER 7 CATALOG ADMINISTRATION status Catalog DeleteCategory this- mActionedCategoryId if status 0 this- mErrorMessage Category not empty If editing category s products . if this- mAction edit_products header Location Page Products DepartmentID . this- mDepartmentId . CategoryID . this- mActionedCategoryId exit this- mAdminCategoriesTarget . DepartmentID . this- mDepartmentId Load the list of categories this- mCategories Catalog GetDepartmentCategories this- mDepartmentId this- mCategoriesCount count this- mCategories 3. Create a new template file named in the presentation templates folder and add the following code to it load_admin_products assign admin_products span class admin_page_text Editing products for category admin_products- mCategoryName strip a href admin_products- mAdminCategoriesLink prepare_link https back to categories . a strip span br br if admin_products- mErrorMessage neq span class admin_error_text .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
174    393    1    21-05-2024
35    72    1    21-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.