} $order_info = get_order_info($order_id); if ($order_info['referrer_payment_status'] == 0) { Order::update($order_id, array('referrer_payment_status' => 1, 'referrer_payment_date' => date('Y-m-d H:i:s'))); } } $result[] = 'Оплачено'; break; } if ($bDoUpdate) { Order::update($_GET['order_id'], array($_GET['field'] => $value)); $order_info = Order::find($_GET['order_id']); if ($bDoHistoryUpdate) { $data = array('change_date' => time(), 'change_user_id' => $_SESSION['user']['data']['id'], 'order_id' => $_GET['order_id'], 'filial_id_new' => $order_info['filial_id'], 'klient_id_new' => $order_info['klient_id'], 'vuz_id_new' => $order_info['vuz_id'], 'vuz_user_new' => $order_info['vuz_user'], 'type_id_new' => $order_info['type_id'], 'type_user_new' => $order_info['type_user'], 'napr_id_new' => $order_info['napr_id'], 'disc_id_new' => $order_info['disc_id'], 'disc_user_new' => $order_info['disc_user'], 'time_kln_new' => $order_info['time_kln'], 'cost_kln_new' => $order_info['cost_kln'], 'payment_id_new' => $order_info['payment_id'], 'subject_new' => $order_info['subject'], 'about_kln_new' => $order_info['about_kln'], 'about_mng_new' => $order_info['about_mng'], 'kurs_new' => $order_info['kurs'], 'prakt_pc_new' => $order_info['prakt_pc'], 'pages_min_new' => $order_info['pages_min'], 'pages_max_new' => $order_info['pages_max'], 'src_min_new' => $order_info['src_min'], 'src_max_new' => $order_info['src_max'], 'from_id_new' => $order_info['from_id'], 'oform_new' => $order_info['oform'], 'next_rel_date_new' => $order_info['next_rel_date'], 'status_id_new' => $order_info['status_id'], 'ok_comment_new' => $order_info['ok_comment'], 'ok_comment_date_new' => $order_info['ok_comment_date'], 'payment_comment_new' => $order_info['payment_comment'], 'cost_auth_new' => $order_info['cost_auth'], 'time_auth_new' => $order_info['time_auth'], 'oplata_kln_new' => $order_info['oplata_kln'], 'author_paid_new' => $order_info['author_paid'], 'company_paid_new' => $order_info['company_paid'], 'filial_id_old' => $order_info['filial_id'], 'klient_id_old' => $order_info['klient_id'], 'vuz_id_old' => $order_info['vuz_id'], 'vuz_user_old' => $order_info['vuz_user'], 'type_id_old' => $order_info['type_id'], 'type_user_old' => $order_info['type_user'], 'napr_id_old' => $order_info['napr_id'], 'disc_id_old' => $order_info['disc_id'], 'disc_user_old' => $order_info['disc_user'], 'time_kln_old' => $order_info['time_kln'], 'cost_kln_old' => $order_info['cost_kln'], 'payment_id_old' => $order_info['payment_id'], 'subject_old' => $order_info['subject'], 'about_kln_old' => $order_info['about_kln'], 'about_mng_old' => $order_info['about_mng'], 'kurs_old' => $order_info['kurs'], 'prakt_pc_old' => $order_info['prakt_pc'], 'pages_min_old' => $order_info['pages_min'], 'pages_max_old' => $order_info['pages_max'], 'src_min_old' => $order_info['src_min'], 'src_max_old' => $order_info['src_max'], 'from_id_old' => $order_info['from_id'], 'oform_old' => $order_info['oform'], 'next_rel_date_old' => $order_info['next_rel_date'], 'status_id_old' => $order_info['status_id'], 'ok_comment_old' => $order_info['ok_comment'], 'ok_comment_date_old' => $order_info['ok_comment_date'], 'payment_comment_old' => $order_info['payment_comment'], 'cost_auth_old' => $order_info['cost_auth'], 'time_auth_old' => $order_info['time_auth'], 'oplata_kln_old' => $order_info['oplata_kln'], 'author_paid_old' => $order_info['author_paid'], 'company_paid_old' => $order_info['company_paid']); $data[$_GET['field'] . '_new'] = $_GET['value']; OrderHistory::create($data); } } } break; case 'get': if (!empty($_GET['field'])) { switch ($_GET['field']) { case 'status_id': $result[] = db::get_select("SELECT id, status_name FROM " . TBL_PREF . "orders_status", 'status', '', $_GET['value'], 'class="instantEditNewValue"'); break; case 'referrer_payment_status': $result[] = 'Оплатить?<input type="hidden" value="1" class="instantEditNewValue"/>'; break; case 'oplata_kln': case 'cost_kln':
<?php use Components\Entity\OrderHistory; if (isset($_REQUEST['change']) && !empty($_REQUEST['change'])) { $order_change_history = OrderHistory::find($_REQUEST['change']); /******************** before edit start ********************/ $frm = $GUI->Form("Содержание заказа до изменений", 650); $ypos = 10; $is_author = is_author($_SESSION["user"]["data"]['id']); if ($is_author) { $h = 800; } else { $h = 1100; } $frm->VLine(10, $h - 80, 630); $frm->height = $h; $b = $frm->Button("К списку", 275, $h - 60, 100); $b->Event = "document.location.href=\"?section=ord&subsection=2&order=" . $_REQUEST['order'] . "&p=5\""; if (!$is_author) { $klient = get_client_info($order_change_history['klient_id_old']); $frm->Label("Клиент: <b>" . $klient["fio"] . "</b>", 10, $ypos); $ypos += 20; $frm->Label("Почта: <b>" . $klient["email"] . "</b>", 10, $ypos); $ypos += 20; $frm->Label("Телефон: <b>" . $klient["telnum"] . "</b>", 10, $ypos); $ypos += 20; $s = $frm->Hidden($klient["id"]); //0 $s->linkName = "client"; $b = $frm->Button("Инфо", 560, $ypos - 32, 70); $b->Event = 'var id= jQuery("#' . $s->idname . '").val(); if(id!=0) window.open("?section=kln&subsection=2&edit="+id);';