Example #1
0
 /**
  * Inicjalizacja formularza
  */
 public function baseInit()
 {
     $this->_atModel = $atModel = new AddonType();
     $this->_bModel = $bModel = new Branch();
     $rows = $atModel->fetchAll('not ghost', 'name asc');
     $addons = array();
     foreach ($rows as $row) {
         $addons[Base_Convert::strToHex($row->id)] = $row->name;
     }
     $this->addElement('MultiCheckbox', 'addons', array('label' => 'Uzwględnij następujące dodatki:', 'MultiOptions' => $addons, 'value' => array_keys($addons), 'required' => true));
     $this->addons->getDecorator('row')->setOption('class', 'row widerow');
     $rows = $bModel->fetchAll('not ghost', 'web_name asc');
     $branches = array();
     foreach ($rows as $row) {
         $branches[Base_Convert::strToHex($row->id)] = $row->branch_name;
     }
     $this->addElement('MultiCheckbox', 'branches', array('label' => 'Uwzględnij następujące brandy:', 'MultiOptions' => $branches, 'value' => array_keys($branches), 'required' => true));
     $dic = new Logic_Dictionary();
     $cTypes = array();
     $this->_cDic = $cDic = $dic->getDictionaryEntriesByCode('client_type');
     foreach ($cDic as $ct) {
         $cTypes[Base_Convert::strToHex($ct->id)] = ucfirst($ct->entry);
     }
     $rows = $bModel->fetchAll('not ghost', 'web_name asc');
     $branches = array();
     foreach ($rows as $row) {
         $branches[Base_Convert::strToHex($row->id)] = $row->branch_name;
     }
     $this->addElement('MultiCheckbox', 'clients', array('label' => 'Uwzględnij nastepujących klientów:', 'MultiOptions' => $cTypes, 'value' => array_keys($cTypes), 'required' => true));
     $this->addElement('Select', 'timepoint', array('label' => 'Wyeksportuj wartości:', 'MultiOptions' => array('now' => 'Aktualne', 'archive' => 'Archiwalne'), 'required' => true));
     $this->datee(false, 'date', 'Data:', true, array('value' => date('Y-m-d'), 'required' => true));
     $this->addElement('text', 'time', array('label' => 'Godzina:', 'class' => 'timeentry', 'required' => true, 'value' => date('H:00:00'), 'validators' => array(array('validator' => 'Date', 'options' => array('format' => 'H:i:s')))));
     $this->submit(false, 'submitbtn', 'Eksportuj');
 }
Example #2
0
 public function __construct($customerType, $brandId)
 {
     $dict = new Logic_Dictionary();
     $customerTypeId = $dict->getDictionaryEntryId('client_type', $customerType);
     if ($customerTypeId === null) {
         throw new Exception('Niepoprawny kod słownikowy typu klienta!');
     }
     $addonTypeModel = new AddonType();
     $addonTypeId = $addonTypeModel->getAddonTypeId($this->addonCode);
     if ($addonTypeId === null) {
         throw new Exception('Niepoprawny kod typu dodatku!');
     }
     $this->addonTypeId = $addonTypeId;
     $this->customerTypeId = $customerTypeId;
     $this->brandId = $brandId;
     parent::__construct($this->addonName);
 }
Example #3
0
 public function synchronizedAction()
 {
     $logicObj = new Logic_Dictionary();
     $db = Zend_Db_Table_Abstract::getDefaultAdapter();
     try {
         $db->beginTransaction();
         $logicObj->synchronizedWithBackendAplications();
         $db->commit();
         $translate = new Zend_View_Helper_Translate();
         $this->_helper->messenger("success", $translate->translate('Dictionary was successfully updated.'));
     } catch (Exception $e) {
         $db->rollBack();
         $this->_helper->messenger('error', MSG_ERROR, $e);
     }
 }
Example #4
0
 public static function lvl3ProductDelete($id, $money, $currency, array $periods)
 {
     $db = new DEFProductPeriod();
     $v = explode('-', $money);
     $currency = Logic_Dictionary::getEntriesIdByCode('waluty', $currency);
     $adapret = $db->getDefaultAdapter();
     foreach ($periods as $value) {
         $p[] = "'" . $value . "'";
     }
     $sql = "UPDATE  negotiations.product_period\n        SET ghost = true\n        WHERE  period in (" . implode(', ', $p) . ")\n        AND id_product_money = (SELECT pm.id  FROM negotiations.product_money pm JOIN negotiations.product p ON p.id = pm.id_product WHERE\n        not p.ghost AND not pm.ghost AND p.min_amount_currency = '" . $currency . "' AND p.def_id = '" . $id . "' AND pm.min_amount = '" . $v[0] . "' AND pm.max_amount = '" . $v[1] . "')";
     return $adapret->query($sql);
 }