public function listAction() { $this->tplVars['page_js'][] = 'products.js'; $this->tplVars['header']['actions']['names'][] = array('name' => 'add', 'menu_name' => 'Add Product'); $this->tplVars['header']['actions']['names'][] = array('name' => 'platforms', 'menu_name' => 'Platform list'); $this->tplVars['header']['actions']['names'][] = array('name' => 'os', 'menu_name' => 'OS list'); array_push($this->viewIncludes, 'products/productsList.tpl'); $products = new AdminProducts(); $this->tplVars['products'] = $products->getProducts(); unset($products); }
public function builderAction() { include_once 'models/plimusLinksBuilder.php'; $linksBuilder = new PurchaseLinksBuilder(); $products = new AdminProducts(); if ($this->_request->isPost()) { if (!$this->_request->getPost('address') || $linksBuilder->checkAddress($this->_request->getPost('address'))) { $this->tplVars['builder']['errors']['address'] = true; } if (!isset($this->tplVars['builder']['errors'])) { $licenses = array(); //foreach($this->_request->getPost('licenses') AS $licenseId) { //$licenses[$licenseId] = $this->_request->getPost('license_qnt_'.$licenseId); $licenses = $this->_request->getPost('license_qnt'); //} $linksBuilder->addLink($this->_request->getPost('address'), $licenses, $this->_request->getPost('currency'), $this->_request->getPost('coupon'), $this->_request->getPost('backup_cd'), $this->_request->getPost('lifetime_upgrades'), $this->_request->getPost('priority_email_support'), $this->_request->getPost('premium_tech_support'), $this->_request->getPost('premium_tech_support_price'), $this->_request->getPost('language'), $this->_request->getPost('theme')); } else { $this->tplVars['builder']['val']['address'] = $this->_request->getPost('address'); $this->tplVars['builder']['val']['currency'] = $this->_request->getPost('currency'); $this->tplVars['builder']['val']['coupon'] = $this->_request->getPost('coupon'); $this->tplVars['builder']['val']['backup_cd'] = $this->_request->getPost('backup_cd'); $this->tplVars['builder']['val']['lifetime_upgrades'] = $this->_request->getPost('lifetime_upgrades'); $this->tplVars['builder']['val']['priority_email_support'] = $this->_request->getPost('priority_email_support'); $this->tplVars['builder']['val']['premium_tech_support'] = $this->_request->getPost('premium_tech_support'); $this->tplVars['builder']['val']['language'] = $this->_request->getPost('language'); $this->tplVars['builder']['val']['theme'] = $this->_request->getPost('theme'); } } $this->tplVars['builder']['couponsList'] = $this->purchaseHandler->getCoupons(-1, -1); // ��� ��������� $this->tplVars['builder']['currenciesList'] = $this->purchaseHandler->getCurrenciesRatios(true); $this->tplVars['builder']['licensesList'] = $this->purchaseHandler->getLicenses2ProductsList(); $this->tplVars['builder']['productsList'] = $products->getProducts(); $this->tplVars['builder']['linksList'] = $linksBuilder->getLinks(); array_push($this->viewIncludes, 'purchase/builder.tpl'); array_push($this->viewIncludes, 'purchase/builderLinksList.tpl'); }
public function addAction() { if ($this->tplVars['lvals']['canEdit']) { include_once 'support.php'; if ($this->_request->getPost('ispost')) { $support = new Support(); $this->tplVars['support'] = $this->_request->getPost(); if (($this->tplVars['lvals']['postRes'] = $support->add($this->_request->getPost())) > 0) { $this->_redirect('support/'); } $select_prods = $this->_request->getPost('products_support'); foreach ($select_prods as $val) { $select[$val] = $val; } } $products = new AdminProducts(); $prods = $products->getProducts(); foreach ($prods['prods'] as $cat => $prod) { foreach ($prod as $key => $val) { $prods['prods'][$cat][$key]['select'] = $select[$key] ? 1 : 0; } } $this->tplVars['products'] = $prods; array_push($this->tplVars['page_css'], 'product_edit.css'); array_push($this->tplVars['page_css'], 'livevalidation.css'); array_push($this->tplVars['page_js'], 'livevalidation.js'); $this->tplVars['lvals']['isNewRecord'] = true; array_push($this->viewIncludes, 'support/Edit.tpl'); $this->tplVars['lvals']['postRes'] = 2; unset($support); } else { $this->_redirect('support/'); } }