lang = TRUE; parent::__construct(); } public function displayForm($isMainTab=TRUE) { global $currentIndex, $cookie; parent::displayForm(); } public function display() { global $cookie, $currentIndex; $iso = Language::getIsoById((int)($cookie->id_lang)); $day_from = Tools::getValue('day_from', date('Y-m-d')); if(!preg_match('/^20[0-1][0-9]-[0-1][0-9]-[0-3][0-9]$/', $day_from)) { $day_from = date('Y-m-d'); } $day_to = Tools::getValue('day_to', date('Y-m-d')); if(!preg_match('/^20[0-1][0-9]-[0-1][0-9]-[0-3][0-9]$/', $day_to)) { $day_to = date('Y-m-d'); } if(strtotime($day_to) < strtotime($day_from)) { $day_to = $day_from; } $result = ' '; if($iso != 'en') { $result .= ''; } $current_url = $currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesLiveStats'); $result .= '
'.$this->l('ID sale').' | '.$this->l('Sale title').' | '.$this->l('Start date').' | '.$this->l('End date').' | '.$this->l('Days active').' | '.$this->l('Init. stock').' | '.$this->l('Period').' | '.$this->l('Total').' | '.$this->l('Out of stock').' | '.$this->l('Out of stock (sold)').' | '.$this->l('Margin').' | '.$this->l('Employee').' | '.$this->l('Out of stock').' | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'.$this->l('Products').' {total_products_period} |
'.$this->l('Sales (WT)').' {total_sales_period} |
'.$this->l('Cmde').' |
'.$this->l('Multi').' |
'.$this->l('Products').' {total_products} |
'.$this->l('Sales (WT)').' {total_sales} |
|||||||||||
'.(int) $sale['id_sale'].' | '.$sale['name'].' | '.date('Y-m-d', strtotime($sale['date_start'])).' | '.date('Y-m-d', strtotime($sale['date_end'])).' | '.(strtotime($sale['date_end']) > time()? ceil((time() - strtotime($sale['date_start'])) / 86400) : /*ceil((strtotime($sale['date_end']) - strtotime($sale['date_start'])) / 86400)*/'T').' | '.number_format($global[(int) $sale['id_sale']]['init_stock'], 0, '.', ' ').' | '.number_format($period[(int) $sale['id_sale']][0], 0, '.', ' ').' | '.number_format($period[(int) $sale['id_sale']][1], 0, '.', ' ').' | '.number_format($period[(int) $sale['id_sale']][2], 0, '.', ' ').' | '.number_format((($period[(int) $sale['id_sale']][3]/$period[(int) $sale['id_sale']][2]) * 100), 0, '.', ' ') .'%'.' | '.number_format((int) $global[(int) $sale['id_sale']]['total_products'], 0, '.', ' ').' | '.number_format((float) $global[(int) $sale['id_sale']]['total_sales_wt'], 0, '.', ' ').' | '.$global[(int) $sale['id_sale']]['oos'].' % | '.$global[(int) $sale['id_sale']]['oos_sold'].' % | '.sprintf('%.02f', Tools::ps_round((float) $global[(int) $sale['id_sale']]['margin_rate'] * 100, 2)).' % | '.substr($sale['firstname'], 0, 1).substr($sale['lastname'], 0, 1).' | Voir |