public function initContent() { $module = new orderfiles(); $this->var = $module->getconf(); parent::initContent(); global $smarty; $ext = explode(",", Configuration::get('OF_FTYPES')); $smarty->assign('extensions', $ext); if (isset($_POST['addfile'])) { if (isset($_POST['oid'])) { $order = new OrderCore($_POST['oid']); if ($order->id_customer == $this->context->customer->id) { $this->insertphoto($_POST, $_FILES); } } } if (isset($_POST['savefile'])) { if ($_POST['pty'] == "order") { $module->updatefileorder($_POST['fid'], mysql_escape_string($_POST['description']), mysql_escape_string($_POST['title'])); } if ($_POST['pty'] == "cart") { $module->updatefilecart($_POST['fid'], mysql_escape_string($_POST['description']), mysql_escape_string($_POST['title'])); } if ($_POST['pty'] == "product") { $module->updatefileproduct($_POST['fid'], mysql_escape_string($_POST['description']), mysql_escape_string($_POST['title'])); } } if (isset($_POST['delfile'])) { if (isset($_POST['oid'])) { $order = new OrderCore($_POST['oid']); if ($order->id_customer == $this->context->customer->id) { $this->photodelete($_POST['fid'], $this->context->customer->id); } } } if (isset($_POST['delcartfile'])) { if (isset($_POST['fid'])) { $this->cartfiledelete($_POST['fid']); } } if (isset($_POST['delproductfile'])) { if (isset($_POST['fid'])) { $this->productfiledelete($_POST['fid']); } } if (isset($_POST['oid'])) { $order = new OrderCore($_POST['oid']); if ($order->id_customer == $this->context->customer->id) { $this->context->smarty->assign(array('mod' => $this, 'setup' => $this->var, 'order' => $order, 'idorder' => $_POST['oid'], 'files' => $this->get_files($_POST['oid'], $this->context->customer->id), 'link' => $this->context->link, 'customer' => $this->context->customer)); $this->setTemplate('filesmanager.tpl'); } else { $this->setTemplate('access-denied.tpl'); } } else { $this->setTemplate('access-denied.tpl'); } }
public function initContent() { $module = new orderfiles(); $this->var = $module->getconf(); parent::initContent(); $order = new OrderCore(); $custorders = $order->getCustomerOrders($this->context->customer->id); $this->context->smarty->assign(array('mod' => $this, 'setup' => $this->var, 'orders' => $custorders, 'link' => $this->context->link, 'psversion' => $module->psversion(), 'customer' => $this->context->customer)); $this->setTemplate('my-files.tpl'); }
<?php require_once dirname(__FILE__) . '/../../config/config.inc.php'; require_once dirname(__FILE__) . '/../../init.php'; include_once dirname(__FILE__) . '/orderfiles.php'; $orderfiles = new orderfiles(); $setup = $orderfiles->getconf(); global $cookie; include dirname(__FILE__) . '/../../header.php'; if (!$cookie->isLogged()) { Tools::redirect('authentication.php?back=modules/orderfiles/myfiles14.php'); } else { $order = new OrderCore(); $custorders = $order->getCustomerOrders($cookie->id_customer); global $smarty; $smarty->assign('this_path', __PS_BASE_URI__ . 'modules/' . $orderfiles->name . '/'); $smarty->assign('mod', $orderfiles); $smarty->assign('setup', $setup); $smarty->assign('orders', $custorders); if ($orderfiles->psversion() == 4) { echo Module::display(dirname(__FILE__) . '/orderfiles.php', 'my-files14.tpl'); } } include dirname(__FILE__) . '/../../footer.php';