* @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 7541 $ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ include_once('envoimoinscher.php'); class AdminEnvoiMoinsCher extends AdminTab { public $packaging = array('Pli' => 'Pli', 'Colis' => 'Colis', 'Encombrant' => 'Objet lourd', 'Palette' => 'Palette'); public function __construct() { parent::__construct(); } public function display() { global $cookie; $emc = new Envoimoinscher(); echo '
' . $emc->lang('Change configuration') . '
'; } private function getOrders() { $id_order_state = (int)(Configuration::get('EMC_ORDER_STATE')); $id_carrier = (int)(Configuration::get('EMC_CARRIER')); $sql = ' SELECT o.id_order as id_order, o.`id_customer` as id_customer, CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, o.total_paid_real as total, o.total_shipping as shipping, o.date_add as date, o.id_currency as id_currency, o.id_lang as id_lang, SUM(od.product_weight * od.product_quantity) as weight FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (o.`id_order` = od.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (oh.`id_order` = o.`id_order`) LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = oh.`id_order_state`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = o.`id_lang`) WHERE (SELECT moh.`id_order_state` FROM `'._DB_PREFIX_.'order_history` moh WHERE moh.`id_order` = o.`id_order` ORDER BY moh.date_add DESC LIMIT 1) = '.$id_order_state.' AND o.id_carrier = '.pSQL($id_carrier).' GROUP BY o.`id_order`, od.`id_order` ORDER BY o.`date_add` ASC'; return Db::getInstance()->ExecuteS($sql); } private function displayOrders($orders) { global $cookie; echo '