コード例 #1
0
ファイル: action.php プロジェクト: bcawosxy/pindelta
         $product_id = get_product_id($category_id);
         if ($product_id != null) {
             if (!del_product($product_id)) {
                 php_call_jbox('error', '刪除產品時發生錯誤,請重新操作。', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type);
             }
             if (!del_product_meta($product_id)) {
                 php_call_jbox('error', '刪除產品描述時發生錯誤,請重新操作。', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type);
             }
         }
         //刪除項目
         if (!del_category($category_id)) {
             php_call_jbox('error', '刪除項目時發生錯誤,請重新操作。', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type);
         }
     }
     //刪除類別
     del_categoryarea($id) ? php_call_jbox('success', '刪除資料完成', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type) : php_call_jbox('error', '刪除失敗', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type);
 }
 if ($type == 'category') {
     $category_id[] = $id;
     //取得項目下的產品ID及刪除產品
     $product_id = get_product_id($category_id);
     if ($product_id != null) {
         if (!del_product($product_id)) {
             php_call_jbox('error', '刪除產品時發生錯誤,請重新操作。', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type);
         }
         if (!del_product_meta($product_id)) {
             php_call_jbox('error', '刪除產品描述時發生錯誤,請重新操作。', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type);
         }
     }
     //刪除項目
     del_category($category_id) ? php_call_jbox('success', '刪除資料完成', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type) : php_call_jbox('error', '刪除失敗', URL_ADMIN_ROOT . 'product/?act=show&type=' . $type);
コード例 #2
0
ファイル: content.php プロジェクト: bcawosxy/pindelta
                return !empty($product_id_list) ? $product_id_list : null;
            }
            $categoryarea_id[] = $id;
            //取得類別下的項目ID
            $category_id = get_category_id($categoryarea_id);
            if ($category_id != null) {
                //取得項目下的產品ID及刪除產品
                $product_id = get_product_id($category_id);
                if ($product_id != null) {
                    if (!del_product($product_id)) {
                        json_encode_return(0, '刪除產品時發生錯誤,請重新操作。', URL_ADMIN2_ROOT . 'categoryarea/');
                    }
                    if (!del_product_meta($product_id)) {
                        json_encode_return(0, '刪除產品描述時發生錯誤,請重新操作。', URL_ADMIN2_ROOT . 'categoryarea/');
                    }
                }
                //刪除項目
                if (!del_category($category_id)) {
                    json_encode_return(0, '刪除項目時發生錯誤,請重新操作。', URL_ADMIN2_ROOT . 'categoryarea/');
                }
            }
            //刪除類別
            del_categoryarea($id) ? json_encode_return(1, '刪除資料完成', URL_ADMIN2_ROOT . 'categoryarea/') : json_encode_return(0, '刪除失敗', URL_ADMIN2_ROOT . 'categoryarea/');
            break;
        default:
            json_encode_return(0, '流程異常,請重新操作[ACT#2]');
            break;
    }
}
header('Content-type: text/html; charset=utf-8');
header('Location: http://' . $_SERVER['SERVER_NAME']);