예제 #1
0
$lid = LANGUAGEID;
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'CREATENEWPRODUCT') {
        $category_top_id = tep_db_prepare_input($_POST['categories_top_id']);
        $category_id = tep_db_prepare_input($_POST['categories_id'][$category_top_id]);
        //$products_price = tep_db_prepare_input($_POST['products_price']);
        $pname = tep_db_prepare_input($_POST['products_name']);
        $pdesc = tep_db_prepare_input($_POST['products_desc']);
        $brand_id = tep_db_prepare_input($_POST['brand_id']);
        $is_wholesale = true;
        $product_id = Product::createNewProduct($category_id, 0, '1', $pname, $pdesc, $brand_id, $is_wholesale);
        header("Location: ?open=product-detail&products_id={$product_id}");
        exit;
    }
}
if (CategoryTop::getTotalCount() == 0) {
    $content .= '<h3 class="red">No TOP Catagory found in Database!</h3>';
} else {
    $ct_options = array();
    $cat_options = array();
    while ($ct = CategoryTop::getOneByOneAsObject()) {
        if ($ct->getCategoriesTotalCount() > 0) {
            $ct_options[$ct->id] = $ct->name;
            $cat_options[$ct->id] = array();
            while ($cat = $ct->getCategoriesOneByOneAsObject()) {
                if ($cat->getProductCodePrefix() != "") {
                    $cat_options[$ct->id][$cat->id] = $cat->getName($lid);
                }
            }
        }
    }
<?php

/**
 * @author IT TEAM BONOFACTUM
 * @created Dec 16, 2014 13:39:47 PM
 */
use_class('CategoryTop');
$row_per_page_in_list = 10;
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADLIST') {
        $page = tep_db_prepare_input($_POST['page']);
        //currently we don't support the paging function yet
        $total_count = CategoryTop::getTotalCount();
        if ($total_count == 0) {
            $result = '<h3 class="red">No TOP Category found in database</h3>';
        } else {
            $table = array();
            $row = array();
            $row['nm w200'] = 'Name';
            $row['id w080'] = 'ID';
            $row['ac w300'] = 'Actions';
            $table[] = $row;
            while ($ct = CategoryTop::getOneByOneAsObject()) {
                $row = array();
                $row['nm pointer'] = $ct->name;
                $row['id'] = $ct->id;
                $row['ac smallText'] = '<a href="?open=setting-categories' . '&amp;ctid=' . $ct->id . '&amp;hidemenu=true" class="' . 'view_webpage">&laquo;Manage Categories&raquo;</a>';
                $table[] = $row;
            }
            $result = '<h2>TOP Category List</h2>' . tep_draw_table('', $table);
        }