Example #1
0
 public function getContent()
 {
     $out = '';
     $me = $this->doorGets->user;
     // get Content for edit / delete
     $params = $this->doorGets->Params();
     if (array_key_exists('id', $params['GET'])) {
         $id = $params['GET']['id'];
         $isContent = $this->doorGets->dbQS($id, '_taxes');
         if (!empty($isContent)) {
             // $isCheckedDefault = ($isContent['is_default'] === '1') ? 'checked': '';
         }
     }
     $storeMenuFile = 'user/user_store_menu';
     $tplStoreMenu = Template::getView($storeMenuFile);
     ob_start();
     if (is_file($tplStoreMenu)) {
         include $tplStoreMenu;
     }
     $storeMenuHtml = ob_get_clean();
     $aActivation = $this->doorGets->getArrayForms('yn');
     $currencyCode = $this->doorGets->configWeb['currency'];
     $currencyIcon = Constant::$currencyIcon[$currencyCode];
     $aPriority = range(0, 10);
     $aPercent = range(0, 100);
     $aStockmin = range(0, 100);
     $aType = array('percent' => $this->doorGets->__("Pourcentage") . ' %', 'amount' => $this->doorGets->__("Montant") . ' ' . $currencyIcon);
     switch ($this->Action) {
         case 'index':
             $TaxesQuery = new TaxesQuery($this->doorGets);
             $TaxesQuery->orderByPriority();
             $TaxesQuery->find();
             $Taxess = $TaxesQuery->_getEntities('array');
             break;
         case 'add':
             $shopModules = $this->doorGets->loadModules(true, true, 'shop');
             $categories = array();
             if (!empty($shopModules)) {
                 foreach ($shopModules as $module) {
                     $this->doorGets->loadCategories($module['uri']);
                     $categories[$module['id']] = $this->doorGets->categorieSimple_;
                 }
             }
             break;
         case 'edit':
             break;
         case 'delete':
             break;
     }
     $ActionFile = 'user/taxes/user_taxes_' . $this->Action;
     $tpl = Template::getView($ActionFile);
     ob_start();
     if (is_file($tpl)) {
         include $tpl;
     }
     $out .= ob_get_clean();
     return $out;
 }
Example #2
0
 public function getAllActiveTaxes()
 {
     $out = array();
     $TaxesQuery = new TaxesQuery($this->doorGets);
     $TaxesQuery->filterByActive(1);
     $TaxesQuery->find();
     $Taxes = $TaxesQuery->_getEntities('array');
     $now = time();
     if (!empty($Taxes)) {
         foreach ($Taxes as $taxe) {
             $out[$taxe['id']] = $taxe;
         }
     }
     return $out;
 }