public function prepareElements() { $translator = Utility::translate(); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $this->add(array('name' => 'name', 'options' => array('label' => $translator->translate('Name')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Save', 'id' => 'submitbutton', 'class' => 'btn btn-danger'))); }
public function onDispatch(\Zend\Mvc\MvcEvent $e) { $install = setupUtility::checkInstall(); if ($install == true) { return $this->redirect()->toRoute('install'); } //get doctrine service $this->serviceLocatorStr = 'doctrine'; $this->sm = $this->getServiceLocator(); $this->doctrineService = $this->sm->get($this->serviceLocatorStr); //get translate service $this->translator = Utility::translate(); //check login $user = Utility::checkLogin(); if (!is_object($user) && $user == 0) { $this->redirect()->toRoute('frontend/child', array('controller' => 'login')); } //start acl // $acl = new myAcl(); // $currentRoute = $this->getModuleCurrentRoute($e); // $isOk = $acl->checkRole(UtilityRoleLevel::convertUserTypeToRole($user->userType)['role'],$currentRoute); // if(!$isOk || $isOk == '' || $isOk == null){ // return $this->redirect()->toRoute('frontend/child', array('controller' => 'login')); // } //end check login //end acl $this->init(); return parent::onDispatch($e); }
public function prepareElements() { // add() can take either an Element/Fieldset instance, // or a specification, from which the appropriate object // will be built. $translator = Utility::translate(); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $this->add(array('name' => 'company', 'options' => array('label' => $translator->translate('Company')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'name', 'options' => array('label' => $translator->translate('Name')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); // $this->add(array( // 'name' => 'supply_for', // 'options' => array( // 'label' => $translator->translate('Supply for'), // ), // 'attributes' => array( // 'type' => 'text', // 'class' => 'input-xlarge' // ), // )); $supArray = Utility::getAllSuplyItemsArray(); $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('multiple' => 'multiple'), 'name' => 'supply_for', 'options' => array('label' => $translator->translate('Product'), 'value_options' => $supArray))); $this->add(array('name' => 'phone', 'options' => array('label' => $translator->translate('Phone')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'mobile', 'options' => array('label' => $translator->translate('Mobile')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'email', 'options' => array('label' => $translator->translate('Email')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'addr', 'options' => array('label' => $translator->translate('addr')), 'attributes' => array('type' => 'textarea', 'class' => 'input-xlarge'))); $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => $translator->translate('Save')))); // We could also define the input filter here, or // lazy-create it in the getInputFilter() method. }
public function __construct($name = null) { $translator = Utility::translate(); parent::__construct('AdminCategories'); $this->setAttribute('method', 'post'); $this->add(array('name' => 'name', 'attributes' => array('type' => 'Text'))); $this->add(array('name' => 'id', 'attributes' => array('type' => 'Hidden'))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => $translator->translate('Save'), 'id' => 'submitbutton', 'class' => 'btn btn-primary'))); }
public function onDispatch(\Zend\Mvc\MvcEvent $e) { $service_locator_str = 'doctrine'; $this->postPerPage = 10; $this->sm = $this->getServiceLocator(); $this->doctrineService = $this->sm->get($service_locator_str); $this->translator = Utility::translate(); $this->init(); return parent::onDispatch($e); }
public function init() { $this->modelCategories = new categoryModel($this->doctrineService); $this->translator = Utility::translate(); //check login $user = Utility::checkLogin($this); if (!is_object($user) && $user == 0) { $this->redirect()->toRoute('frontend/child', array('controller' => 'login')); } parent::init(); }
public function onDispatch(\Zend\Mvc\MvcEvent $e) { $service_locator_str = 'doctrine'; $this->sm = $this->getServiceLocator(); $CategoriesTable = $this->sm->get($service_locator_str); $this->modelUsers = new userModel($CategoriesTable); $this->translator = Utility::translate(); $this->layout('layout/login'); //$this->layout('layout/login'); return parent::onDispatch($e); }
public function prepareElements() { $translator = Utility::translate(); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $supArray = Utility::getPaymentCategoryArray(); $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'attributes' => array(), 'name' => 'categoryId', 'options' => array('label' => $translator->translate('Category'), 'value_options' => $supArray, 'selected' => true))); $this->add(array('name' => 'title', 'options' => array('label' => $translator->translate('Title')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'value', 'options' => array('label' => $translator->translate('Value')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'reason', 'options' => array('label' => $translator->translate('Reason')), 'attributes' => array('type' => 'textarea', 'class' => 'input-xlarge jqueryte'))); $this->add(array('name' => 'time', 'attributes' => array('type' => 'text', 'class' => 'input-xlarge date-picker'))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Go', 'id' => 'submitbutton', 'class' => 'btn btn-danger'))); }
public function prepareElements() { // add() can take either an Element/Fieldset instance, // or a specification, from which the appropriate object // will be built. $translator = Utility::translate(); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $this->add(array('name' => 'value', 'options' => array('label' => $translator->translate('Value')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'isdelete', 'attributes' => array('type' => 'hidden'))); $this->add(array('name' => 'send', 'attributes' => array('type' => 'submit', 'value' => $translator->translate('Save')))); // We could also define the input filter here, or // lazy-create it in the getInputFilter() method. }
public function prepareElements() { $translator = Utility::translate(); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $this->add(array('name' => 'name', 'options' => array('label' => $translator->translate('Name')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'quantity', 'options' => array('label' => $translator->translate('Quantity')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $supArray = Utility::getAllSuplyItemsArray(); $this->add(array('type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('id' => 'supplierItemId'), 'name' => 'supplierItemId', 'options' => array('label' => $translator->translate('Supplier item'), 'value_options' => $supArray, 'selected' => true))); $this->add(array('name' => 'supplierItemName', 'options' => array('label' => $translator->translate('Supplier Item Name')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge', 'id' => 'supplierItemName', 'readonly' => 'readonly'))); $this->add(array('name' => 'note', 'options' => array('label' => $translator->translate('Note')), 'attributes' => array('type' => 'textarea', 'class' => 'input-xlarge'))); $this->add(array('name' => 'time', 'options' => array('label' => $translator->translate('Time')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge date-picker'))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => $translator->translate('Save'), 'id' => 'submitbutton', 'class' => 'btn btn-primary span3 typeahead'))); }
public function convertSingleToArray($coupon) { $translator = Utility::translate(); $couponType = Utility::getCouponType($coupon->getType()); $array = array(); $array['id'] = $coupon->getId(); $array['code'] = $coupon->getCode(); $array['value'] = $coupon->getValue(); $array['fromdate'] = date('d/m/Y', $coupon->getFromDate()); $array['todate'] = date('d/m/Y', $coupon->getToDate()); $array['type'] = $translator->translate($couponType); $array['description'] = $coupon->getDescription(); return $array; }
public function init() { //check api $userApi = Utility::userApi($this->params()->fromQuery('userName'), $this->params()->fromQuery('apiKey')); if ($userApi->getId() == '') { die(-1); } $this->userId = $userApi->getId(); //end check api $this->modelMenu = new menuModel($this->doctrineService); $this->modelCombo = new comboModel($this->doctrineService); $this->catModel = new categoryModel($this->doctrineService); $this->translator = Utility::translate(); parent::init(); }
public function onDispatch(\Zend\Mvc\MvcEvent $e) { //get doctrine service $this->serviceLocatorStr = 'doctrine'; $this->sm = $this->getServiceLocator(); $this->doctrineService = $this->sm->get($this->serviceLocatorStr); //get translate service $this->translator = Utility::translate(); //check login $user = Utility::checkLogin(); if (!is_object($user) && $user == 0) { $this->redirect()->toRoute('frontend/child', array('controller' => 'login')); } $this->init(); return parent::onDispatch($e); }
public function init() { $service_locator_str = 'doctrine'; $this->sm = $this->getServiceLocator(); $doctrineService = $this->sm->get($service_locator_str); $this->modelOrder = new orderModel($doctrineService); $this->modelOrderDetail = new orderdetailModel($doctrineService); $this->tableModel = new tableModel($doctrineService); $this->translator = Utility::translate(); //check login $this->userLogin = Utility::checkLogin($this); if (!is_object($this->userLogin) && $this->userLogin == 0) { $this->redirect()->toRoute('admin/child', array('controller' => 'login')); } return parent::init(); }
public function prepareElements() { $translator = Utility::translate(); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $this->add(array('name' => 'fullname', 'options' => array('label' => $translator->translate('Full name')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'nicename', 'options' => array('label' => $translator->translate('Nice name')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'customerCode', 'options' => array('label' => $translator->translate('Customer code')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'level', 'options' => array('label' => $translator->translate('Level')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'phone', 'options' => array('label' => $translator->translate('Phone')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'email', 'options' => array('label' => $translator->translate('Email')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'address', 'options' => array('label' => $translator->translate('Address')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge'))); $this->add(array('name' => 'birthday', 'options' => array('label' => $translator->translate('Birthday')), 'attributes' => array('type' => 'text', 'class' => 'input-xlarge date-picker'))); $this->add(array('name' => 'avatar', 'options' => array('label' => $translator->translate('Avatar')), 'attributes' => array('type' => 'file', 'class' => 'input-xlarge avatar'))); $this->add(array('name' => 'avatar_old', 'attributes' => array('type' => 'hidden', 'class' => 'input-xlarge avatar'))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Go', 'id' => 'submitbutton', 'class' => 'btn btn-primary span3 typeahead'))); }
public function onDispatch(\Zend\Mvc\MvcEvent $e) { //check install $install = setupUtility::checkInstall(); if ($install == true) { return $this->redirect()->toRoute('install'); } //end check install $service_locator_str = 'doctrine'; $this->sm = $this->getServiceLocator(); $CategoriesTable = $this->sm->get($service_locator_str); $this->modelUsers = new userModel($CategoriesTable); $this->translator = Utility::translate(); $this->layout('layout/login'); //$this->layout('layout/login'); return parent::onDispatch($e); }
public function onDispatch(\Zend\Mvc\MvcEvent $e) { $service_locator_str = 'doctrine'; $this->sm = $this->getServiceLocator(); $doctrine = $this->sm->get($service_locator_str); $this->modelEvent = new eventModel($doctrine); $this->translator = Utility::translate(); //check login $user = Utility::checkLogin($this); if (!is_object($user) && $user == 0) { $this->redirect()->toRoute('admin/child', array('controller' => 'login')); } else { $isPermission = Utility::checkRole($user->userType, ROLE_ADMIN); if ($isPermission == false) { $this->redirect()->toRoute('admin/child', array('controller' => 'login')); } } return parent::onDispatch($e); }
public function onDispatch(\Zend\Mvc\MvcEvent $e) { $install = setupUtility::checkInstall(); if ($install == true) { return $this->redirect()->toRoute('install'); } //get doctrine service $this->serviceLocatorStr = 'doctrine'; $this->sm = $this->getServiceLocator(); $this->doctrineService = $this->sm->get($this->serviceLocatorStr); //get translate service $this->translator = Utility::translate(); //check login $user = Utility::checkLogin(); if (!is_object($user) && $user == 0) { $this->redirect()->toRoute('admin/child', array('controller' => 'login')); } if (!Utility::checkRole($user->userType, ROLE_ADMIN)) { $this->redirect()->toRoute('frontend/child', array('controller' => 'login')); } $this->init(); return parent::onDispatch($e); }
public function convertSingleToArray($config) { $translator = Utility::translate(); $configType = $config->getType(); $configName = $config->getName(); $configValue = $config->getValue(); if ($configType == 'file') { $configValue = '<img style="width:100px" src="' . $configValue . '">'; } if ($configName == 'currency_before') { $selectArray = array('After', 'Before'); $configValue = $selectArray[$configValue]; } //email pass word if ($configName == 'emailPassword') { $configValue = '***************'; } $array = array(); $array['name'] = $translator->translate($configName); $array['id'] = $config->getId(); $array['value'] = $configValue; $array['type'] = $configType; return $array; }
public function onDispatch(\Zend\Mvc\MvcEvent $e) { $this->translator = Utility::translate(); $this->layout('layout/install/installlayout'); return parent::onDispatch($e); }
public function init() { parent::init(); $this->modelMenu = new menuModel($this->doctrineService); $this->translator = Utility::translate(); }
public static function checkAndSendNotifyEmail() { $config = Utility::getConfig(); $translator = Utility::translate(); $doctrine = self::$servicelocator->get('doctrine'); $menuStoreModel = new menuStoreModel($doctrine); $menuStore = $menuStoreModel->findAll(); foreach ($menuStore as $store) { $store = $menuStoreModel->findOneBy(array('id' => $store->getId())); if ($store->getOutOfStock() == -1) { $outOfStock = $config['out_of_stock']; } else { $outOfStock = $store->getOutOfStock(); } $compare = self::getMenuItemQuantityInStore($store->getId()); $data = array('name' => $store->getName(), 'inStore' => $compare, 'unit' => $store->getUnit()); $subject = $translator->translate('Out of stock'); $receiveEmail = $config['emailId']; if ($compare < $outOfStock) { Utility::sendEmail('emptystore', $data, $subject, $receiveEmail, true); } } }