From 191541ba82f598d96d0435f38c409dd3ee41ef83 Mon Sep 17 00:00:00 2001 From: andryeyev Date: Mon, 14 Dec 2015 18:12:56 +0200 Subject: [PATCH] + fix наложеный платеж --- account/admin/orders.php | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 75 insertions(+), 20 deletions(-) diff --git a/account/admin/orders.php b/account/admin/orders.php index 6709baf..bbcd3a6 100644 --- a/account/admin/orders.php +++ b/account/admin/orders.php @@ -12,8 +12,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); // ====================================== if ($_GET['test'] == "1") - { - + { // eMailing('order-new',"5172", "11181"); } @@ -24,7 +23,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); mysql_query ($sql); } elseif (isset ($_GET['label'])) - { + { $sql = sprintf ("UPDATE catalogs_orders SET label=%d WHERE id=%d", $_GET['label'], $_GET['orderID']); mysql_query ($sql); @@ -189,7 +188,58 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); // if(trim($_POST['label'])) $_POST['label'] = 1; // print_r($_POST); // Îáíîâëÿåì äàííûå çàêàçà - $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")); + $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"), + (int)$_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") + ); $result2 = mysql_query ($sql2) or die (mysql_error ()); @@ -2667,13 +2717,15 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') $_GET['status'] = 1; } - $sql = "SELECT o.*,u.*, o.id as order_id,o.city as city FROM catalogs_orders as o - RIGHT JOIN zlo_users as u on u.id=o.user_id - WHERE o.id='" . $_GET['order_id'] . "' "; + $sql = "SELECT o.*,u.*, o.id as order_id,o.city as city + FROM catalogs_orders as o + RIGHT JOIN zlo_users as u on u.id=o.user_id + WHERE o.id='" . $_GET['order_id'] . "' "; - $sql = "SELECT o.*, o.id as order_id,o.city as city,adm.login as meneger FROM catalogs_orders as o - LEFT JOIN zlo_admin adm ON adm.id=o.meneger - WHERE o.id='" . $_GET['order_id'] . "' "; + $sql = "SELECT o.*, o.id as order_id,o.city as city,adm.login as meneger + FROM catalogs_orders as o + LEFT JOIN zlo_admin adm ON adm.id=o.meneger + WHERE o.id='" . $_GET['order_id'] . "' "; $result = mysql_query ($sql) or die (mysql_error ()); if (mysql_affected_rows () != 0) { @@ -2767,8 +2819,9 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') // Òàáëèöà òîâàðîâ - $sql3 = "SELECT * FROM catalogs_orders_products - WHERE `order_id`='" . $order['order_id'] . "' "; + $sql3 = "SELECT * + FROM catalogs_orders_products + WHERE `order_id`='" . $order['order_id'] . "' "; $result3 = mysql_query ($sql3) or die (mysql_error ()); if (mysql_affected_rows () != 0) { @@ -2781,17 +2834,19 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') { $i ++; - $sql4 = "SELECT *,IF(m.cine>0,m.cine,p.cine) as cine FROM catalogs_modifications as m - LEFT JOIN catalogs_products as p - ON p.id=m.product_id - WHERE m.id='" . $item_id['product_id'] . "' "; + $sql4 = "SELECT *,IF(m.cine>0,m.cine,p.cine) as cine + FROM catalogs_modifications as m + LEFT JOIN catalogs_products as p + ON p.id=m.product_id + WHERE m.id='" . $item_id['product_id'] . "' "; $result4 = mysql_query ($sql4) or die (mysql_error ()); if (mysql_affected_rows () == 0111) { - $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine from catalogs_modifications as m - LEFT JOIN catalogs_products as p - ON p.id=m.product_id - WHERE m.code='" . $item_id['code'] . "' "; + $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine + from catalogs_modifications as m + LEFT JOIN catalogs_products as p + ON p.id=m.product_id + WHERE m.code='" . $item_id['code'] . "' "; $result4 = mysql_query ($sql4) or die (mysql_error ()); } if (mysql_affected_rows () != 0) -- libgit2 0.21.4