Exemple #1
0
<?php

require_once '../../../../includes/classes/core.php';
$action = $_REQUEST['act'];
switch ($action) {
    case 'get_table':
        $page = GetProductDialog($res = '');
        $data = array('page' => $page);
        break;
    case 'add_product':
        $notes = $_REQUEST['notes'];
        $shabloni = $_REQUEST['shabloni'];
        $product_id = $_REQUEST['product_id'];
        mysql_query("\r\n\t\t\t\t\t\tINSERT INTO `shabloni` \r\n\t\t\t\t\t\t(`scenar_id`, `quest_id`, `name`, `notes`, `qvota`, `product_id`)\r\n\t\t\t\t\t\tVALUES\r\n\t\t\t\t\t\t('1', '4', '{$shabloni}', '{$notes}', '', '{$product_id}');\r\n\t\t\t\t\t");
        break;
    case 'get_product_info':
        $name = $_REQUEST['name'];
        $res = GetProductInfo($name);
        if (!$res) {
            $error = 'პროდუქტი ვერ მოიძებნა!';
        } else {
            $data = array('genre' => $res['genre'], 'category' => $res['category'], 'description' => $res['description'], 'price' => $res['price'], 'id' => $res['id']);
        }
        break;
    case 'get_list':
        $count = $_REQUEST['count'];
        $hidden = $_REQUEST['hidden'];
        $scenar_name = $_REQUEST['scenar_name'];
        $rResult = mysql_query("\r\n\t\t\t\t\t\t\t\tSELECT \t`production`.`id`,\r\n\t\t\t\t\t\t\t\t\t\t`production`.`name`,\r\n\t\t\t\t\t\t\t\t\t\t`production`.`price`,\r\n\t\t\t\t\t\t\t\t\t\t`production`.`description`,\r\n\t\t\t\t\t\t\t\t\t\t`production`.`comment`\r\n\t\t\t\t\t\t\t\tFROM \t`production`\r\n\t\t\t\t\t\t\t\tJOIN \t`shabloni` ON `production`.`id` = `shabloni`.`product_id`\r\n\t\t\t\t\t\t\t\tWHERE \t`production`.`actived`=1 AND shabloni.quest_id = '3' AND shabloni.`name` = '{$scenar_name}' \r\n\t\t\t\t\t\t\t");
        $data = array("aaData" => array());
        while ($aRow = mysql_fetch_array($rResult)) {
Exemple #2
0
switch ($action) {
    case 'get_add_page':
        $page = GetGroupPage();
        $data = array('page' => $page);
        break;
    case 'get_product_dialog':
        $page = GetProductDialog();
        $data = array('page' => $page);
        break;
    case 'save_product':
        $page = SaveProduct();
        $data = array('page' => $page);
        break;
    case 'get_product_search':
        $title = $_REQUEST['title'];
        $page = GetProductDialog(GetProductSearch($title));
        $data = array('page' => $page);
        break;
    case 'get_edit_page':
        $group_id = $_REQUEST['id'];
        $page = GetGroupPage(GetPage($group_id));
        $data = array('page' => $page);
        break;
    case 'save_notes':
        $minishneba = $_REQUEST['minishneba'];
        $qvota = $_REQUEST['qvota'];
        $hidden_id = $_REQUEST['hidden_id'];
        $group_name = $_REQUEST['group_name'];
        $scenar_id = $_REQUEST['scenar_id'];
        $product_id = $_REQUEST['product_id'];
        $shab_id = $_REQUEST['shab_id'];
Exemple #3
0
<?php

require_once '../../../includes/classes/core.php';
$action = $_REQUEST['act'];
switch ($action) {
    case 'get_table':
        $page = GetProductDialog($_REQUEST[sale_detail_id]);
        $data = array('page' => $page);
        break;
    case 'add_product':
        $user_id = $_SESSION['USERID'];
        $product_id = $_REQUEST['product_id'];
        $task_detail_id = $_REQUEST['task_scenar_id'];
        $porod_count = $_REQUEST['porod_count'];
        $sale_detail_id = $_REQUEST['sale_detail_id'];
        $cur_date = date('Y-m-d H:i:s');
        $task_checker = mysql_num_rows(mysql_query("SELECT id FROM task_scenar WHERE task_detail_id = {$task_detail_id}"));
        $product_detail = mysql_fetch_assoc(mysql_query("SELECT id,production_category_id,price FROM `production` WHERE id = {$product_id}"));
        if ($task_checker == 0) {
            mysql_query("INSERT INTO `task_scenar`\r\n            \t\t(`user_id`, `date`, `task_detail_id`, `hello_comment`, `hello_quest`, `info_comment`, `info_quest`, `result_comment`, `result_quest`, `send_date`, `payment_comment`, `payment_quest`, `preface_name`, `preface_quest`, `d1`, `d2`, `d3`, `d4`, `d5`, `d6`, `d7`, `d8`, `d9`, `d10`, `d11`, `d12`, `q1`, `product_ids`, `gift_ids`, `b1`, `b2`, `result_quest1`, `result_comment1`)\r\n            \t\tVALUES\r\n            \t\t('{$user_id}', '{$cur_date}', '{$task_detail_id}', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '')");
        }
        if ($sale_detail_id == '') {
            $checker_prod = mysql_num_rows(mysql_query("SELECT id FROM sale_details WHERE task_scenar_id = {$task_detail_id} AND production_id = {$product_id} AND actived = 1"));
            if ($checker_prod == 0) {
                mysql_query("INSERT INTO `sale_details`\r\n            \t\t    ( `user_id`, `elva_sale_id`, `task_scenar_id`, `production_id`, `department_id`, `quantity`, `price`, `actived`)\r\n            \t\t    VALUES\r\n            \t\t    ( '{$user_id}', '1', '{$task_detail_id}', '{$product_id}', '{$product_detail['production_category_id']}', '{$porod_count}', '{$product_detail['price']}', '1');");
            } else {
                $data = array('hint' => "ესეთი პროდუქტი უკვე დამატებულია, თუ გსურთ შეცვალეთ რაოდენობა!");
            }
        } else {
            mysql_query("UPDATE `sale_details` SET\r\n                                `user_id`='{$user_id}',\r\n                                `quantity`='{$porod_count}'\r\n                         WHERE (`id`='{$sale_detail_id}');");
        }