Пример #1
0
<?php

include './config.php';
include './auth.php';
$id = $_GET['id'];
$can_id = $_GET['can_id'];
$ord_id = $_GET['ord_id'];


$active_super_category = getSuperCategoryActive();
$editProductsName = editPdoructs($id);
$editProducts = editPdoructsOrder($id,$ord_id);
$active_category = getCategoryActive();
$ca_id = $editProducts[0]['category_id'];
$super_id = $editProducts[0]['supercategory_id'];
$active_sub_category = getSubCategoryActive($super_id,$ca_id);
$qty = getQty($id,$ord_id);
$price = getPriceE($id,$ord_id);
?> 
<!DOCTYPE html>
<html>
    <head>
        <title>Edit Sub Category</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="style/style.css" rel="stylesheet" type="text/css" media="all" />
        <script type="text/javascript" src="js/jquery.min.js"></script>
        
    </head>
    <body>
 <div id="popup_content"> <!--your content start-->
               <div id="msg" style="color:#007F2A; font-size: 13px;"></div>
Пример #2
0
<?php

include './config.php';
include './auth.php';
$active_category = getSuperCategoryActive();
$active_sub_category = getSubCategoryActive();
$super_category = getSuperCat();
if ($_REQUEST['new_prod'] == '1') {
    extract($_POST);
    $sql_sk = mysql_query("SELECT sku_id FROM sohorepro_products ORDER BY id DESC LIMIT 1");
    $object = mysql_fetch_assoc($sql_sk);
    if (count($object['sku_id']) > 0) {
        $sku = $object['sku_id'] + 1;
    } else {
        $sku = "10001";
    }
    $sql_order_id = mysql_query("SELECT id FROM sohorepro_products ORDER BY id DESC LIMIT 1");
    $object = mysql_fetch_assoc($sql_order_id);
    if (count($object['id']) > 0) {
        $sort_id = $object['id'] + 1;
    } else {
        $sort_id = '1';
    }
    $sql = "INSERT INTO sohorepro_products\r\r\n\t\t\tSET     supercategory_id = '" . $supercategory_name . "',                        \r\r\n                                category_id     = '" . $category_name . "',\r\r\n                                subcategory_id  = '" . $subcategory_name . "',\r\r\n                                sku_id          = '" . $sku . "',\r\r\n                                product_name    = '" . stripslashes(mysql_real_escape_string($product_name)) . "',\r\r\n                                list_price      = '" . $price . "',\r\r\n                                discount        = '" . $discount . "',   \r\r\n                                price           = '" . $sell_price . "',   \r\r\n\t\t\t\tstatus          = '" . $status . "',\r\r\n                                sort            = '" . $sort_id . "'  ";
    $sql_result = mysql_query($sql);
    if ($sql_result) {
        $result = "success";
    } else {
        $result = "failure";
    }
}