_object = false; $this->controller = 'AdminModules'; $this->module_name = 'ant_supplierdemand'; $this->config_tab = (bool)$config_tab; if ($config_tab) { $this->controller = 'AdminAntSupplierDemand'; } $this->helperForm = new HelperFormBootstrap(); $this->helperForm->_select2 = true; $this->helperForm->_inputMask = true; $this->helperForm->_dateTimePicker = true; } public function display() { $this->_html = ''; $this->_postProcess(); $this->_addCss(); $this->_html .= $this->helperForm->renderStyle(); if(Validate::isLoadedObject($this->_object)) { $this->_displayView(); } else { $this->_displayList(); } $this->_html .='
'; $this->_addJs(); $this->_html .= $this->helperForm->renderScript(); echo $this->_html; } protected function _addJs() { $this->helperForm->_js .= ''; } protected function _addCss() { $this->helperForm->_css .=' #content .bootstrap-datetimepicker-widget tr th { border-radius :0px !important; } .table tr th { background: #565485; background: rgba(86,84,133,0.9); color: #fff; font-size: 12px; } .table tr:nth-child(even) { background: #F1F1F1; } .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th { vertical-align: middle; } .table .input-group-btn .btn { padding: 4px 5px; color: #504d8b; } .table .input-group-btn .btn .anticon{ font-size: 12px; } .bg-grey{ background: #EFEFEF; border-radius:4px; } .bg-grey .div-title { border-bottom: 2px solid #504D8B; } .div-title i.anticon, .div-title i.glyphicon, ul li a{ color:#504d8b; } '; } protected function _displayList() { global $cookie, $currentIndex; $id_lang = (int)$cookie->id_lang; $query_state = array(1,2,3); if(Tools::getValue('query_state')){ $wanted_state = Tools::getValue('query_state'); $query_state = array((int)$wanted_state); } if(Tools::getValue('from') && Tools::getValue('to') && Tools::getValue('filter')){ $datefrom = DateTime::createFromFormat('d/m/Y', Tools::getValue('from')); $dateto = DateTime::createFromFormat('d/m/Y', Tools::getValue('to')); $supplier_demands = SupplierDemand::getDemands(false, 'sd.date_add > "'.$datefrom->format('Y-m-d').' 00:00:00" AND sd.date_add < "'.$dateto->format('Y-m-d').' 23:59:59" '.(!empty($query_state) ? 'AND sd.`id_state` IN ('.implode(',',$query_state).')' : '').' ORDER BY sd.date_add DESC' ); } else { $supplier_demands = SupplierDemand::getDemands($query_state); } $states = SupplierDemand::$states; $solutions = SupplierDemand::$solutions; $counts = array( "done" => SupplierDemand::getCountDemands(array(5)), "no_answered" => SupplierDemand::getCountDemands(array(4)), "in_progress" => SupplierDemand::getCountDemands(array(1,2,3)) ); $_current_index = ($this->config_tab ? $currentIndex . '&token=' . Tools::getAdminTokenLite($this->controller) : $_SERVER['REQUEST_URI']); $this->_html .=''.$this->l('ID').' | '.$this->l('Order').' | '.$this->l('Product').' | '.$this->l('Sale').' | '.$this->l('Status').' | '.$this->l('Date').' | '.$this->l('Renewed').' | '.$this->l('Solution').' | '.$this->l('Action').' |
---|---|---|---|---|---|---|---|---|
#'.$supplier_demand['id_supplier_demand'].' | N° '.$supplier_demand['id_order'].' | '.wordwrap($info['product_name'], 40, " \n").' |
'.$info['category_name'].' | '.$states[$supplier_demand['id_state']]['name'].' | '.date('d/m/Y',strtotime($supplier_demand['date_add'])).' | '.($renews_number>1?''.$renews_number.'':''.$renews_number.'').' | '.((int)$supplier_demand['solution']>0?$solutions[(int)$supplier_demand['solution']]:'/').' |
'.($this->_object->comment!==null?nl2br($this->_object->comment):'No comment').'
'.$states[$histories[0]['id_state']]['name'].'
('.$histories[0]['employee'].' - '.date('d/m/Y H:i',strtotime($histories[0]['date_add'])).')
'.date('d/m/Y H:i',strtotime($history['date_add'])).' | '.$states[$history['id_state']]['name'].' | '.$history['employee'].' |