Commit f0ab673d3e00695cec9479bfe93f53c732e6b88f
1 parent
6ed0a6ee
+ правки по пользователям (admin, Veronika, Natalia)
Showing
2 changed files
with
955 additions
and
963 deletions
Show diff stats
account/admin/orders.php
| @@ -10,81 +10,81 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -10,81 +10,81 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 10 | // ============ Îáðàáîòêà =============== | 10 | // ============ Îáðàáîòêà =============== |
| 11 | // ====================================== | 11 | // ====================================== |
| 12 | // ====================================== | 12 | // ====================================== |
| 13 | - | 13 | + |
| 14 | if ($_GET['test'] == "1") | 14 | if ($_GET['test'] == "1") |
| 15 | - { | 15 | + { |
| 16 | // eMailing('order-new',"5172", "11181"); | 16 | // eMailing('order-new',"5172", "11181"); |
| 17 | } | 17 | } |
| 18 | - | 18 | + |
| 19 | if (isset ($_GET['orderID']) && isset ($_GET['paid'])) | 19 | if (isset ($_GET['orderID']) && isset ($_GET['paid'])) |
| 20 | { | 20 | { |
| 21 | $sql = sprintf ("UPDATE catalogs_orders SET paid=%d WHERE id=%d", $_GET['paid'], $_GET['orderID']); | 21 | $sql = sprintf ("UPDATE catalogs_orders SET paid=%d WHERE id=%d", $_GET['paid'], $_GET['orderID']); |
| 22 | - | 22 | + |
| 23 | mysql_query ($sql); | 23 | mysql_query ($sql); |
| 24 | } | 24 | } |
| 25 | elseif (isset ($_GET['label'])) | 25 | elseif (isset ($_GET['label'])) |
| 26 | - { | 26 | + { |
| 27 | $sql = sprintf ("UPDATE catalogs_orders SET label=%d WHERE id=%d", $_GET['label'], $_GET['orderID']); | 27 | $sql = sprintf ("UPDATE catalogs_orders SET label=%d WHERE id=%d", $_GET['label'], $_GET['orderID']); |
| 28 | - | 28 | + |
| 29 | mysql_query ($sql); | 29 | mysql_query ($sql); |
| 30 | - | 30 | + |
| 31 | GoBack (1); | 31 | GoBack (1); |
| 32 | } | 32 | } |
| 33 | - | 33 | + |
| 34 | // ================= | 34 | // ================= |
| 35 | // ==== status ===== | 35 | // ==== status ===== |
| 36 | // ================= | 36 | // ================= |
| 37 | - | 37 | + |
| 38 | if ((isset ($_POST['action']) && $_POST['action'] == 'status') || trim ($_POST['status']) != '') | 38 | if ((isset ($_POST['action']) && $_POST['action'] == 'status') || trim ($_POST['status']) != '') |
| 39 | { | 39 | { |
| 40 | - | 40 | + |
| 41 | $sql = "UPDATE catalogs_orders SET status='" . $_POST['status'] . "' WHERE `id`='" . $_POST['order_id'] . "'"; | 41 | $sql = "UPDATE catalogs_orders SET status='" . $_POST['status'] . "' WHERE `id`='" . $_POST['order_id'] . "'"; |
| 42 | $result = mysql_query ($sql) or die (mysql_error ()); | 42 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 43 | // exit; | 43 | // exit; |
| 44 | } | 44 | } |
| 45 | - | 45 | + |
| 46 | // ==================== | 46 | // ==================== |
| 47 | // ===== order ======== | 47 | // ===== order ======== |
| 48 | // ==================== | 48 | // ==================== |
| 49 | - | 49 | + |
| 50 | // ============== | 50 | // ============== |
| 51 | // ==== edit ==== | 51 | // ==== edit ==== |
| 52 | // ============== | 52 | // ============== |
| 53 | - | 53 | + |
| 54 | if (isset ($_POST['sms_send'])) | 54 | if (isset ($_POST['sms_send'])) |
| 55 | { | 55 | { |
| 56 | $sql = "insert into sms_history(order_id,mktime,text,user) values('" . $_POST['order_id'] . "','" . mktime () . "','" . $_POST['sms_msg'] . "','" . $_SESSION['admin']['login'] . "')"; | 56 | $sql = "insert into sms_history(order_id,mktime,text,user) values('" . $_POST['order_id'] . "','" . mktime () . "','" . $_POST['sms_msg'] . "','" . $_SESSION['admin']['login'] . "')"; |
| 57 | mysql_query ($sql); | 57 | mysql_query ($sql); |
| 58 | - | 58 | + |
| 59 | foreach ($_POST['sms_tel'] as $tel) | 59 | foreach ($_POST['sms_tel'] as $tel) |
| 60 | { | 60 | { |
| 61 | sendSMS ($tel, $_POST['sms_msg']); | 61 | sendSMS ($tel, $_POST['sms_msg']); |
| 62 | } | 62 | } |
| 63 | - | 63 | + |
| 64 | GoBack (1); | 64 | GoBack (1); |
| 65 | } | 65 | } |
| 66 | elseif (isset ($_POST['send']) && $_POST['send'] == 'edit-order') | 66 | elseif (isset ($_POST['send']) && $_POST['send'] == 'edit-order') |
| 67 | { | 67 | { |
| 68 | - | 68 | + |
| 69 | $error = ''; | 69 | $error = ''; |
| 70 | $error[] = ValidFormData ($_POST['user']['email'], 'email', 'email'); | 70 | $error[] = ValidFormData ($_POST['user']['email'], 'email', 'email'); |
| 71 | $error[] = ValidFormData ($_POST['user']['city'], 'ãîðîä', 'require'); | 71 | $error[] = ValidFormData ($_POST['user']['city'], 'ãîðîä', 'require'); |
| 72 | $error[] = ValidFormData ($_POST['user']['address'], 'àäðåñ', 'require'); | 72 | $error[] = ValidFormData ($_POST['user']['address'], 'àäðåñ', 'require'); |
| 73 | $error[] = ValidFormData ($_POST['user']['tel'], 'ìîá.òåëåôîí', 'mobile'); | 73 | $error[] = ValidFormData ($_POST['user']['tel'], 'ìîá.òåëåôîí', 'mobile'); |
| 74 | $error[] = ValidFormData ($_POST['user']['username'], 'èìÿ', 'require'); | 74 | $error[] = ValidFormData ($_POST['user']['username'], 'èìÿ', 'require'); |
| 75 | - | 75 | + |
| 76 | $alert = implode ('\r\n', $error); | 76 | $alert = implode ('\r\n', $error); |
| 77 | - | 77 | + |
| 78 | $mass = array_filter ($error); | 78 | $mass = array_filter ($error); |
| 79 | if (empty ($mass)) | 79 | if (empty ($mass)) |
| 80 | { | 80 | { |
| 81 | - | 81 | + |
| 82 | $summary = 0; | 82 | $summary = 0; |
| 83 | - | 83 | + |
| 84 | // Ïðîâåðÿåì åñòü ëè óæå â çàêàçàõ | 84 | // Ïðîâåðÿåì åñòü ëè óæå â çàêàçàõ |
| 85 | $sql = "SELECT *, product_id as mod_id from catalogs_orders_products WHERE order_id='" . $_POST['order_id'] . "'"; | 85 | $sql = "SELECT *, product_id as mod_id from catalogs_orders_products WHERE order_id='" . $_POST['order_id'] . "'"; |
| 86 | $result = mysql_query ($sql) or die (mysql_error ()); | 86 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 87 | - | 87 | + |
| 88 | if (mysql_affected_rows () != 0) | 88 | if (mysql_affected_rows () != 0) |
| 89 | { | 89 | { |
| 90 | while ($item = mysql_fetch_assoc ($result)) | 90 | while ($item = mysql_fetch_assoc ($result)) |
| @@ -92,20 +92,20 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -92,20 +92,20 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 92 | $ordered[] = $item['mod_id']; | 92 | $ordered[] = $item['mod_id']; |
| 93 | } | 93 | } |
| 94 | } | 94 | } |
| 95 | - | 95 | + |
| 96 | // =========================================== | 96 | // =========================================== |
| 97 | // ======= Ïðîâåðÿåì íà èçìåíåíèå =========== | 97 | // ======= Ïðîâåðÿåì íà èçìåíåíèå =========== |
| 98 | // =========================================== | 98 | // =========================================== |
| 99 | - | 99 | + |
| 100 | $ChangesOfOrder = ChangesOfMass ($_POST['item']['mod_id'], $ordered); | 100 | $ChangesOfOrder = ChangesOfMass ($_POST['item']['mod_id'], $ordered); |
| 101 | - | 101 | + |
| 102 | // ============== | 102 | // ============== |
| 103 | // ==== same ==== | 103 | // ==== same ==== |
| 104 | // ============== | 104 | // ============== |
| 105 | - | 105 | + |
| 106 | if (isset ($ChangesOfOrder['same'])) | 106 | if (isset ($ChangesOfOrder['same'])) |
| 107 | { | 107 | { |
| 108 | - | 108 | + |
| 109 | $mass = array_filter ($ChangesOfOrder['same']); | 109 | $mass = array_filter ($ChangesOfOrder['same']); |
| 110 | if (! empty ($mass)) | 110 | if (! empty ($mass)) |
| 111 | { | 111 | { |
| @@ -114,23 +114,23 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -114,23 +114,23 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 114 | // Óçíàåì key(èíäåêñ) â ìàññèâå | 114 | // Óçíàåì key(èíäåêñ) â ìàññèâå |
| 115 | $i = array_keys ($_POST['item']['mod_id'], $value); | 115 | $i = array_keys ($_POST['item']['mod_id'], $value); |
| 116 | $i = $i[0]; | 116 | $i = $i[0]; |
| 117 | - | 117 | + |
| 118 | // Îáíîâëÿåì êîëè÷åñòâî | 118 | // Îáíîâëÿåì êîëè÷åñòâî |
| 119 | // print_r($_POST);exit; | 119 | // print_r($_POST);exit; |
| 120 | $sql2 = "UPDATE catalogs_orders_products SET `count`='" . $_POST['item']['quant'][$i] . "',`reservation`='" . $_POST['item']['reservation'][$i] . "',`status`='" . $_POST['item']['status'][$i] . "',`vozvrat`='" . $_POST['item']['vozvrat'][$i] . "' WHERE order_id='" . $_POST['order_id'] . "' AND product_id='" . $_POST['item']['mod_id'][$i] . "'"; | 120 | $sql2 = "UPDATE catalogs_orders_products SET `count`='" . $_POST['item']['quant'][$i] . "',`reservation`='" . $_POST['item']['reservation'][$i] . "',`status`='" . $_POST['item']['status'][$i] . "',`vozvrat`='" . $_POST['item']['vozvrat'][$i] . "' WHERE order_id='" . $_POST['order_id'] . "' AND product_id='" . $_POST['item']['mod_id'][$i] . "'"; |
| 121 | // print "<br>"; | 121 | // print "<br>"; |
| 122 | $result2 = mysql_query ($sql2) or die (mysql_error ()); | 122 | $result2 = mysql_query ($sql2) or die (mysql_error ()); |
| 123 | - | 123 | + |
| 124 | // Ñóììà âñåãî çàêàçà | 124 | // Ñóììà âñåãî çàêàçà |
| 125 | $summary = $summary + ($_POST['item']['quant'][$i] * $_POST['item']['price'][$i]); | 125 | $summary = $summary + ($_POST['item']['quant'][$i] * $_POST['item']['price'][$i]); |
| 126 | } | 126 | } |
| 127 | } | 127 | } |
| 128 | } | 128 | } |
| 129 | - | 129 | + |
| 130 | // ============= | 130 | // ============= |
| 131 | // ==== add ==== | 131 | // ==== add ==== |
| 132 | // ============= | 132 | // ============= |
| 133 | - | 133 | + |
| 134 | if (isset ($ChangesOfOrder['add'])) | 134 | if (isset ($ChangesOfOrder['add'])) |
| 135 | { | 135 | { |
| 136 | $mass = array_filter ($ChangesOfOrder['add']); | 136 | $mass = array_filter ($ChangesOfOrder['add']); |
| @@ -141,7 +141,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -141,7 +141,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 141 | // Óçíàåì key(èíäåêñ) â ìàññèâå | 141 | // Óçíàåì key(èíäåêñ) â ìàññèâå |
| 142 | $i = array_keys ($_POST['item']['mod_id'], $value); | 142 | $i = array_keys ($_POST['item']['mod_id'], $value); |
| 143 | $i = $i[0]; | 143 | $i = $i[0]; |
| 144 | - | 144 | + |
| 145 | $r = mysql_query ("select count(*) from catalogs_orders_products where order_id='{$_POST['order_id']}' and product_id='{$_POST['item']['mod_id'][$i]}'"); | 145 | $r = mysql_query ("select count(*) from catalogs_orders_products where order_id='{$_POST['order_id']}' and product_id='{$_POST['item']['mod_id'][$i]}'"); |
| 146 | $c = mysql_result ($r, 0); | 146 | $c = mysql_result ($r, 0); |
| 147 | if (! $c) | 147 | if (! $c) |
| @@ -149,18 +149,18 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -149,18 +149,18 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 149 | // Äîáàâëÿåì òîâàðû | 149 | // Äîáàâëÿåì òîâàðû |
| 150 | $sql2 = sprintf ("INSERT INTO catalogs_orders_products (order_id,product_id,code,product_cine_id,count,reservation) VALUES (%s,%s,%s,%s,%s,%s)", GetSQLValueString ($_POST['order_id'], "text"), GetSQLValueString ($_POST['item']['mod_id'][$i], "text"), GetSQLValueString ($_POST['item']['code'][$i], "text"), GetSQLValueString ($_POST['item']['price'][$i], "text"), GetSQLValueString ($_POST['item']['quant'][$i], "text"), GetSQLValueString ($_POST['item']['reservation'][$i], "text")); | 150 | $sql2 = sprintf ("INSERT INTO catalogs_orders_products (order_id,product_id,code,product_cine_id,count,reservation) VALUES (%s,%s,%s,%s,%s,%s)", GetSQLValueString ($_POST['order_id'], "text"), GetSQLValueString ($_POST['item']['mod_id'][$i], "text"), GetSQLValueString ($_POST['item']['code'][$i], "text"), GetSQLValueString ($_POST['item']['price'][$i], "text"), GetSQLValueString ($_POST['item']['quant'][$i], "text"), GetSQLValueString ($_POST['item']['reservation'][$i], "text")); |
| 151 | $result2 = mysql_query ($sql2) or die (mysql_error ()); | 151 | $result2 = mysql_query ($sql2) or die (mysql_error ()); |
| 152 | - | 152 | + |
| 153 | // Ñóììà âñåãî çàêàçà | 153 | // Ñóììà âñåãî çàêàçà |
| 154 | $summary = $summary + ($_POST['item']['quant'][$i] * $_POST['item']['price'][$i]); | 154 | $summary = $summary + ($_POST['item']['quant'][$i] * $_POST['item']['price'][$i]); |
| 155 | } | 155 | } |
| 156 | } | 156 | } |
| 157 | } | 157 | } |
| 158 | } | 158 | } |
| 159 | - | 159 | + |
| 160 | // ========== | 160 | // ========== |
| 161 | // == del === | 161 | // == del === |
| 162 | // ========== | 162 | // ========== |
| 163 | - | 163 | + |
| 164 | /* | 164 | /* |
| 165 | * if (isset($ChangesOfOrder['del'])) { | 165 | * if (isset($ChangesOfOrder['del'])) { |
| 166 | * | 166 | * |
| @@ -176,19 +176,19 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -176,19 +176,19 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 176 | * } | 176 | * } |
| 177 | * } | 177 | * } |
| 178 | */ | 178 | */ |
| 179 | - | 179 | + |
| 180 | // =========== | 180 | // =========== |
| 181 | // == ÂÑÅÃÎ == | 181 | // == ÂÑÅÃÎ == |
| 182 | // =========== | 182 | // =========== |
| 183 | - | 183 | + |
| 184 | if (isset ($summary)) | 184 | if (isset ($summary)) |
| 185 | { | 185 | { |
| 186 | // if(trim($_POST['label'])) $_POST['label'] = 1; | 186 | // if(trim($_POST['label'])) $_POST['label'] = 1; |
| 187 | // print_r($_POST); | 187 | // print_r($_POST); |
| 188 | // Îáíîâëÿåì äàííûå çàêàçà | 188 | // Îáíîâëÿåì äàííûå çàêàçà |
| 189 | $sql2 = sprintf (" | 189 | $sql2 = sprintf (" |
| 190 | - UPDATE catalogs_orders | ||
| 191 | - SET | 190 | + UPDATE catalogs_orders |
| 191 | + SET | ||
| 192 | cards=%s, | 192 | cards=%s, |
| 193 | insurance=%s, | 193 | insurance=%s, |
| 194 | warehouse=%s, | 194 | warehouse=%s, |
| @@ -211,42 +211,42 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -211,42 +211,42 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 211 | dedline=%s, | 211 | dedline=%s, |
| 212 | sumn=%s, | 212 | sumn=%s, |
| 213 | sends=%s, | 213 | sends=%s, |
| 214 | - work_user=%s | ||
| 215 | - WHERE | ||
| 216 | - id='" . $_POST['order_id'] . "'", | ||
| 217 | - GetSQLValueString ($_POST['user']['cards'], "text"), | ||
| 218 | - GetSQLValueString ($_POST['user']['insurance'], "text"), | ||
| 219 | - GetSQLValueString ($_POST['user']['warehouse'], "text"), | ||
| 220 | - GetSQLValueString ($_POST['user']['nakladnaya'], "text"), | ||
| 221 | - GetSQLValueString ($_POST['cost_delivery'], "text"), | ||
| 222 | - $_POST['paid'], | ||
| 223 | - $_POST['cause'], | ||
| 224 | - $_POST['label'], | ||
| 225 | - $_POST['user']['delivery'], | ||
| 226 | - GetSQLValueString ($_POST['user']['declaration'], "text"), | ||
| 227 | - GetSQLValueString ($_POST['user']['payment'], "text"), | ||
| 228 | - GetSQLValueString ($_POST['user']['city'], "text"), | ||
| 229 | - GetSQLValueString ($_POST['user']['address'], "text"), | ||
| 230 | - GetSQLValueString ($_POST['user']['comment'], "text"), | ||
| 231 | - GetSQLValueString ($_POST['user']['mcomment'], "text"), | ||
| 232 | - GetSQLValueString ($summary, "text"), | ||
| 233 | - (int)$_POST['meneger'], | ||
| 234 | - GetSQLValueString ($_POST['user']['check'], "text"), | ||
| 235 | - GetSQLValueString ($_POST['user']['smst'], "text"), | ||
| 236 | - GetSQLValueString ($_POST['user']['dedline'], "text"), | ||
| 237 | - GetSQLValueString ($_POST['user']['sumn'], "text"), | ||
| 238 | - GetSQLValueString ($_POST['user']['sends'], "text"), | 214 | + work_user=%s |
| 215 | + WHERE | ||
| 216 | + id='" . $_POST['order_id'] . "'", | ||
| 217 | + GetSQLValueString ($_POST['user']['cards'], "text"), | ||
| 218 | + GetSQLValueString ($_POST['user']['insurance'], "text"), | ||
| 219 | + GetSQLValueString ($_POST['user']['warehouse'], "text"), | ||
| 220 | + GetSQLValueString ($_POST['user']['nakladnaya'], "text"), | ||
| 221 | + GetSQLValueString ($_POST['cost_delivery'], "text"), | ||
| 222 | + $_POST['paid'], | ||
| 223 | + $_POST['cause'], | ||
| 224 | + $_POST['label'], | ||
| 225 | + $_POST['user']['delivery'], | ||
| 226 | + GetSQLValueString ($_POST['user']['declaration'], "text"), | ||
| 227 | + GetSQLValueString ($_POST['user']['payment'], "text"), | ||
| 228 | + GetSQLValueString ($_POST['user']['city'], "text"), | ||
| 229 | + GetSQLValueString ($_POST['user']['address'], "text"), | ||
| 230 | + GetSQLValueString ($_POST['user']['comment'], "text"), | ||
| 231 | + GetSQLValueString ($_POST['user']['mcomment'], "text"), | ||
| 232 | + GetSQLValueString ($summary, "text"), | ||
| 233 | + (int)$_POST['meneger'], | ||
| 234 | + GetSQLValueString ($_POST['user']['check'], "text"), | ||
| 235 | + GetSQLValueString ($_POST['user']['smst'], "text"), | ||
| 236 | + GetSQLValueString ($_POST['user']['dedline'], "text"), | ||
| 237 | + GetSQLValueString ($_POST['user']['sumn'], "text"), | ||
| 238 | + GetSQLValueString ($_POST['user']['sends'], "text"), | ||
| 239 | GetSQLValueString ('0', "text") | 239 | GetSQLValueString ('0', "text") |
| 240 | ); | 240 | ); |
| 241 | - | 241 | + |
| 242 | $result2 = mysql_query ($sql2) or die (mysql_error ()); | 242 | $result2 = mysql_query ($sql2) or die (mysql_error ()); |
| 243 | - | 243 | + |
| 244 | eMailing ('xml', $_POST['user_id'], $_POST['order_id']); | 244 | eMailing ('xml', $_POST['user_id'], $_POST['order_id']); |
| 245 | - | 245 | + |
| 246 | $sql = sprintf ("INSERT INTO catalogs_orders_git (order_id,user_id,cost_delivery,cards,insurance,warehouse,paid,label,delivery,declaration,payment,name,email,city,adress,phone,phonemob,comment,mcomment,mktime,total,sumn,sends,status,work_user) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,1,%s)", $_POST['order_id'], GetSQLValueString ($_POST['user']['id'], "text"), GetSQLValueString ($_POST['cost_delivery'], "text"), GetSQLValueString ($_POST['user']['cards'], "text"), GetSQLValueString ($_POST['user']['insurance'], "text"), GetSQLValueString ($_POST['user']['warehouse'], "text"), GetSQLValueString ($_POST['paid'], "text"), GetSQLValueString ($_POST['label'], "text"), GetSQLValueString ($_POST['user']['delivery'], "text"), GetSQLValueString ($_POST['user']['declaration'], "text"), GetSQLValueString ($_POST['user']['payment'], "text"), GetSQLValueString ($_POST['user']['username'], "text"), GetSQLValueString ($_POST['user']['email'], "text"), GetSQLValueString ($_POST['user']['city'], "text"), GetSQLValueString ($_POST['user']['address'], "text"), GetSQLValueString ($_POST['user']['tel'], "text"), GetSQLValueString ($_POST['user']['tel2'], "text"), GetSQLValueString ($_POST['user']['comment'], "text"), GetSQLValueString ($_POST['user']['mcomment'], "text"), GetSQLValueString (mktime (), "text"), GetSQLValueString ($_POST['summary'], "text"), GetSQLValueString ($_POST['user']['sumn'], "text"), GetSQLValueString ($_POST['user']['sends'], "text"), $_SESSION['admin']['id']); | 246 | $sql = sprintf ("INSERT INTO catalogs_orders_git (order_id,user_id,cost_delivery,cards,insurance,warehouse,paid,label,delivery,declaration,payment,name,email,city,adress,phone,phonemob,comment,mcomment,mktime,total,sumn,sends,status,work_user) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,1,%s)", $_POST['order_id'], GetSQLValueString ($_POST['user']['id'], "text"), GetSQLValueString ($_POST['cost_delivery'], "text"), GetSQLValueString ($_POST['user']['cards'], "text"), GetSQLValueString ($_POST['user']['insurance'], "text"), GetSQLValueString ($_POST['user']['warehouse'], "text"), GetSQLValueString ($_POST['paid'], "text"), GetSQLValueString ($_POST['label'], "text"), GetSQLValueString ($_POST['user']['delivery'], "text"), GetSQLValueString ($_POST['user']['declaration'], "text"), GetSQLValueString ($_POST['user']['payment'], "text"), GetSQLValueString ($_POST['user']['username'], "text"), GetSQLValueString ($_POST['user']['email'], "text"), GetSQLValueString ($_POST['user']['city'], "text"), GetSQLValueString ($_POST['user']['address'], "text"), GetSQLValueString ($_POST['user']['tel'], "text"), GetSQLValueString ($_POST['user']['tel2'], "text"), GetSQLValueString ($_POST['user']['comment'], "text"), GetSQLValueString ($_POST['user']['mcomment'], "text"), GetSQLValueString (mktime (), "text"), GetSQLValueString ($_POST['summary'], "text"), GetSQLValueString ($_POST['user']['sumn'], "text"), GetSQLValueString ($_POST['user']['sends'], "text"), $_SESSION['admin']['id']); |
| 247 | $resultg = mysql_query ($sql) or die (mysql_error ()); | 247 | $resultg = mysql_query ($sql) or die (mysql_error ()); |
| 248 | $id_order_git = mysql_insert_id (); | 248 | $id_order_git = mysql_insert_id (); |
| 249 | - | 249 | + |
| 250 | for ($i = 0; $i <= count ($_POST['item']); $i ++) | 250 | for ($i = 0; $i <= count ($_POST['item']); $i ++) |
| 251 | { | 251 | { |
| 252 | if (! empty ($_POST['item']['mod_id'][$i])) | 252 | if (! empty ($_POST['item']['mod_id'][$i])) |
| @@ -255,22 +255,22 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -255,22 +255,22 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 255 | $result2 = mysql_query ($sql2) or die (mysql_error ()); | 255 | $result2 = mysql_query ($sql2) or die (mysql_error ()); |
| 256 | } | 256 | } |
| 257 | } | 257 | } |
| 258 | - | 258 | + |
| 259 | // header("location:/admin.php/orders/?page=".$_GET['page']); | 259 | // header("location:/admin.php/orders/?page=".$_GET['page']); |
| 260 | } | 260 | } |
| 261 | else | 261 | else |
| 262 | { | 262 | { |
| 263 | - | 263 | + |
| 264 | // $sql2="DELETE FROM catalogs_orders WHERE id='".$_POST['order_id']."'"; | 264 | // $sql2="DELETE FROM catalogs_orders WHERE id='".$_POST['order_id']."'"; |
| 265 | // $result2 = mysql_query($sql2) or die(mysql_error()); | 265 | // $result2 = mysql_query($sql2) or die(mysql_error()); |
| 266 | } | 266 | } |
| 267 | - | 267 | + |
| 268 | // GoBack(1); | 268 | // GoBack(1); |
| 269 | // echo"<script language=\"JavaScript\">document.location='/admin.php/orders/?page=".$_GET['page']."&n=1';</script>"; | 269 | // echo"<script language=\"JavaScript\">document.location='/admin.php/orders/?page=".$_GET['page']."&n=1';</script>"; |
| 270 | } | 270 | } |
| 271 | else | 271 | else |
| 272 | { | 272 | { |
| 273 | - | 273 | + |
| 274 | echo "<script language=\"JavaScript\">alert('$alert')</script>"; | 274 | echo "<script language=\"JavaScript\">alert('$alert')</script>"; |
| 275 | } | 275 | } |
| 276 | } | 276 | } |
| @@ -279,32 +279,32 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -279,32 +279,32 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 279 | if (! empty ($_GET['exit_order_id'])) | 279 | if (! empty ($_GET['exit_order_id'])) |
| 280 | { | 280 | { |
| 281 | $sql = sprintf ("UPDATE catalogs_orders SET work_user=0 WHERE id=%d", $_GET['exit_order_id']); | 281 | $sql = sprintf ("UPDATE catalogs_orders SET work_user=0 WHERE id=%d", $_GET['exit_order_id']); |
| 282 | - | 282 | + |
| 283 | mysql_query ($sql); | 283 | mysql_query ($sql); |
| 284 | } | 284 | } |
| 285 | - | 285 | + |
| 286 | if (empty ($_SESSION['up'])) | 286 | if (empty ($_SESSION['up'])) |
| 287 | { | 287 | { |
| 288 | $_SESSION['up'] = 2; | 288 | $_SESSION['up'] = 2; |
| 289 | } | 289 | } |
| 290 | - | 290 | + |
| 291 | if (! empty ($_GET['order_ID'])) | 291 | if (! empty ($_GET['order_ID'])) |
| 292 | { | 292 | { |
| 293 | $sql = sprintf ("UPDATE catalogs_orders SET work_user=%d WHERE id=%d AND work_user=0", $_SESSION['admin']['id'], $_GET['order_ID']); | 293 | $sql = sprintf ("UPDATE catalogs_orders SET work_user=%d WHERE id=%d AND work_user=0", $_SESSION['admin']['id'], $_GET['order_ID']); |
| 294 | - | 294 | + |
| 295 | mysql_query ($sql); | 295 | mysql_query ($sql); |
| 296 | } | 296 | } |
| 297 | } | 297 | } |
| 298 | - | 298 | + |
| 299 | // ============== | 299 | // ============== |
| 300 | // ==== add ===== | 300 | // ==== add ===== |
| 301 | // ============== | 301 | // ============== |
| 302 | - | 302 | + |
| 303 | if (isset ($_POST['send']) && $_POST['send'] == 'add-order') | 303 | if (isset ($_POST['send']) && $_POST['send'] == 'add-order') |
| 304 | - { | 304 | + { |
| 305 | // Ïðîâåðÿåì äûáèë ëè àäìèí | 305 | // Ïðîâåðÿåì äûáèë ëè àäìèí |
| 306 | $debil == false; | 306 | $debil == false; |
| 307 | - | 307 | + |
| 308 | for ($i = 1; $i <= count ($_POST['item']); $i ++) | 308 | for ($i = 1; $i <= count ($_POST['item']); $i ++) |
| 309 | { | 309 | { |
| 310 | if (isset ($_POST['item']['mod_id'][$i]) && $_POST['item']['mod_id'][$i] == '') | 310 | if (isset ($_POST['item']['mod_id'][$i]) && $_POST['item']['mod_id'][$i] == '') |
| @@ -312,36 +312,36 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -312,36 +312,36 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 312 | $debil = true; | 312 | $debil = true; |
| 313 | } | 313 | } |
| 314 | } | 314 | } |
| 315 | - | 315 | + |
| 316 | if ($debil == false) | 316 | if ($debil == false) |
| 317 | { | 317 | { |
| 318 | - | 318 | + |
| 319 | // $error=''; | 319 | // $error=''; |
| 320 | // $error[] = ValidFormData($_POST['user']['email'],'email','email'); | 320 | // $error[] = ValidFormData($_POST['user']['email'],'email','email'); |
| 321 | // $error[] = ValidFormData($_POST['user']['city'],'ãîðîä','require'); | 321 | // $error[] = ValidFormData($_POST['user']['city'],'ãîðîä','require'); |
| 322 | // $error[] = ValidFormData($_POST['user']['address'],'àäðåñ','require'); | 322 | // $error[] = ValidFormData($_POST['user']['address'],'àäðåñ','require'); |
| 323 | // $error[] = ValidFormData($_POST['user']['tel'],'ìîá.òåëåôîí','mobile'); | 323 | // $error[] = ValidFormData($_POST['user']['tel'],'ìîá.òåëåôîí','mobile'); |
| 324 | // $error[] = ValidFormData($_POST['user']['username'],'èìÿ','require'); | 324 | // $error[] = ValidFormData($_POST['user']['username'],'èìÿ','require'); |
| 325 | - | 325 | + |
| 326 | // $alert=implode('\r\n',$error); | 326 | // $alert=implode('\r\n',$error); |
| 327 | - | 327 | + |
| 328 | // $mass=array_filter($error); | 328 | // $mass=array_filter($error); |
| 329 | // if (empty($mass)) { | 329 | // if (empty($mass)) { |
| 330 | - | 330 | + |
| 331 | // Ïðîâåðÿåì ñóùåñòâóåò ëè ïîëüçîâàòåëü | 331 | // Ïðîâåðÿåì ñóùåñòâóåò ëè ïîëüçîâàòåëü |
| 332 | // $sql="SELECT * FROM zlo_users WHERE email='".$_POST['user']['email']."' "; | 332 | // $sql="SELECT * FROM zlo_users WHERE email='".$_POST['user']['email']."' "; |
| 333 | // $result = mysql_query($sql) or die(mysql_error()); | 333 | // $result = mysql_query($sql) or die(mysql_error()); |
| 334 | // if (mysql_affected_rows()!=0) { | 334 | // if (mysql_affected_rows()!=0) { |
| 335 | - | 335 | + |
| 336 | // } | 336 | // } |
| 337 | - | 337 | + |
| 338 | $time = mktime (); | 338 | $time = mktime (); |
| 339 | $date = date ('Y-m-d H:i:s', $time); | 339 | $date = date ('Y-m-d H:i:s', $time); |
| 340 | - | 340 | + |
| 341 | // Åñëè ñîçäàåì íîâîãî ïîëüçîâàòåëü | 341 | // Åñëè ñîçäàåì íîâîãî ïîëüçîâàòåëü |
| 342 | if ($_POST['user']['user_id'] == '' || $_POST['user']['user_id'] == 0 || $_POST['user']['user_id'] == '0') | 342 | if ($_POST['user']['user_id'] == '' || $_POST['user']['user_id'] == 0 || $_POST['user']['user_id'] == '0') |
| 343 | { | 343 | { |
| 344 | - | 344 | + |
| 345 | if (strpos ($_POST['user']['email'], "@user.com")) | 345 | if (strpos ($_POST['user']['email'], "@user.com")) |
| 346 | { | 346 | { |
| 347 | $_POST['user']['group'] = 1; | 347 | $_POST['user']['group'] = 1; |
| @@ -350,25 +350,25 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -350,25 +350,25 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 350 | { | 350 | { |
| 351 | $_POST['user']['group'] = 2; | 351 | $_POST['user']['group'] = 2; |
| 352 | } | 352 | } |
| 353 | - | 353 | + |
| 354 | // Äîáàâëÿåì ïîëüçîâàòåëÿ | 354 | // Äîáàâëÿåì ïîëüçîâàòåëÿ |
| 355 | $pass = generate_password (6); | 355 | $pass = generate_password (6); |
| 356 | $sql = sprintf ("INSERT INTO zlo_users (pass, email, city, address, tel, registered, username, tel2, `group`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString ($pass, "text"), GetSQLValueString ($_POST['user']['email'], "text"), GetSQLValueString ($_POST['user']['city'], "text"), GetSQLValueString ($_POST['user']['address'], "text"), GetSQLValueString ($_POST['user']['tel'], "text"), GetSQLValueString ($date, "text"), GetSQLValueString ($_POST['user']['username'], "text"), GetSQLValueString ($_POST['user']['tel2'], "text"), GetSQLValueString ($_POST['user']['group'], "int")); | 356 | $sql = sprintf ("INSERT INTO zlo_users (pass, email, city, address, tel, registered, username, tel2, `group`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString ($pass, "text"), GetSQLValueString ($_POST['user']['email'], "text"), GetSQLValueString ($_POST['user']['city'], "text"), GetSQLValueString ($_POST['user']['address'], "text"), GetSQLValueString ($_POST['user']['tel'], "text"), GetSQLValueString ($date, "text"), GetSQLValueString ($_POST['user']['username'], "text"), GetSQLValueString ($_POST['user']['tel2'], "text"), GetSQLValueString ($_POST['user']['group'], "int")); |
| 357 | $result = mysql_query ($sql) or die (mysql_error ()); | 357 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 358 | - | 358 | + |
| 359 | // Óçíàåì ID ïîëüçîâàòåëÿ | 359 | // Óçíàåì ID ïîëüçîâàòåëÿ |
| 360 | $sql = "SELECT id FROM zlo_users WHERE registered='$date' AND tel='" . $_POST['user']['tel'] . "'"; | 360 | $sql = "SELECT id FROM zlo_users WHERE registered='$date' AND tel='" . $_POST['user']['tel'] . "'"; |
| 361 | $result = mysql_query ($sql) or die (mysql_error ()); | 361 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 362 | if (mysql_affected_rows () != 0) | 362 | if (mysql_affected_rows () != 0) |
| 363 | { | 363 | { |
| 364 | $user = mysql_fetch_assoc ($result); | 364 | $user = mysql_fetch_assoc ($result); |
| 365 | - | 365 | + |
| 366 | // Øëåì ïèñüìà | 366 | // Øëåì ïèñüìà |
| 367 | if ($user['group'] != 1) | 367 | if ($user['group'] != 1) |
| 368 | { | 368 | { |
| 369 | eMailing ('reg', $user['id']); | 369 | eMailing ('reg', $user['id']); |
| 370 | } | 370 | } |
| 371 | - | 371 | + |
| 372 | $_POST['user']['user_id'] = $user['id']; | 372 | $_POST['user']['user_id'] = $user['id']; |
| 373 | } | 373 | } |
| 374 | else | 374 | else |
| @@ -376,11 +376,11 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -376,11 +376,11 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 376 | echo "íåò ïîëüçîâàòåëÿ"; | 376 | echo "íåò ïîëüçîâàòåëÿ"; |
| 377 | } | 377 | } |
| 378 | } | 378 | } |
| 379 | - | 379 | + |
| 380 | // Äîáàâëÿåì çàêàç | 380 | // Äîáàâëÿåì çàêàç |
| 381 | $sql = sprintf ("INSERT INTO catalogs_orders (cost_delivery,cards,insurance,warehouse,paid,label,delivery,declaration,payment,user_id,name,email,city,adress,phone,phonemob,comment,mcomment,mktime,total,sumn,sends,status) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,1)", GetSQLValueString ($_POST['cost_delivery'], "text"), GetSQLValueString ($_POST['user']['cards'], "text"), GetSQLValueString ($_POST['user']['insurance'], "text"), GetSQLValueString ($_POST['user']['warehouse'], "text"), GetSQLValueString ($_POST['paid'], "text"), GetSQLValueString ($_POST['label'], "text"), GetSQLValueString ($_POST['user']['delivery'], "text"), GetSQLValueString ($_POST['user']['declaration'], "text"), GetSQLValueString ($_POST['user']['payment'], "text"), GetSQLValueString ($_POST['user']['user_id'], "text"), GetSQLValueString ($_POST['user']['username'], "text"), GetSQLValueString ($_POST['user']['email'], "text"), GetSQLValueString ($_POST['user']['city'], "text"), GetSQLValueString ($_POST['user']['address'], "text"), GetSQLValueString ($_POST['user']['tel'], "text"), GetSQLValueString ($_POST['user']['tel2'], "text"), GetSQLValueString ($_POST['user']['comment'], "text"), GetSQLValueString ($_POST['user']['mcomment'], "text"), GetSQLValueString ($time, "text"), GetSQLValueString ($_POST['summary'], "text"), GetSQLValueString ($_POST['user']['sumn'], "text"), GetSQLValueString ($_POST['user']['sends'], "text")); | 381 | $sql = sprintf ("INSERT INTO catalogs_orders (cost_delivery,cards,insurance,warehouse,paid,label,delivery,declaration,payment,user_id,name,email,city,adress,phone,phonemob,comment,mcomment,mktime,total,sumn,sends,status) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,1)", GetSQLValueString ($_POST['cost_delivery'], "text"), GetSQLValueString ($_POST['user']['cards'], "text"), GetSQLValueString ($_POST['user']['insurance'], "text"), GetSQLValueString ($_POST['user']['warehouse'], "text"), GetSQLValueString ($_POST['paid'], "text"), GetSQLValueString ($_POST['label'], "text"), GetSQLValueString ($_POST['user']['delivery'], "text"), GetSQLValueString ($_POST['user']['declaration'], "text"), GetSQLValueString ($_POST['user']['payment'], "text"), GetSQLValueString ($_POST['user']['user_id'], "text"), GetSQLValueString ($_POST['user']['username'], "text"), GetSQLValueString ($_POST['user']['email'], "text"), GetSQLValueString ($_POST['user']['city'], "text"), GetSQLValueString ($_POST['user']['address'], "text"), GetSQLValueString ($_POST['user']['tel'], "text"), GetSQLValueString ($_POST['user']['tel2'], "text"), GetSQLValueString ($_POST['user']['comment'], "text"), GetSQLValueString ($_POST['user']['mcomment'], "text"), GetSQLValueString ($time, "text"), GetSQLValueString ($_POST['summary'], "text"), GetSQLValueString ($_POST['user']['sumn'], "text"), GetSQLValueString ($_POST['user']['sends'], "text")); |
| 382 | $result = mysql_query ($sql) or die (mysql_error ()); | 382 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 383 | - | 383 | + |
| 384 | // Óçíàåì íîìåð çàêàçà | 384 | // Óçíàåì íîìåð çàêàçà |
| 385 | $sql = "SELECT id FROM catalogs_orders WHERE mktime='$time' AND user_id='" . $_POST['user']['user_id'] . "'"; | 385 | $sql = "SELECT id FROM catalogs_orders WHERE mktime='$time' AND user_id='" . $_POST['user']['user_id'] . "'"; |
| 386 | $result = mysql_query ($sql) or die (mysql_error ()); | 386 | $result = mysql_query ($sql) or die (mysql_error ()); |
| @@ -392,7 +392,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -392,7 +392,7 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 392 | { | 392 | { |
| 393 | echo "Îøèáêà"; | 393 | echo "Îøèáêà"; |
| 394 | } | 394 | } |
| 395 | - | 395 | + |
| 396 | // Äîáàâëÿåì òîâàðû | 396 | // Äîáàâëÿåì òîâàðû |
| 397 | for ($i = 0; $i <= count ($_POST['item']); $i ++) | 397 | for ($i = 0; $i <= count ($_POST['item']); $i ++) |
| 398 | { | 398 | { |
| @@ -408,26 +408,26 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -408,26 +408,26 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 408 | } | 408 | } |
| 409 | } | 409 | } |
| 410 | } | 410 | } |
| 411 | - | 411 | + |
| 412 | mysql_query ("update catalogs_orders set total='$summary' where id='{$order['id']}'"); | 412 | mysql_query ("update catalogs_orders set total='$summary' where id='{$order['id']}'"); |
| 413 | - | 413 | + |
| 414 | // Øëåì ïèñüìà | 414 | // Øëåì ïèñüìà |
| 415 | if ($user['group'] != 1) | 415 | if ($user['group'] != 1) |
| 416 | { | 416 | { |
| 417 | eMailing ('order-new', $_POST['user']['user_id'], $order['id']); | 417 | eMailing ('order-new', $_POST['user']['user_id'], $order['id']); |
| 418 | } | 418 | } |
| 419 | - | 419 | + |
| 420 | echo "<script language=\"JavaScript\">{ location.href=\"/admin.php/orders/\"; self.focus(); } </script>"; | 420 | echo "<script language=\"JavaScript\">{ location.href=\"/admin.php/orders/\"; self.focus(); } </script>"; |
| 421 | - | 421 | + |
| 422 | // } else { | 422 | // } else { |
| 423 | - | 423 | + |
| 424 | // echo"<script language=\"JavaScript\">alert('$alert')</script>"; | 424 | // echo"<script language=\"JavaScript\">alert('$alert')</script>"; |
| 425 | - | 425 | + |
| 426 | // } | 426 | // } |
| 427 | } | 427 | } |
| 428 | else | 428 | else |
| 429 | { | 429 | { |
| 430 | - | 430 | + |
| 431 | echo "<script language=\"JavaScript\">alert('Íåò òîâàpà - íåò çàêàçà')</script>"; | 431 | echo "<script language=\"JavaScript\">alert('Íåò òîâàpà - íåò çàêàçà')</script>"; |
| 432 | } | 432 | } |
| 433 | } | 433 | } |
| @@ -435,9 +435,9 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -435,9 +435,9 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 435 | // ============= | 435 | // ============= |
| 436 | // ==== Del ==== | 436 | // ==== Del ==== |
| 437 | // ============= | 437 | // ============= |
| 438 | - | 438 | + |
| 439 | if (isset ($_GET['del_order']) && $_GET['del_order'] == 1) | 439 | if (isset ($_GET['del_order']) && $_GET['del_order'] == 1) |
| 440 | - { | 440 | + { |
| 441 | function delOrder (array $orders_id, $del_user = false) | 441 | function delOrder (array $orders_id, $del_user = false) |
| 442 | { | 442 | { |
| 443 | foreach ($orders_id as $order_id) | 443 | foreach ($orders_id as $order_id) |
| @@ -446,12 +446,12 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -446,12 +446,12 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 446 | if ($del_user) | 446 | if ($del_user) |
| 447 | { | 447 | { |
| 448 | mysql_query (' | 448 | mysql_query (' |
| 449 | - DELETE `zlo_users` FROM `zlo_users` | 449 | + DELETE `zlo_users` FROM `zlo_users` |
| 450 | INNER JOIN `catalogs_orders` as `order` ON `order`.user_id = `zlo_users`.id | 450 | INNER JOIN `catalogs_orders` as `order` ON `order`.user_id = `zlo_users`.id |
| 451 | AND `order`.id = '.(int)$order_id | 451 | AND `order`.id = '.(int)$order_id |
| 452 | ) or die (mysql_error ()); | 452 | ) or die (mysql_error ()); |
| 453 | } | 453 | } |
| 454 | - | 454 | + |
| 455 | // ïðîäóêòû | 455 | // ïðîäóêòû |
| 456 | mysql_query (' | 456 | mysql_query (' |
| 457 | DELETE `catalogs_orders_products` FROM `catalogs_orders_products` | 457 | DELETE `catalogs_orders_products` FROM `catalogs_orders_products` |
| @@ -461,21 +461,21 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -461,21 +461,21 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 461 | 461 | ||
| 462 | // çàêàçû | 462 | // çàêàçû |
| 463 | mysql_query (' | 463 | mysql_query (' |
| 464 | - DELETE FROM `catalogs_orders` | 464 | + DELETE FROM `catalogs_orders` |
| 465 | WHERE `id` = '.(int)$order_id | 465 | WHERE `id` = '.(int)$order_id |
| 466 | - ) or die (mysql_error ()); | 466 | + ) or die (mysql_error ()); |
| 467 | } | 467 | } |
| 468 | } | 468 | } |
| 469 | - | 469 | + |
| 470 | if ($_SESSION['admin']['group'] == 1) // òîëüêî àäìèí | 470 | if ($_SESSION['admin']['group'] == 1) // òîëüêî àäìèí |
| 471 | { | 471 | { |
| 472 | delOrder (array ( | 472 | delOrder (array ( |
| 473 | 'order_id' => $_GET['order_id']) | 473 | 'order_id' => $_GET['order_id']) |
| 474 | ); | 474 | ); |
| 475 | - | 475 | + |
| 476 | echo "<script language=\"JavaScript\">alert('Çàêàç óñïåøíî óäàëåí')</script>"; | 476 | echo "<script language=\"JavaScript\">alert('Çàêàç óñïåøíî óäàëåí')</script>"; |
| 477 | } | 477 | } |
| 478 | - else | 478 | + else |
| 479 | { | 479 | { |
| 480 | echo "<script language=\"JavaScript\">alert('Óäàëÿòü ìîæåò òîëüêî àäìèí!')</script>"; | 480 | echo "<script language=\"JavaScript\">alert('Óäàëÿòü ìîæåò òîëüêî àäìèí!')</script>"; |
| 481 | } | 481 | } |
| @@ -484,16 +484,16 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -484,16 +484,16 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 484 | // ================= | 484 | // ================= |
| 485 | // ==== NOTIFY ===== | 485 | // ==== NOTIFY ===== |
| 486 | // ================= | 486 | // ================= |
| 487 | - | 487 | + |
| 488 | // ================== | 488 | // ================== |
| 489 | // ==== changed ===== | 489 | // ==== changed ===== |
| 490 | // ================== | 490 | // ================== |
| 491 | - | 491 | + |
| 492 | if (isset ($_GET['notify']) && $_GET['notify'] == 'order-changed') | 492 | if (isset ($_GET['notify']) && $_GET['notify'] == 'order-changed') |
| 493 | { | 493 | { |
| 494 | - | 494 | + |
| 495 | eMailing ('order-changed', $_GET['user'], $_GET['order']); | 495 | eMailing ('order-changed', $_GET['user'], $_GET['order']); |
| 496 | - | 496 | + |
| 497 | echo "<script language=\"JavaScript\">{ location.href=\"/admin.php/orders/\"; self.focus(); } </script>"; | 497 | echo "<script language=\"JavaScript\">{ location.href=\"/admin.php/orders/\"; self.focus(); } </script>"; |
| 498 | } | 498 | } |
| 499 | 499 | ||
| @@ -502,26 +502,26 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | @@ -502,26 +502,26 @@ include_once ($_SERVER['DOCUMENT_ROOT'] . "/account/func/func.php"); | ||
| 502 | // ============== Âûâîä ================= | 502 | // ============== Âûâîä ================= |
| 503 | // ====================================== | 503 | // ====================================== |
| 504 | // ====================================== | 504 | // ====================================== |
| 505 | - | ||
| 506 | - // ===== javascript ==== | ||
| 507 | - | 505 | + |
| 506 | + // ===== javascript ==== | ||
| 507 | + | ||
| 508 | echo " | 508 | echo " |
| 509 | <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script> | 509 | <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script> |
| 510 | <script src='/js/JsHttpRequest.js'></script> | 510 | <script src='/js/JsHttpRequest.js'></script> |
| 511 | <script src='/js/OrderContol.js' type='text/javascript'></script> | 511 | <script src='/js/OrderContol.js' type='text/javascript'></script> |
| 512 | <script src='/js/msg.js'></script> | 512 | <script src='/js/msg.js'></script> |
| 513 | <script src='/js/msg2.js'></script>"; | 513 | <script src='/js/msg2.js'></script>"; |
| 514 | - | 514 | + |
| 515 | // modal | 515 | // modal |
| 516 | echo " | 516 | echo " |
| 517 | <script src='/js/modalBox/modalBox.js'></script> | 517 | <script src='/js/modalBox/modalBox.js'></script> |
| 518 | <script src='/js/bpopup/jquery.bpopup.min.js'></script> | 518 | <script src='/js/bpopup/jquery.bpopup.min.js'></script> |
| 519 | <link href='/js/bpopup/bpopup.min.css' type='text/css' rel='stylesheet'/>"; | 519 | <link href='/js/bpopup/bpopup.min.css' type='text/css' rel='stylesheet'/>"; |
| 520 | - | 520 | + |
| 521 | // validator | 521 | // validator |
| 522 | echo " | 522 | echo " |
| 523 | <link rel='stylesheet' href='/js/validator/validationEngine.jquery.css' type='text/css'/> | 523 | <link rel='stylesheet' href='/js/validator/validationEngine.jquery.css' type='text/css'/> |
| 524 | - <link rel='stylesheet' href='/js/validator/template.css' type='text/css'/> | 524 | + <link rel='stylesheet' href='/js/validator/template.css' type='text/css'/> |
| 525 | <script src='/js/validator/languages/jquery.validationEngine-ru.js' type='text/javascript' charset='utf-8'></script> | 525 | <script src='/js/validator/languages/jquery.validationEngine-ru.js' type='text/javascript' charset='utf-8'></script> |
| 526 | <script src='/js/validator/jquery.validationEngine.js' type='text/javascript' charset='utf-8'></script>"; | 526 | <script src='/js/validator/jquery.validationEngine.js' type='text/javascript' charset='utf-8'></script>"; |
| 527 | 527 | ||
| @@ -539,13 +539,15 @@ if (! isset ($_GET['action'])) | @@ -539,13 +539,15 @@ if (! isset ($_GET['action'])) | ||
| 539 | echo "<a href='/admin.php/orders/?action=add' class='button-save'>Äîáàâèòü</a>"; | 539 | echo "<a href='/admin.php/orders/?action=add' class='button-save'>Äîáàâèòü</a>"; |
| 540 | } | 540 | } |
| 541 | // *********************** | 541 | // *********************** |
| 542 | - | 542 | + |
| 543 | // ============== | 543 | // ============== |
| 544 | // === report === | 544 | // === report === |
| 545 | // ============== | 545 | // ============== |
| 546 | - | 546 | + |
| 547 | $time = ''; | 547 | $time = ''; |
| 548 | + | ||
| 548 | $time['day'] = "o.`mktime` >= " . mktime (0, 0, 0, date ('n'), date ('j'), date ('Y')); | 549 | $time['day'] = "o.`mktime` >= " . mktime (0, 0, 0, date ('n'), date ('j'), date ('Y')); |
| 550 | + | ||
| 549 | if (date ('w') == 1) | 551 | if (date ('w') == 1) |
| 550 | { | 552 | { |
| 551 | $time['week'] = " o.`mktime` >=" . mktime (0, 0, 0, date ('n'), date ('j'), date ('Y')) . " "; | 553 | $time['week'] = " o.`mktime` >=" . mktime (0, 0, 0, date ('n'), date ('j'), date ('Y')) . " "; |
| @@ -554,54 +556,12 @@ if (! isset ($_GET['action'])) | @@ -554,54 +556,12 @@ if (! isset ($_GET['action'])) | ||
| 554 | { | 556 | { |
| 555 | $time['week'] = "( o.`mktime` BETWEEN " . strtotime ("last Monday") . " AND " . mktime (0, 0, 0, date ('n'), date ('j') + 1, date ('Y')) . ") "; | 557 | $time['week'] = "( o.`mktime` BETWEEN " . strtotime ("last Monday") . " AND " . mktime (0, 0, 0, date ('n'), date ('j') + 1, date ('Y')) . ") "; |
| 556 | } | 558 | } |
| 559 | + | ||
| 557 | $time['month'] = "o.`mktime` >= " . mktime (0, 0, 0, date ('n'), 1, date ('Y')); | 560 | $time['month'] = "o.`mktime` >= " . mktime (0, 0, 0, date ('n'), 1, date ('Y')); |
| 558 | - | 561 | + |
| 559 | Report::put_time ($time); | 562 | Report::put_time ($time); |
| 560 | Report::make (); | 563 | Report::make (); |
| 561 | - /* | ||
| 562 | - * echo"<div class='orders-report' style='display:table; overflow:hidden;'>"; | ||
| 563 | - * | ||
| 564 | - * // === êëèåíòû === | ||
| 565 | - * | ||
| 566 | - * echo"<div style='background: url(\"http://".$_SERVER['SERVER_NAME']."/img/bg_report.jpg\"); background-repeat:no-repeat; border:1px solid #B9B9B9; padding:0 15px 5px;'>"; | ||
| 567 | - * | ||
| 568 | - * echo"<span style='padding:5px 0; display:block;'>ÒÎÏ êëèåíòîâ çà ïåðèîä: </span>"; | ||
| 569 | - * echo Report::html_report(Report::get_mass_client()); | ||
| 570 | - * echo"</div>"; | ||
| 571 | - * | ||
| 572 | - * echo"<div style='height:20px;display:block;'></div>"; | ||
| 573 | - * | ||
| 574 | - * // === ïðîäàæè === | ||
| 575 | - * | ||
| 576 | - * echo"<div style='background: url(\"http://".$_SERVER['SERVER_NAME']."/img/bg_report.jpg\"); background-repeat:no-repeat; border:1px solid #B9B9B9; padding:0 15px 5px;'>"; | ||
| 577 | - * | ||
| 578 | - * echo"<span style='padding:5px 0; display:block;'>Ïðîäàæè çà ïåðèîä: </span>"; | ||
| 579 | - * echo Report::html_report(Report::get_mass_order()); | ||
| 580 | - * echo"</div>"; | ||
| 581 | - * | ||
| 582 | - * echo"<div style='height:20px;display:block;'> </div>"; | ||
| 583 | - * | ||
| 584 | - * // === ãðàôèê === | ||
| 585 | - * | ||
| 586 | - * echo"<div style='background: url(\"http://".$_SERVER['SERVER_NAME']."/img/bg_report.jpg\"); background-repeat:no-repeat; border:1px solid #B9B9B9; padding:0 15px 5px;'>"; | ||
| 587 | - * | ||
| 588 | - * echo"<span style='padding:5px 0; display:block;'>Ãðàôèê: </span>"; | ||
| 589 | - * echo"<a href='http://".$_SERVER['SERVER_NAME']."/xml/".date('Y')."/".date('m')."/grafic_report_".date('Y-m')."-".(date('d')-1).".png' ><img src='http://".$_SERVER['SERVER_NAME']."/xml/".date('Y')."/".date('m')."/grafic_report_".date('Y-m')."-".(date('d')-1).".png' width='340px' ></a>"; | ||
| 590 | - * | ||
| 591 | - * // ëåãåíäà | ||
| 592 | - * echo"<div class='legend' style='display:table;text-align:center;'>"; | ||
| 593 | - * echo"<div style='width:15px; height:15px; background:#00A652; float:left;'></div><span style='float:left; padding:0 5px;'>íîâûé</span>"; | ||
| 594 | - * echo"<div style='width:15px; height:15px; background:#0072BB; float:left;'></div><span style='float:left; padding:0 5px;'>ïîäòâåðæäåí</span>"; | ||
| 595 | - * echo"<div style='width:15px; height:15px; background:#F36523; float:left;'></div><span style='float:left; padding:0 5px;'>îòìåíåí</span>"; | ||
| 596 | - * echo"<div style='width:15px; height:15px; background:#ED1B24; float:left;'></div><span style='float:left; padding:0 5px;'>âûïîëíåí</span>"; | ||
| 597 | - * echo"<div style='clear:both;'></div>"; | ||
| 598 | - * echo"</div>"; | ||
| 599 | - * | ||
| 600 | - * echo"</div>"; | ||
| 601 | - * | ||
| 602 | - * echo"</div>"; | ||
| 603 | - */ | ||
| 604 | - | 564 | + |
| 605 | if (! isset ($_GET['status'])) | 565 | if (! isset ($_GET['status'])) |
| 606 | { | 566 | { |
| 607 | $_GET['status'] = "1"; | 567 | $_GET['status'] = "1"; |
| @@ -610,20 +570,19 @@ if (! isset ($_GET['action'])) | @@ -610,20 +570,19 @@ if (! isset ($_GET['action'])) | ||
| 610 | { | 570 | { |
| 611 | $_GET['page'] = "1"; | 571 | $_GET['page'] = "1"; |
| 612 | } | 572 | } |
| 613 | - | 573 | + |
| 574 | + $WHERE = array(); | ||
| 575 | + $WHERE_DATE = ''; | ||
| 576 | + | ||
| 614 | if (isset ($_GET['user'])) | 577 | if (isset ($_GET['user'])) |
| 615 | { | 578 | { |
| 616 | - $AND = "AND u.id=" . $_GET['user']; | ||
| 617 | - } | ||
| 618 | - else | ||
| 619 | - { | ||
| 620 | - $AND = ''; | 579 | + $WHERE[] = "u.id=" . $_GET['user']; |
| 621 | } | 580 | } |
| 622 | - | 581 | + |
| 623 | // ============= | 582 | // ============= |
| 624 | // === Ïîèñê === | 583 | // === Ïîèñê === |
| 625 | // ============= | 584 | // ============= |
| 626 | - | 585 | + |
| 627 | $th = array ( | 586 | $th = array ( |
| 628 | "id" => "íîìåð çêàçà", | 587 | "id" => "íîìåð çêàçà", |
| 629 | "username" => "êëèåíò", | 588 | "username" => "êëèåíò", |
| @@ -632,9 +591,9 @@ if (! isset ($_GET['action'])) | @@ -632,9 +591,9 @@ if (! isset ($_GET['action'])) | ||
| 632 | "declaration" => "Äåêëàðàöèÿ ¹", | 591 | "declaration" => "Äåêëàðàöèÿ ¹", |
| 633 | "nakladnaya" => "¹ íàêëàäíîé", | 592 | "nakladnaya" => "¹ íàêëàäíîé", |
| 634 | "code" => "øòðèõêîä", | 593 | "code" => "øòðèõêîä", |
| 635 | - "mcomment" => "Êîìåíòàðèé" | 594 | + "mcomment" => "Êîìåíòàðèé" |
| 636 | ); | 595 | ); |
| 637 | - | 596 | + |
| 638 | // Åñëè ñóùåñòâóåò Ïîèñê | 597 | // Åñëè ñóùåñòâóåò Ïîèñê |
| 639 | if (isset ($_REQUEST['search'])) | 598 | if (isset ($_REQUEST['search'])) |
| 640 | { | 599 | { |
| @@ -670,239 +629,203 @@ if (! isset ($_GET['action'])) | @@ -670,239 +629,203 @@ if (! isset ($_GET['action'])) | ||
| 670 | { | 629 | { |
| 671 | $pre = "o"; | 630 | $pre = "o"; |
| 672 | } | 631 | } |
| 673 | - $AND = ''; | 632 | + |
| 674 | if (trim ($_REQUEST['look']) != '') | 633 | if (trim ($_REQUEST['look']) != '') |
| 675 | { | 634 | { |
| 676 | if ($_REQUEST['field'] == "id") | 635 | if ($_REQUEST['field'] == "id") |
| 677 | - $AND .= "AND $pre.`" . $_REQUEST['field'] . "` LIKE '" . trim ($_REQUEST['look']) . "' "; | 636 | + $WHERE[] = "$pre.`" . $_REQUEST['field'] . "` LIKE '" . trim ($_REQUEST['look']) . "' "; |
| 678 | else | 637 | else |
| 679 | - $AND .= "AND $pre.`" . $_REQUEST['field'] . "` LIKE '%" . trim ($_REQUEST['look']) . "%' "; | 638 | + $WHERE[] = "$pre.`" . $_REQUEST['field'] . "` LIKE '%" . trim ($_REQUEST['look']) . "%' "; |
| 680 | } | 639 | } |
| 640 | + | ||
| 681 | if (($_REQUEST['form']['date_start'] != '') && ($_REQUEST['form']['date_end'] != '')) | 641 | if (($_REQUEST['form']['date_start'] != '') && ($_REQUEST['form']['date_end'] != '')) |
| 682 | { | 642 | { |
| 683 | - | ||
| 684 | $dateStart = $_REQUEST['form']['date_start']; | 643 | $dateStart = $_REQUEST['form']['date_start']; |
| 685 | - $dateEnd = $_REQUEST['form']['date_end']; | ||
| 686 | - | 644 | + $dateEnd = $_REQUEST['form']['date_end']; |
| 645 | + | ||
| 687 | $mkdate = ExtractDate ($_REQUEST['form']['date_start']); | 646 | $mkdate = ExtractDate ($_REQUEST['form']['date_start']); |
| 688 | $_REQUEST['form']['date_start'] = mktime (0, 0, 0, $mkdate[1], $mkdate[2], $mkdate[0]); | 647 | $_REQUEST['form']['date_start'] = mktime (0, 0, 0, $mkdate[1], $mkdate[2], $mkdate[0]); |
| 689 | - | 648 | + |
| 690 | $mkdate = ExtractDate ($_REQUEST['form']['date_end']); | 649 | $mkdate = ExtractDate ($_REQUEST['form']['date_end']); |
| 691 | $_REQUEST['form']['date_end'] = mktime (0, 0, 0, $mkdate[1], $mkdate[2], $mkdate[0]); | 650 | $_REQUEST['form']['date_end'] = mktime (0, 0, 0, $mkdate[1], $mkdate[2], $mkdate[0]); |
| 692 | - | ||
| 693 | - $AND .= " AND (o.`mktime` BETWEEN '" . $_REQUEST['form']['date_start'] . "' AND '" . $_REQUEST['form']['date_end'] . "') "; | 651 | + |
| 652 | + $WHERE_DATE = "(o.`mktime` BETWEEN '" . $_REQUEST['form']['date_start'] . "' AND '" . $_REQUEST['form']['date_end'] . "') "; | ||
| 653 | + | ||
| 654 | + $WHERE[] = $WHERE_DATE; | ||
| 694 | } | 655 | } |
| 695 | } | 656 | } |
| 696 | - // ============= | ||
| 697 | - // === Äàòà ==== | ||
| 698 | - // ============= | ||
| 699 | - | ||
| 700 | - echo " | ||
| 701 | - <div class='grid-search'> | ||
| 702 | - <form action='" . GetFormUrl () . "' name='search' method='GET'> | ||
| 703 | - <div class='search'> | ||
| 704 | - <input type='text' name='look' id='grid-search' value='" . $_REQUEST['look'] . "'> | ||
| 705 | - <select name='field'>"; | 657 | + |
| 658 | + // ***** Àäìèí ðåæèì ***** | ||
| 659 | + if (in_array ($_SESSION['admin']['id'], array (1, 19, 20))) | ||
| 660 | + { | ||
| 661 | + // ============= | ||
| 662 | + // === Äàòà ==== | ||
| 663 | + // ============= | ||
| 706 | 664 | ||
| 707 | - foreach ($th as $key => $value) | ||
| 708 | - { | ||
| 709 | - if ($_REQUEST['field'] == $key) | ||
| 710 | - { | ||
| 711 | - $selected = 'selected="selected"'; | ||
| 712 | - } | ||
| 713 | - else | 665 | + echo " |
| 666 | + <div class='grid-search'> | ||
| 667 | + <form action='" . GetFormUrl () . "' name='search' method='GET'> | ||
| 668 | + <div class='search'> | ||
| 669 | + <input type='text' name='look' id='grid-search' value='" . $_REQUEST['look'] . "'> | ||
| 670 | + <select name='field'>"; | ||
| 671 | + | ||
| 672 | + foreach ($th as $key => $value) | ||
| 714 | { | 673 | { |
| 715 | - $selected = ''; | 674 | + $selected = $_REQUEST['field'] == $key ? 'selected="selected"' : ''; |
| 675 | + | ||
| 676 | + echo "<option value='$key' $selected>$value</option>"; | ||
| 716 | } | 677 | } |
| 717 | - echo "<option value='$key' $selected>$value</option>"; | 678 | + |
| 679 | + echo "</select> | ||
| 680 | + <input type='submit' value='ïîèñê'> | ||
| 681 | + <input type='hidden' name='status' value='" . $_GET['status'] . "'> | ||
| 682 | + </div>"; | ||
| 683 | + | ||
| 684 | + echo " | ||
| 685 | + <div class='dates'> | ||
| 686 | + <div class='row'> | ||
| 687 | + <input type='text' name='form[date_start]' id='date_start_input' value='" . $dateStart . "'> | ||
| 688 | + <img src='/img/calendar.gif' id='date_start'> | ||
| 689 | + </div> | ||
| 690 | + <div class='row'> | ||
| 691 | + <input type='text' name='form[date_end]' id='date_end_input' value='" . $dateEnd . "'> | ||
| 692 | + <img src='/img/calendar.gif' id='date_end'> | ||
| 693 | + </div> | ||
| 694 | + </div>"; | ||
| 695 | + | ||
| 696 | + echo ' | ||
| 697 | + <script type="text/javascript"> | ||
| 698 | + Calendar.setup( | ||
| 699 | + { | ||
| 700 | + inputField : "date_start_input", | ||
| 701 | + ifFormat : "%Y-%m-%d", | ||
| 702 | + button : "date_start" | ||
| 718 | } | 703 | } |
| 704 | + ); | ||
| 705 | + </script>'; | ||
| 706 | + | ||
| 707 | + echo ' | ||
| 708 | + <script type="text/javascript"> | ||
| 709 | + Calendar.setup( | ||
| 710 | + { | ||
| 711 | + inputField : "date_end_input", | ||
| 712 | + ifFormat : "%Y-%m-%d", | ||
| 713 | + button : "date_end" | ||
| 714 | + } | ||
| 715 | + ); | ||
| 716 | + </script>'; | ||
| 719 | 717 | ||
| 720 | - echo "</select> | ||
| 721 | - <input type='submit' value='ïîèñê'> | ||
| 722 | - <input type='hidden' name='status' value='" . $_GET['status'] . "'> | ||
| 723 | - </div>"; | ||
| 724 | - | ||
| 725 | echo " | 718 | echo " |
| 726 | - <div class='dates'> | ||
| 727 | - <div class='row'> | ||
| 728 | - <input type='text' name='form[date_start]' id='date_start_input' value='" . $dateStart . "'> | ||
| 729 | - <img src='/img/calendar.gif' id='date_start'> | ||
| 730 | - </div> | ||
| 731 | - <div class='row'> | ||
| 732 | - <input type='text' name='form[date_end]' id='date_end_input' value='" . $dateEnd . "'> | ||
| 733 | - <img src='/img/calendar.gif' id='date_end'> | ||
| 734 | - </div> | ||
| 735 | - </div>"; | ||
| 736 | - | ||
| 737 | - echo ' | ||
| 738 | - <script type="text/javascript"> | ||
| 739 | - Calendar.setup( | ||
| 740 | - { | ||
| 741 | - inputField : "date_start_input", | ||
| 742 | - ifFormat : "%Y-%m-%d", | ||
| 743 | - button : "date_start" | ||
| 744 | - } | ||
| 745 | - ); | ||
| 746 | - </script>'; | ||
| 747 | - | ||
| 748 | - echo ' | ||
| 749 | - <script type="text/javascript"> | ||
| 750 | - Calendar.setup( | ||
| 751 | - { | ||
| 752 | - inputField : "date_end_input", | ||
| 753 | - ifFormat : "%Y-%m-%d", | ||
| 754 | - button : "date_end" | ||
| 755 | - } | ||
| 756 | - ); | ||
| 757 | - </script>'; | ||
| 758 | - | ||
| 759 | - echo " | ||
| 760 | - <input type='hidden' name='search' value='ok'> | ||
| 761 | - </form> | ||
| 762 | - </div>"; | ||
| 763 | - | 719 | + <input type='hidden' name='search' value='ok'> |
| 720 | + </form> | ||
| 721 | + </div>"; | ||
| 722 | + | ||
| 723 | + } | ||
| 764 | // =========== Ãåíåðèì òàáëèöó =========== | 724 | // =========== Ãåíåðèì òàáëèöó =========== |
| 765 | - | ||
| 766 | - $eshka = ""; | ||
| 767 | - $eshka2 = ""; | ||
| 768 | - $eshka3 = ""; | 725 | + |
| 769 | $lll = ""; | 726 | $lll = ""; |
| 770 | - /* | ||
| 771 | - * if(trim(@$_REQUEST['da'])=='1'){ | ||
| 772 | - * $eshka = "o.mktime<'1341090000' AND "; | ||
| 773 | - * $eshka2 = "o.mktime<'1341090000' AND "; | ||
| 774 | - * $lll = "font-weight:bold;"; | ||
| 775 | - * }else{ | ||
| 776 | - * $eshka = "o.mktime>'1341090000' AND "; | ||
| 777 | - * $eshka2 = "o.mktime>'1341090000' AND "; | ||
| 778 | - * $lll = ""; | ||
| 779 | - * } | ||
| 780 | - */ | ||
| 781 | - | 727 | + |
| 782 | if (trim (@$_REQUEST['pr']) == '1') | 728 | if (trim (@$_REQUEST['pr']) == '1') |
| 783 | { | 729 | { |
| 784 | $tim = (time () - 86400); | 730 | $tim = (time () - 86400); |
| 785 | - $eshka3 = "o.upd<'" . date ("Y-m-d H:i:s", $tim) . "' AND "; | ||
| 786 | - } | ||
| 787 | - else | ||
| 788 | - { | ||
| 789 | - $eshka3 = ""; | 731 | + $WHERE[] = "o.upd<'" . date ("Y-m-d H:i:s", $tim) . "'"; |
| 790 | } | 732 | } |
| 791 | - | 733 | + |
| 792 | if (trim (@$_REQUEST['prs']) == '1') | 734 | if (trim (@$_REQUEST['prs']) == '1') |
| 793 | { | 735 | { |
| 794 | $tim = (time () - 172800); | 736 | $tim = (time () - 172800); |
| 795 | - $eshka4 = "o.upd<'" . date ("Y-m-d H:i:s", $tim) . "' AND "; | ||
| 796 | - } | ||
| 797 | - else | ||
| 798 | - { | ||
| 799 | - $eshka4 = ""; | 737 | + $WHERE[] = "o.upd<'" . date ("Y-m-d H:i:s", $tim) . "'"; |
| 800 | } | 738 | } |
| 801 | - | 739 | + |
| 802 | $order = ((isset ($_GET['order'])) ? $_GET['order'] : 'mktime'); | 740 | $order = ((isset ($_GET['order'])) ? $_GET['order'] : 'mktime'); |
| 803 | $type = ((isset ($_GET['type'])) ? $_GET['type'] : 'DESC'); | 741 | $type = ((isset ($_GET['type'])) ? $_GET['type'] : 'DESC'); |
| 804 | - | 742 | + |
| 743 | + // ïåðèîä | ||
| 805 | if (isset ($_GET['stat']) && $_GET['stat'] == 1) | 744 | if (isset ($_GET['stat']) && $_GET['stat'] == 1) |
| 806 | { | 745 | { |
| 807 | - $AND .= " AND o.status IN(4,5) AND o.mktime<'" . mktime (0, 0, 0, "01", "01", "2013") . "' "; | 746 | + //$WHERE[] = "o.status IN(4,5)"; |
| 747 | + $WHERE[] = "o.mktime<'" . mktime (0, 0, 0, "01", "01", "2013") . "' "; | ||
| 808 | } | 748 | } |
| 809 | else | 749 | else |
| 810 | { | 750 | { |
| 811 | - // $mk_and = $AND = "AND o.mktime>='".mktime(0, 0, 0, date("m"), date("d"), date("Y"))."' and o.mktime<='".mktime(0, 0, 0, date("m"), date("d")+1, date("Y"))."' "; | ||
| 812 | - $AND .= " AND o.status IN(1,2) AND o.mktime>='" . mktime (0, 0, 0, "01", "01", "2013") . "' "; | ||
| 813 | - $mk_and = " AND o.status IN(1,2) AND o.mktime>='" . mktime (0, 0, 0, "01", "01", "2013") . "' "; | 751 | + //$WHERE[] = "o.status IN(1,2)"; |
| 752 | + $WHERE[] = "o.mktime>='" . mktime (0, 0, 0, "01", "01", "2013") . "' "; | ||
| 814 | } | 753 | } |
| 815 | - | 754 | + |
| 816 | if (isset ($_GET['sort_label']) && $_GET['sort_label'] != '') | 755 | if (isset ($_GET['sort_label']) && $_GET['sort_label'] != '') |
| 817 | { | 756 | { |
| 818 | - $AND .= " AND o.label='" . $_GET['sort_label'] . "' "; | 757 | + $WHERE[] = "o.label = '" . $_GET['sort_label'] . "' "; |
| 819 | } | 758 | } |
| 820 | if (isset ($_GET['lab'])) | 759 | if (isset ($_GET['lab'])) |
| 821 | { | 760 | { |
| 822 | - $AND .= " AND o.label IN(" . implode (',', $_GET['lab']) . ")"; | 761 | + $WHERE[] = "o.`label` IN (" . implode (',', $_GET['lab']) . ")"; |
| 823 | } | 762 | } |
| 824 | if (isset ($_GET['delivery'])) | 763 | if (isset ($_GET['delivery'])) |
| 825 | { | 764 | { |
| 826 | - $AND .= " AND o.delivery IN(" . implode (',', $_GET['delivery']) . ")"; | 765 | + $WHERE[] = "o.delivery IN (" . implode (',', $_GET['delivery']) . ")"; |
| 827 | } | 766 | } |
| 828 | if (isset ($_GET['meneger']) && $_GET['meneger'] > 0) | 767 | if (isset ($_GET['meneger']) && $_GET['meneger'] > 0) |
| 829 | { | 768 | { |
| 830 | - $AND .= " AND o.meneger='" . $_GET['meneger'] . "'"; | 769 | + $WHERE[] = "o.meneger='" . $_GET['meneger'] . "'"; |
| 831 | } | 770 | } |
| 832 | - | ||
| 833 | - $sql = "SELECT o.*, o.name as username, o.adress as address, o.phone as tel, o.phonemob as tel2, o.`mktime` as order_date, u.group, o.id as order_id, m.*, m.product_id as mod_id, op.* , p.*, g.color as group_color,za.username as meneger_name | ||
| 834 | - FROM catalogs_orders as o | ||
| 835 | - LEFT JOIN catalogs_orders_products as op ON op.order_id=o.id | ||
| 836 | - LEFT JOIN catalogs_modifications AS m ON m.id = op.product_id | ||
| 837 | - LEFT JOIN catalogs_products AS p ON p.id = m.product_id | ||
| 838 | - LEFT JOIN zlo_users as u ON u.id=o.user_id | ||
| 839 | - LEFT JOIN zlo_users_group as g ON g.id=u.group | ||
| 840 | - LEFT JOIN zlo_admin as za ON za.id=o.meneger | ||
| 841 | - WHERE " . $eshka3 . $eshka4 . $eshka./*((!isset($_GET['search']))?"o.status='".$_GET['status']."'":"o.status>'0'").*/"1=1 $AND GROUP BY o.id ORDER BY o.$order $type "; | ||
| 842 | - | 771 | + |
| 772 | + // ***** Àäìèí ðåæèì ***** | ||
| 773 | + if (! in_array ($_SESSION['admin']['id'], array (1, 19, 20))) | ||
| 774 | + { | ||
| 775 | + $WHERE[] = "o.`label` NOT IN (9,10)"; | ||
| 776 | + } | ||
| 777 | + | ||
| 778 | + $sql = " | ||
| 779 | + SELECT | ||
| 780 | + o.*, o.name as username, o.adress as address, o.phone as tel, o.phonemob as tel2, o.`mktime` as order_date, | ||
| 781 | + u.group, o.id as order_id, | ||
| 782 | + m.product_id as mod_id, | ||
| 783 | + op.* , | ||
| 784 | + g.color as group_color, | ||
| 785 | + za.username as meneger_name | ||
| 786 | + FROM catalogs_orders as o | ||
| 787 | + LEFT JOIN catalogs_orders_products as op ON op.order_id=o.id | ||
| 788 | + LEFT JOIN catalogs_modifications AS m ON m.id = op.product_id | ||
| 789 | + LEFT JOIN catalogs_products AS p ON p.id = m.product_id | ||
| 790 | + LEFT JOIN zlo_users as u ON u.id=o.user_id | ||
| 791 | + LEFT JOIN zlo_users_group as g ON g.id=u.group | ||
| 792 | + LEFT JOIN zlo_admin as za ON za.id=o.meneger | ||
| 793 | + WHERE ".(! empty ($WHERE) ? implode (' AND ', $WHERE) : ''). " | ||
| 794 | + GROUP BY o.id | ||
| 795 | + ORDER BY o.$order $type | ||
| 796 | + "; | ||
| 797 | + | ||
| 843 | $pager['sql'] = $sql; | 798 | $pager['sql'] = $sql; |
| 844 | // echo $pager['sql']; | 799 | // echo $pager['sql']; |
| 845 | $pager = pagerGetRun ($pager, 50, 15); | 800 | $pager = pagerGetRun ($pager, 50, 15); |
| 801 | + | ||
| 846 | $result = mysql_query ($pager['sql']) or die (mysql_error ()); | 802 | $result = mysql_query ($pager['sql']) or die (mysql_error ()); |
| 847 | - if (mysql_affected_rows () != 90800) | 803 | + if (mysql_affected_rows () != 0) |
| 848 | { | 804 | { |
| 849 | - | ||
| 850 | // ============= | 805 | // ============= |
| 851 | // === Òàáñ ==== | 806 | // === Òàáñ ==== |
| 852 | // ============= | 807 | // ============= |
| 853 | - | 808 | + |
| 854 | echo "<div class='clear'></div>"; | 809 | echo "<div class='clear'></div>"; |
| 855 | echo "<div class='order-tabs'>"; | 810 | echo "<div class='order-tabs'>"; |
| 856 | - // ////$eshka2.$eshka | ||
| 857 | - $sql0 = "SELECT * FROM zlo_book_status WHERE id IN (1,2,4,5)"; | ||
| 858 | - $result0 = mysql_query ($sql0) or die (mysql_error ()); | ||
| 859 | - if (mysql_affected_rows () != 0) | ||
| 860 | - { | ||
| 861 | - while ($rows = mysql_fetch_assoc ($result0)) | ||
| 862 | - { | ||
| 863 | - | ||
| 864 | - // $AND | ||
| 865 | - | ||
| 866 | - // Ïîäñ÷åò êîëè÷åñòâà çàêàçîâ ïî ñòàòóñó | ||
| 867 | - $sql2 = "SELECT count(o.id) AS calc, o . * , m.*, m.product_id as mod_id, op.* , p.* | ||
| 868 | - FROM catalogs_orders as o | ||
| 869 | - LEFT JOIN catalogs_orders_products as op ON op.order_id=o.id | ||
| 870 | - LEFT JOIN catalogs_modifications AS m ON m.id = op.product_id | ||
| 871 | - LEFT JOIN catalogs_products AS p ON p.id = m.product_id | ||
| 872 | - LEFT JOIN zlo_users as u ON u.id=o.user_id | ||
| 873 | - LEFT JOIN zlo_users_group as g ON g.id=u.group | ||
| 874 | - WHERE " . $eshka2 . "o.status='" . $rows['id'] . "' $AND"; | ||
| 875 | - | ||
| 876 | - // if(trim($_REQUEST['test'])=="1") echo $sql2; | ||
| 877 | - | ||
| 878 | - /* | ||
| 879 | - * $sql2 = "SELECT count(o.id) AS calc FROM catalogs_orders as o WHERE ".$eshka2."o.status='".$rows['id']."'"; | ||
| 880 | - * | ||
| 881 | - * | ||
| 882 | - * $result2 = mysql_query($sql2) or die(mysql_error()); | ||
| 883 | - * $row2=mysql_fetch_assoc($result2); | ||
| 884 | - * $yyyyyy = str_replace("prs=1","prs=0",str_replace("pr=1","pr=0",urlQueryChange2('status',$rows['id']))); | ||
| 885 | - * echo"<div class='status-tabs' ".(($_GET['status']==$rows['id'])?"style='border:1px solid red;'":"")." onclick=\"location.href='".$yyyyyy."'\">".$rows['title']."(".$row2['calc'].")</div>"; | ||
| 886 | - */ | ||
| 887 | - } | ||
| 888 | - } | ||
| 889 | - | 811 | + |
| 890 | $array_label = array ( | 812 | $array_label = array ( |
| 891 | - 0 => "íîâûå çàêàçû", | ||
| 892 | - 1 => "îáðàáîòàí", | 813 | + 0 => "íîâûå çàêàçû", |
| 814 | + 1 => "îáðàáîòàí", | ||
| 893 | 110 => "ïåðåìåùàåòñÿ", | 815 | 110 => "ïåðåìåùàåòñÿ", |
| 894 | - 2 => "äîñòàâèòü", | ||
| 895 | - 3 => "îòïðàâèòü", | ||
| 896 | - 4 => "ñàìîâûâîç", | ||
| 897 | - 5 => "", | ||
| 898 | - 510 => "", | ||
| 899 | - 6 => "", | ||
| 900 | - 610 => "", | ||
| 901 | - 7 => "âîçâðàò", | ||
| 902 | - 8 => "", | ||
| 903 | - 9 => "îòìåíåí", | ||
| 904 | - 10 => "âûïîëíåí" | 816 | + 2 => "äîñòàâèòü", |
| 817 | + 3 => "îòïðàâèòü", | ||
| 818 | + 4 => "ñàìîâûâîç", | ||
| 819 | + 5 => "5", | ||
| 820 | + 510 => "510", | ||
| 821 | + 6 => "6", | ||
| 822 | + 610 => "610", | ||
| 823 | + 7 => "âîçâðàò", | ||
| 824 | + 8 => "8", | ||
| 825 | + 9 => "îòìåíåí", | ||
| 826 | + 10 => "âûïîëíåí", | ||
| 905 | ); | 827 | ); |
| 828 | + | ||
| 906 | print ' | 829 | print ' |
| 907 | <div style="float:left;padding:10px 0px;"> | 830 | <div style="float:left;padding:10px 0px;"> |
| 908 | <form action="/admin.php/orders/" name="form" method="get"> | 831 | <form action="/admin.php/orders/" name="form" method="get"> |
| @@ -914,43 +837,63 @@ if (! isset ($_GET['action'])) | @@ -914,43 +837,63 @@ if (! isset ($_GET['action'])) | ||
| 914 | <input type="hidden" name="page" value="1"> | 837 | <input type="hidden" name="page" value="1"> |
| 915 | <input type="hidden" name="search" value="ok"> | 838 | <input type="hidden" name="search" value="ok"> |
| 916 | '; | 839 | '; |
| 917 | - for ($i = 0; $i <= 10; $i ++) | ||
| 918 | - foreach ($array_label as $i => $v) | 840 | + |
| 841 | + $WHERE = array (); | ||
| 842 | + | ||
| 843 | + foreach ($array_label as $label_id => $label_title) | ||
| 919 | { | 844 | { |
| 920 | - $sql = "select count(*) from catalogs_orders o where o.label='" . $i . "'"; | ||
| 921 | - if (isset ($_GET['stat']) && $_GET['stat'] == 1) | 845 | + // ***** Àäìèí ðåæèì ***** |
| 846 | + if (in_array ($label_id, array (9, 10)) && ! in_array ($_SESSION['admin']['id'], array (1, 19, 20))) | ||
| 922 | { | 847 | { |
| 923 | - $sql .= " AND o.status IN(4,5)"; | 848 | + CONTINUE; |
| 924 | } | 849 | } |
| 925 | - else | 850 | + |
| 851 | + $WHERE[] = "o.`label` = " . $label_id; | ||
| 852 | + | ||
| 853 | + if (! empty ($WHERE_DATE)) | ||
| 926 | { | 854 | { |
| 927 | - $sql .= $mk_and; | 855 | + $WHERE[] = $WHERE_DATE; |
| 928 | } | 856 | } |
| 857 | + | ||
| 858 | + // Ïîäñ÷åò êîëè÷åñòâà çàêàçîâ ïî ñòàòóñó | ||
| 859 | + $sql = " | ||
| 860 | + SELECT count(*) as count | ||
| 861 | + FROM catalogs_orders o | ||
| 862 | + WHERE " . (! empty ($WHERE) ? implode (' AND ', $WHERE) : ''); | ||
| 863 | + | ||
| 929 | $r = mysql_query ($sql) or die (mysql_error ()); | 864 | $r = mysql_query ($sql) or die (mysql_error ()); |
| 930 | $count = mysql_result ($r, 0); | 865 | $count = mysql_result ($r, 0); |
| 931 | - print '<input type="checkbox" id="cb' . $i . '" name="lab[]" value="' . $i . '" '; | ||
| 932 | - // .(($_GET['label'][$i]==$i)?'checked':''). | ||
| 933 | - foreach ($_GET['lab'] as $l) | 866 | + $checked = ''; |
| 867 | + | ||
| 868 | + foreach ($_GET['lab'] as $id) | ||
| 934 | { | 869 | { |
| 935 | - if ($l == $i) | ||
| 936 | - print 'checked'; | 870 | + if ($label_id == $id) |
| 871 | + { | ||
| 872 | + $checked = 'checked=checked'; | ||
| 873 | + break; | ||
| 874 | + } | ||
| 937 | } | 875 | } |
| 938 | - $i = ($i == 110) ? 1.1 : $i; | ||
| 939 | - $i = ($i == 510) ? 5.1 : $i; | ||
| 940 | - $i = ($i == 610) ? 6.1 : $i; | ||
| 941 | - print ' onclick="document.form.submit();"/><label for="cb' . $i . '">' . $i . '-' . $array_label[$i] . '(' . $count . ')</label>'; | 876 | + |
| 877 | + $label_id = ($label_id == 110) ? 1.1 : $label_id; | ||
| 878 | + $label_id = ($label_id == 510) ? 5.1 : $label_id; | ||
| 879 | + $label_id = ($label_id == 610) ? 6.1 : $label_id; | ||
| 880 | + | ||
| 881 | + print '<input type="checkbox" id="cb' . $label_id . '" name="lab[]" ' . $checked . ' value="' . $label_id . '" onclick="document.form.submit();"/><label for="cb' . $label_id . '">' . $label_id . '-' . $label_title . '(' . $count . ')</label>'; | ||
| 942 | } | 882 | } |
| 883 | + | ||
| 943 | print "<br /><br /><br />"; | 884 | print "<br /><br /><br />"; |
| 944 | - | ||
| 945 | - print "<select name='meneger' onChange='document.form.submit();'>"; | ||
| 946 | - print "<option value='0'>Ìåíåäæåð</option>"; | ||
| 947 | - $result_1 = mysql_query ("select * from zlo_admin"); | ||
| 948 | - while ($row = mysql_fetch_assoc ($result_1)) | ||
| 949 | - { | ||
| 950 | - echo "<option value='" . $row["id"] . "' " . (($_GET['meneger'] == $row["id"]) ? "selected" : "") . ">" . $row["username"] . "</option>"; | ||
| 951 | - } | ||
| 952 | - print "</select>"; | ||
| 953 | - | 885 | + |
| 886 | + print "<select name='meneger' onChange='document.form.submit();'>"; | ||
| 887 | + | ||
| 888 | + print "<option value='0'>Ìåíåäæåð</option>"; | ||
| 889 | + | ||
| 890 | + $result_1 = mysql_query ("select * from zlo_admin"); | ||
| 891 | + while ($row = mysql_fetch_assoc ($result_1)) | ||
| 892 | + { | ||
| 893 | + echo "<option value='" . $row["id"] . "' " . (($_GET['meneger'] == $row["id"]) ? "selected" : "") . ">" . $row["username"] . "</option>"; | ||
| 894 | + } | ||
| 895 | + print "</select>"; | ||
| 896 | + | ||
| 954 | $sql = "select * from zlo_book_delivery"; | 897 | $sql = "select * from zlo_book_delivery"; |
| 955 | $r = mysql_query ($sql) or die (mysql_error ()); | 898 | $r = mysql_query ($sql) or die (mysql_error ()); |
| 956 | $i = 0; | 899 | $i = 0; |
| @@ -966,7 +909,7 @@ if (! isset ($_GET['action'])) | @@ -966,7 +909,7 @@ if (! isset ($_GET['action'])) | ||
| 966 | $i ++; | 909 | $i ++; |
| 967 | } | 910 | } |
| 968 | print '</form></div>'; | 911 | print '</form></div>'; |
| 969 | - | 912 | + |
| 970 | $tim = (time () - 86400); | 913 | $tim = (time () - 86400); |
| 971 | $sql3 = " | 914 | $sql3 = " |
| 972 | SELECT count(*) count FROM catalogs_orders WHERE `status`=1 AND `upd`<'" . date ("Y-m-d H:i:s", $tim) . "';"; | 915 | SELECT count(*) count FROM catalogs_orders WHERE `status`=1 AND `upd`<'" . date ("Y-m-d H:i:s", $tim) . "';"; |
| @@ -975,7 +918,7 @@ if (! isset ($_GET['action'])) | @@ -975,7 +918,7 @@ if (! isset ($_GET['action'])) | ||
| 975 | $yyyyyt = ""; | 918 | $yyyyyt = ""; |
| 976 | if (trim ($_REQUEST['pr']) == "1") | 919 | if (trim ($_REQUEST['pr']) == "1") |
| 977 | $yyyyyt = "font-weight:bold; "; | 920 | $yyyyyt = "font-weight:bold; "; |
| 978 | - | 921 | + |
| 979 | $tim2 = (time () - 172800); | 922 | $tim2 = (time () - 172800); |
| 980 | $sql4 = " | 923 | $sql4 = " |
| 981 | SELECT count(*) count FROM catalogs_orders WHERE `status`=2 AND `upd`<'" . date ("Y-m-d H:i:s", $tim2) . "';"; | 924 | SELECT count(*) count FROM catalogs_orders WHERE `status`=2 AND `upd`<'" . date ("Y-m-d H:i:s", $tim2) . "';"; |
| @@ -984,27 +927,33 @@ if (! isset ($_GET['action'])) | @@ -984,27 +927,33 @@ if (! isset ($_GET['action'])) | ||
| 984 | $yyyyyt2 = ""; | 927 | $yyyyyt2 = ""; |
| 985 | if (trim ($_REQUEST['prs']) == "1") | 928 | if (trim ($_REQUEST['prs']) == "1") |
| 986 | $yyyyyt2 = "font-weight:bold; "; | 929 | $yyyyyt2 = "font-weight:bold; "; |
| 987 | - | ||
| 988 | - echo " | ||
| 989 | - | ||
| 990 | - <div class='status-tabs' style=\"" . $lll . "\" onclick=\"location.href='" . urlQueryChange2 ('stat', "1") . "&page=1'\">Êîðçèíà</div>"; | 930 | + |
| 931 | + // ***** Àäìèí ðåæèì ***** | ||
| 932 | + if (in_array ($_SESSION['admin']['id'], array (1, 19, 20))) | ||
| 933 | + { | ||
| 934 | + echo " | ||
| 935 | + <div class='status-tabs' style=\"" . $lll . "\" onclick=\"location.href='" . urlQueryChange2 ('stat', "1") . "&page=1'\">Êîðçèíà</div>"; | ||
| 936 | + | ||
| 937 | + echo " | ||
| 938 | + <div class='status-tabs'> | ||
| 939 | + <a href=\"/order/index.php\" target=\"_blank\" style=\"text-decoration:none; color:#157100\">Ñòàòèñòèêà çàêàçîâ</a> | ||
| 940 | + </div>"; | ||
| 941 | + } | ||
| 942 | + | ||
| 991 | echo " | 943 | echo " |
| 992 | - <div class='status-tabs'> | ||
| 993 | - <a href=\"/order/index.php\" target=\"_blank\" style=\"text-decoration:none; color:#157100\">Ñòàòèñòèêà çàêàçîâ</a> | ||
| 994 | - </div> | ||
| 995 | - </div> | 944 | + </div> |
| 996 | <!--<div class='clear'></div> | 945 | <!--<div class='clear'></div> |
| 997 | - <div onclick=\"location.href='?pr=1&status=1&page=1'\" style=\"" . $yyyyyt . "cursor:pointer; float: left; font-family: Arial,Helvetica,sans-serif; font-size: 12px; margin-left:25px;\"> | ||
| 998 | - Ïðîñòð. (" . $row3['count'] . ") | ||
| 999 | - </div> | ||
| 1000 | - | ||
| 1001 | - <div onclick=\"location.href='?prs=1&status=2&page=1'\" style=\"" . $yyyyyt2 . "cursor:pointer; float: left; font-family: Arial,Helvetica,sans-serif; font-size: 12px; margin-left:45px;\"> | ||
| 1002 | - Ïðîñòð. (" . $row4['count'] . ") | ||
| 1003 | - </div>--> | 946 | + <div onclick=\"location.href='?pr=1&status=1&page=1'\" style=\"" . $yyyyyt . "cursor:pointer; float: left; font-family: Arial,Helvetica,sans-serif; font-size: 12px; margin-left:25px;\"> |
| 947 | + Ïðîñòð. (" . $row3['count'] . ") | ||
| 948 | + </div> | ||
| 949 | + | ||
| 950 | + <div onclick=\"location.href='?prs=1&status=2&page=1'\" style=\"" . $yyyyyt2 . "cursor:pointer; float: left; font-family: Arial,Helvetica,sans-serif; font-size: 12px; margin-left:45px;\"> | ||
| 951 | + Ïðîñòð. (" . $row4['count'] . ") | ||
| 952 | + </div>--> | ||
| 1004 | <div class='clear'></div> | 953 | <div class='clear'></div> |
| 1005 | <div> </div> | 954 | <div> </div> |
| 1006 | - "; | ||
| 1007 | - | 955 | + "; |
| 956 | + | ||
| 1008 | // =================== | 957 | // =================== |
| 1009 | // === ÏÐÎÄÎËÆÅÍÈÅ === | 958 | // === ÏÐÎÄÎËÆÅÍÈÅ === |
| 1010 | // =================== | 959 | // =================== |
| @@ -1020,40 +969,38 @@ if (! isset ($_GET['action'])) | @@ -1020,40 +969,38 @@ if (! isset ($_GET['action'])) | ||
| 1020 | } | 969 | } |
| 1021 | // print $url_l; | 970 | // print $url_l; |
| 1022 | print "<table border='0' width='100%' cellpadding='6' cellspacing='1' bgcolor='#d7decc' style='border-radius:10px;'> | 971 | print "<table border='0' width='100%' cellpadding='6' cellspacing='1' bgcolor='#d7decc' style='border-radius:10px;'> |
| 1023 | - <tr style='color:#acd2f6;text-align:center;' bgcolor='#1372c6'> | ||
| 1024 | - <td width='50' style='border-radius:10px 0px 0px 0px;'><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=id&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Íîìåð çàêàçà</a></td> | ||
| 1025 | - <td width='90'><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=mktime&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Äàòà çàêàçà</a></td> | ||
| 1026 | - <td width='90'>Äåäëàéí</td> | ||
| 1027 | - <td width='150'>ÔÈÎ</td> | ||
| 1028 | - <td width='50'><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=total&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Îáùàÿ ñóììà</a></td> | ||
| 1029 | - <td width='50'><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=paid&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Îïëà÷åí</a></td> | ||
| 1030 | - <td>Òåëåôîí</td> | ||
| 1031 | - <td width='300'>Àäðåñ</td> | ||
| 1032 | - <td><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=label&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Ìåòêà</a></td> | ||
| 1033 | - <td>Ñòàòóñ</td> | ||
| 1034 | - <td width='150'>Êîìåíòàðèé ìåíåäæåðà</td> | ||
| 1035 | - <td style='border-radius:0px 10px 0px 0px;' width='100'>ÑÌÑ</td> | ||
| 1036 | - </tr>"; | 972 | + <tr style='color:#acd2f6;text-align:center;' bgcolor='#1372c6'> |
| 973 | + <td width='50' style='border-radius:10px 0px 0px 0px;'><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=id&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Íîìåð çàêàçà</a></td> | ||
| 974 | + <td width='90'><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=mktime&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Äàòà çàêàçà</a></td> | ||
| 975 | + <td width='90'>Äåäëàéí</td> | ||
| 976 | + <td width='150'>ÔÈÎ</td> | ||
| 977 | + <td width='50'><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=total&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Îáùàÿ ñóììà</a></td> | ||
| 978 | + <td width='50'><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=paid&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Îïëà÷åí</a></td> | ||
| 979 | + <td>Òåëåôîí</td> | ||
| 980 | + <td width='300'>Àäðåñ</td> | ||
| 981 | + <td><a style='color:#acd2f6;' href='" . $url_l . "stat=" . $_GET['stat'] . "&order=label&type=" . (($_GET['type'] == "asc") ? "desc" : "asc") . "'>Ìåòêà</a></td> | ||
| 982 | + <td>Ñòàòóñ</td> | ||
| 983 | + <td width='150'>Êîìåíòàðèé ìåíåäæåðà</td> | ||
| 984 | + <td style='border-radius:0px 10px 0px 0px;' width='100'>ÑÌÑ</td> | ||
| 985 | + </tr>"; | ||
| 1037 | $i1 = 0; | 986 | $i1 = 0; |
| 1038 | while ($order = mysql_fetch_assoc ($result)) | 987 | while ($order = mysql_fetch_assoc ($result)) |
| 1039 | { | 988 | { |
| 1040 | - // print_r($order); | ||
| 1041 | if (empty ($order['order_id'])) | 989 | if (empty ($order['order_id'])) |
| 1042 | $order['order_id'] = 0; | 990 | $order['order_id'] = 0; |
| 1043 | - print " <tr style='text-align:center;' bgcolor='" . ((($i1 % 2) == 0) ? "#fefff5" : "#eff5e7") . "'> | ||
| 1044 | - <td id='ID{$order['order_id']}'><a href='" . $url_l . (($_GET['order_ID'] != $order['order_id']) ? "order_ID={$order['order_id']}#ID{$order['order_id']}" : "") . "'>{$order['order_id']}</a><br />{$order['meneger_name']}</td> | ||
| 1045 | - <td width='90'>" . date ('Y-m-d H:i:s', $order['order_date']) . "</td> | ||
| 1046 | - <td width='90' style='color:" . ($order['dedline'] < date ("Y-m-d") ? 'red' : 'black') . "'>" . $order['dedline'] . "</td> | ||
| 1047 | - <td width='150' align='left'><!--<a href='/admin.php/users/?action=edit&user=" . $order['user_id'] . "'>-->" . $order['username'] . "<!--</a>--></td> | ||
| 1048 | - <td width='50'>{$order['total']}</td> | ||
| 1049 | - <td width='50'>"; | ||
| 1050 | - | 991 | + print " <tr style='text-align:center;' bgcolor='" . ((($i1 % 2) == 0) ? "#fefff5" : "#eff5e7") . "'> |
| 992 | + <td id='ID{$order['order_id']}'><a href='" . $url_l . (($_GET['order_ID'] != $order['order_id']) ? "order_ID={$order['order_id']}#ID{$order['order_id']}" : "") . "'>{$order['order_id']}</a><br />{$order['meneger_name']}</td> | ||
| 993 | + <td width='90'>" . date ('Y-m-d H:i:s', $order['order_date']) . "</td> | ||
| 994 | + <td width='90' style='color:" . ($order['dedline'] < date ("Y-m-d") ? 'red' : 'black') . "'>" . $order['dedline'] . "</td> | ||
| 995 | + <td width='150' align='left'><!--<a href='/admin.php/users/?action=edit&user=" . $order['user_id'] . "'>-->" . $order['username'] . "<!--</a>--></td> | ||
| 996 | + <td width='50'>{$order['total']}</td> | ||
| 997 | + <td width='50'>"; | ||
| 1051 | if ($_SESSION['admin']['group'] == 1 || $_SESSION['admin']['group'] == 4 || $_SESSION['admin']['group'] == 6) | 998 | if ($_SESSION['admin']['group'] == 1 || $_SESSION['admin']['group'] == 4 || $_SESSION['admin']['group'] == 6) |
| 1052 | { | 999 | { |
| 1053 | echo "<select onChange='document.location=\"" . $url_l . "orderID={$order['order_id']}&paid=\"+this.value;'> | 1000 | echo "<select onChange='document.location=\"" . $url_l . "orderID={$order['order_id']}&paid=\"+this.value;'> |
| 1054 | - <option value='0' " . (($order['paid'] == 0) ? 'selected' : '') . ">íåò</option> | ||
| 1055 | - <option value='1' " . (($order['paid'] == 1) ? 'selected' : '') . ">äà</option> | ||
| 1056 | - </select>"; | 1001 | + <option value='0' " . (($order['paid'] == 0) ? 'selected' : '') . ">íåò</option> |
| 1002 | + <option value='1' " . (($order['paid'] == 1) ? 'selected' : '') . ">äà</option> | ||
| 1003 | + </select>"; | ||
| 1057 | } | 1004 | } |
| 1058 | else | 1005 | else |
| 1059 | { | 1006 | { |
| @@ -1062,15 +1009,12 @@ if (! isset ($_GET['action'])) | @@ -1062,15 +1009,12 @@ if (! isset ($_GET['action'])) | ||
| 1062 | else | 1009 | else |
| 1063 | print "Íåò"; | 1010 | print "Íåò"; |
| 1064 | } | 1011 | } |
| 1065 | - | ||
| 1066 | echo " | 1012 | echo " |
| 1067 | </td> | 1013 | </td> |
| 1068 | - <td>{$order['tel']}<br/> <a href='/admin.php/sms/?orderID={$order['order_id']}'>Îòïðàâèòü CMC</a></td> | ||
| 1069 | - <td align='left'>{$order['city']}, {$order['address']}</td> | ||
| 1070 | - <td>"; | ||
| 1071 | - | 1014 | + <td>{$order['tel']}<br/> <a href='/admin.php/sms/?orderID={$order['order_id']}'>Îòïðàâèòü CMC</a></td> |
| 1015 | + <td align='left'>{$order['city']}, {$order['address']}</td> | ||
| 1016 | + <td>"; | ||
| 1072 | // if($_SESSION['admin']['group']==1 || $_SESSION['admin']['group']==4){ | 1017 | // if($_SESSION['admin']['group']==1 || $_SESSION['admin']['group']==4){ |
| 1073 | - | ||
| 1074 | if ($_SESSION['admin']['group'] == 2 and ($order['label'] == 9 or $order['label'] == 10)) | 1018 | if ($_SESSION['admin']['group'] == 2 and ($order['label'] == 9 or $order['label'] == 10)) |
| 1075 | { | 1019 | { |
| 1076 | print $order['label']; | 1020 | print $order['label']; |
| @@ -1078,9 +1022,14 @@ if (! isset ($_GET['action'])) | @@ -1078,9 +1022,14 @@ if (! isset ($_GET['action'])) | ||
| 1078 | else | 1022 | else |
| 1079 | { | 1023 | { |
| 1080 | echo " <select onChange='if(this.value==9){o=\"&order_ID={$order['order_id']}\"}else{o=\"\";}document.location=\"" . $url_l . "orderID={$order['order_id']}&label=\"+this.value+o;'> "; | 1024 | echo " <select onChange='if(this.value==9){o=\"&order_ID={$order['order_id']}\"}else{o=\"\";}document.location=\"" . $url_l . "orderID={$order['order_id']}&label=\"+this.value+o;'> "; |
| 1081 | - for ($i = 0; $i <= 10; $i ++) | 1025 | + for ($i = 0; $i <= 10; $i++) |
| 1082 | { | 1026 | { |
| 1083 | - | 1027 | + // ***** Àäìèí ðåæèì ***** |
| 1028 | + if (in_array ($i, array (9, 10)) && ! in_array ($_SESSION['admin']['id'], array (1, 19, 20))) | ||
| 1029 | + { | ||
| 1030 | + CONTINUE; | ||
| 1031 | + } | ||
| 1032 | + | ||
| 1084 | if (($_SESSION['admin']['group'] == 2) && ($i == 9 || $i == 10) && ($_SESSION['admin']['id'] != 17)) | 1033 | if (($_SESSION['admin']['group'] == 2) && ($i == 9 || $i == 10) && ($_SESSION['admin']['id'] != 17)) |
| 1085 | { | 1034 | { |
| 1086 | } | 1035 | } |
| @@ -1089,6 +1038,8 @@ if (! isset ($_GET['action'])) | @@ -1089,6 +1038,8 @@ if (! isset ($_GET['action'])) | ||
| 1089 | } | 1038 | } |
| 1090 | else | 1039 | else |
| 1091 | print '<option value="' . $i . '" ' . (($order['label'] == $i) ? 'selected' : '') . '>' . $i . '</option>'; | 1040 | print '<option value="' . $i . '" ' . (($order['label'] == $i) ? 'selected' : '') . '>' . $i . '</option>'; |
| 1041 | + | ||
| 1042 | + | ||
| 1092 | if ($i == 1) | 1043 | if ($i == 1) |
| 1093 | { | 1044 | { |
| 1094 | print '<option value="110" ' . (($order['label'] == 110) ? 'selected' : '') . '>1.1</option>'; | 1045 | print '<option value="110" ' . (($order['label'] == 110) ? 'selected' : '') . '>1.1</option>'; |
| @@ -1104,11 +1055,11 @@ if (! isset ($_GET['action'])) | @@ -1104,11 +1055,11 @@ if (! isset ($_GET['action'])) | ||
| 1104 | } | 1055 | } |
| 1105 | echo "</select>"; | 1056 | echo "</select>"; |
| 1106 | } | 1057 | } |
| 1107 | - | ||
| 1108 | - // }else{ | 1058 | + |
| 1059 | + // }else{ | ||
| 1109 | // print $order['label']; | 1060 | // print $order['label']; |
| 1110 | // } | 1061 | // } |
| 1111 | - | 1062 | + |
| 1112 | $s = "select * from catalogs_orders_products where order_id=" . $order['order_id']; | 1063 | $s = "select * from catalogs_orders_products where order_id=" . $order['order_id']; |
| 1113 | $r = mysql_query ($s) or die (mysql_error ()); | 1064 | $r = mysql_query ($s) or die (mysql_error ()); |
| 1114 | $status = array (); | 1065 | $status = array (); |
| @@ -1118,18 +1069,18 @@ if (! isset ($_GET['action'])) | @@ -1118,18 +1069,18 @@ if (! isset ($_GET['action'])) | ||
| 1118 | $status[] = $op['status']; | 1069 | $status[] = $op['status']; |
| 1119 | } | 1070 | } |
| 1120 | echo "</td> | 1071 | echo "</td> |
| 1121 | - <td>" . implode (', ', $status) . "</td> | ||
| 1122 | - <td align='left'>"; | 1072 | + <td>" . implode (', ', $status) . "</td> |
| 1073 | + <td align='left'>"; | ||
| 1123 | if (strlen ($order['mcomment']) > 0) | 1074 | if (strlen ($order['mcomment']) > 0) |
| 1124 | print "<a href='#' rel='msg' title='{$order['mcomment']}'>" . substr ($order['mcomment'], 0, 30) . "...</a>"; | 1075 | print "<a href='#' rel='msg' title='{$order['mcomment']}'>" . substr ($order['mcomment'], 0, 30) . "...</a>"; |
| 1125 | print "</td> | 1076 | print "</td> |
| 1126 | - "; | 1077 | + "; |
| 1127 | print "<td>" . $order['smst'] . "</td>"; | 1078 | print "<td>" . $order['smst'] . "</td>"; |
| 1128 | - | 1079 | + |
| 1129 | // ***** Àäìèí ðåæèì ***** | 1080 | // ***** Àäìèí ðåæèì ***** |
| 1130 | if (isset ($_SESSION['admin']['edit1'])) | 1081 | if (isset ($_SESSION['admin']['edit1'])) |
| 1131 | { | 1082 | { |
| 1132 | - | 1083 | + |
| 1133 | // Ñìåíà ñòàòóñà | 1084 | // Ñìåíà ñòàòóñà |
| 1134 | if ($order['status'] != 6) | 1085 | if ($order['status'] != 6) |
| 1135 | { | 1086 | { |
| @@ -1145,42 +1096,46 @@ if (! isset ($_GET['action'])) | @@ -1145,42 +1096,46 @@ if (! isset ($_GET['action'])) | ||
| 1145 | echo $row4['title']; | 1096 | echo $row4['title']; |
| 1146 | } | 1097 | } |
| 1147 | } | 1098 | } |
| 1148 | - echo " | 1099 | + echo " |
| 1149 | </td><td width='20'> | 1100 | </td><td width='20'> |
| 1150 | - <div id='records'><a href='/admin.php/orders/?action=edit&user=" . $order['user_id'] . "&order=" . $order['order_id'] . "' class='button-edit2' target='_blank'>Èçìåíèòü</a></div> | 1101 | + <div id='records'><a href='/admin.php/orders/?action=edit&user=" . $order['user_id'] . "&order=" . $order['order_id'] . "' class='button-edit2' target='_blank'>Èçìåíèòü</a></div> |
| 1151 | </form></td> | 1102 | </form></td> |
| 1152 | "; | 1103 | "; |
| 1153 | } | 1104 | } |
| 1154 | } | 1105 | } |
| 1106 | + | ||
| 1155 | print "</tr>"; | 1107 | print "</tr>"; |
| 1108 | + | ||
| 1156 | if ($order['order_id'] == $_GET['order_ID']) | 1109 | if ($order['order_id'] == $_GET['order_ID']) |
| 1157 | { | 1110 | { |
| 1158 | - | ||
| 1159 | print '<tr><td colspan="12">'; | 1111 | print '<tr><td colspan="12">'; |
| 1112 | + | ||
| 1160 | // =========== Ãåíåðèì òàáëèöó =========== | 1113 | // =========== Ãåíåðèì òàáëèöó =========== |
| 1161 | - | ||
| 1162 | - $sql = "SELECT o.*, o.name as username, o.adress as address, o.phone as tel, o.phonemob as tel2, u.group, o.id as order_id, o.adress as address, g.name as user_group, g.color as user_color | 1114 | + |
| 1115 | + $sql = " | ||
| 1116 | + SELECT | ||
| 1117 | + o.*, o.name as username, o.adress as address, o.phone as tel, o.phonemob as tel2, u.group, o.id as order_id, o.adress as address, | ||
| 1118 | + g.name as user_group, g.color as user_color | ||
| 1163 | FROM catalogs_orders as o | 1119 | FROM catalogs_orders as o |
| 1164 | - LEFT JOIN zlo_users as u ON u.id=o.user_id | ||
| 1165 | - LEFT JOIN zlo_users_group as g ON g.id=u.group | 1120 | + LEFT JOIN zlo_users as u ON u.id=o.user_id |
| 1121 | + LEFT JOIN zlo_users_group as g ON g.id=u.group | ||
| 1166 | WHERE o.id='" . $_GET['order_ID'] . "'"; | 1122 | WHERE o.id='" . $_GET['order_ID'] . "'"; |
| 1167 | $result1 = mysql_query ($sql) or die (mysql_error ()); | 1123 | $result1 = mysql_query ($sql) or die (mysql_error ()); |
| 1168 | if (mysql_affected_rows () != 0) | 1124 | if (mysql_affected_rows () != 0) |
| 1169 | { | 1125 | { |
| 1170 | - | ||
| 1171 | $order = mysql_fetch_assoc ($result1); | 1126 | $order = mysql_fetch_assoc ($result1); |
| 1172 | - | 1127 | + |
| 1173 | $r = mysql_query ("select * from card where user_id='" . $order['user_id'] . "'") or die (mysql_error ()); | 1128 | $r = mysql_query ("select * from card where user_id='" . $order['user_id'] . "'") or die (mysql_error ()); |
| 1174 | $c = mysql_fetch_assoc ($r); | 1129 | $c = mysql_fetch_assoc ($r); |
| 1175 | $order['cards'] = $c['card']; | 1130 | $order['cards'] = $c['card']; |
| 1176 | - | 1131 | + |
| 1177 | echo "<form action='$url_l' method='POST' name='edit_order' id='add-item'>"; | 1132 | echo "<form action='$url_l' method='POST' name='edit_order' id='add-item'>"; |
| 1178 | echo "<div class='orders' style='margin:0px;'>"; | 1133 | echo "<div class='orders' style='margin:0px;'>"; |
| 1179 | - | 1134 | + |
| 1180 | echo " | 1135 | echo " |
| 1181 | <div class=order-info> | 1136 | <div class=order-info> |
| 1182 | <fieldset id='order-info'> | 1137 | <fieldset id='order-info'> |
| 1183 | - <legend>Çàêàç #" . $order['order_id'] . " Ãðóïïà: <font color='" . $order['user_color'] . "'>" . $order['user_group'] . "</font> Cóììà: " . $order['total'] . " ãðí.</legend> | 1138 | + <legend>Çàêàç #" . $order['order_id'] . " Ãðóïïà: <font color='" . $order['user_color'] . "'>" . $order['user_group'] . "</font> Cóììà: " . $order['total'] . " ãðí.</legend> |
| 1184 | <div style='float:left;'> | 1139 | <div style='float:left;'> |
| 1185 | <label>Äàòà:</label> | 1140 | <label>Äàòà:</label> |
| 1186 | <div class=info>" . date ('d-m-Y H:i:s', $order['mktime']) . "</div> | 1141 | <div class=info>" . date ('d-m-Y H:i:s', $order['mktime']) . "</div> |
| @@ -1196,17 +1151,17 @@ if (! isset ($_GET['action'])) | @@ -1196,17 +1151,17 @@ if (! isset ($_GET['action'])) | ||
| 1196 | } | 1151 | } |
| 1197 | ); | 1152 | ); |
| 1198 | </script> | 1153 | </script> |
| 1199 | - </div> | ||
| 1200 | - | ||
| 1201 | - <label>Îïëà÷åí:</label> | ||
| 1202 | - <div class=info style='float:left;padding-right:20px;'>"; | ||
| 1203 | - | 1154 | + </div> |
| 1155 | + | ||
| 1156 | + <label>Îïëà÷åí:</label> | ||
| 1157 | + <div class=info style='float:left;padding-right:20px;'>"; | ||
| 1158 | + | ||
| 1204 | if ($_SESSION['admin']['group'] == 1 || $_SESSION['admin']['group'] == 4 || $_SESSION['admin']['group'] == 6) | 1159 | if ($_SESSION['admin']['group'] == 1 || $_SESSION['admin']['group'] == 4 || $_SESSION['admin']['group'] == 6) |
| 1205 | { | 1160 | { |
| 1206 | echo "<select name='paid'> | 1161 | echo "<select name='paid'> |
| 1207 | - <option value='0' " . (($order['paid'] == 0) ? 'selected' : '') . ">íåò</option> | ||
| 1208 | - <option value='1' " . (($order['paid'] == 1) ? 'selected' : '') . ">äà</option> | ||
| 1209 | - </select>"; | 1162 | + <option value='0' " . (($order['paid'] == 0) ? 'selected' : '') . ">íåò</option> |
| 1163 | + <option value='1' " . (($order['paid'] == 1) ? 'selected' : '') . ">äà</option> | ||
| 1164 | + </select>"; | ||
| 1210 | } | 1165 | } |
| 1211 | else | 1166 | else |
| 1212 | { | 1167 | { |
| @@ -1216,17 +1171,23 @@ if (! isset ($_GET['action'])) | @@ -1216,17 +1171,23 @@ if (! isset ($_GET['action'])) | ||
| 1216 | print "Íåò"; | 1171 | print "Íåò"; |
| 1217 | echo "<input type=\"hidden\" name=\"paid\" value=\"" . $order['paid'] . "\">"; | 1172 | echo "<input type=\"hidden\" name=\"paid\" value=\"" . $order['paid'] . "\">"; |
| 1218 | } | 1173 | } |
| 1219 | - | 1174 | + |
| 1220 | echo "</div> | 1175 | echo "</div> |
| 1221 | - | ||
| 1222 | - <div class=info style='float:left;padding-right:20px;width:100px;'> | ||
| 1223 | - <label style='width:50px'>Ìåòêà:</label> | ||
| 1224 | - <div class=info>"; | ||
| 1225 | - | 1176 | + |
| 1177 | + <div class=info style='float:left;padding-right:20px;width:100px;'> | ||
| 1178 | + <label style='width:50px'>Ìåòêà:</label> | ||
| 1179 | + <div class=info>"; | ||
| 1180 | + | ||
| 1226 | // ////////if($_SESSION['admin']['group']==1 || $_SESSION['admin']['group']==4){ | 1181 | // ////////if($_SESSION['admin']['group']==1 || $_SESSION['admin']['group']==4){ |
| 1227 | echo "<select name='label'>"; | 1182 | echo "<select name='label'>"; |
| 1228 | for ($i = 0; $i <= 10; $i ++) | 1183 | for ($i = 0; $i <= 10; $i ++) |
| 1229 | { | 1184 | { |
| 1185 | + // ***** Àäìèí ðåæèì ***** | ||
| 1186 | + if (in_array ($i, array (9, 10)) && ! in_array ($_SESSION['admin']['id'], array (1, 19, 20))) | ||
| 1187 | + { | ||
| 1188 | + CONTINUE; | ||
| 1189 | + } | ||
| 1190 | + | ||
| 1230 | if (($_SESSION['admin']['group'] == 2) && ($i == 9 || $i == 10) && ($_SESSION['admin']['id'] != 17)) | 1191 | if (($_SESSION['admin']['group'] == 2) && ($i == 9 || $i == 10) && ($_SESSION['admin']['id'] != 17)) |
| 1231 | { | 1192 | { |
| 1232 | } | 1193 | } |
| @@ -1248,54 +1209,54 @@ if (! isset ($_GET['action'])) | @@ -1248,54 +1209,54 @@ if (! isset ($_GET['action'])) | ||
| 1248 | print '<option value="610" ' . (($order['label'] == 610) ? 'selected' : '') . '>6.1</option>'; | 1209 | print '<option value="610" ' . (($order['label'] == 610) ? 'selected' : '') . '>6.1</option>'; |
| 1249 | } | 1210 | } |
| 1250 | } | 1211 | } |
| 1251 | - | 1212 | + |
| 1252 | echo "</select>"; | 1213 | echo "</select>"; |
| 1253 | // //////////}else{ | 1214 | // //////////}else{ |
| 1254 | // ////////////echo $order['label']; | 1215 | // ////////////echo $order['label']; |
| 1255 | // ///} | 1216 | // ///} |
| 1256 | - | ||
| 1257 | - echo " </div> | 1217 | + |
| 1218 | + echo " </div> | ||
| 1258 | </div> | 1219 | </div> |
| 1259 | - <div> | ||
| 1260 | - <label style='width:60px'>Ïðè÷èíû:</label> | ||
| 1261 | - | ||
| 1262 | - <div class=info> | ||
| 1263 | - <select name='cause' style='width:70px;'> | ||
| 1264 | - <option value='0'></option> | ||
| 1265 | - <option value='1' " . (($order['cause'] == 1) ? 'selected' : '') . ">Íåò òîâàðà</option> | ||
| 1266 | - <option value='2' " . (($order['cause'] == 2) ? 'selected' : '') . ">Íåò îïëàòû</option> | ||
| 1267 | - <option value='3' " . (($order['cause'] == 3) ? 'selected' : '') . ">Ïåðåäóìàë</option> | ||
| 1268 | - | ||
| 1269 | - <option value='31' " . (($order['cause'] == 31) ? 'selected' : '') . "> - Êóïèë â äðóãîì ìåñòå</option> | ||
| 1270 | - <option value='32' " . (($order['cause'] == 32) ? 'selected' : '') . "> - Íå ïîäîøëè óñëîâèÿ äîñòàâêè</option> | ||
| 1271 | - <option value='33' " . (($order['cause'] == 33) ? 'selected' : '') . "> - Íå ïîäîøåë ñðîê äîñòàâêè</option> | ||
| 1272 | - <option value='34' " . (($order['cause'] == 34) ? 'selected' : '') . "> - Íåò äåíåã</option> | ||
| 1273 | - <option value='35' " . (($order['cause'] == 35) ? 'selected' : '') . "> - Êóïèò ïîçæå</option> | ||
| 1274 | - | ||
| 1275 | - <option value='4' " . (($order['cause'] == 4) ? 'selected' : '') . ">Êóïèë â äðóãîì ìåñòå</option> | ||
| 1276 | - <option value='5' " . (($order['cause'] == 5) ? 'selected' : '') . ">Ïîäüåäåò â ìàã.</option> | ||
| 1277 | - <option value='6' " . (($order['cause'] == 6) ? 'selected' : '') . ">Äóáëü çàêàçà.</option> | ||
| 1278 | - <option value='7' " . (($order['cause'] == 7) ? 'selected' : '') . ">Äðóãîå</option> | ||
| 1279 | - | ||
| 1280 | - <option value='8' " . (($order['cause'] == 8) ? 'selected' : '') . ">Áðàê</option> | ||
| 1281 | - <option value='9' " . (($order['cause'] == 9) ? 'selected' : '') . ">Îòêàçàëñÿ îò Ñàìîâûâîçà</option> | ||
| 1282 | - <option value='10' " . (($order['cause'] == 10) ? 'selected' : '') . ">Íå ïðèåõàë çà Ñàìîâûâîçîì</option> | ||
| 1283 | - <option value='11' " . (($order['cause'] == 11) ? 'selected' : '') . ">Îòìåíèë çàêàç</option> | ||
| 1284 | - <option value='12' " . (($order['cause'] == 12) ? 'selected' : '') . ">Íå áåðåò òðóáêó</option> | ||
| 1285 | - | ||
| 1286 | - | ||
| 1287 | - | ||
| 1288 | - <option value='13' " . (($order['cause'] == 13) ? 'selected' : '') . ">Òîâàð íå ñîîòâåòñòâóåò îïèñàíèþ íà ñàéòå</option> | ||
| 1289 | - <option value='14' " . (($order['cause'] == 14) ? 'selected' : '') . ">Âîçâðàò</option> | ||
| 1290 | - </select> | ||
| 1291 | - </div> | ||
| 1292 | - | ||
| 1293 | - </div><div style='clear:both'></div> | ||
| 1294 | - <label>Êëèåíò:</label> | 1220 | + <div> |
| 1221 | + <label style='width:60px'>Ïðè÷èíû:</label> | ||
| 1222 | + | ||
| 1223 | + <div class=info> | ||
| 1224 | + <select name='cause' style='width:70px;'> | ||
| 1225 | + <option value='0'></option> | ||
| 1226 | + <option value='1' " . (($order['cause'] == 1) ? 'selected' : '') . ">Íåò òîâàðà</option> | ||
| 1227 | + <option value='2' " . (($order['cause'] == 2) ? 'selected' : '') . ">Íåò îïëàòû</option> | ||
| 1228 | + <option value='3' " . (($order['cause'] == 3) ? 'selected' : '') . ">Ïåðåäóìàë</option> | ||
| 1229 | + | ||
| 1230 | + <option value='31' " . (($order['cause'] == 31) ? 'selected' : '') . "> - Êóïèë â äðóãîì ìåñòå</option> | ||
| 1231 | + <option value='32' " . (($order['cause'] == 32) ? 'selected' : '') . "> - Íå ïîäîøëè óñëîâèÿ äîñòàâêè</option> | ||
| 1232 | + <option value='33' " . (($order['cause'] == 33) ? 'selected' : '') . "> - Íå ïîäîøåë ñðîê äîñòàâêè</option> | ||
| 1233 | + <option value='34' " . (($order['cause'] == 34) ? 'selected' : '') . "> - Íåò äåíåã</option> | ||
| 1234 | + <option value='35' " . (($order['cause'] == 35) ? 'selected' : '') . "> - Êóïèò ïîçæå</option> | ||
| 1235 | + | ||
| 1236 | + <option value='4' " . (($order['cause'] == 4) ? 'selected' : '') . ">Êóïèë â äðóãîì ìåñòå</option> | ||
| 1237 | + <option value='5' " . (($order['cause'] == 5) ? 'selected' : '') . ">Ïîäüåäåò â ìàã.</option> | ||
| 1238 | + <option value='6' " . (($order['cause'] == 6) ? 'selected' : '') . ">Äóáëü çàêàçà.</option> | ||
| 1239 | + <option value='7' " . (($order['cause'] == 7) ? 'selected' : '') . ">Äðóãîå</option> | ||
| 1240 | + | ||
| 1241 | + <option value='8' " . (($order['cause'] == 8) ? 'selected' : '') . ">Áðàê</option> | ||
| 1242 | + <option value='9' " . (($order['cause'] == 9) ? 'selected' : '') . ">Îòêàçàëñÿ îò Ñàìîâûâîçà</option> | ||
| 1243 | + <option value='10' " . (($order['cause'] == 10) ? 'selected' : '') . ">Íå ïðèåõàë çà Ñàìîâûâîçîì</option> | ||
| 1244 | + <option value='11' " . (($order['cause'] == 11) ? 'selected' : '') . ">Îòìåíèë çàêàç</option> | ||
| 1245 | + <option value='12' " . (($order['cause'] == 12) ? 'selected' : '') . ">Íå áåðåò òðóáêó</option> | ||
| 1246 | + | ||
| 1247 | + | ||
| 1248 | + | ||
| 1249 | + <option value='13' " . (($order['cause'] == 13) ? 'selected' : '') . ">Òîâàð íå ñîîòâåòñòâóåò îïèñàíèþ íà ñàéòå</option> | ||
| 1250 | + <option value='14' " . (($order['cause'] == 14) ? 'selected' : '') . ">Âîçâðàò</option> | ||
| 1251 | + </select> | ||
| 1252 | + </div> | ||
| 1253 | + | ||
| 1254 | + </div><div style='clear:both'></div> | ||
| 1255 | + <label>Êëèåíò:</label> | ||
| 1295 | <div class=info> | 1256 | <div class=info> |
| 1296 | <input type='text' name='user[username]' value='" . $order['username'] . "' style='width:300px;' disabled='disabled'> | 1257 | <input type='text' name='user[username]' value='" . $order['username'] . "' style='width:300px;' disabled='disabled'> |
| 1297 | <input type='hidden' name='user[username]' value='" . $order['username'] . "'> | 1258 | <input type='hidden' name='user[username]' value='" . $order['username'] . "'> |
| 1298 | - <input type='hidden' name='user[id]' value='" . $order['user_id'] . "'> | 1259 | + <input type='hidden' name='user[id]' value='" . $order['user_id'] . "'> |
| 1299 | </div> | 1260 | </div> |
| 1300 | 1261 | ||
| 1301 | <label>Email:</label> | 1262 | <label>Email:</label> |
| @@ -1303,43 +1264,43 @@ if (! isset ($_GET['action'])) | @@ -1303,43 +1264,43 @@ if (! isset ($_GET['action'])) | ||
| 1303 | <input type='text' name='user[email]' value='" . $order['email'] . "' style='width:300px;' disabled='disabled'> | 1264 | <input type='text' name='user[email]' value='" . $order['email'] . "' style='width:300px;' disabled='disabled'> |
| 1304 | <input type='hidden' name='user[email]' value='" . $order['email'] . "'> | 1265 | <input type='hidden' name='user[email]' value='" . $order['email'] . "'> |
| 1305 | </div>"; | 1266 | </div>"; |
| 1306 | - | 1267 | + |
| 1307 | // ==== TEL ==== | 1268 | // ==== TEL ==== |
| 1308 | - | 1269 | + |
| 1309 | $disabled_tel = $_SESSION['admin']['group'] == 1 ? '' : "disabled='disabled'"; | 1270 | $disabled_tel = $_SESSION['admin']['group'] == 1 ? '' : "disabled='disabled'"; |
| 1310 | - | 1271 | + |
| 1311 | echo " | 1272 | echo " |
| 1312 | <label>Òåëåôîí:</label> | 1273 | <label>Òåëåôîí:</label> |
| 1313 | <div class='info tel'> | 1274 | <div class='info tel'> |
| 1314 | <input type='text' name='user[tel]' value='" . $order['tel'] . "' style='width:270px;' ".$disabled_tel."> | 1275 | <input type='text' name='user[tel]' value='" . $order['tel'] . "' style='width:270px;' ".$disabled_tel."> |
| 1315 | <input type='hidden' name='user[tel]' value='" . $order['tel'] . "'> | 1276 | <input type='hidden' name='user[tel]' value='" . $order['tel'] . "'> |
| 1316 | - <input type='checkbox' name='sms_tel[]' id='sms_tel1' value='" . $order['tel'] . "'> | 1277 | + <input type='checkbox' name='sms_tel[]' id='sms_tel1' value='" . $order['tel'] . "'> |
| 1317 | </div> | 1278 | </div> |
| 1318 | - | 1279 | + |
| 1319 | <label>Òåëåôîí 2:</label> | 1280 | <label>Òåëåôîí 2:</label> |
| 1320 | <div class='info tel'> | 1281 | <div class='info tel'> |
| 1321 | <input type='text' name='user[tel2]' value='" . $order['tel2'] . "' style='width:270px;' ".$disabled_tel."> | 1282 | <input type='text' name='user[tel2]' value='" . $order['tel2'] . "' style='width:270px;' ".$disabled_tel."> |
| 1322 | <input type='hidden' name='user[tel2]' value='" . $order['tel2'] . "'> | 1283 | <input type='hidden' name='user[tel2]' value='" . $order['tel2'] . "'> |
| 1323 | - <input type='checkbox' name='sms_tel[]' id='sms_tel2' value='" . $order['tel2'] . "'> | 1284 | + <input type='checkbox' name='sms_tel[]' id='sms_tel2' value='" . $order['tel2'] . "'> |
| 1324 | </div>"; | 1285 | </div>"; |
| 1325 | - | ||
| 1326 | - echo " | 1286 | + |
| 1287 | + echo " | ||
| 1327 | <label>¹ êàðòî÷êè:</label> | 1288 | <label>¹ êàðòî÷êè:</label> |
| 1328 | <div class=info> | 1289 | <div class=info> |
| 1329 | <input type='text' name='user[cards]' value='" . $order['cards'] . "' style='width:300px;' disabled='disabled'> | 1290 | <input type='text' name='user[cards]' value='" . $order['cards'] . "' style='width:300px;' disabled='disabled'> |
| 1330 | <input type='hidden' name='user[cards]' value='" . $order['cards'] . "'> | 1291 | <input type='hidden' name='user[cards]' value='" . $order['cards'] . "'> |
| 1331 | </div> | 1292 | </div> |
| 1332 | - | ||
| 1333 | - <label>Êîìåíòàðèé:</label><br /> | 1293 | + |
| 1294 | + <label>Êîìåíòàðèé:</label><br /> | ||
| 1334 | <div class=info><textarea rows='4' style='width:400px;' name='user[comment]' cols='30' name='comment'>" . $order['comment'] . "</textarea></div> | 1295 | <div class=info><textarea rows='4' style='width:400px;' name='user[comment]' cols='30' name='comment'>" . $order['comment'] . "</textarea></div> |
| 1335 | - | ||
| 1336 | - <label>Îòïðàâêà ÑÌÑ:</label>"; | 1296 | + |
| 1297 | + <label>Îòïðàâêà ÑÌÑ:</label>"; | ||
| 1337 | global $setup; | 1298 | global $setup; |
| 1338 | $res = $setup->db->getAll ("select * from sms_tpl", array (), DB_FETCHMODE_ASSOC); | 1299 | $res = $setup->db->getAll ("select * from sms_tpl", array (), DB_FETCHMODE_ASSOC); |
| 1339 | echo " | 1300 | echo " |
| 1340 | <div class=info> | 1301 | <div class=info> |
| 1341 | <select name='sms_tpl' id='sms_tpl' style='width:300px'> | 1302 | <select name='sms_tpl' id='sms_tpl' style='width:300px'> |
| 1342 | - <option value='0'>ÂÛÁÐÀÒÜ ØÀÁËÎÍ</option>"; | 1303 | + <option value='0'>ÂÛÁÐÀÒÜ ØÀÁËÎÍ</option>"; |
| 1343 | foreach ($res as $row) | 1304 | foreach ($res as $row) |
| 1344 | { | 1305 | { |
| 1345 | echo "<option value='" . $row['id'] . "'>" . $row['title'] . "</option>"; | 1306 | echo "<option value='" . $row['id'] . "'>" . $row['title'] . "</option>"; |
| @@ -1347,14 +1308,14 @@ if (! isset ($_GET['action'])) | @@ -1347,14 +1308,14 @@ if (! isset ($_GET['action'])) | ||
| 1347 | echo "</select> | 1308 | echo "</select> |
| 1348 | </div>"; | 1309 | </div>"; |
| 1349 | $sms_count = $setup->db->getOne ("select count(*) from sms_history where order_id=?", array ( | 1310 | $sms_count = $setup->db->getOne ("select count(*) from sms_history where order_id=?", array ( |
| 1350 | - $order['id'] | 1311 | + $order['id'] |
| 1351 | )); | 1312 | )); |
| 1352 | echo "<div class=info><div style='float:left;margin-right:10px;'><textarea rows='4' style='width:400px;' name='sms_msg' id='sms_msg' cols='30' ></textarea><br /><input type='radio' name='sms_type' id='sms_type' value='l' checked />ëàòèíèöà <input type='radio' name='sms_type' id='sms_type' value='k' />êèðèëèöà Êîëëè÷åñòâî ñèìâîëîâ <span id='sms_c'>0</span> (<span id='sms_c_sum'></span>)</div>"; | 1313 | echo "<div class=info><div style='float:left;margin-right:10px;'><textarea rows='4' style='width:400px;' name='sms_msg' id='sms_msg' cols='30' ></textarea><br /><input type='radio' name='sms_type' id='sms_type' value='l' checked />ëàòèíèöà <input type='radio' name='sms_type' id='sms_type' value='k' />êèðèëèöà Êîëëè÷åñòâî ñèìâîëîâ <span id='sms_c'>0</span> (<span id='sms_c_sum'></span>)</div>"; |
| 1353 | echo "<div style='float:left'><a href='/admin.php/sms_history/?orderID=" . $order['id'] . "' target='_blank'>Èñòîðèÿ</a>"; | 1314 | echo "<div style='float:left'><a href='/admin.php/sms_history/?orderID=" . $order['id'] . "' target='_blank'>Èñòîðèÿ</a>"; |
| 1354 | echo "<br /><input type='submit' style='margin-top:4px;' class='submit_green' id='sms_send' value='Îòïðàâèòü' name='sms_send'> | 1315 | echo "<br /><input type='submit' style='margin-top:4px;' class='submit_green' id='sms_send' value='Îòïðàâèòü' name='sms_send'> |
| 1355 | - <br />Îòïðàâëåíî ÑÌÑ (" . $sms_count . ")</div>"; | 1316 | + <br />Îòïðàâëåíî ÑÌÑ (" . $sms_count . ")</div>"; |
| 1356 | echo "</div>"; | 1317 | echo "</div>"; |
| 1357 | - | 1318 | + |
| 1358 | echo "</div> | 1319 | echo "</div> |
| 1359 | <div style='float:right;'> | 1320 | <div style='float:right;'> |
| 1360 | <label>Äîñòàâêà</label>"; | 1321 | <label>Äîñòàâêà</label>"; |
| @@ -1365,31 +1326,31 @@ if (! isset ($_GET['action'])) | @@ -1365,31 +1326,31 @@ if (! isset ($_GET['action'])) | ||
| 1365 | viewBookSelectValue ('zlo_book_delivery', 'id', 'title', $order['delivery']); | 1326 | viewBookSelectValue ('zlo_book_delivery', 'id', 'title', $order['delivery']); |
| 1366 | echo "</select> | 1327 | echo "</select> |
| 1367 | </div>"; | 1328 | </div>"; |
| 1368 | - | ||
| 1369 | - echo " | 1329 | + |
| 1330 | + echo " | ||
| 1370 | <label>Äåêëàðàöèÿ ¹:</label> | 1331 | <label>Äåêëàðàöèÿ ¹:</label> |
| 1371 | <div class=info><input type='text' name='user[declaration]' style='width:300px;' class=\"validate[required]\" value='" . $order['declaration'] . "' id='declarationValidate'></div>"; | 1332 | <div class=info><input type='text' name='user[declaration]' style='width:300px;' class=\"validate[required]\" value='" . $order['declaration'] . "' id='declarationValidate'></div>"; |
| 1372 | - | ||
| 1373 | - echo " | 1333 | + |
| 1334 | + echo " | ||
| 1374 | <label>¹ ñêëàäà:</label> | 1335 | <label>¹ ñêëàäà:</label> |
| 1375 | <div class=info><input type='text' name='user[warehouse]' style='width:300px;' class=\"validate[required]\" value='" . $order['warehouse'] . "' id='warehouseValidate'></div>"; | 1336 | <div class=info><input type='text' name='user[warehouse]' style='width:300px;' class=\"validate[required]\" value='" . $order['warehouse'] . "' id='warehouseValidate'></div>"; |
| 1376 | - | ||
| 1377 | - echo " | 1337 | + |
| 1338 | + echo " | ||
| 1378 | <label>¹ íàêëàäíîé:</label> | 1339 | <label>¹ íàêëàäíîé:</label> |
| 1379 | <div class=info><input type='text' name='user[nakladnaya]' style='width:300px;' class=\"validate[required]\" value='" . $order['nakladnaya'] . "' id='nakladnayaValidate'></div>"; | 1340 | <div class=info><input type='text' name='user[nakladnaya]' style='width:300px;' class=\"validate[required]\" value='" . $order['nakladnaya'] . "' id='nakladnayaValidate'></div>"; |
| 1380 | - | 1341 | + |
| 1381 | $array_method = array ( | 1342 | $array_method = array ( |
| 1382 | "Îïëàòèòü íàëè÷íûìè", | 1343 | "Îïëàòèòü íàëè÷íûìè", |
| 1383 | "Îïëàòèòü íà êàðòó Ïðèâàò Áàíêà", | 1344 | "Îïëàòèòü íà êàðòó Ïðèâàò Áàíêà", |
| 1384 | "Îïëàòèòü ïî áåçíàëè÷íîìó ðàñ÷åòó", | 1345 | "Îïëàòèòü ïî áåçíàëè÷íîìó ðàñ÷åòó", |
| 1385 | "Îïëàòèòü Ïðàâåêñ-òåëåãðàô", | 1346 | "Îïëàòèòü Ïðàâåêñ-òåëåãðàô", |
| 1386 | "Íàëîæåííûì ïëàòåæîì", | 1347 | "Íàëîæåííûì ïëàòåæîì", |
| 1387 | - "Îïëàòèòü íà Áàíê Áîãóñëàâ" | 1348 | + "Îïëàòèòü íà Áàíê Áîãóñëàâ" |
| 1388 | ); | 1349 | ); |
| 1389 | echo " | 1350 | echo " |
| 1390 | - <div class=info> | ||
| 1391 | - <label>Ñïîñîá îïëàòû:</label> | ||
| 1392 | - <select name='user[payment]' style='width:300px'><option value=''></option>"; | 1351 | + <div class=info> |
| 1352 | + <label>Ñïîñîá îïëàòû:</label> | ||
| 1353 | + <select name='user[payment]' style='width:300px'><option value=''></option>"; | ||
| 1393 | foreach ($array_method as $method) | 1354 | foreach ($array_method as $method) |
| 1394 | { | 1355 | { |
| 1395 | echo '<option value="' . $method . '" '; | 1356 | echo '<option value="' . $method . '" '; |
| @@ -1399,20 +1360,20 @@ if (! isset ($_GET['action'])) | @@ -1399,20 +1360,20 @@ if (! isset ($_GET['action'])) | ||
| 1399 | } | 1360 | } |
| 1400 | echo "</select> | 1361 | echo "</select> |
| 1401 | </div>"; | 1362 | </div>"; |
| 1402 | - | 1363 | + |
| 1403 | echo "<label>Ñòðàõîâêà:</label> | 1364 | echo "<label>Ñòðàõîâêà:</label> |
| 1404 | <div class=info><input type='text' name='user[insurance]' style='width:300px;' class=\"validate[required]\" value='" . $order['insurance'] . "' id='insuranceValidate'></div>"; | 1365 | <div class=info><input type='text' name='user[insurance]' style='width:300px;' class=\"validate[required]\" value='" . $order['insurance'] . "' id='insuranceValidate'></div>"; |
| 1405 | 1366 | ||
| 1406 | - if ($_SESSION['admin']['id'] == 22 | ||
| 1407 | - || $_SESSION['admin']['id'] == 7 | ||
| 1408 | - || $_SESSION['admin']['id'] == 1 | 1367 | + if ($_SESSION['admin']['id'] == 22 |
| 1368 | + || $_SESSION['admin']['id'] == 7 | ||
| 1369 | + || $_SESSION['admin']['id'] == 1 | ||
| 1409 | || $_SESSION['admin']['id'] == 19 | 1370 | || $_SESSION['admin']['id'] == 19 |
| 1410 | || $_SESSION['admin']['id'] == 20 | 1371 | || $_SESSION['admin']['id'] == 20 |
| 1411 | ) | 1372 | ) |
| 1412 | { | 1373 | { |
| 1413 | $sumn_disabled = ''; | 1374 | $sumn_disabled = ''; |
| 1414 | } | 1375 | } |
| 1415 | - else | 1376 | + else |
| 1416 | { | 1377 | { |
| 1417 | $sumn_disabled = "disabled"; | 1378 | $sumn_disabled = "disabled"; |
| 1418 | } | 1379 | } |
| @@ -1421,33 +1382,33 @@ if (! isset ($_GET['action'])) | @@ -1421,33 +1382,33 @@ if (! isset ($_GET['action'])) | ||
| 1421 | <label>Ñóììà íàëîæåííîãî:</label> | 1382 | <label>Ñóììà íàëîæåííîãî:</label> |
| 1422 | <div class=info> | 1383 | <div class=info> |
| 1423 | <input type='text' name='user[sumn]' style='width:300px;' class=\"validate[required]\" value='" . $order['sumn'] . "' id='sumnValidate' $sumn_disabled>"; | 1384 | <input type='text' name='user[sumn]' style='width:300px;' class=\"validate[required]\" value='" . $order['sumn'] . "' id='sumnValidate' $sumn_disabled>"; |
| 1424 | - | 1385 | + |
| 1425 | if ($sumn_disabled != '') | 1386 | if ($sumn_disabled != '') |
| 1426 | { | 1387 | { |
| 1427 | echo "<input type='hidden' name='user[sumn]' style='width:300px;' class=\"validate[required]\" value='" . $order['sumn'] . "' id='sumnValidate'>"; | 1388 | echo "<input type='hidden' name='user[sumn]' style='width:300px;' class=\"validate[required]\" value='" . $order['sumn'] . "' id='sumnValidate'>"; |
| 1428 | } | 1389 | } |
| 1429 | - | 1390 | + |
| 1430 | echo " | 1391 | echo " |
| 1431 | </div><br /> | 1392 | </div><br /> |
| 1432 | - <div class=info> | ||
| 1433 | - <label>Îòïðàâêà çà ñ÷åò:</label> | ||
| 1434 | - <select name='user[sends]' style='width:300px'> | ||
| 1435 | - <option value=''></option>"; | ||
| 1436 | - | 1393 | + <div class=info> |
| 1394 | + <label>Îòïðàâêà çà ñ÷åò:</label> | ||
| 1395 | + <select name='user[sends]' style='width:300px'> | ||
| 1396 | + <option value=''></option>"; | ||
| 1397 | + | ||
| 1437 | // àõàõà | 1398 | // àõàõà |
| 1438 | foreach ( | 1399 | foreach ( |
| 1439 | array ( | 1400 | array ( |
| 1440 | "Ïîëó÷àòåëÿ", | 1401 | "Ïîëó÷àòåëÿ", |
| 1441 | - "Îòïðàâèòåëÿ" | 1402 | + "Îòïðàâèòåëÿ" |
| 1442 | ) as $method) | 1403 | ) as $method) |
| 1443 | { | 1404 | { |
| 1444 | echo '<option value="' . $method . '" '.($order['sends'] == $method ? 'selected' : '').'>' . $method . '</option>'; | 1405 | echo '<option value="' . $method . '" '.($order['sends'] == $method ? 'selected' : '').'>' . $method . '</option>'; |
| 1445 | } | 1406 | } |
| 1446 | - | 1407 | + |
| 1447 | echo " | 1408 | echo " |
| 1448 | </select> | 1409 | </select> |
| 1449 | </div>"; | 1410 | </div>"; |
| 1450 | - | 1411 | + |
| 1451 | echo "<label>Ãîðîä:</label> | 1412 | echo "<label>Ãîðîä:</label> |
| 1452 | <div class=info><input type='text' name='user[city]' style='width:300px;' class=\"validate[required]\" value='" . $order['city'] . "' id='cityValidate'></div> | 1413 | <div class=info><input type='text' name='user[city]' style='width:300px;' class=\"validate[required]\" value='" . $order['city'] . "' id='cityValidate'></div> |
| 1453 | 1414 | ||
| @@ -1456,8 +1417,8 @@ if (! isset ($_GET['action'])) | @@ -1456,8 +1417,8 @@ if (! isset ($_GET['action'])) | ||
| 1456 | 1417 | ||
| 1457 | <label>Êîìåíòàðèé (ìåíåäæåðà):</label> | 1418 | <label>Êîìåíòàðèé (ìåíåäæåðà):</label> |
| 1458 | <div class=info><textarea rows='4' id='mcomment' style='width:400px;' name='user[mcomment]' cols='30' name='mcomment'>" . $order['mcomment'] . "</textarea></div> | 1419 | <div class=info><textarea rows='4' id='mcomment' style='width:400px;' name='user[mcomment]' cols='30' name='mcomment'>" . $order['mcomment'] . "</textarea></div> |
| 1459 | - | ||
| 1460 | - "; | 1420 | + |
| 1421 | + "; | ||
| 1461 | $disabled = ""; | 1422 | $disabled = ""; |
| 1462 | if ($order['meneger'] > 0) | 1423 | if ($order['meneger'] > 0) |
| 1463 | { | 1424 | { |
| @@ -1466,11 +1427,11 @@ if (! isset ($_GET['action'])) | @@ -1466,11 +1427,11 @@ if (! isset ($_GET['action'])) | ||
| 1466 | $disabled = "disabled"; | 1427 | $disabled = "disabled"; |
| 1467 | } | 1428 | } |
| 1468 | } | 1429 | } |
| 1469 | - | 1430 | + |
| 1470 | // ==== Ìåíåäæåð ==== | 1431 | // ==== Ìåíåäæåð ==== |
| 1471 | - | 1432 | + |
| 1472 | $disabled = ""; | 1433 | $disabled = ""; |
| 1473 | - | 1434 | + |
| 1474 | if ($_SESSION['admin']['group'] != 1) | 1435 | if ($_SESSION['admin']['group'] != 1) |
| 1475 | { | 1436 | { |
| 1476 | $disabled = "disabled"; | 1437 | $disabled = "disabled"; |
| @@ -1478,11 +1439,11 @@ if (! isset ($_GET['action'])) | @@ -1478,11 +1439,11 @@ if (! isset ($_GET['action'])) | ||
| 1478 | 1439 | ||
| 1479 | echo " | 1440 | echo " |
| 1480 | <label>Ìåíåäæåð:</label> | 1441 | <label>Ìåíåäæåð:</label> |
| 1481 | - <div class=info> | ||
| 1482 | - <select name='meneger'>"; | ||
| 1483 | - | 1442 | + <div class=info> |
| 1443 | + <select name='meneger'>"; | ||
| 1444 | + | ||
| 1484 | $mass_manager = array (); | 1445 | $mass_manager = array (); |
| 1485 | - | 1446 | + |
| 1486 | $result_1 = mysql_query ("select * from zlo_admin"); | 1447 | $result_1 = mysql_query ("select * from zlo_admin"); |
| 1487 | while ($row = mysql_fetch_assoc ($result_1)) | 1448 | while ($row = mysql_fetch_assoc ($result_1)) |
| 1488 | { | 1449 | { |
| @@ -1491,52 +1452,52 @@ if (! isset ($_GET['action'])) | @@ -1491,52 +1452,52 @@ if (! isset ($_GET['action'])) | ||
| 1491 | $manager_id = $_SESSION['admin']['id']; | 1452 | $manager_id = $_SESSION['admin']['id']; |
| 1492 | $disabled = $row["id"] != $manager_id ? 'disabled' : ''; | 1453 | $disabled = $row["id"] != $manager_id ? 'disabled' : ''; |
| 1493 | } | 1454 | } |
| 1494 | - else | 1455 | + else |
| 1495 | { | 1456 | { |
| 1496 | $manager_id = $order['meneger']; | 1457 | $manager_id = $order['meneger']; |
| 1497 | $disabled = 'disabled'; | 1458 | $disabled = 'disabled'; |
| 1498 | } | 1459 | } |
| 1499 | - | 1460 | + |
| 1500 | if ($manager_id == $row["id"] || $_SESSION['admin']['group'] == 1) | 1461 | if ($manager_id == $row["id"] || $_SESSION['admin']['group'] == 1) |
| 1501 | { | 1462 | { |
| 1502 | $disabled = ''; | 1463 | $disabled = ''; |
| 1503 | } | 1464 | } |
| 1504 | 1465 | ||
| 1505 | echo "<option value='" . $row["id"] . "' " . ($manager_id == $row["id"] ? 'selected' : '') . " ".$disabled.">" . $row["username"] . "</option>"; | 1466 | echo "<option value='" . $row["id"] . "' " . ($manager_id == $row["id"] ? 'selected' : '') . " ".$disabled.">" . $row["username"] . "</option>"; |
| 1506 | - } | 1467 | + } |
| 1507 | 1468 | ||
| 1508 | echo "</select>"; | 1469 | echo "</select>"; |
| 1509 | - | 1470 | + |
| 1510 | echo "</div>"; | 1471 | echo "</div>"; |
| 1511 | - | 1472 | + |
| 1512 | // ==== ×åê ==== | 1473 | // ==== ×åê ==== |
| 1513 | - | 1474 | + |
| 1514 | $disabled = ""; | 1475 | $disabled = ""; |
| 1515 | - | 1476 | + |
| 1516 | if ($_SESSION['admin']['id'] != 7 and $_SESSION['admin']['id'] != 17) | 1477 | if ($_SESSION['admin']['id'] != 7 and $_SESSION['admin']['id'] != 17) |
| 1517 | { | 1478 | { |
| 1518 | $disabled = "disabled"; | 1479 | $disabled = "disabled"; |
| 1519 | } | 1480 | } |
| 1520 | - | 1481 | + |
| 1521 | echo " | 1482 | echo " |
| 1522 | <label>×åê:</label> | 1483 | <label>×åê:</label> |
| 1523 | <div class=info><input $disabled type='text' name='user[check]' style='width:300px;' class=\"validate[required]\" value='" . $order['check2'] . "' id='checkValidate'></div>"; | 1484 | <div class=info><input $disabled type='text' name='user[check]' style='width:300px;' class=\"validate[required]\" value='" . $order['check2'] . "' id='checkValidate'></div>"; |
| 1524 | - | 1485 | + |
| 1525 | if ($disabled == "disabled") | 1486 | if ($disabled == "disabled") |
| 1526 | { | 1487 | { |
| 1527 | echo "<input type='hidden' name='user[check]' value='" . $order['check2'] . "'>"; | 1488 | echo "<input type='hidden' name='user[check]' value='" . $order['check2'] . "'>"; |
| 1528 | } | 1489 | } |
| 1529 | - | 1490 | + |
| 1530 | echo "<label>SMS:</label> | 1491 | echo "<label>SMS:</label> |
| 1531 | <div class=info><input type='text' name='user[smst]' style='width:300px;' class=\"validate[required]\" value='" . $order['smst'] . "' id='smstValidate'></div>"; | 1492 | <div class=info><input type='text' name='user[smst]' style='width:300px;' class=\"validate[required]\" value='" . $order['smst'] . "' id='smstValidate'></div>"; |
| 1532 | - | 1493 | + |
| 1533 | echo "</div> | 1494 | echo "</div> |
| 1534 | </fieldset> | 1495 | </fieldset> |
| 1535 | <div class=clear></div> | 1496 | <div class=clear></div> |
| 1536 | </div>"; | 1497 | </div>"; |
| 1537 | - | 1498 | + |
| 1538 | // Òàáëèöà òîâàðîâ | 1499 | // Òàáëèöà òîâàðîâ |
| 1539 | - | 1500 | + |
| 1540 | $sql3 = "SELECT * FROM catalogs_orders_products | 1501 | $sql3 = "SELECT * FROM catalogs_orders_products |
| 1541 | WHERE `order_id`='" . $order['order_id'] . "' "; | 1502 | WHERE `order_id`='" . $order['order_id'] . "' "; |
| 1542 | $result3 = mysql_query ($sql3) or die (mysql_error ()); | 1503 | $result3 = mysql_query ($sql3) or die (mysql_error ()); |
| @@ -1556,9 +1517,9 @@ if (! isset ($_GET['action'])) | @@ -1556,9 +1517,9 @@ if (! isset ($_GET['action'])) | ||
| 1556 | <div class='quant'>Êîë.</div> | 1517 | <div class='quant'>Êîë.</div> |
| 1557 | <div class='price'>Öåíà</div> | 1518 | <div class='price'>Öåíà</div> |
| 1558 | <div class='total'>Ñóììà</div> | 1519 | <div class='total'>Ñóììà</div> |
| 1559 | - <div class='reservation'>Áðîíü</div> | ||
| 1560 | - <div class='status'>Ñòàòóñ</div> | ||
| 1561 | - <div class='status'>Âîçâðàò</div> | 1520 | + <div class='reservation'>Áðîíü</div> |
| 1521 | + <div class='status'>Ñòàòóñ</div> | ||
| 1522 | + <div class='status'>Âîçâðàò</div> | ||
| 1562 | <div class='onstock'>Íàëè÷èå</div> | 1523 | <div class='onstock'>Íàëè÷èå</div> |
| 1563 | <div class='control' style='float:right;'><a href='javascript:return false;' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a></div> | 1524 | <div class='control' style='float:right;'><a href='javascript:return false;' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a></div> |
| 1564 | <div class='clear'></div> | 1525 | <div class='clear'></div> |
| @@ -1575,7 +1536,7 @@ if (! isset ($_GET['action'])) | @@ -1575,7 +1536,7 @@ if (! isset ($_GET['action'])) | ||
| 1575 | <div id='livesearch(0)'></div> | 1536 | <div id='livesearch(0)'></div> |
| 1576 | </div> | 1537 | </div> |
| 1577 | <!-- ---> | 1538 | <!-- ---> |
| 1578 | - </div> | 1539 | + </div> |
| 1579 | <div class='brand' id='brand(0)'> </div> | 1540 | <div class='brand' id='brand(0)'> </div> |
| 1580 | <div class='title' id='title(0)'> </div> | 1541 | <div class='title' id='title(0)'> </div> |
| 1581 | <div class='size' id='size(0)'> </div> | 1542 | <div class='size' id='size(0)'> </div> |
| @@ -1583,88 +1544,90 @@ if (! isset ($_GET['action'])) | @@ -1583,88 +1544,90 @@ if (! isset ($_GET['action'])) | ||
| 1583 | <div class='quant'><input type='text' name='item[quant][]' value='1' id='quantValue(0)' onBlur='SumPerRow();'></div> | 1544 | <div class='quant'><input type='text' name='item[quant][]' value='1' id='quantValue(0)' onBlur='SumPerRow();'></div> |
| 1584 | <div class='price' id='price(0)'>0</div> | 1545 | <div class='price' id='price(0)'>0</div> |
| 1585 | <div class='total' id='total(0)'>0</div> | 1546 | <div class='total' id='total(0)'>0</div> |
| 1586 | - <div class='reservation'><input type='text' size='3' name='item[reservation][]' /></div> | 1547 | + <div class='reservation'><input type='text' size='3' name='item[reservation][]' /></div> |
| 1587 | <div class='status'>"; | 1548 | <div class='status'>"; |
| 1588 | echo '<input type="text" class="input_status" name="item[status][]" data-id="1" id="input_status_1" size="5" value="" /> | 1549 | echo '<input type="text" class="input_status" name="item[status][]" data-id="1" id="input_status_1" size="5" value="" /> |
| 1589 | - <div class="status_box" id="status_box_1" data-id="1"> | ||
| 1590 | - <ul> | ||
| 1591 | - <li data-id="1" class="name_city">Ì?</li> | ||
| 1592 | - <li data-id="1" class="name_city">Ìñòîê?</li> | ||
| 1593 | - <li data-id="1" class="name_city">Ãî?</li> | ||
| 1594 | - <li data-id="1" class="name_city">Ãð?</li> | ||
| 1595 | - <li data-id="1" class="name_city">Õ?</li> | ||
| 1596 | - <li data-id="1" class="name_city">Î?</li> | ||
| 1597 | - <li data-id="1" class="name_city">Ä?</li> | ||
| 1598 | - <li data-id="1" class="name_city">Á?</li> | ||
| 1599 | - <li data-id="1" class="name_city">Á2?</li> | ||
| 1600 | - <li data-id="1" class="name_city">Îñîê?</li> | ||
| 1601 | - <li data-id="1" class="name_city">áðàê</li> | ||
| 1602 | - <li data-id="1" class="name_city">áðîíü</li> | ||
| 1603 | - <li data-id="1" class="name_city">âåðíåò</li> | ||
| 1604 | - <li data-id="1" class="other"><i>Ââåäèòå</i></li> | ||
| 1605 | - </ul> | ||
| 1606 | - </div>'; | 1550 | + <div class="status_box" id="status_box_1" data-id="1"> |
| 1551 | + <ul> | ||
| 1552 | + <li data-id="1" class="name_city">Ì?</li> | ||
| 1553 | + <li data-id="1" class="name_city">Ìñòîê?</li> | ||
| 1554 | + <li data-id="1" class="name_city">Ãî?</li> | ||
| 1555 | + <li data-id="1" class="name_city">Ãð?</li> | ||
| 1556 | + <li data-id="1" class="name_city">Õ?</li> | ||
| 1557 | + <li data-id="1" class="name_city">Î?</li> | ||
| 1558 | + <li data-id="1" class="name_city">Ä?</li> | ||
| 1559 | + <li data-id="1" class="name_city">Á?</li> | ||
| 1560 | + <li data-id="1" class="name_city">Á2?</li> | ||
| 1561 | + <li data-id="1" class="name_city">Îñîê?</li> | ||
| 1562 | + <li data-id="1" class="name_city">áðàê</li> | ||
| 1563 | + <li data-id="1" class="name_city">áðîíü</li> | ||
| 1564 | + <li data-id="1" class="name_city">âåðíåò</li> | ||
| 1565 | + <li data-id="1" class="other"><i>Ââåäèòå</i></li> | ||
| 1566 | + </ul> | ||
| 1567 | + </div>'; | ||
| 1607 | echo "</div>"; | 1568 | echo "</div>"; |
| 1608 | - | 1569 | + |
| 1609 | echo " | 1570 | echo " |
| 1610 | <div class='status'> | 1571 | <div class='status'> |
| 1611 | <select name='item[vozvrat][]'> | 1572 | <select name='item[vozvrat][]'> |
| 1612 | - <option value=''></option> | ||
| 1613 | - <option value='äà' >äà</option> | ||
| 1614 | - <option value='íåò' >íåò</option> | ||
| 1615 | - </select> | 1573 | + <option value=''></option> |
| 1574 | + <option value='äà' >äà</option> | ||
| 1575 | + <option value='íåò' >íåò</option> | ||
| 1576 | + </select> | ||
| 1616 | </div>"; | 1577 | </div>"; |
| 1617 | 1578 | ||
| 1618 | echo " | 1579 | echo " |
| 1619 | - <div class='onstock' id='onstock(0)'></div> | ||
| 1620 | - | 1580 | + <div class='onstock' id='onstock(0)'></div> |
| 1581 | + | ||
| 1621 | <input type='hidden' name='item[mod_id][]' id='mod_idValue(0)' value=''> | 1582 | <input type='hidden' name='item[mod_id][]' id='mod_idValue(0)' value=''> |
| 1622 | <input type='hidden' name='item[product_id][]' id='product_idValue(0)' value=''> | 1583 | <input type='hidden' name='item[product_id][]' id='product_idValue(0)' value=''> |
| 1623 | <input type='hidden' name='item[brand_id][]' id='brand_idValue(0)' value=''> | 1584 | <input type='hidden' name='item[brand_id][]' id='brand_idValue(0)' value=''> |
| 1624 | <input type='hidden' name='item[price][]' id='priceValue(0)' value='0'> | 1585 | <input type='hidden' name='item[price][]' id='priceValue(0)' value='0'> |
| 1625 | <input type='hidden' name='item[total][]' id='totalValue(0)' value='0'> | 1586 | <input type='hidden' name='item[total][]' id='totalValue(0)' value='0'> |
| 1626 | - | 1587 | + |
| 1627 | <div class='control' style='float:right;'> | 1588 | <div class='control' style='float:right;'> |
| 1628 | <a href='javascript:return false;' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> | 1589 | <a href='javascript:return false;' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> |
| 1629 | <a href='javascript:return false;' onclick='DDivLine(0);'><img src='/account/pic/del.png' width='18px'></a> | 1590 | <a href='javascript:return false;' onclick='DDivLine(0);'><img src='/account/pic/del.png' width='18px'></a> |
| 1630 | </div> | 1591 | </div> |
| 1631 | - | 1592 | + |
| 1632 | <div class='clear'></div> | 1593 | <div class='clear'></div> |
| 1633 | </div><div style='clear:both;'></div> | 1594 | </div><div style='clear:both;'></div> |
| 1634 | </div> | 1595 | </div> |
| 1635 | - | 1596 | + |
| 1636 | <!---------------------------------------------------------------------------------->"; | 1597 | <!---------------------------------------------------------------------------------->"; |
| 1637 | - | 1598 | + |
| 1638 | while ($item_id = mysql_fetch_assoc ($result3)) | 1599 | while ($item_id = mysql_fetch_assoc ($result3)) |
| 1639 | { | 1600 | { |
| 1640 | $i ++; | 1601 | $i ++; |
| 1641 | - | 1602 | + |
| 1642 | // Èíôî î òîâàðå | 1603 | // Èíôî î òîâàðå |
| 1643 | $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine from catalogs_modifications as m | 1604 | $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine from catalogs_modifications as m |
| 1644 | - LEFT JOIN catalogs_products as p | ||
| 1645 | - ON p.id=m.product_id | ||
| 1646 | - WHERE m.id='" . $item_id['product_id'] . "' "; | 1605 | + LEFT JOIN catalogs_products as p |
| 1606 | + ON p.id=m.product_id | ||
| 1607 | + WHERE m.id='" . $item_id['product_id'] . "' "; | ||
| 1647 | $result4 = mysql_query ($sql4) or die (mysql_error ()); | 1608 | $result4 = mysql_query ($sql4) or die (mysql_error ()); |
| 1648 | if (mysql_affected_rows () == 11110) | 1609 | if (mysql_affected_rows () == 11110) |
| 1649 | { | 1610 | { |
| 1650 | $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine from catalogs_modifications as m | 1611 | $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine from catalogs_modifications as m |
| 1651 | - LEFT JOIN catalogs_products as p | ||
| 1652 | - ON p.id=m.product_id | 1612 | + LEFT JOIN catalogs_products as p |
| 1613 | + ON p.id=m.product_id | ||
| 1653 | WHERE m.code='" . $item_id['code'] . "' "; | 1614 | WHERE m.code='" . $item_id['code'] . "' "; |
| 1654 | $result4 = mysql_query ($sql4) or die (mysql_error ()); | 1615 | $result4 = mysql_query ($sql4) or die (mysql_error ()); |
| 1655 | } | 1616 | } |
| 1656 | if (mysql_affected_rows () != 0) | 1617 | if (mysql_affected_rows () != 0) |
| 1657 | { | 1618 | { |
| 1658 | $item = mysql_fetch_assoc ($result4); | 1619 | $item = mysql_fetch_assoc ($result4); |
| 1659 | - | 1620 | + |
| 1660 | if (! empty ($item['code'])) | 1621 | if (! empty ($item['code'])) |
| 1661 | { | 1622 | { |
| 1662 | // íàëè÷èå òîâàðà | 1623 | // íàëè÷èå òîâàðà |
| 1663 | - $sql5 = "SELECT c.name as city, o.count | 1624 | + $sql5 = " |
| 1625 | + SELECT c.name as city, o.count | ||
| 1664 | FROM catalogs_keys_products_cities as o | 1626 | FROM catalogs_keys_products_cities as o |
| 1665 | - LEFT JOIN catalogs_cities as c | ||
| 1666 | - ON o.city_id=c.id | ||
| 1667 | - WHERE o.mod_code='" . $item['code'] . "' AND o.count>0 "; | 1627 | + LEFT JOIN catalogs_cities as c |
| 1628 | + ON o.city_id=c.id | ||
| 1629 | + WHERE o.mod_code='" . $item['code'] . "' | ||
| 1630 | + AND o.count>0 "; | ||
| 1668 | // print $sql5; | 1631 | // print $sql5; |
| 1669 | $result5 = mysql_query ($sql5) or die (mysql_error ()); | 1632 | $result5 = mysql_query ($sql5) or die (mysql_error ()); |
| 1670 | if (mysql_affected_rows () != 0) | 1633 | if (mysql_affected_rows () != 0) |
| @@ -1692,7 +1655,7 @@ if (! isset ($_GET['action'])) | @@ -1692,7 +1655,7 @@ if (! isset ($_GET['action'])) | ||
| 1692 | else | 1655 | else |
| 1693 | { | 1656 | { |
| 1694 | echo " | 1657 | echo " |
| 1695 | - <input type='text' name='item[code][]' disabled value='" . $item['code'] . "' id='code($i)' autocomplete='off' onkeyup=flyFind(this.value,'($i)') onkeydown=selectFirst(event.keyCode)> | 1658 | + <input type='text' name='item[code][]' disabled value='" . $item['code'] . "' id='code($i)' autocomplete='off' onkeyup=flyFind(this.value,'($i)') onkeydown=selectFirst(event.keyCode)> |
| 1696 | <!-- search ---> | 1659 | <!-- search ---> |
| 1697 | <div class='livesearch-block'> | 1660 | <div class='livesearch-block'> |
| 1698 | <div id='livesearch($i)'></div> | 1661 | <div id='livesearch($i)'></div> |
| @@ -1700,8 +1663,8 @@ if (! isset ($_GET['action'])) | @@ -1700,8 +1663,8 @@ if (! isset ($_GET['action'])) | ||
| 1700 | <!-- --->"; | 1663 | <!-- --->"; |
| 1701 | echo "<input type='hidden' name='item[code][]' value='" . $item['code'] . "' />"; | 1664 | echo "<input type='hidden' name='item[code][]' value='" . $item['code'] . "' />"; |
| 1702 | } | 1665 | } |
| 1703 | - echo " | ||
| 1704 | - </div> | 1666 | + echo " |
| 1667 | + </div> | ||
| 1705 | <div class='brand' id='brand($i)'>" . viewBook ('catalogs_brends', $item['brend_id'], 'id', 'name') . " </div> | 1668 | <div class='brand' id='brand($i)'>" . viewBook ('catalogs_brends', $item['brend_id'], 'id', 'name') . " </div> |
| 1706 | <div class='title' id='title($i)'><a rel='msg' title='" . $item['name'] . "' href='http://extremstyle.ua/uploaded/pic/catalogs/products/" . $item['pic'] . "'>" . $item['name'] . "</a> </div> | 1669 | <div class='title' id='title($i)'><a rel='msg' title='" . $item['name'] . "' href='http://extremstyle.ua/uploaded/pic/catalogs/products/" . $item['pic'] . "'>" . $item['name'] . "</a> </div> |
| 1707 | <div class='size' id='size($i)'>" . $item['size'] . " </div> | 1670 | <div class='size' id='size($i)'>" . $item['size'] . " </div> |
| @@ -1709,7 +1672,7 @@ if (! isset ($_GET['action'])) | @@ -1709,7 +1672,7 @@ if (! isset ($_GET['action'])) | ||
| 1709 | <div class='quant'><input type='text' name='item[quant][]' value='" . $item_id['count'] . "' id='quantValue($i)' onBlur='SumPerRow();'></div> | 1672 | <div class='quant'><input type='text' name='item[quant][]' value='" . $item_id['count'] . "' id='quantValue($i)' onBlur='SumPerRow();'></div> |
| 1710 | <div class='price' id='price($i)'>" . "(" . $item_id['product_cine_id'] . ") " . $item['cine'] . "</div> | 1673 | <div class='price' id='price($i)'>" . "(" . $item_id['product_cine_id'] . ") " . $item['cine'] . "</div> |
| 1711 | <div class='total' id='total($i)'>" . ($item['cine'] * $item_id['count']) . "</div> | 1674 | <div class='total' id='total($i)'>" . ($item['cine'] * $item_id['count']) . "</div> |
| 1712 | - <div class='reservation'>"; | 1675 | + <div class='reservation'>"; |
| 1713 | if ($item_id['count'] == 0) | 1676 | if ($item_id['count'] == 0) |
| 1714 | { | 1677 | { |
| 1715 | echo "<input type='text' size='3' value='" . $item_id['reservation'] . "' disabled />"; | 1678 | echo "<input type='text' size='3' value='" . $item_id['reservation'] . "' disabled />"; |
| @@ -1719,86 +1682,86 @@ if (! isset ($_GET['action'])) | @@ -1719,86 +1682,86 @@ if (! isset ($_GET['action'])) | ||
| 1719 | { | 1682 | { |
| 1720 | // echo"<input type='text' size='3' name='item[reservation][]' value='".$item_id['reservation']."' />"; | 1683 | // echo"<input type='text' size='3' name='item[reservation][]' value='".$item_id['reservation']."' />"; |
| 1721 | echo "<select name='item[reservation][]'> | 1684 | echo "<select name='item[reservation][]'> |
| 1722 | - <option value=''></option> | ||
| 1723 | - <option value='Ì' " . ($item_id['reservation'] == 'Ì' ? 'selected' : '') . ">Ì</option> | ||
| 1724 | - <option value='Ìñòîê' " . ($item_id['reservation'] == 'Ìñòîê' ? 'selected' : '') . ">Ìñòîê</option> | ||
| 1725 | - <option value='Ãî' " . ($item_id['reservation'] == 'Ãî' ? 'selected' : '') . ">Ãî</option> | ||
| 1726 | - <option value='Ãð' " . ($item_id['reservation'] == 'Ãð' ? 'selected' : '') . ">Ãð</option> | ||
| 1727 | - <option value='Õ' " . ($item_id['reservation'] == 'Õ' ? 'selected' : '') . ">Õ</option> | ||
| 1728 | - <option value='Î' " . ($item_id['reservation'] == 'Î' ? 'selected' : '') . ">Î</option> | ||
| 1729 | - <option value='Ä' " . ($item_id['reservation'] == 'Ä' ? 'selected' : '') . ">Ä</option> | ||
| 1730 | - <option value='Á' " . ($item_id['reservation'] == 'Á' ? 'selected' : '') . ">Á</option> | ||
| 1731 | - <option value='Á2' " . ($item_id['reservation'] == 'Á2' ? 'selected' : '') . ">Á2</option> | ||
| 1732 | - <option value='Îñîê' " . ($item_id['reservation'] == 'Îñîê' ? 'selected' : '') . ">Îñîê</option> | ||
| 1733 | - </select>"; | 1685 | + <option value=''></option> |
| 1686 | + <option value='Ì' " . ($item_id['reservation'] == 'Ì' ? 'selected' : '') . ">Ì</option> | ||
| 1687 | + <option value='Ìñòîê' " . ($item_id['reservation'] == 'Ìñòîê' ? 'selected' : '') . ">Ìñòîê</option> | ||
| 1688 | + <option value='Ãî' " . ($item_id['reservation'] == 'Ãî' ? 'selected' : '') . ">Ãî</option> | ||
| 1689 | + <option value='Ãð' " . ($item_id['reservation'] == 'Ãð' ? 'selected' : '') . ">Ãð</option> | ||
| 1690 | + <option value='Õ' " . ($item_id['reservation'] == 'Õ' ? 'selected' : '') . ">Õ</option> | ||
| 1691 | + <option value='Î' " . ($item_id['reservation'] == 'Î' ? 'selected' : '') . ">Î</option> | ||
| 1692 | + <option value='Ä' " . ($item_id['reservation'] == 'Ä' ? 'selected' : '') . ">Ä</option> | ||
| 1693 | + <option value='Á' " . ($item_id['reservation'] == 'Á' ? 'selected' : '') . ">Á</option> | ||
| 1694 | + <option value='Á2' " . ($item_id['reservation'] == 'Á2' ? 'selected' : '') . ">Á2</option> | ||
| 1695 | + <option value='Îñîê' " . ($item_id['reservation'] == 'Îñîê' ? 'selected' : '') . ">Îñîê</option> | ||
| 1696 | + </select>"; | ||
| 1734 | } | 1697 | } |
| 1735 | echo "</div> | 1698 | echo "</div> |
| 1736 | <div class='status'>"; | 1699 | <div class='status'>"; |
| 1737 | echo '<input type="text" class="input_status" name="item[status][]" data-id="' . $item_id['id'] . '" id="input_status_' . $item_id['id'] . '" size="5" value="' . $item_id['status'] . '" /> | 1700 | echo '<input type="text" class="input_status" name="item[status][]" data-id="' . $item_id['id'] . '" id="input_status_' . $item_id['id'] . '" size="5" value="' . $item_id['status'] . '" /> |
| 1738 | - <div class="status_box" id="status_box_' . $item_id['id'] . '" data-id="' . $item_id['id'] . '"> | ||
| 1739 | - <ul> | ||
| 1740 | - <li data-id="' . $item_id['id'] . '" class="name_city">Ì?</li> | ||
| 1741 | - <li data-id="' . $item_id['id'] . '" class="name_city">Ìñòîê?</li> | ||
| 1742 | - <li data-id="' . $item_id['id'] . '" class="name_city">Ãî?</li> | ||
| 1743 | - <li data-id="' . $item_id['id'] . '" class="name_city">Ãð?</li> | ||
| 1744 | - <li data-id="' . $item_id['id'] . '" class="name_city">Õ?</li> | ||
| 1745 | - <li data-id="' . $item_id['id'] . '" class="name_city">Î?</li> | ||
| 1746 | - <li data-id="' . $item_id['id'] . '" class="name_city">Ä?</li> | ||
| 1747 | - <li data-id="' . $item_id['id'] . '" class="name_city">Á?</li> | ||
| 1748 | - <li data-id="' . $item_id['id'] . '" class="name_city">Á2?</li> | ||
| 1749 | - <li data-id="1" class="name_city">Îñîê?</li> | ||
| 1750 | - <li data-id="' . $item_id['id'] . '" class="name_city">áðàê</li> | ||
| 1751 | - <li data-id="' . $item_id['id'] . '" class="name_city">áðîíü</li> | ||
| 1752 | - <li data-id="' . $item_id['id'] . '" class="name_city">âåðíåò</li> | ||
| 1753 | - <li data-id="' . $item_id['id'] . '" class="name_city">Ó íàñ</li> | ||
| 1754 | - <li data-id="' . $item_id['id'] . '" class="other"><i>Ââåäèòå</i></li> | ||
| 1755 | - </ul> | ||
| 1756 | - </div>'; | 1701 | + <div class="status_box" id="status_box_' . $item_id['id'] . '" data-id="' . $item_id['id'] . '"> |
| 1702 | + <ul> | ||
| 1703 | + <li data-id="' . $item_id['id'] . '" class="name_city">Ì?</li> | ||
| 1704 | + <li data-id="' . $item_id['id'] . '" class="name_city">Ìñòîê?</li> | ||
| 1705 | + <li data-id="' . $item_id['id'] . '" class="name_city">Ãî?</li> | ||
| 1706 | + <li data-id="' . $item_id['id'] . '" class="name_city">Ãð?</li> | ||
| 1707 | + <li data-id="' . $item_id['id'] . '" class="name_city">Õ?</li> | ||
| 1708 | + <li data-id="' . $item_id['id'] . '" class="name_city">Î?</li> | ||
| 1709 | + <li data-id="' . $item_id['id'] . '" class="name_city">Ä?</li> | ||
| 1710 | + <li data-id="' . $item_id['id'] . '" class="name_city">Á?</li> | ||
| 1711 | + <li data-id="' . $item_id['id'] . '" class="name_city">Á2?</li> | ||
| 1712 | + <li data-id="1" class="name_city">Îñîê?</li> | ||
| 1713 | + <li data-id="' . $item_id['id'] . '" class="name_city">áðàê</li> | ||
| 1714 | + <li data-id="' . $item_id['id'] . '" class="name_city">áðîíü</li> | ||
| 1715 | + <li data-id="' . $item_id['id'] . '" class="name_city">âåðíåò</li> | ||
| 1716 | + <li data-id="' . $item_id['id'] . '" class="name_city">Ó íàñ</li> | ||
| 1717 | + <li data-id="' . $item_id['id'] . '" class="other"><i>Ââåäèòå</i></li> | ||
| 1718 | + </ul> | ||
| 1719 | + </div>'; | ||
| 1757 | echo "</div>"; | 1720 | echo "</div>"; |
| 1758 | echo "<div class='status'><select name='item[vozvrat][]'> | 1721 | echo "<div class='status'><select name='item[vozvrat][]'> |
| 1759 | - <option value=''></option> | ||
| 1760 | - <option value='äà' " . ($item_id['vozvrat'] == 'äà' ? 'selected' : '') . ">äà</option> | ||
| 1761 | - <option value='íåò' " . ($item_id['vozvrat'] == 'íåò' ? 'selected' : '') . ">íåò</option> | ||
| 1762 | - </select></div>"; | 1722 | + <option value=''></option> |
| 1723 | + <option value='äà' " . ($item_id['vozvrat'] == 'äà' ? 'selected' : '') . ">äà</option> | ||
| 1724 | + <option value='íåò' " . ($item_id['vozvrat'] == 'íåò' ? 'selected' : '') . ">íåò</option> | ||
| 1725 | + </select></div>"; | ||
| 1763 | echo " | 1726 | echo " |
| 1764 | - <div class='onstock' id='onstock($i)'>$onStockDesc</div> | 1727 | + <div class='onstock' id='onstock($i)'>$onStockDesc</div> |
| 1728 | + | ||
| 1765 | 1729 | ||
| 1766 | - | ||
| 1767 | - <input type='hidden' name='item[mod_id][]' id='mod_idValue($i)' value='" . $item['mod_id'] . "'> | 1730 | + <input type='hidden' name='item[mod_id][]' id='mod_idValue($i)' value='" . $item['mod_id'] . "'> |
| 1768 | <input type='hidden' name='item[product_id][]' id='product_idValue($i)' value='" . $item['product_id'] . "'> | 1731 | <input type='hidden' name='item[product_id][]' id='product_idValue($i)' value='" . $item['product_id'] . "'> |
| 1769 | <input type='hidden' name='item[brand_id][]' id='brand_idValue($i)' value='" . $item['brend_id'] . "'> | 1732 | <input type='hidden' name='item[brand_id][]' id='brand_idValue($i)' value='" . $item['brend_id'] . "'> |
| 1770 | <input type='hidden' name='item[price][]' id='priceValue($i)' value='" . $item_id['product_cine_id'] . "'> | 1733 | <input type='hidden' name='item[price][]' id='priceValue($i)' value='" . $item_id['product_cine_id'] . "'> |
| 1771 | <input type='hidden' name='item[total][]' id='totalValue($i)' value='" . ($item_id['product_cine_id'] * $item_id['count']) . "'> | 1734 | <input type='hidden' name='item[total][]' id='totalValue($i)' value='" . ($item_id['product_cine_id'] * $item_id['count']) . "'> |
| 1772 | - | 1735 | + |
| 1773 | <div class='control' style='float:right;'> | 1736 | <div class='control' style='float:right;'> |
| 1774 | <a href='javascript:return false;' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> | 1737 | <a href='javascript:return false;' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> |
| 1775 | <!--a href='javascript:return false;' onclick='RemoveDivLine($i);'><img src='/account/pic/del.png' width='18px'></a--> | 1738 | <!--a href='javascript:return false;' onclick='RemoveDivLine($i);'><img src='/account/pic/del.png' width='18px'></a--> |
| 1776 | - <a href='javascript:return false;' onclick='DDivLine($i);'><img src='/account/pic/del.png' width='18px'></a> | 1739 | + <a href='javascript:return false;' onclick='DDivLine($i);'><img src='/account/pic/del.png' width='18px'></a> |
| 1777 | </div> | 1740 | </div> |
| 1778 | - | 1741 | + |
| 1779 | <div class='clear'></div> | 1742 | <div class='clear'></div> |
| 1780 | </div><div style='clear:both;'></div> | 1743 | </div><div style='clear:both;'></div> |
| 1781 | </div>"; | 1744 | </div>"; |
| 1782 | } | 1745 | } |
| 1783 | } | 1746 | } |
| 1784 | - | 1747 | + |
| 1785 | echo "</div> | 1748 | echo "</div> |
| 1786 | - | 1749 | + |
| 1787 | <div class='report'> | 1750 | <div class='report'> |
| 1788 | - Ñòîèìîñòü äîñòàâêè <input type='text' size='10' name='cost_delivery' id='cost_delivery' value='" . $order['cost_delivery'] . "' onBlur='SumPerRow()' /> | ||
| 1789 | - Âñåãî: <span id='quantity'>0</span> òîâàðîâ íà <span id='summary'>0</span> ãðí. | 1751 | + Ñòîèìîñòü äîñòàâêè <input type='text' size='10' name='cost_delivery' id='cost_delivery' value='" . $order['cost_delivery'] . "' onBlur='SumPerRow()' /> |
| 1752 | + Âñåãî: <span id='quantity'>0</span> òîâàðîâ íà <span id='summary'>0</span> ãðí. | ||
| 1790 | </div> | 1753 | </div> |
| 1791 | - | 1754 | + |
| 1792 | <input type='hidden' name='summary' value='' id='summaryValue'> | 1755 | <input type='hidden' name='summary' value='' id='summaryValue'> |
| 1793 | <input type='hidden' name='user_id' value='" . $order['user_id'] . "'> | 1756 | <input type='hidden' name='user_id' value='" . $order['user_id'] . "'> |
| 1794 | <input type='hidden' name='order_id' value='" . $order['order_id'] . "'> | 1757 | <input type='hidden' name='order_id' value='" . $order['order_id'] . "'> |
| 1795 | <input type='hidden' name='send' value='edit-order'> "; | 1758 | <input type='hidden' name='send' value='edit-order'> "; |
| 1796 | - | 1759 | + |
| 1797 | echo "<div class='clear'></div>"; | 1760 | echo "<div class='clear'></div>"; |
| 1798 | - | 1761 | + |
| 1799 | // Äëÿ XML ôàéëà | 1762 | // Äëÿ XML ôàéëà |
| 1800 | $dateFromDate = ExtractDate ((date ('Y-m-d H:i:s', $order['mktime']))); | 1763 | $dateFromDate = ExtractDate ((date ('Y-m-d H:i:s', $order['mktime']))); |
| 1801 | - | 1764 | + |
| 1802 | // Ñìåíà ñòàòóñà | 1765 | // Ñìåíà ñòàòóñà |
| 1803 | if ($order['status'] != 6) | 1766 | if ($order['status'] != 6) |
| 1804 | { | 1767 | { |
| @@ -1828,10 +1791,13 @@ if (! isset ($_GET['action'])) | @@ -1828,10 +1791,13 @@ if (! isset ($_GET['action'])) | ||
| 1828 | // ================= | 1791 | // ================= |
| 1829 | // ==== CONTROL ==== | 1792 | // ==== CONTROL ==== |
| 1830 | // ================= | 1793 | // ================= |
| 1831 | - | 1794 | + |
| 1832 | if ($order['work_user'] > 0 && $order['work_user'] != $_SESSION['admin']['id']) | 1795 | if ($order['work_user'] > 0 && $order['work_user'] != $_SESSION['admin']['id']) |
| 1833 | { | 1796 | { |
| 1834 | - $r = mysql_query ('select login from zlo_admin where id=' . $order['work_user']); | 1797 | + $r = mysql_query (' |
| 1798 | + select login | ||
| 1799 | + from zlo_admin | ||
| 1800 | + where id=' . $order['work_user']); | ||
| 1835 | print '<tr><td colspan="12">Ñ ýòèì çàêàçîì óæå ðàáîòàåò ïîëüçîâàòåëü ' . mysql_result ($r, 0) . '</td></tr>'; | 1801 | print '<tr><td colspan="12">Ñ ýòèì çàêàçîì óæå ðàáîòàåò ïîëüçîâàòåëü ' . mysql_result ($r, 0) . '</td></tr>'; |
| 1836 | } | 1802 | } |
| 1837 | else | 1803 | else |
| @@ -1844,23 +1810,23 @@ if (! isset ($_GET['action'])) | @@ -1844,23 +1810,23 @@ if (! isset ($_GET['action'])) | ||
| 1844 | echo "<div id='records'><a href='/account/admin/orders.php?action=print&order_id=" . $order['order_id'] . "' target='_new' class='button-save'>Ïå÷àòü</a></div>"; | 1810 | echo "<div id='records'><a href='/account/admin/orders.php?action=print&order_id=" . $order['order_id'] . "' target='_new' class='button-save'>Ïå÷àòü</a></div>"; |
| 1845 | // âûõîä | 1811 | // âûõîä |
| 1846 | echo "<div id='records'><a href='" . $url_l . "&exit_order_id=" . $order['order_id'] . "' class='button-save'>Âûéòè èç çàêàçà</a></div>"; | 1812 | echo "<div id='records'><a href='" . $url_l . "&exit_order_id=" . $order['order_id'] . "' class='button-save'>Âûéòè èç çàêàçà</a></div>"; |
| 1847 | - // óäàëèòü | 1813 | + // óäàëèòü |
| 1848 | if ($_SESSION['admin']['group'] == 1) // òîëüêî àäìèí | 1814 | if ($_SESSION['admin']['group'] == 1) // òîëüêî àäìèí |
| 1849 | { | 1815 | { |
| 1850 | echo "<div id='records'><a href='" . $url_l . "&del_order=1&order_id=" . $order['order_id'] . "' class='button-save need-confirm red'>Óäàëèòü çàêàç</a></div>"; | 1816 | echo "<div id='records'><a href='" . $url_l . "&del_order=1&order_id=" . $order['order_id'] . "' class='button-save need-confirm red'>Óäàëèòü çàêàç</a></div>"; |
| 1851 | } | 1817 | } |
| 1852 | } | 1818 | } |
| 1853 | - | 1819 | + |
| 1854 | /* | 1820 | /* |
| 1855 | * if (is_file($_SERVER['DOCUMENT_ROOT']."/xml/".$dateFromDate[0]."/".$dateFromDate[1]."/order_".$order['order_id'].".xml")) { | 1821 | * if (is_file($_SERVER['DOCUMENT_ROOT']."/xml/".$dateFromDate[0]."/".$dateFromDate[1]."/order_".$order['order_id'].".xml")) { |
| 1856 | * echo"<div id='records'><a href='/xml/".$dateFromDate[0]."/".$dateFromDate[1]."/order_".$order['order_id'].".xml'><img src='/account/pic/xml.png' width='38px' title='xml çàêàç ïîëüçîâàòåëÿ'></a></div>"; | 1822 | * echo"<div id='records'><a href='/xml/".$dateFromDate[0]."/".$dateFromDate[1]."/order_".$order['order_id'].".xml'><img src='/account/pic/xml.png' width='38px' title='xml çàêàç ïîëüçîâàòåëÿ'></a></div>"; |
| 1857 | * } | 1823 | * } |
| 1858 | */ | 1824 | */ |
| 1859 | - | 1825 | + |
| 1860 | echo "</div>"; | 1826 | echo "</div>"; |
| 1861 | } | 1827 | } |
| 1862 | echo "</fieldset></div>"; | 1828 | echo "</fieldset></div>"; |
| 1863 | - | 1829 | + |
| 1864 | echo "</div>"; | 1830 | echo "</div>"; |
| 1865 | } | 1831 | } |
| 1866 | } | 1832 | } |
| @@ -1868,19 +1834,19 @@ if (! isset ($_GET['action'])) | @@ -1868,19 +1834,19 @@ if (! isset ($_GET['action'])) | ||
| 1868 | { | 1834 | { |
| 1869 | echo "<p>Ïóñòî</p>"; | 1835 | echo "<p>Ïóñòî</p>"; |
| 1870 | } | 1836 | } |
| 1871 | - | 1837 | + |
| 1872 | print '</td></tr>'; | 1838 | print '</td></tr>'; |
| 1873 | } | 1839 | } |
| 1874 | - | 1840 | + |
| 1875 | $i1 ++; | 1841 | $i1 ++; |
| 1876 | } | 1842 | } |
| 1877 | - | 1843 | + |
| 1878 | echo "</table>"; | 1844 | echo "</table>"; |
| 1879 | - | 1845 | + |
| 1880 | echo "</div>"; | 1846 | echo "</div>"; |
| 1881 | - | 1847 | + |
| 1882 | // === Pager | 1848 | // === Pager |
| 1883 | - | 1849 | + |
| 1884 | echo " | 1850 | echo " |
| 1885 | <div class='grid-pager'> | 1851 | <div class='grid-pager'> |
| 1886 | " . pagerGetShow ($pager) . " | 1852 | " . pagerGetShow ($pager) . " |
| @@ -1894,105 +1860,115 @@ if (! isset ($_GET['action'])) | @@ -1894,105 +1860,115 @@ if (! isset ($_GET['action'])) | ||
| 1894 | 1860 | ||
| 1895 | if (isset ($_GET['action']) && $_GET['action'] == 'show') | 1861 | if (isset ($_GET['action']) && $_GET['action'] == 'show') |
| 1896 | { | 1862 | { |
| 1897 | - | 1863 | + |
| 1898 | // Òàáñ | 1864 | // Òàáñ |
| 1899 | - | 1865 | + |
| 1900 | echo "<div class='order-tabs'>"; | 1866 | echo "<div class='order-tabs'>"; |
| 1901 | - $sql = "SELECT * FROM zlo_book_status WHERE id IN (1,2,4,5)"; | 1867 | + $sql = " |
| 1868 | + SELECT * | ||
| 1869 | + FROM zlo_book_status | ||
| 1870 | + WHERE id IN (1,2,4,5)"; | ||
| 1902 | $result = mysql_query ($sql) or die (mysql_error ()); | 1871 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 1903 | if (mysql_affected_rows () != 0) | 1872 | if (mysql_affected_rows () != 0) |
| 1904 | { | 1873 | { |
| 1905 | while ($row = mysql_fetch_assoc ($result)) | 1874 | while ($row = mysql_fetch_assoc ($result)) |
| 1906 | { | 1875 | { |
| 1907 | - | 1876 | + |
| 1908 | // Ïîäñ÷åò êîëè÷åñòâà çàêàçîâ ïî ñòàòóñó | 1877 | // Ïîäñ÷åò êîëè÷åñòâà çàêàçîâ ïî ñòàòóñó |
| 1909 | - $sql2 = "SELECT count(`id`) AS calc FROM catalogs_orders WHERE status='" . $row['id'] . "' AND user_id=" . $_GET['user'] . ""; | 1878 | + $sql2 = " |
| 1879 | + SELECT count(`id`) AS calc | ||
| 1880 | + FROM catalogs_orders | ||
| 1881 | + WHERE status='" . $row['id'] . "' | ||
| 1882 | + AND user_id=" . $_GET['user']; | ||
| 1910 | $result2 = mysql_query ($sql2) or die (mysql_error ()); | 1883 | $result2 = mysql_query ($sql2) or die (mysql_error ()); |
| 1911 | $row2 = mysql_fetch_assoc ($result2); | 1884 | $row2 = mysql_fetch_assoc ($result2); |
| 1912 | - | 1885 | + |
| 1913 | echo "<div class='status-tabs' onclick=\"location.href='" . urlQueryChange2 ('status', $row['id']) . "&page=1'\">" . $row['title'] . "(" . $row2['calc'] . ")</div>"; | 1886 | echo "<div class='status-tabs' onclick=\"location.href='" . urlQueryChange2 ('status', $row['id']) . "&page=1'\">" . $row['title'] . "(" . $row2['calc'] . ")</div>"; |
| 1914 | } | 1887 | } |
| 1915 | } | 1888 | } |
| 1916 | echo "</div> | 1889 | echo "</div> |
| 1917 | <div class='clear'></div> | 1890 | <div class='clear'></div> |
| 1918 | "; | 1891 | "; |
| 1919 | - | 1892 | + |
| 1920 | if (! isset ($_GET['status'])) | 1893 | if (! isset ($_GET['status'])) |
| 1921 | { | 1894 | { |
| 1922 | $_GET['status'] = 1; | 1895 | $_GET['status'] = 1; |
| 1923 | } | 1896 | } |
| 1924 | - | 1897 | + |
| 1925 | // =========== Ãåíåðèì òàáëèöó =========== | 1898 | // =========== Ãåíåðèì òàáëèöó =========== |
| 1926 | - | ||
| 1927 | - $sql = "SELECT o.*, o.name as username, o.adress as address, o.phone as tel, o.phonemob as tel2, u.group, o.id as order_id | ||
| 1928 | - FROM catalogs_orders as o | ||
| 1929 | - LEFT JOIN zlo_users as u on u.id=o.user_id | ||
| 1930 | - WHERE u.id=" . $_GET['user'] . " AND o.status=" . $_GET['status'] . " ORDER BY mktime DESC "; | 1899 | + |
| 1900 | + $sql = " | ||
| 1901 | + SELECT o.*, o.name as username, o.adress as address, o.phone as tel, o.phonemob as tel2, u.group, o.id as order_id | ||
| 1902 | + FROM catalogs_orders as o | ||
| 1903 | + LEFT JOIN zlo_users as u on u.id=o.user_id | ||
| 1904 | + WHERE u.id=" . $_GET['user'] . " | ||
| 1905 | + AND o.status=" . $_GET['status'] . " | ||
| 1906 | + ORDER BY mktime DESC "; | ||
| 1931 | $pager['sql'] = $sql; | 1907 | $pager['sql'] = $sql; |
| 1932 | $pager = pagerGetRun ($pager, 10, 15); // echo$pager['sql']; | 1908 | $pager = pagerGetRun ($pager, 10, 15); // echo$pager['sql']; |
| 1933 | $result = mysql_query ($pager['sql']) or die (mysql_error ()); | 1909 | $result = mysql_query ($pager['sql']) or die (mysql_error ()); |
| 1934 | if (mysql_affected_rows () != 0) | 1910 | if (mysql_affected_rows () != 0) |
| 1935 | { | 1911 | { |
| 1936 | - | 1912 | + |
| 1937 | // =================== | 1913 | // =================== |
| 1938 | // === ÏÐÎÄÎËÆÅÍÈÅ === | 1914 | // === ÏÐÎÄÎËÆÅÍÈÅ === |
| 1939 | // =================== | 1915 | // =================== |
| 1940 | - | 1916 | + |
| 1941 | while ($order = mysql_fetch_assoc ($result)) | 1917 | while ($order = mysql_fetch_assoc ($result)) |
| 1942 | { | 1918 | { |
| 1943 | - | 1919 | + |
| 1944 | echo "<div class='orders'>"; | 1920 | echo "<div class='orders'>"; |
| 1945 | - | 1921 | + |
| 1946 | echo "<div class='order-info-all'> | 1922 | echo "<div class='order-info-all'> |
| 1947 | - | 1923 | + |
| 1948 | <div class=order-info> | 1924 | <div class=order-info> |
| 1949 | <h4>Çàêàç #" . $order['order_id'] . "<br> | 1925 | <h4>Çàêàç #" . $order['order_id'] . "<br> |
| 1950 | Äàòà: " . date ('Y-m-d H:i:s', $order['mktime']) . " | 1926 | Äàòà: " . date ('Y-m-d H:i:s', $order['mktime']) . " |
| 1951 | </h4> | 1927 | </h4> |
| 1952 | <fieldset id='order-info' style='background: " . $order['color'] . ";'> | 1928 | <fieldset id='order-info' style='background: " . $order['color'] . ";'> |
| 1953 | - <legend>Êëèåíò</legend> | ||
| 1954 | - | 1929 | + <legend>Êëèåíò</legend> |
| 1930 | + | ||
| 1955 | <label>Êëèåíò:</label> | 1931 | <label>Êëèåíò:</label> |
| 1956 | <div class=info><a href='/admin.php/users/?action=edit&user=" . $order['user_id'] . "'>" . $order['username'] . "</a> </div> | 1932 | <div class=info><a href='/admin.php/users/?action=edit&user=" . $order['user_id'] . "'>" . $order['username'] . "</a> </div> |
| 1957 | 1933 | ||
| 1958 | <label>Òåë:</label> | 1934 | <label>Òåë:</label> |
| 1959 | <div class=info>" . $order['tel'] . " </div> | 1935 | <div class=info>" . $order['tel'] . " </div> |
| 1960 | - | 1936 | + |
| 1961 | <label>Òåë 2:</label> | 1937 | <label>Òåë 2:</label> |
| 1962 | <div class=info>" . $order['tel2'] . " </div> | 1938 | <div class=info>" . $order['tel2'] . " </div> |
| 1963 | - | 1939 | + |
| 1964 | <label>Ãðóïïà:</label> | 1940 | <label>Ãðóïïà:</label> |
| 1965 | <div class=info>" . viewBook ('zlo_users_group', $order['group'], 'id', 'name') . " </div> | 1941 | <div class=info>" . viewBook ('zlo_users_group', $order['group'], 'id', 'name') . " </div> |
| 1966 | - | 1942 | + |
| 1967 | <div class=clear></div> | 1943 | <div class=clear></div> |
| 1968 | <a class='history' href='/admin.php/orders/?action=show&user=" . $order['user_id'] . "'>[Èñòîðèÿ çàêàçîâ]</a> | 1944 | <a class='history' href='/admin.php/orders/?action=show&user=" . $order['user_id'] . "'>[Èñòîðèÿ çàêàçîâ]</a> |
| 1969 | - | 1945 | + |
| 1970 | </fieldset> | 1946 | </fieldset> |
| 1971 | 1947 | ||
| 1972 | <fieldset id='order-info' style='background: " . $order['color'] . ";'> | 1948 | <fieldset id='order-info' style='background: " . $order['color'] . ";'> |
| 1973 | <legend>Äîñòàâêà</legend> | 1949 | <legend>Äîñòàâêà</legend> |
| 1974 | - | 1950 | + |
| 1975 | <label>Äîñòàâêà:</label> | 1951 | <label>Äîñòàâêà:</label> |
| 1976 | <div class=info>" . viewBook ('zlo_book_delivery', $order['delivery'], 'id', 'title') . " </div> | 1952 | <div class=info>" . viewBook ('zlo_book_delivery', $order['delivery'], 'id', 'title') . " </div> |
| 1977 | - | 1953 | + |
| 1978 | <label>Ãîðîä:</label> | 1954 | <label>Ãîðîä:</label> |
| 1979 | <div class=info>" . $order['city'] . " </div> | 1955 | <div class=info>" . $order['city'] . " </div> |
| 1980 | - | 1956 | + |
| 1981 | <label>Àäðåñ:</label> | 1957 | <label>Àäðåñ:</label> |
| 1982 | <div class=info>" . $order['address'] . " </div> | 1958 | <div class=info>" . $order['address'] . " </div> |
| 1983 | - | 1959 | + |
| 1984 | <label>Èíôî:</label> | 1960 | <label>Èíôî:</label> |
| 1985 | <div class=info> " . $order['comment'] . " </div> | 1961 | <div class=info> " . $order['comment'] . " </div> |
| 1986 | - | 1962 | + |
| 1987 | <div class=clear></div> | 1963 | <div class=clear></div> |
| 1988 | - | 1964 | + |
| 1989 | </fieldset> | 1965 | </fieldset> |
| 1990 | <div class=clear></div> | 1966 | <div class=clear></div> |
| 1991 | </div> | 1967 | </div> |
| 1992 | </div>"; | 1968 | </div>"; |
| 1993 | - | 1969 | + |
| 1994 | // Òàáëèöà òîâàðîâ | 1970 | // Òàáëèöà òîâàðîâ |
| 1995 | - | 1971 | + |
| 1996 | echo " | 1972 | echo " |
| 1997 | <div class='order-details'> | 1973 | <div class='order-details'> |
| 1998 | <fieldset id='order-details'> | 1974 | <fieldset id='order-details'> |
| @@ -2011,68 +1987,66 @@ if (isset ($_GET['action']) && $_GET['action'] == 'show') | @@ -2011,68 +1987,66 @@ if (isset ($_GET['action']) && $_GET['action'] == 'show') | ||
| 2011 | <td>Íàëè÷èå</td> | 1987 | <td>Íàëè÷èå</td> |
| 2012 | <td></td> | 1988 | <td></td> |
| 2013 | </tr>"; | 1989 | </tr>"; |
| 2014 | - | 1990 | + |
| 2015 | $sql3 = " | 1991 | $sql3 = " |
| 2016 | SELECT o . * , m.*, m.product_id as mod_id, op.* , p.* | 1992 | SELECT o . * , m.*, m.product_id as mod_id, op.* , p.* |
| 2017 | - FROM catalogs_orders AS o | 1993 | + FROM catalogs_orders AS o |
| 2018 | LEFT JOIN catalogs_orders_products as op ON op.order_id=o.id | 1994 | LEFT JOIN catalogs_orders_products as op ON op.order_id=o.id |
| 2019 | - LEFT JOIN catalogs_modifications AS m ON m.id = op.product_id | ||
| 2020 | - LEFT JOIN catalogs_products AS p ON p.id = m.product_id | 1995 | + LEFT JOIN catalogs_modifications AS m ON m.id = op.product_id |
| 1996 | + LEFT JOIN catalogs_products AS p ON p.id = m.product_id | ||
| 2021 | WHERE o.id='" . $order['order_id'] . "'"; | 1997 | WHERE o.id='" . $order['order_id'] . "'"; |
| 2022 | $result3 = mysql_query ($sql3) or die (mysql_error ()); | 1998 | $result3 = mysql_query ($sql3) or die (mysql_error ()); |
| 2023 | if (mysql_affected_rows () != 0) | 1999 | if (mysql_affected_rows () != 0) |
| 2024 | { | 2000 | { |
| 2025 | while ($item = mysql_fetch_assoc ($result3)) | 2001 | while ($item = mysql_fetch_assoc ($result3)) |
| 2026 | { | 2002 | { |
| 2003 | + $i ++; | ||
| 2004 | + | ||
| 2005 | + // íàëè÷èå òîâàðà | ||
| 2006 | + $sql5 = "SELECT c.name as city, o.count | ||
| 2007 | + FROM catalogs_keys_products_cities as o | ||
| 2008 | + LEFT JOIN catalogs_cities as c | ||
| 2009 | + ON o.city_id=c.id | ||
| 2010 | + WHERE o.mod_code='" . $item['code'] . "' AND o.count>0 "; | ||
| 2011 | + $result5 = mysql_query ($sql5) or die (mysql_error ()); | ||
| 2012 | + if (mysql_affected_rows () != 0) | ||
| 2027 | { | 2013 | { |
| 2028 | - $i ++; | ||
| 2029 | - | ||
| 2030 | - // íàëè÷èå òîâàðà | ||
| 2031 | - $sql5 = "SELECT c.name as city, o.count | ||
| 2032 | - FROM catalogs_keys_products_cities as o | ||
| 2033 | - LEFT JOIN catalogs_cities as c | ||
| 2034 | - ON o.city_id=c.id | ||
| 2035 | - WHERE o.mod_code='" . $item['code'] . "' AND o.count>0 "; | ||
| 2036 | - $result5 = mysql_query ($sql5) or die (mysql_error ()); | ||
| 2037 | - if (mysql_affected_rows () != 0) | ||
| 2038 | - { | ||
| 2039 | - $onStockDesc = ''; | ||
| 2040 | - while ($onStock = mysql_fetch_assoc ($result5)) | ||
| 2041 | - { | ||
| 2042 | - $onStockDesc .= $onStock['city'] . "(" . $onStock['count'] . ") "; | ||
| 2043 | - } | ||
| 2044 | - } | ||
| 2045 | - else | 2014 | + $onStockDesc = ''; |
| 2015 | + while ($onStock = mysql_fetch_assoc ($result5)) | ||
| 2046 | { | 2016 | { |
| 2047 | - $onStockDesc = 'íåò'; | 2017 | + $onStockDesc .= $onStock['city'] . "(" . $onStock['count'] . ") "; |
| 2048 | } | 2018 | } |
| 2049 | - | ||
| 2050 | - echo "<tr> | ||
| 2051 | - <td>$i .</td> | ||
| 2052 | - <td>" . $item['code'] . "</td> | ||
| 2053 | - <td>" . viewBook ('catalogs_brends', $item['brend_id'], 'id', 'name') . "</td> | ||
| 2054 | - <td><a href='/" . $item['rubric_id'] . "-catalogs/" . $item['translit'] . "-" . $item['id'] . "/' target='_new'>" . $item['name'] . "</a></td> | ||
| 2055 | - <td>" . $item['size'] . "</td> | ||
| 2056 | - <td>" . $item['color'] . "</td> | ||
| 2057 | - <td>" . $item['count'] . "</td> | ||
| 2058 | - <td>" . $item['cine'] . "</td> | ||
| 2059 | - <td>" . ($item['cine'] * $item['count']) . "</td> | ||
| 2060 | - <td>" . $onStockDesc . "</td> | ||
| 2061 | - <td></td> | ||
| 2062 | - </tr>"; | ||
| 2063 | } | 2019 | } |
| 2020 | + else | ||
| 2021 | + { | ||
| 2022 | + $onStockDesc = 'íåò'; | ||
| 2023 | + } | ||
| 2024 | + | ||
| 2025 | + echo "<tr> | ||
| 2026 | + <td>$i .</td> | ||
| 2027 | + <td>" . $item['code'] . "</td> | ||
| 2028 | + <td>" . viewBook ('catalogs_brends', $item['brend_id'], 'id', 'name') . "</td> | ||
| 2029 | + <td><a href='/" . $item['rubric_id'] . "-catalogs/" . $item['translit'] . "-" . $item['id'] . "/' target='_new'>" . $item['name'] . "</a></td> | ||
| 2030 | + <td>" . $item['size'] . "</td> | ||
| 2031 | + <td>" . $item['color'] . "</td> | ||
| 2032 | + <td>" . $item['count'] . "</td> | ||
| 2033 | + <td>" . $item['cine'] . "</td> | ||
| 2034 | + <td>" . ($item['cine'] * $item['count']) . "</td> | ||
| 2035 | + <td>" . $onStockDesc . "</td> | ||
| 2036 | + <td></td> | ||
| 2037 | + </tr>"; | ||
| 2064 | } | 2038 | } |
| 2065 | } | 2039 | } |
| 2066 | - | 2040 | + |
| 2067 | echo "</table> | 2041 | echo "</table> |
| 2068 | - <b>Îáùàÿ ñóììà: " . $order['total'] . " ãðí.</b> | 2042 | + <b>Îáùàÿ ñóììà: " . $order['total'] . " ãðí.</b> |
| 2069 | </div>"; | 2043 | </div>"; |
| 2070 | - | 2044 | + |
| 2071 | echo "<div class='clear'></div></div>"; | 2045 | echo "<div class='clear'></div></div>"; |
| 2072 | } | 2046 | } |
| 2073 | - | 2047 | + |
| 2074 | // === Pager | 2048 | // === Pager |
| 2075 | - | 2049 | + |
| 2076 | echo "<div class='grid-pager'> | 2050 | echo "<div class='grid-pager'> |
| 2077 | " . pagerGetShow ($pager) . " | 2051 | " . pagerGetShow ($pager) . " |
| 2078 | </div>"; | 2052 | </div>"; |
| @@ -2085,9 +2059,9 @@ if (isset ($_GET['action']) && $_GET['action'] == 'show') | @@ -2085,9 +2059,9 @@ if (isset ($_GET['action']) && $_GET['action'] == 'show') | ||
| 2085 | 2059 | ||
| 2086 | if (isset ($_GET['action']) && $_GET['action'] == 'edit') | 2060 | if (isset ($_GET['action']) && $_GET['action'] == 'edit') |
| 2087 | { | 2061 | { |
| 2088 | - | 2062 | + |
| 2089 | // Òàáñ | 2063 | // Òàáñ |
| 2090 | - | 2064 | + |
| 2091 | if (! isset ($_GET['status'])) | 2065 | if (! isset ($_GET['status'])) |
| 2092 | { | 2066 | { |
| 2093 | $status = 1; | 2067 | $status = 1; |
| @@ -2096,7 +2070,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2096,7 +2070,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2096 | { | 2070 | { |
| 2097 | $status = $_GET['status']; | 2071 | $status = $_GET['status']; |
| 2098 | } | 2072 | } |
| 2099 | - | 2073 | + |
| 2100 | echo "<div class='order-tabs'>"; | 2074 | echo "<div class='order-tabs'>"; |
| 2101 | $sql = "SELECT * FROM zlo_book_status WHERE id IN (1,2,4,5)"; | 2075 | $sql = "SELECT * FROM zlo_book_status WHERE id IN (1,2,4,5)"; |
| 2102 | $result = mysql_query ($sql) or die (mysql_error ()); | 2076 | $result = mysql_query ($sql) or die (mysql_error ()); |
| @@ -2104,21 +2078,21 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2104,21 +2078,21 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2104 | { | 2078 | { |
| 2105 | while ($row = mysql_fetch_assoc ($result)) | 2079 | while ($row = mysql_fetch_assoc ($result)) |
| 2106 | { | 2080 | { |
| 2107 | - | 2081 | + |
| 2108 | // Ïîäñ÷åò êîëè÷åñòâà çàêàçîâ ïî ñòàòóñó | 2082 | // Ïîäñ÷åò êîëè÷åñòâà çàêàçîâ ïî ñòàòóñó |
| 2109 | $sql2 = "SELECT count(`id`) AS calc FROM catalogs_orders WHERE status='" . $row['id'] . "' AND user_id=" . $_GET['user'] . ""; | 2083 | $sql2 = "SELECT count(`id`) AS calc FROM catalogs_orders WHERE status='" . $row['id'] . "' AND user_id=" . $_GET['user'] . ""; |
| 2110 | $result2 = mysql_query ($sql2) or die (mysql_error ()); | 2084 | $result2 = mysql_query ($sql2) or die (mysql_error ()); |
| 2111 | $row2 = mysql_fetch_assoc ($result2); | 2085 | $row2 = mysql_fetch_assoc ($result2); |
| 2112 | - | 2086 | + |
| 2113 | echo "<div class='status-tabs' onclick=\"location.href='" . urlQueryChange2 ('status', $row['id']) . "&page=1'\">" . $row['title'] . "(" . $row2['calc'] . ")</div>"; | 2087 | echo "<div class='status-tabs' onclick=\"location.href='" . urlQueryChange2 ('status', $row['id']) . "&page=1'\">" . $row['title'] . "(" . $row2['calc'] . ")</div>"; |
| 2114 | } | 2088 | } |
| 2115 | } | 2089 | } |
| 2116 | echo "</div> | 2090 | echo "</div> |
| 2117 | <div class='clear'></div> | 2091 | <div class='clear'></div> |
| 2118 | "; | 2092 | "; |
| 2119 | - | 2093 | + |
| 2120 | // =========== Ãåíåðèì òàáëèöó =========== | 2094 | // =========== Ãåíåðèì òàáëèöó =========== |
| 2121 | - | 2095 | + |
| 2122 | $sql = "SELECT o.*, o.name as username, o.adress as address, o.phone as tel, o.phonemob as tel2, u.group, o.id as order_id, o.adress as address, g.color | 2096 | $sql = "SELECT o.*, o.name as username, o.adress as address, o.phone as tel, o.phonemob as tel2, u.group, o.id as order_id, o.adress as address, g.color |
| 2123 | FROM catalogs_orders as o | 2097 | FROM catalogs_orders as o |
| 2124 | LEFT JOIN zlo_users as u ON u.id=o.user_id | 2098 | LEFT JOIN zlo_users as u ON u.id=o.user_id |
| @@ -2127,39 +2101,45 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2127,39 +2101,45 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2127 | $result = mysql_query ($sql) or die (mysql_error ()); | 2101 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 2128 | if (mysql_affected_rows () != 0) | 2102 | if (mysql_affected_rows () != 0) |
| 2129 | { | 2103 | { |
| 2130 | - | 2104 | + |
| 2131 | $order = mysql_fetch_assoc ($result); | 2105 | $order = mysql_fetch_assoc ($result); |
| 2132 | - | 2106 | + |
| 2133 | echo "<form action='' method='POST' name='edit_order' id='add-item'>"; | 2107 | echo "<form action='' method='POST' name='edit_order' id='add-item'>"; |
| 2134 | echo "<div class='orders'>"; | 2108 | echo "<div class='orders'>"; |
| 2135 | - | 2109 | + |
| 2136 | echo " | 2110 | echo " |
| 2137 | <div class=order-info> | 2111 | <div class=order-info> |
| 2138 | <fieldset id='order-info' style='background: " . $order['color'] . ";'> | 2112 | <fieldset id='order-info' style='background: " . $order['color'] . ";'> |
| 2139 | - <legend>Çàêàç #" . $order['order_id'] . " Cóììà: " . $order['total'] . " ãðí.</legend> | ||
| 2140 | - | 2113 | + <legend>Çàêàç #" . $order['order_id'] . " Cóììà: " . $order['total'] . " ãðí.</legend> |
| 2114 | + | ||
| 2141 | <label>Äàòà:</label> | 2115 | <label>Äàòà:</label> |
| 2142 | <div class=info>" . date ('Y-m-d H:i:s', $order['mktime']) . "</div> | 2116 | <div class=info>" . date ('Y-m-d H:i:s', $order['mktime']) . "</div> |
| 2143 | - | ||
| 2144 | - <label>Îïëà÷åí:</label> | ||
| 2145 | - <div class=info> | ||
| 2146 | - <input type='radio' name='paid' value='1' " . (($order['paid'] == 1) ? 'checked' : '') . "> äà<Br> | ||
| 2147 | - <input type='radio' name='paid' value='0' " . (($order['paid'] == 0) ? 'checked' : '') . "> íåò | ||
| 2148 | - </div> | ||
| 2149 | - | ||
| 2150 | - <label>Ìåòêà:</label> | ||
| 2151 | - <div class=info> | ||
| 2152 | - <select name='label'>"; | ||
| 2153 | - | 2117 | + |
| 2118 | + <label>Îïëà÷åí:</label> | ||
| 2119 | + <div class=info> | ||
| 2120 | + <input type='radio' name='paid' value='1' " . (($order['paid'] == 1) ? 'checked' : '') . "> äà<Br> | ||
| 2121 | + <input type='radio' name='paid' value='0' " . (($order['paid'] == 0) ? 'checked' : '') . "> íåò | ||
| 2122 | + </div> | ||
| 2123 | + | ||
| 2124 | + <label>Ìåòêà:</label> | ||
| 2125 | + <div class=info> | ||
| 2126 | + <select name='label'>"; | ||
| 2127 | + | ||
| 2154 | for ($i = 0; $i <= 10; $i ++) | 2128 | for ($i = 0; $i <= 10; $i ++) |
| 2155 | { | 2129 | { |
| 2130 | + // ***** Àäìèí ðåæèì ***** | ||
| 2131 | + if (in_array ($i, array (9, 10)) && ! in_array ($_SESSION['admin']['id'], array (1, 19, 20))) | ||
| 2132 | + { | ||
| 2133 | + CONTINUE; | ||
| 2134 | + } | ||
| 2135 | + | ||
| 2156 | print '<option value="' . $i . '" ' . (($order['label'] == $i) ? 'selected' : '') . '>' . $i . '</option>'; | 2136 | print '<option value="' . $i . '" ' . (($order['label'] == $i) ? 'selected' : '') . '>' . $i . '</option>'; |
| 2157 | } | 2137 | } |
| 2158 | - | ||
| 2159 | - echo "</select> | ||
| 2160 | - </div> | ||
| 2161 | - | ||
| 2162 | - <label>Êëèåíò:</label> | 2138 | + |
| 2139 | + echo "</select> | ||
| 2140 | + </div> | ||
| 2141 | + | ||
| 2142 | + <label>Êëèåíò:</label> | ||
| 2163 | <div class=info> | 2143 | <div class=info> |
| 2164 | <input type='text' name='user[username]' value='" . $order['username'] . "' disabled='disabled'> | 2144 | <input type='text' name='user[username]' value='" . $order['username'] . "' disabled='disabled'> |
| 2165 | <input type='hidden' name='user[username]' value='" . $order['username'] . "'> | 2145 | <input type='hidden' name='user[username]' value='" . $order['username'] . "'> |
| @@ -2170,19 +2150,19 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2170,19 +2150,19 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2170 | <input type='text' name='user[email]' value='" . $order['email'] . "' disabled='disabled'> | 2150 | <input type='text' name='user[email]' value='" . $order['email'] . "' disabled='disabled'> |
| 2171 | <input type='hidden' name='user[email]' value='" . $order['email'] . "'> | 2151 | <input type='hidden' name='user[email]' value='" . $order['email'] . "'> |
| 2172 | </div> | 2152 | </div> |
| 2173 | - | 2153 | + |
| 2174 | <label>Òåëåôîí:</label> | 2154 | <label>Òåëåôîí:</label> |
| 2175 | <div class=info> | 2155 | <div class=info> |
| 2176 | <input type='text' name='user[tel]' value='" . $order['tel'] . "' disabled='disabled'> | 2156 | <input type='text' name='user[tel]' value='" . $order['tel'] . "' disabled='disabled'> |
| 2177 | <input type='hidden' name='user[tel]' value='" . $order['tel'] . "'> | 2157 | <input type='hidden' name='user[tel]' value='" . $order['tel'] . "'> |
| 2178 | </div> | 2158 | </div> |
| 2179 | - | 2159 | + |
| 2180 | <label>Òåëåôîí 2:</label> | 2160 | <label>Òåëåôîí 2:</label> |
| 2181 | <div class=info> | 2161 | <div class=info> |
| 2182 | <input type='text' name='user[tel2]' value='" . $order['tel2'] . "' disabled='disabled'> | 2162 | <input type='text' name='user[tel2]' value='" . $order['tel2'] . "' disabled='disabled'> |
| 2183 | <input type='hidden' name='user[tel2]' value='" . $order['tel2'] . "'> | 2163 | <input type='hidden' name='user[tel2]' value='" . $order['tel2'] . "'> |
| 2184 | </div> | 2164 | </div> |
| 2185 | - | 2165 | + |
| 2186 | <label>Äîñòàâêà</label>"; | 2166 | <label>Äîñòàâêà</label>"; |
| 2187 | echo " | 2167 | echo " |
| 2188 | <div class=info> | 2168 | <div class=info> |
| @@ -2190,8 +2170,8 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2190,8 +2170,8 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2190 | viewBookSelectValue ('zlo_book_delivery', 'id', 'title', $order['delivery']); | 2170 | viewBookSelectValue ('zlo_book_delivery', 'id', 'title', $order['delivery']); |
| 2191 | echo "</select> | 2171 | echo "</select> |
| 2192 | </div>"; | 2172 | </div>"; |
| 2193 | - | ||
| 2194 | - echo " | 2173 | + |
| 2174 | + echo " | ||
| 2195 | <label>Ãîðîä:</label> | 2175 | <label>Ãîðîä:</label> |
| 2196 | <div class=info><input type='text' name='user[city]' class=\"validate[required]\" value='" . $order['city'] . "' id='cityValidate'> </div> | 2176 | <div class=info><input type='text' name='user[city]' class=\"validate[required]\" value='" . $order['city'] . "' id='cityValidate'> </div> |
| 2197 | 2177 | ||
| @@ -2200,19 +2180,19 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2200,19 +2180,19 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2200 | 2180 | ||
| 2201 | <label>Êîìåíòàðèé:</label> | 2181 | <label>Êîìåíòàðèé:</label> |
| 2202 | <div class=info><textarea rows='4' style='width:400px;' name='user[comment]' cols='30' name='comment'>" . $order['comment'] . "</textarea></div> | 2182 | <div class=info><textarea rows='4' style='width:400px;' name='user[comment]' cols='30' name='comment'>" . $order['comment'] . "</textarea></div> |
| 2203 | - | 2183 | + |
| 2204 | <label>Êîìåíòàðèé (ìåíåäæåðà):</label> | 2184 | <label>Êîìåíòàðèé (ìåíåäæåðà):</label> |
| 2205 | <div class=info><textarea rows='4' id='mcomment' style='width:400px;' name='user[mcomment]' cols='30' name='mcomment'>" . $order['mcomment'] . "</textarea></div> | 2185 | <div class=info><textarea rows='4' id='mcomment' style='width:400px;' name='user[mcomment]' cols='30' name='mcomment'>" . $order['mcomment'] . "</textarea></div> |
| 2206 | 2186 | ||
| 2207 | - "; | ||
| 2208 | - | 2187 | + "; |
| 2188 | + | ||
| 2209 | echo " | 2189 | echo " |
| 2210 | </fieldset> | 2190 | </fieldset> |
| 2211 | <div class=clear></div> | 2191 | <div class=clear></div> |
| 2212 | </div>"; | 2192 | </div>"; |
| 2213 | - | 2193 | + |
| 2214 | // Òàáëèöà òîâàðîâ | 2194 | // Òàáëèöà òîâàðîâ |
| 2215 | - | 2195 | + |
| 2216 | $sql3 = "SELECT * FROM catalogs_orders_products | 2196 | $sql3 = "SELECT * FROM catalogs_orders_products |
| 2217 | WHERE `order_id`='" . $order['order_id'] . "' "; | 2197 | WHERE `order_id`='" . $order['order_id'] . "' "; |
| 2218 | $result3 = mysql_query ($sql3) or die (mysql_error ()); | 2198 | $result3 = mysql_query ($sql3) or die (mysql_error ()); |
| @@ -2248,7 +2228,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2248,7 +2228,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2248 | <div id='livesearch(0)'></div> | 2228 | <div id='livesearch(0)'></div> |
| 2249 | </div> | 2229 | </div> |
| 2250 | <!-- ---> | 2230 | <!-- ---> |
| 2251 | - </div> | 2231 | + </div> |
| 2252 | <div class='brand' id='brand(0)'> </div> | 2232 | <div class='brand' id='brand(0)'> </div> |
| 2253 | <div class='title' id='title(0)'> </div> | 2233 | <div class='title' id='title(0)'> </div> |
| 2254 | <div class='size' id='size(0)'> </div> | 2234 | <div class='size' id='size(0)'> </div> |
| @@ -2257,43 +2237,43 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2257,43 +2237,43 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2257 | <div class='price' id='price(0)'>0</div> | 2237 | <div class='price' id='price(0)'>0</div> |
| 2258 | <div class='total' id='total(0)'>0</div> | 2238 | <div class='total' id='total(0)'>0</div> |
| 2259 | <div class='onstock' id='onstock(0)'></div> | 2239 | <div class='onstock' id='onstock(0)'></div> |
| 2260 | - | 2240 | + |
| 2261 | <input type='hidden' name='item[mod_id][]' id='mod_idValue(0)' value=''> | 2241 | <input type='hidden' name='item[mod_id][]' id='mod_idValue(0)' value=''> |
| 2262 | <input type='hidden' name='item[product_id][]' id='product_idValue(0)' value=''> | 2242 | <input type='hidden' name='item[product_id][]' id='product_idValue(0)' value=''> |
| 2263 | <input type='hidden' name='item[brand_id][]' id='brand_idValue(0)' value=''> | 2243 | <input type='hidden' name='item[brand_id][]' id='brand_idValue(0)' value=''> |
| 2264 | <input type='hidden' name='item[price][]' id='priceValue(0)' value='0'> | 2244 | <input type='hidden' name='item[price][]' id='priceValue(0)' value='0'> |
| 2265 | <input type='hidden' name='item[total][]' id='totalValue(0)' value='0'> | 2245 | <input type='hidden' name='item[total][]' id='totalValue(0)' value='0'> |
| 2266 | - | 2246 | + |
| 2267 | <div class='control'> | 2247 | <div class='control'> |
| 2268 | <a href='#' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> | 2248 | <a href='#' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> |
| 2269 | <a href='#' onclick='RemoveDivLine(0);'><img src='/account/pic/del.png' width='18px'></a> | 2249 | <a href='#' onclick='RemoveDivLine(0);'><img src='/account/pic/del.png' width='18px'></a> |
| 2270 | </div> | 2250 | </div> |
| 2271 | - | 2251 | + |
| 2272 | <div class='clear'></div> | 2252 | <div class='clear'></div> |
| 2273 | </div> | 2253 | </div> |
| 2274 | </div> | 2254 | </div> |
| 2275 | <!---------------------------------------------------------------------------------->"; | 2255 | <!---------------------------------------------------------------------------------->"; |
| 2276 | - | 2256 | + |
| 2277 | while ($item_id = mysql_fetch_assoc ($result3)) | 2257 | while ($item_id = mysql_fetch_assoc ($result3)) |
| 2278 | { | 2258 | { |
| 2279 | $i ++; | 2259 | $i ++; |
| 2280 | - | 2260 | + |
| 2281 | // Èíôî î òîâàðå | 2261 | // Èíôî î òîâàðå |
| 2282 | $sql4 = "SELECT m.*, m.id as mod_id, p.* from catalogs_modifications as m | 2262 | $sql4 = "SELECT m.*, m.id as mod_id, p.* from catalogs_modifications as m |
| 2283 | - LEFT JOIN catalogs_products as p | ||
| 2284 | - ON p.id=m.product_id | 2263 | + LEFT JOIN catalogs_products as p |
| 2264 | + ON p.id=m.product_id | ||
| 2285 | WHERE m.id='" . $item_id['product_id'] . "' "; | 2265 | WHERE m.id='" . $item_id['product_id'] . "' "; |
| 2286 | - | 2266 | + |
| 2287 | $result4 = mysql_query ($sql4) or die (mysql_error ()); | 2267 | $result4 = mysql_query ($sql4) or die (mysql_error ()); |
| 2288 | if (mysql_affected_rows () != 0) | 2268 | if (mysql_affected_rows () != 0) |
| 2289 | { | 2269 | { |
| 2290 | $item = mysql_fetch_assoc ($result4); | 2270 | $item = mysql_fetch_assoc ($result4); |
| 2291 | - | 2271 | + |
| 2292 | // íàëè÷èå òîâàðà | 2272 | // íàëè÷èå òîâàðà |
| 2293 | $sql5 = "SELECT c.name as city, o.count | 2273 | $sql5 = "SELECT c.name as city, o.count |
| 2294 | FROM catalogs_keys_products_cities as o | 2274 | FROM catalogs_keys_products_cities as o |
| 2295 | LEFT JOIN catalogs_cities as c | 2275 | LEFT JOIN catalogs_cities as c |
| 2296 | - ON o.city_id=c.id | 2276 | + ON o.city_id=c.id |
| 2297 | WHERE o.mod_code='" . $item['code'] . "' AND o.count>0 "; | 2277 | WHERE o.mod_code='" . $item['code'] . "' AND o.count>0 "; |
| 2298 | $result5 = mysql_query ($sql5) or die (mysql_error ()); | 2278 | $result5 = mysql_query ($sql5) or die (mysql_error ()); |
| 2299 | if (mysql_affected_rows () != 0) | 2279 | if (mysql_affected_rows () != 0) |
| @@ -2308,7 +2288,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2308,7 +2288,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2308 | { | 2288 | { |
| 2309 | $onStock = 'íåò'; | 2289 | $onStock = 'íåò'; |
| 2310 | } | 2290 | } |
| 2311 | - | 2291 | + |
| 2312 | echo "<div id='line$i' " . (($item_id['count'] == 0) ? "style='background:#ffc5c5;'" : "") . "> | 2292 | echo "<div id='line$i' " . (($item_id['count'] == 0) ? "style='background:#ffc5c5;'" : "") . "> |
| 2313 | <div class='row'> | 2293 | <div class='row'> |
| 2314 | <div class='count' id='id($i)'>$i</div> | 2294 | <div class='count' id='id($i)'>$i</div> |
| @@ -2319,7 +2299,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2319,7 +2299,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2319 | <div id='livesearch($i)'></div> | 2299 | <div id='livesearch($i)'></div> |
| 2320 | </div> | 2300 | </div> |
| 2321 | <!-- ---> | 2301 | <!-- ---> |
| 2322 | - </div> | 2302 | + </div> |
| 2323 | <div class='brand' id='brand($i)'>" . viewBook ('catalogs_brends', $item['brend_id'], 'id', 'name') . " </div> | 2303 | <div class='brand' id='brand($i)'>" . viewBook ('catalogs_brends', $item['brend_id'], 'id', 'name') . " </div> |
| 2324 | <div class='title' id='title($i)'><a rel='msg' title='" . $item['name'] . "' href='http://extremstyle.ua/uploaded/pic/catalogs/products/" . $item['pic'] . "'>" . $item['name'] . "</a> </div> | 2304 | <div class='title' id='title($i)'><a rel='msg' title='" . $item['name'] . "' href='http://extremstyle.ua/uploaded/pic/catalogs/products/" . $item['pic'] . "'>" . $item['name'] . "</a> </div> |
| 2325 | <div class='size' id='size($i)'>" . $item['size'] . " </div> | 2305 | <div class='size' id='size($i)'>" . $item['size'] . " </div> |
| @@ -2334,47 +2314,47 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2334,47 +2314,47 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2334 | <input type='hidden' name='item[brand_id][]' id='brand_idValue($i)' value='" . $item['brend_id'] . "'> | 2314 | <input type='hidden' name='item[brand_id][]' id='brand_idValue($i)' value='" . $item['brend_id'] . "'> |
| 2335 | <input type='hidden' name='item[price][]' id='priceValue($i)' value='" . $item['cine'] . "'> | 2315 | <input type='hidden' name='item[price][]' id='priceValue($i)' value='" . $item['cine'] . "'> |
| 2336 | <input type='hidden' name='item[total][]' id='totalValue($i)' value='" . ($item['cine'] * $item_id['count']) . "'> | 2316 | <input type='hidden' name='item[total][]' id='totalValue($i)' value='" . ($item['cine'] * $item_id['count']) . "'> |
| 2337 | - | 2317 | + |
| 2338 | <div class='control'> | 2318 | <div class='control'> |
| 2339 | <a href='#' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> | 2319 | <a href='#' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> |
| 2340 | <a href='#' onclick='RemoveDivLine($i);'><img src='/account/pic/del.png' width='18px'></a> | 2320 | <a href='#' onclick='RemoveDivLine($i);'><img src='/account/pic/del.png' width='18px'></a> |
| 2341 | - <a href='#' onclick='DDivLine($i);'>Ä</a> | 2321 | + <a href='#' onclick='DDivLine($i);'>Ä</a> |
| 2342 | </div> | 2322 | </div> |
| 2343 | - | 2323 | + |
| 2344 | <div class='clear'></div> | 2324 | <div class='clear'></div> |
| 2345 | </div><div style='clear:both;'></div> | 2325 | </div><div style='clear:both;'></div> |
| 2346 | </div>"; | 2326 | </div>"; |
| 2347 | } | 2327 | } |
| 2348 | } | 2328 | } |
| 2349 | - | 2329 | + |
| 2350 | echo "</div> | 2330 | echo "</div> |
| 2351 | - | 2331 | + |
| 2352 | <div class='report'> | 2332 | <div class='report'> |
| 2353 | Âñåãî: <span id='quantity'>0</span> òîâàðîâ íà <span id='summary'>0</span> ãðí. | 2333 | Âñåãî: <span id='quantity'>0</span> òîâàðîâ íà <span id='summary'>0</span> ãðí. |
| 2354 | </div> | 2334 | </div> |
| 2355 | - | 2335 | + |
| 2356 | <input type='hidden' name='summary' value='' id='summaryValue'> | 2336 | <input type='hidden' name='summary' value='' id='summaryValue'> |
| 2357 | <input type='hidden' name='user_id' value='" . $order['user_id'] . "'> | 2337 | <input type='hidden' name='user_id' value='" . $order['user_id'] . "'> |
| 2358 | <input type='hidden' name='order_id' value='" . $order['order_id'] . "'> | 2338 | <input type='hidden' name='order_id' value='" . $order['order_id'] . "'> |
| 2359 | <input type='hidden' name='send' value='edit-order'>"; | 2339 | <input type='hidden' name='send' value='edit-order'>"; |
| 2360 | - | 2340 | + |
| 2361 | echo "<div class='clear'></div>"; | 2341 | echo "<div class='clear'></div>"; |
| 2362 | - | 2342 | + |
| 2363 | // Äëÿ XML ôàéëà | 2343 | // Äëÿ XML ôàéëà |
| 2364 | $dateFromDate = ExtractDate ((date ('Y-m-d H:i:s', $order['mktime']))); | 2344 | $dateFromDate = ExtractDate ((date ('Y-m-d H:i:s', $order['mktime']))); |
| 2365 | - | 2345 | + |
| 2366 | // Ñìåíà ñòàòóñà | 2346 | // Ñìåíà ñòàòóñà |
| 2367 | if ($order['status'] != 6) | 2347 | if ($order['status'] != 6) |
| 2368 | { | 2348 | { |
| 2369 | echo "<div class='pager-pages'> | 2349 | echo "<div class='pager-pages'> |
| 2370 | <div id='show'>Ïåðåâåñòè</div> | 2350 | <div id='show'>Ïåðåâåñòè</div> |
| 2371 | - <form method='POST' action='" . $_SERVER["REQUEST_URI"] . "' id='PerPageForm' name='SetStatus'> | 2351 | + <form method='POST' action='" . $_SERVER["REQUEST_URI"] . "' id='PerPageForm' name='SetStatus'> |
| 2372 | <select size='1' name='status' id='PerPage' >"; | 2352 | <select size='1' name='status' id='PerPage' >"; |
| 2373 | $sql4 = "SELECT * FROM zlo_book_status WHERE id IN (1,2,4,5)"; | 2353 | $sql4 = "SELECT * FROM zlo_book_status WHERE id IN (1,2,4,5)"; |
| 2374 | $result4 = mysql_query ($sql4) or die (mysql_error ()); | 2354 | $result4 = mysql_query ($sql4) or die (mysql_error ()); |
| 2375 | if (mysql_affected_rows () != 0) | 2355 | if (mysql_affected_rows () != 0) |
| 2376 | { | 2356 | { |
| 2377 | - | 2357 | + |
| 2378 | while ($row4 = mysql_fetch_assoc ($result4)) | 2358 | while ($row4 = mysql_fetch_assoc ($result4)) |
| 2379 | { | 2359 | { |
| 2380 | if ($row4['id'] == $order['status']) | 2360 | if ($row4['id'] == $order['status']) |
| @@ -2387,23 +2367,23 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2387,23 +2367,23 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2387 | echo "<input type='hidden' name='action' value='status'> | 2367 | echo "<input type='hidden' name='action' value='status'> |
| 2388 | <input type='hidden' name='order_id' value='" . $order['order_id'] . "'>"; | 2368 | <input type='hidden' name='order_id' value='" . $order['order_id'] . "'>"; |
| 2389 | } | 2369 | } |
| 2390 | - | 2370 | + |
| 2391 | echo "</form>"; | 2371 | echo "</form>"; |
| 2392 | - | 2372 | + |
| 2393 | echo " | 2373 | echo " |
| 2394 | <div id='records'><input type='submit' value='Ïåðåâåñòè' class='button-save' onclick=\"if(document.getElementById('mcomment').value=='' && document.getElementById('PerPage').value=='5'){ alert('Äëÿ ñìåíû ñòàòóñà çàêàçà íà \'Îòìåíåí\', îáÿçàòåëüíî, çàïîëíåíèå ïîëÿ \'Êîìåíòàðèé (ìåíåäæåðà)\''); return false;} else document.forms['SetStatus'].submit();\" ></div> | 2374 | <div id='records'><input type='submit' value='Ïåðåâåñòè' class='button-save' onclick=\"if(document.getElementById('mcomment').value=='' && document.getElementById('PerPage').value=='5'){ alert('Äëÿ ñìåíû ñòàòóñà çàêàçà íà \'Îòìåíåí\', îáÿçàòåëüíî, çàïîëíåíèå ïîëÿ \'Êîìåíòàðèé (ìåíåäæåðà)\''); return false;} else document.forms['SetStatus'].submit();\" ></div> |
| 2395 | <div id='records'><input type='submit' class='button-save' title='Ñîõðàíèòü' value='Ñîõðàíèòü' onclick=\"document.forms['edit_order'].submit();\"></div> | 2375 | <div id='records'><input type='submit' class='button-save' title='Ñîõðàíèòü' value='Ñîõðàíèòü' onclick=\"document.forms['edit_order'].submit();\"></div> |
| 2396 | <div id='records'><a href='/account/admin/orders.php?action=print&order_id=" . $order['order_id'] . "' target='_new' class='button-save'>Ïå÷àòü</a></div>"; | 2376 | <div id='records'><a href='/account/admin/orders.php?action=print&order_id=" . $order['order_id'] . "' target='_new' class='button-save'>Ïå÷àòü</a></div>"; |
| 2397 | - | 2377 | + |
| 2398 | if (is_file ($_SERVER['DOCUMENT_ROOT'] . "/xml/" . $dateFromDate[0] . "/" . $dateFromDate[1] . "/order_" . $order['order_id'] . ".xml")) | 2378 | if (is_file ($_SERVER['DOCUMENT_ROOT'] . "/xml/" . $dateFromDate[0] . "/" . $dateFromDate[1] . "/order_" . $order['order_id'] . ".xml")) |
| 2399 | { | 2379 | { |
| 2400 | echo "<div id='records'><a href='/xml/" . $dateFromDate[0] . "/" . $dateFromDate[1] . "/order_" . $order['order_id'] . ".xml'><img src='/account/pic/xml.png' width='38px' title='xml çàêàç ïîëüçîâàòåëÿ'></a></div>"; | 2380 | echo "<div id='records'><a href='/xml/" . $dateFromDate[0] . "/" . $dateFromDate[1] . "/order_" . $order['order_id'] . ".xml'><img src='/account/pic/xml.png' width='38px' title='xml çàêàç ïîëüçîâàòåëÿ'></a></div>"; |
| 2401 | } | 2381 | } |
| 2402 | - | 2382 | + |
| 2403 | echo "</div>"; | 2383 | echo "</div>"; |
| 2404 | } | 2384 | } |
| 2405 | echo "</fieldset></div>"; | 2385 | echo "</fieldset></div>"; |
| 2406 | - | 2386 | + |
| 2407 | echo "</div>"; | 2387 | echo "</div>"; |
| 2408 | } | 2388 | } |
| 2409 | } | 2389 | } |
| @@ -2419,16 +2399,16 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | @@ -2419,16 +2399,16 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') | ||
| 2419 | 2399 | ||
| 2420 | if (isset ($_GET['action']) && $_GET['action'] == 'add') | 2400 | if (isset ($_GET['action']) && $_GET['action'] == 'add') |
| 2421 | { | 2401 | { |
| 2422 | - | 2402 | + |
| 2423 | if (isset ($_POST['user'])) | 2403 | if (isset ($_POST['user'])) |
| 2424 | { | 2404 | { |
| 2425 | } | 2405 | } |
| 2426 | - | 2406 | + |
| 2427 | $user = array (); | 2407 | $user = array (); |
| 2428 | - | 2408 | + |
| 2429 | if (isset ($_GET['user'])) | 2409 | if (isset ($_GET['user'])) |
| 2430 | { | 2410 | { |
| 2431 | - | 2411 | + |
| 2432 | $sql = "SELECT * FROM zlo_users WHERE id='" . $_GET['user'] . "'"; | 2412 | $sql = "SELECT * FROM zlo_users WHERE id='" . $_GET['user'] . "'"; |
| 2433 | $result = mysql_query ($sql) or die (mysql_error ()); | 2413 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 2434 | if (mysql_affected_rows () != 0) | 2414 | if (mysql_affected_rows () != 0) |
| @@ -2438,17 +2418,17 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2438,17 +2418,17 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2438 | } | 2418 | } |
| 2439 | else | 2419 | else |
| 2440 | { | 2420 | { |
| 2441 | - | 2421 | + |
| 2442 | if (isset ($_POST)) | 2422 | if (isset ($_POST)) |
| 2443 | { | 2423 | { |
| 2444 | $user = $_POST['user']; | 2424 | $user = $_POST['user']; |
| 2445 | } | 2425 | } |
| 2446 | } | 2426 | } |
| 2447 | - | 2427 | + |
| 2448 | echo "<form action='' method='POST' name='add_order' id='add-item'>"; | 2428 | echo "<form action='' method='POST' name='add_order' id='add-item'>"; |
| 2449 | echo "<div class='add-order'>"; | 2429 | echo "<div class='add-order'>"; |
| 2450 | echo "<div class='orders'>"; | 2430 | echo "<div class='orders'>"; |
| 2451 | - | 2431 | + |
| 2452 | echo " | 2432 | echo " |
| 2453 | <div class=order-info> | 2433 | <div class=order-info> |
| 2454 | <fieldset id='order-info'> | 2434 | <fieldset id='order-info'> |
| @@ -2456,36 +2436,42 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2456,36 +2436,42 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2456 | <div style='float:left;width:400px;'> | 2436 | <div style='float:left;width:400px;'> |
| 2457 | <label>Äàòà:</label> | 2437 | <label>Äàòà:</label> |
| 2458 | <div class=info>" . date ('d-m-Y H:i:s') . "</div>"; | 2438 | <div class=info>" . date ('d-m-Y H:i:s') . "</div>"; |
| 2459 | - | 2439 | + |
| 2460 | echo "<label>Îïëà÷åí:</label> | 2440 | echo "<label>Îïëà÷åí:</label> |
| 2461 | - <div class=info style='float:left;padding-right:20px;'> | ||
| 2462 | - <select name='paid'> | ||
| 2463 | - <option value='0' " . (($user['paid'] == 0) ? 'selected' : '') . ">íåò</option> | ||
| 2464 | - <option value='1' " . (($user['paid'] == 1) ? 'selected' : '') . ">äà</option> | ||
| 2465 | - </select> | ||
| 2466 | - </div> | ||
| 2467 | - <div> | ||
| 2468 | - <label style='width:50px'>Ìåòêà:</label> | ||
| 2469 | - <div class=info> | ||
| 2470 | - <select name='label'> | ||
| 2471 | - "; | 2441 | + <div class=info style='float:left;padding-right:20px;'> |
| 2442 | + <select name='paid'> | ||
| 2443 | + <option value='0' " . (($user['paid'] == 0) ? 'selected' : '') . ">íåò</option> | ||
| 2444 | + <option value='1' " . (($user['paid'] == 1) ? 'selected' : '') . ">äà</option> | ||
| 2445 | + </select> | ||
| 2446 | + </div> | ||
| 2447 | + <div> | ||
| 2448 | + <label style='width:50px'>Ìåòêà:</label> | ||
| 2449 | + <div class=info> | ||
| 2450 | + <select name='label'>"; | ||
| 2451 | + | ||
| 2472 | for ($i = 0; $i <= 10; $i ++) | 2452 | for ($i = 0; $i <= 10; $i ++) |
| 2473 | { | 2453 | { |
| 2454 | + // ***** Àäìèí ðåæèì ***** | ||
| 2455 | + if (in_array ($i, array (9, 10)) && ! in_array ($_SESSION['admin']['id'], array (1, 19, 20))) | ||
| 2456 | + { | ||
| 2457 | + CONTINUE; | ||
| 2458 | + } | ||
| 2459 | + | ||
| 2474 | print '<option value="' . $i . '" ' . (($user['label'] == $i) ? 'selected' : '') . '>' . $i . '</option>'; | 2460 | print '<option value="' . $i . '" ' . (($user['label'] == $i) ? 'selected' : '') . '>' . $i . '</option>'; |
| 2475 | } | 2461 | } |
| 2476 | 2462 | ||
| 2477 | - echo "</select> | ||
| 2478 | - </div> | 2463 | + echo "</select> |
| 2464 | + </div> | ||
| 2479 | </div>"; | 2465 | </div>"; |
| 2480 | - | 2466 | + |
| 2481 | if (! isset ($_GET['user'])) | 2467 | if (! isset ($_GET['user'])) |
| 2482 | { | 2468 | { |
| 2483 | echo "<div class='new'>Ïî óìîë÷àíèþ<input type='checkbox' onChange='newUnknownUser();' id='default'></div>"; | 2469 | echo "<div class='new'>Ïî óìîë÷àíèþ<input type='checkbox' onChange='newUnknownUser();' id='default'></div>"; |
| 2484 | } | 2470 | } |
| 2485 | - | 2471 | + |
| 2486 | if (isset ($_GET['user'])) | 2472 | if (isset ($_GET['user'])) |
| 2487 | { | 2473 | { |
| 2488 | - | 2474 | + |
| 2489 | $readonly = 'readonly="readonly"'; | 2475 | $readonly = 'readonly="readonly"'; |
| 2490 | $disabled = 'disabled="disabled"'; | 2476 | $disabled = 'disabled="disabled"'; |
| 2491 | } | 2477 | } |
| @@ -2494,7 +2480,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2494,7 +2480,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2494 | $readonly = ''; | 2480 | $readonly = ''; |
| 2495 | $disabled = ''; | 2481 | $disabled = ''; |
| 2496 | } | 2482 | } |
| 2497 | - | 2483 | + |
| 2498 | echo " | 2484 | echo " |
| 2499 | <label>Email:<font color='red'>*</font></label> | 2485 | <label>Email:<font color='red'>*</font></label> |
| 2500 | <div class=info><input type='text' style='width:300px;' name='user[email]' value='" . $user['email'] . "' class='validate[required,user[email]] text-input' id='emailValue' $readonly autocomplete='off' onkeyup=livesearchEmail(this.value,'(0)')></div> | 2486 | <div class=info><input type='text' style='width:300px;' name='user[email]' value='" . $user['email'] . "' class='validate[required,user[email]] text-input' id='emailValue' $readonly autocomplete='off' onkeyup=livesearchEmail(this.value,'(0)')></div> |
| @@ -2502,8 +2488,8 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2502,8 +2488,8 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2502 | <div class='livesearch-email-block'> | 2488 | <div class='livesearch-email-block'> |
| 2503 | <div id='livesearch-email-list'></div> | 2489 | <div id='livesearch-email-list'></div> |
| 2504 | </div> | 2490 | </div> |
| 2505 | - <!-- ---> | ||
| 2506 | - | 2491 | + <!-- ---> |
| 2492 | + | ||
| 2507 | <label>Òåëåôîí:<font color='red'>*</font></label> | 2493 | <label>Òåëåôîí:<font color='red'>*</font></label> |
| 2508 | <div class=info><input type='text' style='width:300px;' name='user[tel]' value='" . $user['tel'] . "' class='validate[required,custom[cell_phone]] text-input' id='telValue' $readonly autocomplete='off' onkeyup=livesearchTel(this.value,'(0)')></div> | 2494 | <div class=info><input type='text' style='width:300px;' name='user[tel]' value='" . $user['tel'] . "' class='validate[required,custom[cell_phone]] text-input' id='telValue' $readonly autocomplete='off' onkeyup=livesearchTel(this.value,'(0)')></div> |
| 2509 | <!-- search ---> | 2495 | <!-- search ---> |
| @@ -2511,39 +2497,39 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2511,39 +2497,39 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2511 | <div id='livesearch-tel-list'></div> | 2497 | <div id='livesearch-tel-list'></div> |
| 2512 | </div> | 2498 | </div> |
| 2513 | <!-- ---> | 2499 | <!-- ---> |
| 2514 | - | ||
| 2515 | - | 2500 | + |
| 2501 | + | ||
| 2516 | <label>Êëèåíò:<font color='red'>*</font></label> | 2502 | <label>Êëèåíò:<font color='red'>*</font></label> |
| 2517 | <div class=info><input type='text' style='width:300px;' name='user[username]' value='" . $user['username'] . "' id='usernameValue' $readonly></div> | 2503 | <div class=info><input type='text' style='width:300px;' name='user[username]' value='" . $user['username'] . "' id='usernameValue' $readonly></div> |
| 2518 | - | 2504 | + |
| 2519 | <label>Òåëåôîí 2:</label> | 2505 | <label>Òåëåôîí 2:</label> |
| 2520 | <div class=info><input type='text' style='width:300px;' name='user[tel2]' value='" . $user['tel2'] . "' id='tel2Value'></div>"; | 2506 | <div class=info><input type='text' style='width:300px;' name='user[tel2]' value='" . $user['tel2'] . "' id='tel2Value'></div>"; |
| 2521 | - | 2507 | + |
| 2522 | echo " | 2508 | echo " |
| 2523 | <label>¹ êàðòî÷êè:</label> | 2509 | <label>¹ êàðòî÷êè:</label> |
| 2524 | <div class=info> | 2510 | <div class=info> |
| 2525 | <input type='text' name='user[cards]' value='" . $user['cards'] . "' style='width:300px;' id='cardsValue'> | 2511 | <input type='text' name='user[cards]' value='" . $user['cards'] . "' style='width:300px;' id='cardsValue'> |
| 2526 | </div>"; | 2512 | </div>"; |
| 2527 | - | ||
| 2528 | - echo " | 2513 | + |
| 2514 | + echo " | ||
| 2529 | <label>Êîìåíòàðèé:</label> | 2515 | <label>Êîìåíòàðèé:</label> |
| 2530 | <div class=info><textarea rows='2' style='width:300px;' name='user[comment]' cols='30' name='comment'>" . $user['comment'] . "</textarea></div>"; | 2516 | <div class=info><textarea rows='2' style='width:300px;' name='user[comment]' cols='30' name='comment'>" . $user['comment'] . "</textarea></div>"; |
| 2531 | - | 2517 | + |
| 2532 | // ãðóïïà | 2518 | // ãðóïïà |
| 2533 | echo "<label>Ãðóïïà</label>"; | 2519 | echo "<label>Ãðóïïà</label>"; |
| 2534 | - | 2520 | + |
| 2535 | echo "<select style='width:300px;' name='user[group]' id='usergroup' $disabled >"; | 2521 | echo "<select style='width:300px;' name='user[group]' id='usergroup' $disabled >"; |
| 2536 | viewBookSelectValue ('zlo_users_group', 'id', 'name', $user['group']); | 2522 | viewBookSelectValue ('zlo_users_group', 'id', 'name', $user['group']); |
| 2537 | echo "</select>"; | 2523 | echo "</select>"; |
| 2538 | - | 2524 | + |
| 2539 | // hidden | 2525 | // hidden |
| 2540 | if (isset ($_GET['user'])) | 2526 | if (isset ($_GET['user'])) |
| 2541 | { | 2527 | { |
| 2542 | echo "<input type='hidden' name='user[group]' value='" . $user['group'] . "'>"; | 2528 | echo "<input type='hidden' name='user[group]' value='" . $user['group'] . "'>"; |
| 2543 | } | 2529 | } |
| 2544 | - | 2530 | + |
| 2545 | echo "<input type='hidden' name='user[user_id]' value='" . $user['id'] . "' id='user_id'>"; | 2531 | echo "<input type='hidden' name='user[user_id]' value='" . $user['id'] . "' id='user_id'>"; |
| 2546 | - | 2532 | + |
| 2547 | echo "</div><div style='float:right;'> | 2533 | echo "</div><div style='float:right;'> |
| 2548 | <label>Äîñòàâêà</label> | 2534 | <label>Äîñòàâêà</label> |
| 2549 | <div class=info> | 2535 | <div class=info> |
| @@ -2551,29 +2537,29 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2551,29 +2537,29 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2551 | viewBookSelectValue ('zlo_book_delivery', 'id', 'title', $user['delivery']); | 2537 | viewBookSelectValue ('zlo_book_delivery', 'id', 'title', $user['delivery']); |
| 2552 | echo "</select> | 2538 | echo "</select> |
| 2553 | </div>"; | 2539 | </div>"; |
| 2554 | - | ||
| 2555 | - echo " | 2540 | + |
| 2541 | + echo " | ||
| 2556 | <label>Äåêëàðàöèÿ ¹:</label> | 2542 | <label>Äåêëàðàöèÿ ¹:</label> |
| 2557 | <div class=info><input type='text' name='user[declaration]' style='width:300px;' value='" . $user['declaration'] . "' id='declarationValidate'></div>"; | 2543 | <div class=info><input type='text' name='user[declaration]' style='width:300px;' value='" . $user['declaration'] . "' id='declarationValidate'></div>"; |
| 2558 | - | ||
| 2559 | - echo " | 2544 | + |
| 2545 | + echo " | ||
| 2560 | <label>¹ ñêëàäà:</label> | 2546 | <label>¹ ñêëàäà:</label> |
| 2561 | <div class=info><input type='text' name='user[warehouse]' style='width:300px;' value='" . $user['warehouse'] . "' id='warehouseValidate'></div>"; | 2547 | <div class=info><input type='text' name='user[warehouse]' style='width:300px;' value='" . $user['warehouse'] . "' id='warehouseValidate'></div>"; |
| 2562 | - | 2548 | + |
| 2563 | $array_method = array ( | 2549 | $array_method = array ( |
| 2564 | "Îïëàòèòü íàëè÷íûìè", | 2550 | "Îïëàòèòü íàëè÷íûìè", |
| 2565 | "Îïëàòèòü íà êàðòó Ïðèâàò Áàíêà", | 2551 | "Îïëàòèòü íà êàðòó Ïðèâàò Áàíêà", |
| 2566 | "Îïëàòèòü ïî áåçíàëè÷íîìó ðàñ÷åòó", | 2552 | "Îïëàòèòü ïî áåçíàëè÷íîìó ðàñ÷åòó", |
| 2567 | "Îïëàòèòü Ïðàâåêñ-òåëåãðàô", | 2553 | "Îïëàòèòü Ïðàâåêñ-òåëåãðàô", |
| 2568 | "Íàëîæåííûì ïëàòåæîì", | 2554 | "Íàëîæåííûì ïëàòåæîì", |
| 2569 | - "Îïëàòèòü íà Áàíê Áîãóñëàâ" | 2555 | + "Îïëàòèòü íà Áàíê Áîãóñëàâ" |
| 2570 | ); | 2556 | ); |
| 2571 | - | 2557 | + |
| 2572 | echo " | 2558 | echo " |
| 2573 | - <div class=info> | ||
| 2574 | - <label>Ñïîñîá îïëàòû:</label> | ||
| 2575 | - <select name='user[payment]' style='width:300px'><option value=''></option>"; | ||
| 2576 | - | 2559 | + <div class=info> |
| 2560 | + <label>Ñïîñîá îïëàòû:</label> | ||
| 2561 | + <select name='user[payment]' style='width:300px'><option value=''></option>"; | ||
| 2562 | + | ||
| 2577 | foreach ($array_method as $method) | 2563 | foreach ($array_method as $method) |
| 2578 | { | 2564 | { |
| 2579 | echo '<option value="' . $method . '" '; | 2565 | echo '<option value="' . $method . '" '; |
| @@ -2581,27 +2567,27 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2581,27 +2567,27 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2581 | echo 'selected'; | 2567 | echo 'selected'; |
| 2582 | echo '>' . $method . '</option>'; | 2568 | echo '>' . $method . '</option>'; |
| 2583 | } | 2569 | } |
| 2584 | - | 2570 | + |
| 2585 | echo "</select> | 2571 | echo "</select> |
| 2586 | </div>"; | 2572 | </div>"; |
| 2587 | - | 2573 | + |
| 2588 | echo " | 2574 | echo " |
| 2589 | <label>Ñòðàõîâêà:</label> | 2575 | <label>Ñòðàõîâêà:</label> |
| 2590 | <div class=info><input type='text' name='user[insurance]' style='width:300px;' value='" . $user['insurance'] . "' id='insuranceValidate'></div>"; | 2576 | <div class=info><input type='text' name='user[insurance]' style='width:300px;' value='" . $user['insurance'] . "' id='insuranceValidate'></div>"; |
| 2591 | - | 2577 | + |
| 2592 | echo " | 2578 | echo " |
| 2593 | <label>Ñóììà íàëîæåííîãî:</label> | 2579 | <label>Ñóììà íàëîæåííîãî:</label> |
| 2594 | <div class=info><input type='text' name='user[sumn]' style='width:300px;' value='" . $user['sumn'] . "' id='insuranceValidate'></div>"; | 2580 | <div class=info><input type='text' name='user[sumn]' style='width:300px;' value='" . $user['sumn'] . "' id='insuranceValidate'></div>"; |
| 2595 | $array_method = array ( | 2581 | $array_method = array ( |
| 2596 | "Ïîëó÷àòåëÿ", | 2582 | "Ïîëó÷àòåëÿ", |
| 2597 | - "Îòïðàâèòåëÿ" | 2583 | + "Îòïðàâèòåëÿ" |
| 2598 | ); | 2584 | ); |
| 2599 | 2585 | ||
| 2600 | echo " | 2586 | echo " |
| 2601 | - <div class=info> | ||
| 2602 | - <label>Îòïðàâêà çà ñ÷åò:</label> | ||
| 2603 | - <select name='user[sends]' style='width:300px'><option value=''></option>"; | ||
| 2604 | - | 2587 | + <div class=info> |
| 2588 | + <label>Îòïðàâêà çà ñ÷åò:</label> | ||
| 2589 | + <select name='user[sends]' style='width:300px'><option value=''></option>"; | ||
| 2590 | + | ||
| 2605 | foreach ($array_method as $method) | 2591 | foreach ($array_method as $method) |
| 2606 | { | 2592 | { |
| 2607 | echo '<option value="' . $method . '" '; | 2593 | echo '<option value="' . $method . '" '; |
| @@ -2622,14 +2608,14 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2622,14 +2608,14 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2622 | 2608 | ||
| 2623 | <label>Êîìåíòàðèé (ìåíåäæåðà):</label> | 2609 | <label>Êîìåíòàðèé (ìåíåäæåðà):</label> |
| 2624 | <div class=info><textarea rows='4' id='mcomment' style='width:400px;' name='user[mcomment]' cols='30' name='mcomment'>" . $user['mcomment'] . "</textarea></div> | 2610 | <div class=info><textarea rows='4' id='mcomment' style='width:400px;' name='user[mcomment]' cols='30' name='mcomment'>" . $user['mcomment'] . "</textarea></div> |
| 2625 | - </div> | ||
| 2626 | - "; | ||
| 2627 | - | 2611 | + </div> |
| 2612 | + "; | ||
| 2613 | + | ||
| 2628 | echo "<div class=clear></div> | 2614 | echo "<div class=clear></div> |
| 2629 | </fieldset> | 2615 | </fieldset> |
| 2630 | <div class=clear></div> | 2616 | <div class=clear></div> |
| 2631 | </div>"; | 2617 | </div>"; |
| 2632 | - | 2618 | + |
| 2633 | echo " | 2619 | echo " |
| 2634 | <fieldset id='order-details'> | 2620 | <fieldset id='order-details'> |
| 2635 | <legend>Òîâàðû</legend> | 2621 | <legend>Òîâàðû</legend> |
| @@ -2643,7 +2629,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2643,7 +2629,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2643 | <div class='quant'>Êîë.</div> | 2629 | <div class='quant'>Êîë.</div> |
| 2644 | <div class='price'>Öåíà</div> | 2630 | <div class='price'>Öåíà</div> |
| 2645 | <div class='total'>Ñóììà</div> | 2631 | <div class='total'>Ñóììà</div> |
| 2646 | - <div class='reservation'>Áðîíü</div> | 2632 | + <div class='reservation'>Áðîíü</div> |
| 2647 | <div class='onstock'>Íàëè÷èå</div> | 2633 | <div class='onstock'>Íàëè÷èå</div> |
| 2648 | <div class='control' ></div> | 2634 | <div class='control' ></div> |
| 2649 | <div class='clear'></div> | 2635 | <div class='clear'></div> |
| @@ -2660,7 +2646,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2660,7 +2646,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2660 | <div id='livesearch(0)'></div> | 2646 | <div id='livesearch(0)'></div> |
| 2661 | </div> | 2647 | </div> |
| 2662 | <!-- ---> | 2648 | <!-- ---> |
| 2663 | - </div> | 2649 | + </div> |
| 2664 | <div class='brand' id='brand(0)'> </div> | 2650 | <div class='brand' id='brand(0)'> </div> |
| 2665 | <div class='title' id='title(0)'> </div> | 2651 | <div class='title' id='title(0)'> </div> |
| 2666 | <div class='size' id='size(0)'> </div> | 2652 | <div class='size' id='size(0)'> </div> |
| @@ -2668,20 +2654,20 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2668,20 +2654,20 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2668 | <div class='quant'><input type='text' name='item[quant][]' value='1' id='quantValue(0)' onBlur='SumPerRow();'></div> | 2654 | <div class='quant'><input type='text' name='item[quant][]' value='1' id='quantValue(0)' onBlur='SumPerRow();'></div> |
| 2669 | <div class='price' id='price(0)'>0</div> | 2655 | <div class='price' id='price(0)'>0</div> |
| 2670 | <div class='total' id='total(0)'>0</div> | 2656 | <div class='total' id='total(0)'>0</div> |
| 2671 | - <div class='reservation'><input type='text' size='3' name='item[reservation][]' value='' /></div> | 2657 | + <div class='reservation'><input type='text' size='3' name='item[reservation][]' value='' /></div> |
| 2672 | <div class='onstock' id='onstock(0)'></div> | 2658 | <div class='onstock' id='onstock(0)'></div> |
| 2673 | - | 2659 | + |
| 2674 | <input type='hidden' name='item[mod_id][]' id='mod_idValue(0)' value=''> | 2660 | <input type='hidden' name='item[mod_id][]' id='mod_idValue(0)' value=''> |
| 2675 | <input type='hidden' name='item[product_id][]' id='product_idValue(0)' value=''> | 2661 | <input type='hidden' name='item[product_id][]' id='product_idValue(0)' value=''> |
| 2676 | <input type='hidden' name='item[brand_id][]' id='brand_idValue(0)' value=''> | 2662 | <input type='hidden' name='item[brand_id][]' id='brand_idValue(0)' value=''> |
| 2677 | <input type='hidden' name='item[price][]' id='priceValue(0)' value='0'> | 2663 | <input type='hidden' name='item[price][]' id='priceValue(0)' value='0'> |
| 2678 | <input type='hidden' name='item[total][]' id='totalValue(0)' value='0'> | 2664 | <input type='hidden' name='item[total][]' id='totalValue(0)' value='0'> |
| 2679 | - | 2665 | + |
| 2680 | <div class='control' style='float:right;'> | 2666 | <div class='control' style='float:right;'> |
| 2681 | <a href='#' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> | 2667 | <a href='#' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> |
| 2682 | <a href='#' onclick='RemoveDivLine(0);'><img src='/account/pic/del.png' width='18px'></a> | 2668 | <a href='#' onclick='RemoveDivLine(0);'><img src='/account/pic/del.png' width='18px'></a> |
| 2683 | </div> | 2669 | </div> |
| 2684 | - | 2670 | + |
| 2685 | <div class='clear'></div> | 2671 | <div class='clear'></div> |
| 2686 | </div> | 2672 | </div> |
| 2687 | </div> | 2673 | </div> |
| @@ -2696,7 +2682,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2696,7 +2682,7 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2696 | <div id='livesearch(1)'></div> | 2682 | <div id='livesearch(1)'></div> |
| 2697 | </div> | 2683 | </div> |
| 2698 | <!-- ---> | 2684 | <!-- ---> |
| 2699 | - </div> | 2685 | + </div> |
| 2700 | <div class='brand' id='brand(1)'> </div> | 2686 | <div class='brand' id='brand(1)'> </div> |
| 2701 | <div class='title' id='title(1)'> </div> | 2687 | <div class='title' id='title(1)'> </div> |
| 2702 | <div class='size' id='size(1)'> </div> | 2688 | <div class='size' id='size(1)'> </div> |
| @@ -2704,30 +2690,30 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2704,30 +2690,30 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2704 | <div class='quant'><input type='text' name='item[quant][]' value='1' id='quantValue(1)' onBlur='SumPerRow();'></div> | 2690 | <div class='quant'><input type='text' name='item[quant][]' value='1' id='quantValue(1)' onBlur='SumPerRow();'></div> |
| 2705 | <div class='price' id='price(1)'>0</div> | 2691 | <div class='price' id='price(1)'>0</div> |
| 2706 | <div class='total' id='total(1)'>0</div> | 2692 | <div class='total' id='total(1)'>0</div> |
| 2707 | - <div class='reservation'><input type='text' size='3' name='item[reservation][]' value='' /></div> | 2693 | + <div class='reservation'><input type='text' size='3' name='item[reservation][]' value='' /></div> |
| 2708 | <div class='onstock' id='onstock(1)'></div> | 2694 | <div class='onstock' id='onstock(1)'></div> |
| 2709 | - | 2695 | + |
| 2710 | <input type='hidden' name='item[mod_id][]' id='mod_idValue(1)' value=''> | 2696 | <input type='hidden' name='item[mod_id][]' id='mod_idValue(1)' value=''> |
| 2711 | <input type='hidden' name='item[product_id][]' id='product_idValue(1)' value=''> | 2697 | <input type='hidden' name='item[product_id][]' id='product_idValue(1)' value=''> |
| 2712 | <input type='hidden' name='item[brand_id][]' id='brand_idValue(1)' value=''> | 2698 | <input type='hidden' name='item[brand_id][]' id='brand_idValue(1)' value=''> |
| 2713 | <input type='hidden' name='item[price][]' id='priceValue(1)' value='0'> | 2699 | <input type='hidden' name='item[price][]' id='priceValue(1)' value='0'> |
| 2714 | <input type='hidden' name='item[total][]' id='totalValue(1)' value='0'> | 2700 | <input type='hidden' name='item[total][]' id='totalValue(1)' value='0'> |
| 2715 | - | 2701 | + |
| 2716 | <div class='control' style='float:right;'> | 2702 | <div class='control' style='float:right;'> |
| 2717 | <a href='#' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> | 2703 | <a href='#' onclick='AddRow()'><img src='/account/pic/add2.png' width='18px'></a> |
| 2718 | <a href='#' onclick='RemoveDivLine(1);'><img src='/account/pic/del.png' width='18px'></a> | 2704 | <a href='#' onclick='RemoveDivLine(1);'><img src='/account/pic/del.png' width='18px'></a> |
| 2719 | </div> | 2705 | </div> |
| 2720 | - | 2706 | + |
| 2721 | <div class='clear'></div> | 2707 | <div class='clear'></div> |
| 2722 | </div> | 2708 | </div> |
| 2723 | </div> | 2709 | </div> |
| 2724 | </div> | 2710 | </div> |
| 2725 | - | 2711 | + |
| 2726 | <div class='report'> | 2712 | <div class='report'> |
| 2727 | - Ñòîèìîñòü äîñòàâêè <input type='text' size='10' name='cost_delivery' id='cost_delivery' value='0' onBlur='SumPerRow()' /> | ||
| 2728 | - Âñåãî: <span id='quantity'>0</span> òîâàðîâ íà <span id='summary'>0</span> ãðí. | 2713 | + Ñòîèìîñòü äîñòàâêè <input type='text' size='10' name='cost_delivery' id='cost_delivery' value='0' onBlur='SumPerRow()' /> |
| 2714 | + Âñåãî: <span id='quantity'>0</span> òîâàðîâ íà <span id='summary'>0</span> ãðí. | ||
| 2729 | </div> | 2715 | </div> |
| 2730 | - | 2716 | + |
| 2731 | <input type='hidden' name='summary' id='summaryValue' value=''> | 2717 | <input type='hidden' name='summary' id='summaryValue' value=''> |
| 2732 | <input type='hidden' name='send' value='add-order'> | 2718 | <input type='hidden' name='send' value='add-order'> |
| 2733 | <input type='submit' class='button-add' title='Äîáàâèòü' value='Äîáàâèòü' onclick=\"document.form.submit();\"> | 2719 | <input type='submit' class='button-add' title='Äîáàâèòü' value='Äîáàâèòü' onclick=\"document.form.submit();\"> |
| @@ -2735,12 +2721,12 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2735,12 +2721,12 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2735 | </fieldset > | 2721 | </fieldset > |
| 2736 | </div> | 2722 | </div> |
| 2737 | </form>"; | 2723 | </form>"; |
| 2738 | - | 2724 | + |
| 2739 | // ===================== | 2725 | // ===================== |
| 2740 | // ===== javascript ==== | 2726 | // ===== javascript ==== |
| 2741 | // ===================== | 2727 | // ===================== |
| 2742 | - | ||
| 2743 | - echo " | 2728 | + |
| 2729 | + echo " | ||
| 2744 | <script> | 2730 | <script> |
| 2745 | jQuery(document).ready(function(){ | 2731 | jQuery(document).ready(function(){ |
| 2746 | // binds form submission and fields to the validation engine | 2732 | // binds form submission and fields to the validation engine |
| @@ -2755,43 +2741,43 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | @@ -2755,43 +2741,43 @@ if (isset ($_GET['action']) && $_GET['action'] == 'add') | ||
| 2755 | 2741 | ||
| 2756 | if (isset ($_GET['action']) && $_GET['action'] == 'print') | 2742 | if (isset ($_GET['action']) && $_GET['action'] == 'print') |
| 2757 | { | 2743 | { |
| 2758 | - | 2744 | + |
| 2759 | // =========== Ãåíåðèì òàáëèöó =========== | 2745 | // =========== Ãåíåðèì òàáëèöó =========== |
| 2760 | - | 2746 | + |
| 2761 | if (! isset ($_GET['status'])) | 2747 | if (! isset ($_GET['status'])) |
| 2762 | { | 2748 | { |
| 2763 | $_GET['status'] = 1; | 2749 | $_GET['status'] = 1; |
| 2764 | } | 2750 | } |
| 2765 | - | ||
| 2766 | - $sql = "SELECT o.*,u.*, o.id as order_id,o.city as city | 2751 | + |
| 2752 | + $sql = "SELECT o.*,u.*, o.id as order_id,o.city as city | ||
| 2767 | FROM catalogs_orders as o | 2753 | FROM catalogs_orders as o |
| 2768 | RIGHT JOIN zlo_users as u on u.id=o.user_id | 2754 | RIGHT JOIN zlo_users as u on u.id=o.user_id |
| 2769 | WHERE o.id='" . $_GET['order_id'] . "' "; | 2755 | WHERE o.id='" . $_GET['order_id'] . "' "; |
| 2770 | - | ||
| 2771 | - $sql = "SELECT o.*, o.id as order_id,o.city as city,adm.login as meneger | 2756 | + |
| 2757 | + $sql = "SELECT o.*, o.id as order_id,o.city as city,adm.login as meneger | ||
| 2772 | FROM catalogs_orders as o | 2758 | FROM catalogs_orders as o |
| 2773 | - LEFT JOIN zlo_admin adm ON adm.id=o.meneger | 2759 | + LEFT JOIN zlo_admin adm ON adm.id=o.meneger |
| 2774 | WHERE o.id='" . $_GET['order_id'] . "' "; | 2760 | WHERE o.id='" . $_GET['order_id'] . "' "; |
| 2775 | $result = mysql_query ($sql) or die (mysql_error ()); | 2761 | $result = mysql_query ($sql) or die (mysql_error ()); |
| 2776 | if (mysql_affected_rows () != 0) | 2762 | if (mysql_affected_rows () != 0) |
| 2777 | { | 2763 | { |
| 2778 | $view = ''; | 2764 | $view = ''; |
| 2779 | $view .= "<div class='print'>"; | 2765 | $view .= "<div class='print'>"; |
| 2780 | - | 2766 | + |
| 2781 | $order = mysql_fetch_assoc ($result); | 2767 | $order = mysql_fetch_assoc ($result); |
| 2782 | - | 2768 | + |
| 2783 | $view .= " | 2769 | $view .= " |
| 2784 | <div class='client'> | 2770 | <div class='client'> |
| 2785 | - <table> | 2771 | + <table> |
| 2786 | <tr> | 2772 | <tr> |
| 2787 | <td>Ìåíåäæåð: </td> | 2773 | <td>Ìåíåäæåð: </td> |
| 2788 | <td>" . $order['meneger'] . "</td> | 2774 | <td>" . $order['meneger'] . "</td> |
| 2789 | </tr> | 2775 | </tr> |
| 2790 | - <tr> | 2776 | + <tr> |
| 2791 | <td>Çàêàç # </td> | 2777 | <td>Çàêàç # </td> |
| 2792 | <td>" . $order['order_id'] . "</td> | 2778 | <td>" . $order['order_id'] . "</td> |
| 2793 | </tr> | 2779 | </tr> |
| 2794 | - <tr> | 2780 | + <tr> |
| 2795 | <td>Äàòà: </td> | 2781 | <td>Äàòà: </td> |
| 2796 | <td>" . date ('Y-m-d H:i:s', $order['mktime']) . "</td> | 2782 | <td>" . date ('Y-m-d H:i:s', $order['mktime']) . "</td> |
| 2797 | </tr> | 2783 | </tr> |
| @@ -2811,87 +2797,87 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') | @@ -2811,87 +2797,87 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') | ||
| 2811 | <td>Äîï. òåë: </td> | 2797 | <td>Äîï. òåë: </td> |
| 2812 | <td>" . $order['phonemob'] . "</td> | 2798 | <td>" . $order['phonemob'] . "</td> |
| 2813 | </tr> | 2799 | </tr> |
| 2814 | - <tr> | 2800 | + <tr> |
| 2815 | <td>¹ êàðòî÷êè: </td> | 2801 | <td>¹ êàðòî÷êè: </td> |
| 2816 | <td>" . $order['cards'] . "</td> | 2802 | <td>" . $order['cards'] . "</td> |
| 2817 | </tr> | 2803 | </tr> |
| 2818 | <tr> | 2804 | <tr> |
| 2819 | <td>Êîìåíòàðèé: </td> | 2805 | <td>Êîìåíòàðèé: </td> |
| 2820 | <td>" . $order['comment'] . "</td> | 2806 | <td>" . $order['comment'] . "</td> |
| 2821 | - </tr> | 2807 | + </tr> |
| 2822 | <tr> | 2808 | <tr> |
| 2823 | <td>Äîñòàâêà: </td> | 2809 | <td>Äîñòàâêà: </td> |
| 2824 | <td>" . viewBook ('zlo_book_delivery', $order['delivery'], 'id', 'title') . "</td> | 2810 | <td>" . viewBook ('zlo_book_delivery', $order['delivery'], 'id', 'title') . "</td> |
| 2825 | </tr> | 2811 | </tr> |
| 2826 | - <tr> | 2812 | + <tr> |
| 2827 | <td>Äåêëàðàöèÿ ¹: </td> | 2813 | <td>Äåêëàðàöèÿ ¹: </td> |
| 2828 | <td>" . $order['declaration'] . "</td> | 2814 | <td>" . $order['declaration'] . "</td> |
| 2829 | </tr> | 2815 | </tr> |
| 2830 | - <tr> | 2816 | + <tr> |
| 2831 | <td>¹ ñêëàäà: </td> | 2817 | <td>¹ ñêëàäà: </td> |
| 2832 | <td>" . $order['warehouse'] . "</td> | 2818 | <td>" . $order['warehouse'] . "</td> |
| 2833 | </tr> | 2819 | </tr> |
| 2834 | - <tr> | 2820 | + <tr> |
| 2835 | <td>Ñïîñîá îïëàòû: </td> | 2821 | <td>Ñïîñîá îïëàòû: </td> |
| 2836 | <td>" . $order['payment'] . "</td> | 2822 | <td>" . $order['payment'] . "</td> |
| 2837 | </tr> | 2823 | </tr> |
| 2838 | - <tr> | 2824 | + <tr> |
| 2839 | <td>Ñòðàõîâêà: </td> | 2825 | <td>Ñòðàõîâêà: </td> |
| 2840 | <td>" . $order['insurance'] . "</td> | 2826 | <td>" . $order['insurance'] . "</td> |
| 2841 | </tr> | 2827 | </tr> |
| 2842 | - <tr> | 2828 | + <tr> |
| 2843 | <td>Ñóììà íàëîæåííîãî: </td> | 2829 | <td>Ñóììà íàëîæåííîãî: </td> |
| 2844 | <td>" . $order['sumn'] . "</td> | 2830 | <td>" . $order['sumn'] . "</td> |
| 2845 | </tr> | 2831 | </tr> |
| 2846 | - <tr> | 2832 | + <tr> |
| 2847 | <td>Îòïðàâêà çà ñ÷åò: </td> | 2833 | <td>Îòïðàâêà çà ñ÷åò: </td> |
| 2848 | <td>" . $order['sends'] . "</td> | 2834 | <td>" . $order['sends'] . "</td> |
| 2849 | - </tr> | 2835 | + </tr> |
| 2850 | <tr> | 2836 | <tr> |
| 2851 | <td>Ãîðîä: </td> | 2837 | <td>Ãîðîä: </td> |
| 2852 | <td>" . $order['city'] . "</td> | 2838 | <td>" . $order['city'] . "</td> |
| 2853 | - </tr> | 2839 | + </tr> |
| 2854 | <tr> | 2840 | <tr> |
| 2855 | <td>Àäðåñ: </td> | 2841 | <td>Àäðåñ: </td> |
| 2856 | <td>" . $order['adress'] . "</td> | 2842 | <td>" . $order['adress'] . "</td> |
| 2857 | </tr> | 2843 | </tr> |
| 2858 | - <tr> | 2844 | + <tr> |
| 2859 | <td>Êîìåíòàðèé (ìåíåäæåðà): </td> | 2845 | <td>Êîìåíòàðèé (ìåíåäæåðà): </td> |
| 2860 | <td>" . $order['mcomment'] . "</td> | 2846 | <td>" . $order['mcomment'] . "</td> |
| 2861 | </tr> | 2847 | </tr> |
| 2862 | 2848 | ||
| 2863 | </table> | 2849 | </table> |
| 2864 | </div>"; | 2850 | </div>"; |
| 2865 | - | 2851 | + |
| 2866 | // Òàáëèöà òîâàðîâ | 2852 | // Òàáëèöà òîâàðîâ |
| 2867 | - | ||
| 2868 | - $sql3 = "SELECT * | 2853 | + |
| 2854 | + $sql3 = "SELECT * | ||
| 2869 | FROM catalogs_orders_products | 2855 | FROM catalogs_orders_products |
| 2870 | WHERE `order_id`='" . $order['order_id'] . "' "; | 2856 | WHERE `order_id`='" . $order['order_id'] . "' "; |
| 2871 | $result3 = mysql_query ($sql3) or die (mysql_error ()); | 2857 | $result3 = mysql_query ($sql3) or die (mysql_error ()); |
| 2872 | if (mysql_affected_rows () != 0) | 2858 | if (mysql_affected_rows () != 0) |
| 2873 | { | 2859 | { |
| 2874 | $i = 0; | 2860 | $i = 0; |
| 2875 | - | 2861 | + |
| 2876 | $view .= "<div class='details'>"; | 2862 | $view .= "<div class='details'>"; |
| 2877 | - | 2863 | + |
| 2878 | $sum = array (); | 2864 | $sum = array (); |
| 2879 | while ($item_id = mysql_fetch_assoc ($result3)) | 2865 | while ($item_id = mysql_fetch_assoc ($result3)) |
| 2880 | { | 2866 | { |
| 2881 | $i ++; | 2867 | $i ++; |
| 2882 | - | ||
| 2883 | - $sql4 = "SELECT *,IF(m.cine>0,m.cine,p.cine) as cine | 2868 | + |
| 2869 | + $sql4 = "SELECT *,IF(m.cine>0,m.cine,p.cine) as cine | ||
| 2884 | FROM catalogs_modifications as m | 2870 | FROM catalogs_modifications as m |
| 2885 | LEFT JOIN catalogs_products as p | 2871 | LEFT JOIN catalogs_products as p |
| 2886 | - ON p.id=m.product_id | 2872 | + ON p.id=m.product_id |
| 2887 | WHERE m.id='" . $item_id['product_id'] . "' "; | 2873 | WHERE m.id='" . $item_id['product_id'] . "' "; |
| 2888 | $result4 = mysql_query ($sql4) or die (mysql_error ()); | 2874 | $result4 = mysql_query ($sql4) or die (mysql_error ()); |
| 2889 | if (mysql_affected_rows () == 0111) | 2875 | if (mysql_affected_rows () == 0111) |
| 2890 | { | 2876 | { |
| 2891 | - $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine | 2877 | + $sql4 = "SELECT m.*, m.id as mod_id, p.*,IF(m.cine>0,m.cine,p.cine) as cine |
| 2892 | from catalogs_modifications as m | 2878 | from catalogs_modifications as m |
| 2893 | - LEFT JOIN catalogs_products as p | ||
| 2894 | - ON p.id=m.product_id | 2879 | + LEFT JOIN catalogs_products as p |
| 2880 | + ON p.id=m.product_id | ||
| 2895 | WHERE m.code='" . $item_id['code'] . "' "; | 2881 | WHERE m.code='" . $item_id['code'] . "' "; |
| 2896 | $result4 = mysql_query ($sql4) or die (mysql_error ()); | 2882 | $result4 = mysql_query ($sql4) or die (mysql_error ()); |
| 2897 | } | 2883 | } |
| @@ -2899,69 +2885,69 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') | @@ -2899,69 +2885,69 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') | ||
| 2899 | { | 2885 | { |
| 2900 | while ($item = mysql_fetch_assoc ($result4)) | 2886 | while ($item = mysql_fetch_assoc ($result4)) |
| 2901 | { | 2887 | { |
| 2902 | - | 2888 | + |
| 2903 | $view .= " | 2889 | $view .= " |
| 2904 | <table> | 2890 | <table> |
| 2905 | <tr> | 2891 | <tr> |
| 2906 | <td>¹</td> | 2892 | <td>¹</td> |
| 2907 | - <td>$i .</td> | ||
| 2908 | - <td> </td> | 2893 | + <td>$i .</td> |
| 2894 | + <td> </td> | ||
| 2909 | <td>Êîä</td> | 2895 | <td>Êîä</td> |
| 2910 | - <td>" . $item['code'] . "</td> | ||
| 2911 | - <td> </td> | 2896 | + <td>" . $item['code'] . "</td> |
| 2897 | + <td> </td> | ||
| 2912 | <td>Áðåíä</td> | 2898 | <td>Áðåíä</td> |
| 2913 | <td>" . viewBook ('catalogs_brends', $item['brend_id'], 'id', 'name') . "</td> | 2899 | <td>" . viewBook ('catalogs_brends', $item['brend_id'], 'id', 'name') . "</td> |
| 2914 | - <td> </td> | 2900 | + <td> </td> |
| 2915 | <td>Íàçâàíèå</td> | 2901 | <td>Íàçâàíèå</td> |
| 2916 | <td>" . $item['name'] . "</td> | 2902 | <td>" . $item['name'] . "</td> |
| 2917 | - <td> </td> | 2903 | + <td> </td> |
| 2918 | <td>Ðàçìåð</td> | 2904 | <td>Ðàçìåð</td> |
| 2919 | <td>" . $item['size'] . "</td> | 2905 | <td>" . $item['size'] . "</td> |
| 2920 | - <td> </td> | 2906 | + <td> </td> |
| 2921 | <td>Öâåò</td> | 2907 | <td>Öâåò</td> |
| 2922 | <td>" . $item['color'] . "</td> | 2908 | <td>" . $item['color'] . "</td> |
| 2923 | - <td> </td> | 2909 | + <td> </td> |
| 2924 | <td>Êîë.</td> | 2910 | <td>Êîë.</td> |
| 2925 | <td>" . $item_id['count'] . "</td> | 2911 | <td>" . $item_id['count'] . "</td> |
| 2926 | - <td> </td> | 2912 | + <td> </td> |
| 2927 | <td>Öåíà</td> | 2913 | <td>Öåíà</td> |
| 2928 | - <td>" . "(" . $item_id['product_cine_id'] . ") " . $item['cine'] . "</td> | ||
| 2929 | - <td> </td> | 2914 | + <td>" . "(" . $item_id['product_cine_id'] . ") " . $item['cine'] . "</td> |
| 2915 | + <td> </td> | ||
| 2930 | <td>Ñóììà</td> | 2916 | <td>Ñóììà</td> |
| 2931 | <td>" . ($item_id['product_cine_id'] * $item_id['count']) . "</td> | 2917 | <td>" . ($item_id['product_cine_id'] * $item_id['count']) . "</td> |
| 2932 | - <td> </td> | 2918 | + <td> </td> |
| 2933 | <td>Áðîíü</td> | 2919 | <td>Áðîíü</td> |
| 2934 | - <td>" . $item_id['reservation'] . "</td> | ||
| 2935 | - </tr> | 2920 | + <td>" . $item_id['reservation'] . "</td> |
| 2921 | + </tr> | ||
| 2936 | </table>"; | 2922 | </table>"; |
| 2937 | $sum[] = ($item_id['product_cine_id'] * $item_id['count']); | 2923 | $sum[] = ($item_id['product_cine_id'] * $item_id['count']); |
| 2938 | } | 2924 | } |
| 2939 | } | 2925 | } |
| 2940 | } | 2926 | } |
| 2941 | - | 2927 | + |
| 2942 | $view .= " | 2928 | $view .= " |
| 2943 | <span class='total'>Îáùàÿ ñóììà: " . array_sum ($sum) . " ãðí. </span> | 2929 | <span class='total'>Îáùàÿ ñóììà: " . array_sum ($sum) . " ãðí. </span> |
| 2944 | <span class='total'>Ñòîèìîñòü äîñòàâêè: " . $order['cost_delivery'] . " ãðí. </span> | 2930 | <span class='total'>Ñòîèìîñòü äîñòàâêè: " . $order['cost_delivery'] . " ãðí. </span> |
| 2945 | </div>"; | 2931 | </div>"; |
| 2946 | } | 2932 | } |
| 2947 | - | 2933 | + |
| 2948 | $view .= "</div>"; | 2934 | $view .= "</div>"; |
| 2949 | - | 2935 | + |
| 2950 | // Âûâîäèì 2 ðàçà | 2936 | // Âûâîäèì 2 ðàçà |
| 2951 | - | 2937 | + |
| 2952 | echo $view; | 2938 | echo $view; |
| 2953 | echo "<div class='print'><div class='separator'></div></div>"; | 2939 | echo "<div class='print'><div class='separator'></div></div>"; |
| 2954 | $view2 = ''; | 2940 | $view2 = ''; |
| 2955 | $view2 .= "<div class='print'>"; | 2941 | $view2 .= "<div class='print'>"; |
| 2956 | - | 2942 | + |
| 2957 | $view2 .= " | 2943 | $view2 .= " |
| 2958 | <div class='client'> | 2944 | <div class='client'> |
| 2959 | - <table style='font-size:16px;'> | 2945 | + <table style='font-size:16px;'> |
| 2960 | <tr> | 2946 | <tr> |
| 2961 | <td>Çàêàç # </td> | 2947 | <td>Çàêàç # </td> |
| 2962 | <td>" . $order['order_id'] . "</td> | 2948 | <td>" . $order['order_id'] . "</td> |
| 2963 | </tr> | 2949 | </tr> |
| 2964 | - <tr> | 2950 | + <tr> |
| 2965 | <td>Äàòà: </td> | 2951 | <td>Äàòà: </td> |
| 2966 | <td>" . date ('Y-m-d H:i:s', $order['mktime']) . "</td> | 2952 | <td>" . date ('Y-m-d H:i:s', $order['mktime']) . "</td> |
| 2967 | </tr> | 2953 | </tr> |
| @@ -2976,33 +2962,32 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') | @@ -2976,33 +2962,32 @@ if (isset ($_GET['action']) && $_GET['action'] == 'print') | ||
| 2976 | <tr> | 2962 | <tr> |
| 2977 | <td>Ãîðîä: </td> | 2963 | <td>Ãîðîä: </td> |
| 2978 | <td>" . $order['city'] . "</td> | 2964 | <td>" . $order['city'] . "</td> |
| 2979 | - </tr> | ||
| 2980 | - <tr> | 2965 | + </tr> |
| 2966 | + <tr> | ||
| 2981 | <td>¹ ñêëàäà: </td> | 2967 | <td>¹ ñêëàäà: </td> |
| 2982 | <td>" . $order['warehouse'] . "</td> | 2968 | <td>" . $order['warehouse'] . "</td> |
| 2983 | </tr> | 2969 | </tr> |
| 2984 | - <tr> | 2970 | + <tr> |
| 2985 | <td>Ñòðàõîâêà: </td> | 2971 | <td>Ñòðàõîâêà: </td> |
| 2986 | <td>" . $order['insurance'] . "</td> | 2972 | <td>" . $order['insurance'] . "</td> |
| 2987 | </tr> | 2973 | </tr> |
| 2988 | - <tr> | 2974 | + <tr> |
| 2989 | <td>Ñóììà íàëîæåííîãî: </td> | 2975 | <td>Ñóììà íàëîæåííîãî: </td> |
| 2990 | <td>" . $order['sumn'] . "</td> | 2976 | <td>" . $order['sumn'] . "</td> |
| 2991 | </tr> | 2977 | </tr> |
| 2992 | - <tr> | 2978 | + <tr> |
| 2993 | <td>Îòïðàâêà çà ñ÷åò: </td> | 2979 | <td>Îòïðàâêà çà ñ÷åò: </td> |
| 2994 | <td>" . $order['sends'] . "</td> | 2980 | <td>" . $order['sends'] . "</td> |
| 2995 | - </tr> | ||
| 2996 | - <tr> | 2981 | + </tr> |
| 2982 | + <tr> | ||
| 2997 | <td>Êîìåíòàðèé: </td> | 2983 | <td>Êîìåíòàðèé: </td> |
| 2998 | <td>" . $order['mcomment'] . "</td> | 2984 | <td>" . $order['mcomment'] . "</td> |
| 2999 | </tr> | 2985 | </tr> |
| 3000 | 2986 | ||
| 3001 | </table> | 2987 | </table> |
| 3002 | </div> | 2988 | </div> |
| 3003 | - </div>"; | ||
| 3004 | - | 2989 | + </div>"; |
| 2990 | + | ||
| 3005 | echo $view2; | 2991 | echo $view2; |
| 3006 | } | 2992 | } |
| 3007 | -} | ||
| 3008 | -?> | 2993 | +} |
| 3009 | \ No newline at end of file | 2994 | \ No newline at end of file |
templates/admin/admin.tpl
| @@ -266,7 +266,14 @@ function check(n){ | @@ -266,7 +266,14 @@ function check(n){ | ||
| 266 | </td> | 266 | </td> |
| 267 | <td> | 267 | <td> |
| 268 | <table cellpadding="0" cellspacing="0" width="100%" height="100%"> | 268 | <table cellpadding="0" cellspacing="0" width="100%" height="100%"> |
| 269 | - <tr><td class="bord" align="right"><a href="{$smarty.const.URL}admin.php?action=rules" id="link1">Óïðàâëåíèå ñòðàíèöàìè</a></td></tr> | 269 | + {php} |
| 270 | + | ||
| 271 | + // ***** Àäìèí ðåæèì ***** | ||
| 272 | + if (in_array ($_SESSION['admin']['group'], array (1))) | ||
| 273 | + { | ||
| 274 | + echo '<tr><td class="bord" align="right"><a href="/admin.php?action=rules" id="link1">Óïðàâëåíèå ñòðàíèöàìè</a></td></tr>'; | ||
| 275 | + } | ||
| 276 | + {/php} | ||
| 270 | <tr><td height="100%" class="content_site" valign="top"> | 277 | <tr><td height="100%" class="content_site" valign="top"> |
| 271 | <h1 class="H1Title">{php} echo $H1Title;{/php}</h1> | 278 | <h1 class="H1Title">{php} echo $H1Title;{/php}</h1> |
| 272 | 279 |