Commit 191541ba82f598d96d0435f38c409dd3ee41ef83

Authored by andryeyev
1 parent 41a8747a

+ fix наложеный платеж

Showing 1 changed file with 75 additions and 20 deletions   Show diff stats
account/admin/orders.php
... ... @@ -12,8 +12,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php");
12 12 // ======================================
13 13  
14 14 if ($_GET['test'] == "1")
15   - {
16   -
  15 + {
17 16 // eMailing('order-new',"5172", "11181");
18 17 }
19 18  
... ... @@ -24,7 +23,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php");
24 23 mysql_query ($sql);
25 24 }
26 25 elseif (isset ($_GET['label']))
27   - {
  26 + {
28 27 $sql = sprintf ("UPDATE catalogs_orders SET label=%d WHERE id=%d", $_GET['label'], $_GET['orderID']);
29 28  
30 29 mysql_query ($sql);
... ... @@ -189,7 +188,58 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php");
189 188 // if(trim($_POST['label'])) $_POST['label'] = 1;
190 189 // print_r($_POST);
191 190 // Îáíîâëÿåì äàííûå çàêàçà
192   - $sql2 = sprintf ("UPDATE catalogs_orders SET cards=%s,insurance=%s,warehouse=%s,nakladnaya=%s,cost_delivery=%s,paid=%s,cause=%s,label=%s,delivery=%s,declaration=%s,payment=%s,city=%s,adress=%s,comment=%s,mcomment=%s,total=%s,meneger=%s,check2=%s,smst=%s,dedline=%s,sumn=%s,sends=%s,work_user=%s WHERE id='" . $_POST['order_id'] . "'", GetSQLValueString ($_POST['user']['cards'], "text"), GetSQLValueString ($_POST['user']['insurance'], "text"), GetSQLValueString ($_POST['user']['warehouse'], "text"), GetSQLValueString ($_POST['user']['nakladnaya'], "text"), GetSQLValueString ($_POST['cost_delivery'], "text"), $_POST['paid'], $_POST['cause'], $_POST['label'], $_POST['user']['delivery'], GetSQLValueString ($_POST['user']['declaration'], "text"), GetSQLValueString ($_POST['user']['payment'], "text"), GetSQLValueString ($_POST['user']['city'], "text"), GetSQLValueString ($_POST['user']['address'], "text"), GetSQLValueString ($_POST['user']['comment'], "text"), GetSQLValueString ($_POST['user']['mcomment'], "text"), GetSQLValueString ($summary, "text"), $_POST['meneger'], GetSQLValueString ($_POST['user']['check'], "text"), GetSQLValueString ($_POST['user']['smst'], "text"), GetSQLValueString ($_POST['user']['dedline'], "text"), GetSQLValueString ($_POST['user']['sumn'], "text"), GetSQLValueString ($_POST['user']['sends'], "text"), GetSQLValueString ('0', "text"));
  191 + $sql2 = sprintf ("
  192 + UPDATE catalogs_orders
  193 + SET
  194 + cards=%s,
  195 + insurance=%s,
  196 + warehouse=%s,
  197 + nakladnaya=%s,
  198 + cost_delivery=%s,
  199 + paid=%s,
  200 + cause=%s,
  201 + label=%s,
  202 + delivery=%s,
  203 + declaration=%s,
  204 + payment=%s,
  205 + city=%s,
  206 + adress=%s,
  207 + comment=%s,
  208 + mcomment=%s,
  209 + total=%s,
  210 + meneger=%s,
  211 + check2=%s,
  212 + smst=%s,
  213 + dedline=%s,
  214 + sumn=%s,
  215 + sends=%s,
  216 + work_user=%s
  217 + WHERE
  218 + id='" . $_POST['order_id'] . "'",
  219 + GetSQLValueString ($_POST['user']['cards'], "text"),
  220 + GetSQLValueString ($_POST['user']['insurance'], "text"),
  221 + GetSQLValueString ($_POST['user']['warehouse'], "text"),
  222 + GetSQLValueString ($_POST['user']['nakladnaya'], "text"),
  223 + GetSQLValueString ($_POST['cost_delivery'], "text"),
  224 + $_POST['paid'],
  225 + $_POST['cause'],
  226 + $_POST['label'],
  227 + $_POST['user']['delivery'],
  228 + GetSQLValueString ($_POST['user']['declaration'], "text"),
  229 + GetSQLValueString ($_POST['user']['payment'], "text"),
  230 + GetSQLValueString ($_POST['user']['city'], "text"),
  231 + GetSQLValueString ($_POST['user']['address'], "text"),
  232 + GetSQLValueString ($_POST['user']['comment'], "text"),
  233 + GetSQLValueString ($_POST['user']['mcomment'], "text"),
  234 + GetSQLValueString ($summary, "text"),
  235 + (int)$_POST['meneger'],
  236 + GetSQLValueString ($_POST['user']['check'], "text"),
  237 + GetSQLValueString ($_POST['user']['smst'], "text"),
  238 + GetSQLValueString ($_POST['user']['dedline'], "text"),
  239 + GetSQLValueString ($_POST['user']['sumn'], "text"),
  240 + GetSQLValueString ($_POST['user']['sends'], "text"),
  241 + GetSQLValueString ('0', "text")
  242 + );
193 243  
194 244 $result2 = mysql_query ($sql2) or die (mysql_error ());
195 245  
... ... @@ -2667,13 +2717,15 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print')
2667 2717 $_GET['status'] = 1;
2668 2718 }
2669 2719  
2670   - $sql = "SELECT o.*,u.*, o.id as order_id,o.city as city FROM catalogs_orders as o
2671   - RIGHT JOIN zlo_users as u on u.id=o.user_id
2672   - WHERE o.id='" . $_GET['order_id'] . "' ";
  2720 + $sql = "SELECT o.*,u.*, o.id as order_id,o.city as city
  2721 + FROM catalogs_orders as o
  2722 + RIGHT JOIN zlo_users as u on u.id=o.user_id
  2723 + WHERE o.id='" . $_GET['order_id'] . "' ";
2673 2724  
2674   - $sql = "SELECT o.*, o.id as order_id,o.city as city,adm.login as meneger FROM catalogs_orders as o
2675   - LEFT JOIN zlo_admin adm ON adm.id=o.meneger
2676   - WHERE o.id='" . $_GET['order_id'] . "' ";
  2725 + $sql = "SELECT o.*, o.id as order_id,o.city as city,adm.login as meneger
  2726 + FROM catalogs_orders as o
  2727 + LEFT JOIN zlo_admin adm ON adm.id=o.meneger
  2728 + WHERE o.id='" . $_GET['order_id'] . "' ";
2677 2729 $result = mysql_query ($sql) or die (mysql_error ());
2678 2730 if (mysql_affected_rows () != 0)
2679 2731 {
... ... @@ -2767,8 +2819,9 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print')
2767 2819  
2768 2820 // Òàáëèöà òîâàðîâ
2769 2821  
2770   - $sql3 = "SELECT * FROM catalogs_orders_products
2771   - WHERE `order_id`='" . $order['order_id'] . "' ";
  2822 + $sql3 = "SELECT *
  2823 + FROM catalogs_orders_products
  2824 + WHERE `order_id`='" . $order['order_id'] . "' ";
2772 2825 $result3 = mysql_query ($sql3) or die (mysql_error ());
2773 2826 if (mysql_affected_rows () != 0)
2774 2827 {
... ... @@ -2781,17 +2834,19 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print')
2781 2834 {
2782 2835 $i ++;
2783 2836  
2784   - $sql4 = "SELECT *,IF(m.cine>0,m.cine,p.cine) as cine FROM catalogs_modifications as m
2785   - LEFT JOIN catalogs_products as p
2786   - ON p.id=m.product_id
2787   - WHERE m.id='" . $item_id['product_id'] . "' ";
  2837 + $sql4 = "SELECT *,IF(m.cine>0,m.cine,p.cine) as cine
  2838 + FROM catalogs_modifications as m
  2839 + LEFT JOIN catalogs_products as p
  2840 + ON p.id=m.product_id
  2841 + WHERE m.id='" . $item_id['product_id'] . "' ";
2788 2842 $result4 = mysql_query ($sql4) or die (mysql_error ());
2789 2843 if (mysql_affected_rows () == 0111)
2790 2844 {
2791   - $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine from catalogs_modifications as m
2792   - LEFT JOIN catalogs_products as p
2793   - ON p.id=m.product_id
2794   - WHERE m.code='" . $item_id['code'] . "' ";
  2845 + $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine
  2846 + from catalogs_modifications as m
  2847 + LEFT JOIN catalogs_products as p
  2848 + ON p.id=m.product_id
  2849 + WHERE m.code='" . $item_id['code'] . "' ";
2795 2850 $result4 = mysql_query ($sql4) or die (mysql_error ());
2796 2851 }
2797 2852 if (mysql_affected_rows () != 0)
... ...