private function order_standart_rows_Template($id_row = 0) { $html = ''; $table_head_html = ' <table id="general_panel_orders_tbl"> <tr> <th colspan="3">Артикул/номенклатура/печать</th> <th>тираж<br>запас</th> <th>поставщик товара и резерв</th> <th>подрядчик печати</th> <th>сумма</th> <th>тех + доп инфо</th> <th>дата утв. макета</th> <th>дата сдачи</th> <th colspan="2">статус</th> </tr> '; $this->collspan = 12; // запрос строк заказов $this->get_the_orders_Database($id_row); $table_order_row = ''; // создаем экземпляр класса форм $this->FORM = new Forms(); // тут будут храниться операторы $this->Order['operators_listiong'] = ''; // ПЕРЕБОР ЗАКАЗОВ foreach ($this->Order_arr as $this->Order) { // переменные для вычисления даты сдачи заказа // обнуляются при начале обсчётак каждого заказа $this->order_shipping_date = ''; $this->order_shipping_date_timestamp = 0; $this->one_specificate_is_not_approval = 0; // одна из спецификаций не утверждена $this->price_order = 0; // стоимость заказа ////////////////////////// // open_close -- start ////////////////////////// // получаем флаг открыт/закрыто $this->open__close = $this->get_open_close_for_this_user($this->Order['open_close']); ////////////////////////// // open_close -- end ////////////////////////// // запоминаем обрабатываемые номера заказа и запроса // номер запроса $this->query_num = $this->Order['query_num']; // номер заказа $this->order_num = $this->Order['order_num']; // преобразовываем вид номера заказа для пользователя (подставляем впереди 0000) $this->order_num_for_User = Cabinet::show_order_num($this->Order['order_num']); // запрашиваем информацию по позициям $this->order_deadline = ''; // дата отгрузки заказа (из спецификации) $this->order_date_of_delivery = ''; // количество рабочих дней на работу над заказом (из спецификации) $this->position_item = 1; // порядковый номер позиции $table_order_positions_rows = $this->table_specificate_for_order_Html(); // $table_order_positions_rows = ''; if ($table_order_positions_rows == '') { continue; } // формируем строку с информацией о заказе $table_order_row .= '<tr class="order_head_row" data-id="' . $this->Order['id'] . '" data-order_num="' . $this->Order['order_num'] . '">'; ////////////////////////// // тело строки заказа -- start --- ////////////////////////// $table_order_row2_body = '<td class="show_hide" ' . $this->open_close_rowspan . '="' . ($this->rows_num + 1) . '"><span class="cabinett_row_hide_orders' . $this->open_close_class . '"></span></td>'; $table_order_row2_body .= '<td colspan="4" class="orders_info">'; // исполнители заказа $table_order_row2_body .= $this->performer_table_for_order(); $table_order_row2_body .= '</td>'; // стоимость заказа $table_order_row2_body .= '<td><span class="show_the_full_information">' . $this->price_order . '</span> р.</td>'; // бух учет $table_order_row2_body .= '<td class="buh_uchet_for_order" data-id="' . $this->Order['order_num'] . '"></td>'; // платёжная информация $this->Order_payment_percent = $this->calculation_percent_of_payment($this->price_order, $this->Order['payment_status']); // комментарии $table_order_row2_body .= '<td>'; $table_order_row2_body .= '<span data-cab_list_order_num="' . $this->order_num . '" data-cab_list_query_num="' . $this->Order['query_num'] . '" class="icon_comment_order_show white ' . Comments_for_order_class::check_the_empty_order_coment_Database($this->Order['order_num']) . '"></span>'; $table_order_row2_body .= '</td>'; // срок по ДС $table_order_row2_body .= '<td></td>'; // $table_order_row2_body .= '<td><input type="text" name="date_of_delivery_of_the_order" class="date_of_delivery_of_the_order" value="'.$this->Order['date_of_delivery_of_the_order'].'"></td>'; // дата сдачи / отгрузки $table_order_row2_body .= '<td>'; $table_order_row2_body .= $this->order_shipping_date; $table_order_row2_body .= '</td>'; $table_order_row2_body .= '<td style="width:78px"><span class="greyText black">Заказа: </span></td>'; $table_order_row2_body .= '<td class="' . ($this->user_access == 5 || $this->user_access == 1 ? 'order_status_chenge' : '') . '">' . $this->decoder_statuslist_order_and_paperwork($this->Order['global_status']) . '</td>'; ///////////////////////////////////// // тело строки заказа -- end --- ///////////////////////////////////// $table_order_row2 = '</tr>'; // включаем вывод позиций $table_order_row .= $table_order_row2_body . $table_order_row2 . $table_order_positions_rows; // запрос по одной строке без подробностей if ($id_row != 0) { return $table_order_row2_body; } } $html = $table_head_html . $table_order_row . '</table>'; echo $html; }
protected function save_logotip_for_all_order_AJAX() { global $mysqli; // если массив услуг пуст - заполняем его if (empty($this->Services_list_arr)) { $this->Services_list_arr = $this->get_all_services_Database(); } // запрос спецификаций $query = "SELECT * FROM `" . CAB_BILL_AND_SPEC_TBL . "` WHERE `order_num` = '" . (int) $_POST['order_num'] . "'"; $result = $mysqli->query($query) or die($mysqli->error); $spec_id = ''; $n = 0; if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $spec_id .= ($n > 0 ? ',' : '') . "'" . $row['id'] . "'"; $n++; } } // echo '{"response":"OK","message":"'.base64_encode($spec_id).'", "function":"echo_message","message_type":"system_message"}'; // exit; // запрашиваем позиции прикреплённые к спецификации $query = "SELECT *, `" . CAB_ORDER_DOP_DATA . "`.`id` AS `id_dop_data` \n\t\t\t\tFROM `" . CAB_ORDER_DOP_DATA . "` \n\t\t\t\tINNER JOIN " . CAB_ORDER_MAIN . " ON `" . CAB_ORDER_MAIN . "`.`id` = `" . CAB_ORDER_DOP_DATA . "`.`row_id` \n\t\t\t\tWHERE `" . CAB_ORDER_MAIN . "`.`the_bill_id` IN (" . $spec_id . ")"; $dop_row_id_str = ''; $result = $mysqli->query($query) or die($mysqli->error); $n = 0; if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $dop_row_id_str .= ($n > 0 ? ',' : '') . "'" . $row['id_dop_data'] . "'"; $n++; } } // echo $query.' <br> '.$dop_row_id_str; $service_union_arr = array(); // если у нас есть список dop_row_id позиций if ($dop_row_id_str != '') { // завпрашиваем услуги прикрепленные к позициям заказа $query = "SELECT * FROM `" . CAB_DOP_USLUGI . "` WHERE `dop_row_id` IN (" . $dop_row_id_str . ");"; $result = $mysqli->query($query) or die($mysqli->error); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $service_union_arr[] = $row; } } } // echo '<br>'.$query.'<br>'; $id_s = array(); // перебираем прикрепленные услуги foreach ($service_union_arr as $key => $union_service) { // проеряем существует ли описание такой услуги и если существует то включено ли поле логотип if (isset($this->Services_list_arr[$union_service['uslugi_id']]) && $this->Services_list_arr[$union_service['uslugi_id']]['logotip_on'] == 'on') { // запоминаем id прикреплённой услуги, который мы намереваемся изменить $id_s[] = $union_service['id']; } else { // если такой услуги у нас в списках почему-то нет, но она у нас прикреплена // т.е. мы не можем проверить включено ли поле логотип в данной прикрепленнной услуге и заполняем ету ячейку в базе без проверки $id_s[] = $union_service['id']; } } // перебор выписанных нами id услуг, к которым мы будем прикреплять логотип $id_s_str = ''; foreach ($id_s as $key => $value) { $id_s_str .= ($key > 0 ? ',' : '') . "'" . $value . "'"; } // echo $id_s_str,' <br>'; if ($id_s_str != '') { ////////////////////////////////////////////////////////////////////////////// // запрос на прикрепление логотипа к услугам прикреплённым к позиции ////////////////////////////////////////////////////////////////////////////// $query = "UPDATE `" . CAB_DOP_USLUGI . "` SET \n\t\t\t\t\t\t`logotip` = '" . trim($_POST['logotip']) . "' \n\t\t\t\t\t\tWHERE `id` IN (" . $id_s_str . ");"; $result = $mysqli->query($query) or die($mysqli->error); // формируем ответ $Message = 'Значение проля логотип успешно прикреплено ко всем услугам заказа № ' . Cabinet::show_order_num($_POST['order_num']) . '.'; // echo $query; } else { // формируем ответ $Message = 'К данному заказу не прикреплено ни одной услуги<br> в которой можно было бы заполнить поле логотип.'; } echo '{"response":"OK","message":"' . base64_encode($Message) . '", "function":"echo_message","message_type":"system_message"}'; exit; }
<th>артикул</th> <th>номенклатура</th> <th>тираж</th> <th>цена за товар</th> <th>доп. услуги</th> <th>цена позиции</th> '.(($order_tbl_access['ttn_see']['access'])?'<th>ТТН</th>':'').' <th>статус снаб</th> <th>статус мен</th> <th>статус заказа</th> </tr>'; // //if(count($main_rows_id)==0){$order_tbl = 'в данном заказе число позиций равно нулю';die;} // print_r($value); $order_num_1 = Cabinet::show_order_num($order_num); // $html .= '<tr class="query_detail">'; // $html .= '<td class="show_hide"><span class="cabinett_row_hide"></span></td>'; // $html .= '<td colspan="6" class="each_art">'; // запрос из os__cab_orders_dop_data по id заказа $query = " SELECT `".CAB_ORDER_DOP_DATA."`.`id` AS `id_dop_data`, `".CAB_ORDER_DOP_DATA."`.`quantity`, `".CAB_ORDER_DOP_DATA."`.`price_out`, `".CAB_ORDER_DOP_DATA."`.`print_z`, `".CAB_ORDER_DOP_DATA."`.`zapas`, DATE_FORMAT(`".CAB_ORDER_MAIN."`.`date_create`,'%d.%m.%Y %H:%i:%s') AS `gen_create_date`,
private function production_rows($id_row = 0) { $where = 0; // скрываем левое меню $html = ''; $table_head_html = ''; if ($this->user_access == $this->group_access) { $table_head_html .= ' <style type="text/css" media="screen"> #cabinet_left_coll_menu{display:none;} #cabinet_filtres_list ul li{ background-color: #ECEF3D;} select.get_statuslist_uslugi { width: 125px;} </style>'; } // формируем шапку таблицы вывода $table_head_html .= ' <table id="general_panel_orders_tbl"> <tr> <th colspan="3" rowspan="2">Артикул/номенклатура/печать</th> <th rowspan="2">М</th> <th rowspan="2">операции</th> <th rowspan="2">тираж</th> <th rowspan="2">Цв.</th> <th rowspan="2">пплёнки/клише</th> <th rowspan="2">статус снабжение/склад</th> <th rowspan="2">дата сдачи</th> <th colspan="2">дата работы</th> <th rowspan="2">станок</th> <th rowspan="2">мастер</th> <th rowspan="2">статус операции</th> <th rowspan="2">% гот-ти</th> </tr> <tr> <th>от</th> <th>до</th> </tr>'; // запрос заказов $this->get_the_orders_Database($id_row); $table_order_row = ''; // подключаем класс форм (понадобится в методе: decode_json_no_cat_to_html) // создаем экземпляр класса форм // $this->FORM = new Forms(); // ПЕРЕБОР ЗАКАЗОВ foreach ($this->Order_arr as $this->Order) { // приостановленные заказы выводим только во вкладках "пауза" и "все" if (isset($_GET['subsection']) && $_GET['subsection'] == 'production') { if ($this->Order['global_status'] != 'paused' && $this->Order['global_status'] != 'in_work') { continue; } } else { if ($this->Order['global_status'] != 'in_work') { continue; } } // переменные для вычисления даты сдачи заказа // обнуляются при начале обсчётак каждого заказа $this->order_shipping_date = ''; $this->order_shipping_date_timestamp = 0; $this->one_specificate_is_not_approval = 0; // одна из спецификаций не утверждена // цена заказа $this->price_order = 0; // получаем флаг открыт/закрыто $this->open__close = $this->get_open_close_for_this_user($this->Order['open_close']); // запоминаем обрабатываемые номера заказа и запроса // номер запроса $this->query_num = $this->Order['query_num']; // номер заказа $this->order_num = $this->Order['order_num']; // преобразовываем вид номера заказа для пользователя (подставляем впереди 0000) $this->order_num_for_User = Cabinet::show_order_num($this->Order['order_num']); // запрашиваем информацию по спецификациям $table_order_positions_rows = $this->table_specificate_for_order_for_production_Html(); if ($table_order_positions_rows == '') { continue; } // формируем строку с информацией о заказе $table_order_row .= '<tr class="order_head_row ' . $this->open_close_row_class . '" data-id="' . $this->Order['id'] . '">'; $table_order_row .= '<td class="show_hide" ' . $this->open_close_rowspan . '="' . $this->position_item . '"> <span class="cabinett_row_hide_orders' . $this->open_close_class . '"></span> </td>'; $table_order_row .= '<td colspan="11" class="orders_info">'; // исполнители заказа $table_order_row .= $this->performer_table_for_order(); $table_order_row .= '</td>'; // дата сдачи $table_order_row .= '<td>'; $table_order_row .= $this->order_shipping_date; $table_order_row .= '</td>'; // комментарии по заказу $table_order_row .= '<td>'; $table_order_row .= '<span data-cab_list_order_num="' . $this->order_num . '" data-cab_list_query_num="' . $this->Order['query_num'] . '" class="icon_comment_order_show white ' . Comments_for_order_class::check_the_empty_order_coment_Database($this->Order['order_num']) . '"></span>'; $table_order_row .= '</td>'; // $table_order_row .= '<td colspan=""></td>'; // $table_order_row .= '<td style="width:78px"></td>'; $table_order_row .= '<td class="' . ($this->user_access == 5 || $this->user_access == 1 || $this->user_access == 9 ? 'order_status_chenge' : '') . '">' . ($this->user_access != 8 ? '<span class="greyText black">' . ($this->user_access == 8 ? '' : 'Статус заказа (МЕН):') . ' </span><br>' . $this->decoder_statuslist_order_and_paperwork($this->Order['global_status']) : '') . '</td>'; $table_order_row .= '<td colspan="1"></td>'; $table_order_row .= '</tr>'; // включаем вывод позиций $table_order_row .= $table_order_positions_rows; } $html = $table_head_html . $table_order_row . '</table>'; return $html; }
protected function orders_Template_OLD($id_row = 0) { $this->get_filters(); $where = 0; // скрываем левое меню $html = ''; $table_head_html = '<style type="text/css" media="screen"> #cabinet_left_coll_menu{display:none;} </style>'; // $html = ''; $table_head_html .= ' <table id="general_panel_orders_tbl"> <tr> <th colspan="3">Артикул/номенклатура/печать</th> <th>тираж</th> <th>логотип</th> <th>поставщик товара</th> <th>№ резерва</th> <th>подрядчик печати</th> <th>дата отгрузки</th> <th>статус товара</th> <th>статус заказа</th> </tr> '; global $mysqli; $query = "SELECT \n\t\t\t\t\t`" . CAB_ORDER_ROWS . "`.*, \n\t\t\t\t\tDATE_FORMAT(`" . CAB_ORDER_ROWS . "`.`create_time`,'%d.%m.%Y %H:%i:%s') AS `create_time`\n\t\t\t\t\tFROM `" . CAB_ORDER_ROWS . "`"; if ($id_row) { $query .= " " . ($where ? 'AND' : 'WHERE') . " `" . CAB_ORDER_ROWS . "`.`id` = '" . $id_row . "'"; $where = 1; } else { // filters for the client id if (isset($_GET['client_id'])) { $query .= " " . ($where ? 'AND' : 'WHERE') . " `" . CAB_ORDER_ROWS . "`.`client_id` = '" . (int) $_GET['client_id'] . "'"; $where = 1; } // filters if (isset($_GET['order_num'])) { $query .= " " . ($where ? 'AND' : 'WHERE') . " `" . CAB_ORDER_ROWS . "`.`order_num` = '" . (int) $_GET['order_num'] . "'"; $where = 1; } // $query .=" WHERE `".CAB_ORDER_ROWS."`.`global_status` = ''"; } ////////////////////////// // sorting ////////////////////////// $query .= ' ORDER BY `id` DESC'; // echo $query; $result = $mysqli->query($query) or die($mysqli->error); $this->Order_arr = array(); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $this->Order_arr[] = $row; } } $table_order_row = ''; // подключаем класс форм (понадобится в методе: decode_json_no_cat_to_html) // создаем экземпляр класса форм // $this->FORM = new Forms(); // ПЕРЕБОР ЗАКАЗОВ foreach ($this->Order_arr as $this->Order) { // цена заказа $this->price_order = 0; ////////////////////////// // open_close -- start ////////////////////////// // получаем флаг открыт/закрыто $this->open__close = $this->get_open_close_for_this_user($this->Order['open_close']); // выполнение метода get_open_close_for_this_user - вернёт 3 переменные в object // class для кнопки показать / скрыть #$this->open_close_class = ""; // rowspan / data-rowspan #$this->open_close_rowspan = "rowspan"; // стили для строк которые скрываем или показываем #$this->open_close_tr_style = ' style="display: table-row;"'; ////////////////////////// // open_close -- end ////////////////////////// // запоминаем обрабатываемые номера заказа и запроса // номер запроса $this->query_num = $this->Order['query_num']; // номер заказа $this->order_num = $this->Order['order_num']; // преобразовываем вид номера заказа для пользователя (подставляем впереди 0000) $this->order_num_for_User = Cabinet::show_order_num($this->Order['order_num']); // запрашиваем информацию по позициям $table_order_positions_rows = $this->table_order_positions_rows_Html(); if ($table_order_positions_rows == '') { continue; } // формируем строку с информацией о заказе $table_order_row .= '<tr class="order_head_row" data-id="' . $this->Order['id'] . '">'; $table_order_row .= '<td class="show_hide" ' . $this->open_close_rowspan . '="' . $this->position_item . '"> <span class="cabinett_row_hide_orders' . $this->open_close_class . '"></span> </td>'; $table_order_row .= '<td colspan="6" class="orders_info"> <span class="greyText">Заказ №: </span><a href="?page=cabinet' . (isset($_GET['section']) ? '§ion=' . $_GET['section'] : '') . (isset($_GET['subsection']) ? '&subsection=' . $_GET['subsection'] : '') . '&client_id=' . $this->Order['client_id'] . '&order_num=' . $this->order_num_for_User . '">' . $this->order_num_for_User . '</a> <span class="greyText">, Кампания : </span>' . $this->get_client_name_link_Database($this->Order['client_id']) . ' <span class="greyText">, Юр.лицо : в разработке</span> <span class="greyText">, менеджер: ' . $this->get_manager_name_Database_Html($this->Order['manager_id'], 1) . '</span> <span class="greyText">, снабжение: ' . $this->get_name_employee_Database_Html($this->Order['snab_id']) . '</span> </td>'; $table_order_row .= '<td> <!--// comments --> <span data-cab_list_order_num="' . $this->order_num . '" data-cab_list_query_num="' . $this->Order['query_num'] . '" class="icon_comment_order_show white ' . Comments_for_order_class::check_the_empty_order_coment_Database($this->Order['order_num']) . '"></span> </td>'; // $table_order_row .= '<td><strong>'.$this->Order['date_of_delivery_of_the_order'].'</strong></td>'; $table_order_row .= '<td><strong></strong></td>'; $table_order_row .= '<td><span class="greyText">заказа: </span></td>'; $table_order_row .= '<td>' . $this->decoder_statuslist_order_and_paperwork($this->Order['global_status']) . '</td>'; $table_order_row .= '</tr>'; // включаем вывод позиций $table_order_row .= $table_order_positions_rows; } $html = $table_head_html . $table_order_row . '</table>'; echo $html; }
private function get_paperwork_specificate_rows_Template() { // запрос по спецификациям $this->get_the_specificate_paperworck_Database($id_row = 0); // собираем html строк-предзаказов $html1 = ''; $table_head_html = ''; if ($this->user_access == 2) { echo ' <style type="text/css" media="screen"> #cabinet_left_coll_menu{display:none;} #cabinet_filtres_list ul li{ background-color: #ECEF3D;} </style>'; } if (count($this->Specificate_arr) == 0) { return 1; } $table_head_html .= ' <table class="cabinet_general_content_row" id="cabinet_general_content_row"> <tr> <th id="show_allArt"></th> <th class="check_show_me"></th> <th>Дата создания документа</th> <th>Заказ</th> <th>Компания</th> <th>Документ:</th> <th class="buh_uchet">Бух. учет</th> <th class="invoice_num">Счёт</th> <th>Дата опл-ты</th> <th>% оплаты</th> <th>Оплачено</th> <th>стоимость в спец.</th> <th>статус БУХ</th> </tr>'; foreach ($this->Specificate_arr as $this->specificate) { $invoice_num = $this->specificate['number_the_bill']; // номер счёта // получаем флаг открыт/закрыто $this->open__close = $this->get_open_close_for_this_user($this->specificate['open_close']); ////////////////////////// // open_close -- end ////////////////////////// // получаем массив позиций к спецификации $position_arr = $this->positions_rows_Database($this->specificate['id']); // СОБИРАЕМ ТАБЛИЦУ ############################### // строка с артикулами START ############################### $html = '<tr class="query_detail" ' . $this->open_close_tr_style . '>'; //$html .= '<td class="show_hide"><span class="this->cabinett_row_hide"></span></td>'; $html .= '<td colspan="14" class="each_art" >'; // ВЫВОД позиций $html .= '<table class="cab_position_div">'; // шапка таблицы позиций заказа $html .= '<tr> <th>артикул</th> <th>номенклатура</th> <th>тираж</th> <th>цены:</th> <th>товар</th> <th>печать</th> <th>доп. услуги</th> <th>в общем</th> <th></th> <th></th> </tr>'; $this->Price_of_position = 0; // общая стоимость заказа foreach ($position_arr as $position) { //////////////////////////////////// // Расчёт стоимости позиций START //////////////////////////////////// $this->GET_PRICE_for_position($position); //////////////////////////////////// // Расчёт стоимости позиций END //////////////////////////////////// $html .= '<tr data-id="' . $this->specificate['id'] . '">'; $html .= '<td> ' . $position['art'] . '</td>'; $html .= '<td>' . $position['name'] . '</td>'; $html .= '<td>' . ($position['quantity'] + $position['zapas']) . '</td>'; $html .= '<td></td>'; $html .= '<td><span>' . $this->Price_for_the_goods . '</span> р.</td>'; $html .= '<td><span>' . $this->Price_of_printing . '</span> р.</td>'; $html .= '<td><span>' . $this->Price_of_no_printing . '</span> р.</td>'; $html .= '<td><span>' . $this->Price_for_the_position . '</span> р.</td>'; $html .= '<td></td>'; $html .= '<td></td>'; $html .= '</tr>'; $this->Price_of_position += $this->Price_for_the_position; // прибавим к общей стоимости } $html .= '</table>'; $html .= '</td>'; $html .= '</tr>'; ############################### // строка с артикулами END ############################### // получаем % оплаты $percent_payment = $this->Price_of_position != 0 ? round($this->specificate['payment_status'] * 100 / $this->Price_of_position, 2) : '0.00'; // собираем строку заказа $html2 = '<tr data-id="' . $this->specificate['id'] . '" >'; $rowspan = isset($_POST['rowspan']) ? $_POST['rowspan'] : 2; //'.$this->get_manager_name_Database_Html($this->specificate['manager_id']).' $html2_body = '<td class="show_hide" ' . $this->open_close_rowspan . '="' . $rowspan . '"><span class="cabinett_row_hide' . $this->open_close_class . '"></span></td>'; $enable_check_for_order = ''; if ($this->user_access == 1 || ($this->specificate['order_num'] == 0 and $this->user_access == 5)) { $enable_check_for_order = '<div class="masterBtnContainer" data-manager_id="' . $this->specificate['manager_id'] . '" data-id="' . $this->specificate['id'] . '">'; $enable_check_for_order .= '<input type="checkbox" name="masterBtn" id="masterBtn' . $this->specificate['id'] . '"><label for="masterBtn' . $this->specificate['id'] . '"></label>'; $enable_check_for_order .= '</div>'; } ///////////////////////// // если хранящаяся в базу стоимость // не совпадает со стоимостью которая была выщетана - перезаписываем её на правильную // необходимо для записи там, где пусто ///////////////////////////////// if ($this->Price_of_position != $this->specificate['spec_price']) { $this->save_price_specificate_Database($this->specificate['id'], $this->Price_of_position); } // преобразовываем вид номера заказа для пользователя (подставляем впереди 0000) $this->order_num_for_User = Cabinet::show_order_num($this->specificate['order_num']); $html2_body .= '<td class="check_show_me">' . $enable_check_for_order . '</td>'; $html2_body .= '<td>' . $this->specificate['create_time'] . '<br>' . $this->get_manager_name_Database_Html($this->specificate['manager_id'], 1) . '</td>'; $html2_body .= '<td>' . $this->order_num_for_User . '</td>'; $html2_body .= '<td>' . $this->get_client_name_Database($this->specificate['client_id'], 1) . '</td>'; $html2_body .= '<td>'; $html2_body .= $this->get_document_link($this->specificate, $this->specificate['client_id'], $this->specificate['create_time']); // дата лимита, если работаем по дате $html2_body .= $this->specificate['date_type'] == 'date' ? '<br> <span class="dop_grey_small_info" style="padding:5px">оплатить ' . $this->specificate['prepayment'] . '% и утвердить макет до: ' . $this->specificate['shipping_date_limit'] . '</span>' : ''; $html2_body .= '</td>'; $html2_body .= '<td class="buh_uchet_for_spec" data-id="' . $this->specificate['id'] . '"></td>'; $html2_body .= '<td class="invoice_num">' . $this->specificate['number_the_bill'] . '</td>'; //$html2_body .= '<td><input type="text" class="payment_date" readonly="readonly" value="'.(((int)$this->specificate['payment_date']!=0)?$this->specificate['payment_date']:'').'"></td>'; $html2_body .= '<td>' . ((int) $this->specificate['payment_date'] != 0 ? $this->specificate['payment_date'] : '') . '</td>'; $html2_body .= '<td><span>' . $percent_payment . '</span> %</td>'; $html2_body .= '<td><span class="payment_status_span edit_span">' . $this->specificate['payment_status'] . '</span>р</td>'; $html2_body .= '<td><span>' . $this->Price_of_position . '</span> р.</td>'; $html2_body .= '<td class="buch_status_select">' . $this->decoder_statuslist_buch($this->specificate['buch_status'], 0, $this->specificate) . '</td>'; $html3 = '</tr>'; $html1 .= $html2 . $html2_body . $html3 . $html; // запрос по одной строке без подробностей if ($id_row) { return $html2_body; } } // добавляем скрытую кнопку для объединения выбранных счётов/спецификаций в заказ $html1 .= '<div id="export_in_order_div">'; $html1 .= '<ul>'; $html1 .= '<li id="create_in_order_button">Создать заказ</li>'; // для админа добавляем возможность приркрепления спецификации уже к существующему заказу if ($this->user_access == 1) { $html1 .= '<li id="add_for_other_order">Добавть к существующему заказу</li>'; } $html1 .= '</ul>'; $html1 .= '</div>'; echo $table_head_html; echo $html1; echo '</table>'; }