public function init()
 {
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_soundcloud.phtml'))));
     //enable soundcloud uploads
     $this->addElement('checkbox', 'UseSoundCloud', array('label' => _('Automatically Upload Recorded Shows'), 'required' => false, 'value' => Application_Model_Preference::GetAutoUploadRecordedShowToSoundcloud(), 'decorators' => array('ViewHelper')));
     //enable soundcloud uploads option
     $this->addElement('checkbox', 'UploadToSoundcloudOption', array('label' => _('Enable SoundCloud Upload'), 'required' => false, 'value' => Application_Model_Preference::GetUploadToSoundcloudOption(), 'decorators' => array('ViewHelper')));
     //enable downloadable for soundcloud
     $this->addElement('checkbox', 'SoundCloudDownloadbleOption', array('label' => _('Automatically Mark Files "Downloadable" on SoundCloud'), 'required' => false, 'value' => Application_Model_Preference::GetSoundCloudDownloadbleOption(), 'decorators' => array('ViewHelper')));
     //SoundCloud Username
     $this->addElement('text', 'SoundCloudUser', array('class' => 'input_text', 'label' => _('SoundCloud Email'), 'filters' => array('StringTrim'), 'autocomplete' => 'off', 'value' => Application_Model_Preference::GetSoundCloudUser(), 'decorators' => array('ViewHelper'), 'allowEmpty' => false, 'validators' => array(new ConditionalNotEmpty(array('UploadToSoundcloudOption' => '1')))));
     //SoundCloud Password
     $this->addElement('password', 'SoundCloudPassword', array('class' => 'input_text', 'label' => _('SoundCloud Password'), 'filters' => array('StringTrim'), 'autocomplete' => 'off', 'value' => Application_Model_Preference::GetSoundCloudPassword(), 'decorators' => array('ViewHelper'), 'allowEmpty' => false, 'validators' => array(new ConditionalNotEmpty(array('UploadToSoundcloudOption' => '1'))), 'renderPassword' => true));
     // Add the description element
     $this->addElement('textarea', 'SoundCloudTags', array('label' => _('SoundCloud Tags: (separate tags with spaces)'), 'required' => false, 'class' => 'input_text_area', 'value' => Application_Model_Preference::GetSoundCloudTags(), 'decorators' => array('ViewHelper')));
     //SoundCloud default genre
     $this->addElement('text', 'SoundCloudGenre', array('class' => 'input_text', 'label' => _('Default Genre:'), 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudGenre(), 'decorators' => array('ViewHelper')));
     $select = new Zend_Form_Element_Select('SoundCloudTrackType');
     $select->setLabel(_('Default Track Type:'));
     $select->setAttrib('class', 'input_select');
     $select->setMultiOptions(array("" => "", "original" => _("Original"), "remix" => _("Remix"), "live" => _("Live"), "recording" => _("Recording"), "spoken" => _("Spoken"), "podcast" => _("Podcast"), "demo" => _("Demo"), "in progress" => _("Work in progress"), "stem" => _("Stem"), "loop" => _("Loop"), "sound effect" => _("Sound Effect"), "sample" => _("One Shot Sample"), "other" => _("Other")));
     $select->setRequired(false);
     $select->setValue(Application_Model_Preference::GetSoundCloudTrackType());
     $select->setDecorators(array('ViewHelper'));
     $this->addElement($select);
     $select = new Zend_Form_Element_Select('SoundCloudLicense');
     $select->setLabel(_('Default License:'));
     $select->setAttrib('class', 'input_select');
     $select->setMultiOptions(array("" => "", "no-rights-reserved" => _("The work is in the public domain"), "all-rights-reserved" => _("All rights are reserved"), "cc-by" => _("Creative Commons Attribution"), "cc-by-nc" => _("Creative Commons Attribution Noncommercial"), "cc-by-nd" => _("Creative Commons Attribution No Derivative Works"), "cc-by-sa" => _("Creative Commons Attribution Share Alike"), "cc-by-nc-nd" => _("Creative Commons Attribution Noncommercial Non Derivate Works"), "cc-by-nc-sa" => _("Creative Commons Attribution Noncommercial Share Alike")));
     $select->setRequired(false);
     $select->setValue(Application_Model_Preference::GetSoundCloudLicense());
     $select->setDecorators(array('ViewHelper'));
     $this->addElement($select);
 }
Exemple #2
0
 public function init()
 {
     // profissional_beleza_id
     $profissional_beleza_id = new Zend_Form_Element_Radio("profissional_beleza_id");
     $profissional_beleza_id->setLabel("Selecione o profissional desejado: ");
     $profissional_beleza_id->setRegisterInArrayValidator(false);
     $profissional_beleza_id->setRequired();
     $profissional_beleza_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
     // agenda_data
     $agenda_data = new Zend_Form_Element_Text("agenda_data");
     $agenda_data->setLabel("Selecione a data: ");
     $agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off'));
     $agenda_data->setRequired();
     $agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // agenda_hora
     $agenda_hora = new Zend_Form_Element_Select("agenda_hora");
     $agenda_hora->setLabel('Selecione a hora: ');
     $agenda_hora->setAttribs(array('class' => 'form-control'));
     $agenda_hora->setMultiOptions(array('' => 'Horários'));
     $agenda_hora->setRequired();
     $agenda_hora->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $agenda_hora->setRegisterInArrayValidator(false);
     // agenda_observacao
     $agenda_observacao = new Zend_Form_Element_Textarea("agenda_observacao");
     $agenda_observacao->setLabel("Observações: ");
     $agenda_observacao->setAttribs(array('class' => 'form-control', 'rows' => 7, 'placeholder' => 'Informe alguma observação, por exemplo, alguma preferência de produto, etc.'));
     // salao_id
     $salao_id = new Zend_Form_Element_Hidden('salao_id');
     // especialidade_id
     $especialidade_id = new Zend_Form_Element_Hidden("especialidade_id");
     // usuario_id
     $usuario_id = new Zend_Form_Element_Hidden("usuario_id");
     $this->addElements(array($profissional_beleza_id, $agenda_data, $agenda_hora, $agenda_observacao, $salao_id, $especialidade_id, $usuario_id));
     parent::init();
 }
Exemple #3
0
 public function FrmProCate($frm = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $id_code = new Zend_Form_Element_Text('id_code');
     $id_code->setAttribs(array('class' => 'form-control', "readonly" => ""));
     $code = table_Model_DbTable_DbTable::getCallteralCode();
     $id_code->setValue($code);
     $cat_name_en = new Zend_Form_Element_Text("name_en");
     $cat_name_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In English', "OnChange" => "GetCatName(1)"));
     $cat_name_km = new Zend_Form_Element_Text("name_km");
     $cat_name_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'Name In Khmer', "OnChange" => "GetCatName(2)"));
     $status = new Zend_Form_Element_Select('status');
     $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $status->setMultiOptions($_arr_status);
     $status->setAttribs(array('class' => 'form-control validate[required]'));
     $icon = new Zend_Form_Element_File("icon");
     $description = new Zend_Form_Element_Textarea("description");
     $this->addElements(array($icon, $status, $cat_name_en, $cat_name_km, $id_code, $description));
     if ($frm != "") {
         $id_code->setValue($frm["code"]);
         $cat_name_en->setValue($frm["name_en"]);
         $cat_name_km->setValue($frm["name_km"]);
         $status->setValue($frm["status"]);
         $description->setValue($frm["description"]);
     }
     return $this;
 }
Exemple #4
0
 function init()
 {
     // Set the method for the display form to POST
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'addGroup', 'class' => ''));
     $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART);
     $control = new Zend_Form_Element_Hidden('control');
     $control->setValue('addGroup');
     $this->addElement($control);
     // begin inputs
     $name = new Zend_Form_Element_Text('name');
     $name->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_category_name')));
     $name->setRequired(true);
     $this->addElement($name);
     // begin inputs
     $color = new Zend_Form_Element_Text('color');
     $color->setAttribs(array('class' => 'text validate[required] rightAdd', 'placeholder' => Zend_Registry::get('translate')->_('admin_color_for_charts')));
     $color->setRequired(true);
     $this->addElement($color);
     // begin inputs
     $type = new Zend_Form_Element_Select('type');
     $options = array('' => Zend_Registry::get('translate')->_('admin_category_select_type'), '0' => Zend_Registry::get('translate')->_('admin_expenses'), '1' => Zend_Registry::get('translate')->_('admin_income'));
     $type->setMultiOptions($options);
     $type->addValidator(new Zend_Validate_InArray(array_keys($options)));
     $type->setAttribs(array('class' => 'select', 'id' => 'type'));
     $type->setRequired(true);
     $this->addElement($type);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue(Zend_Registry::get('translate')->_('admin_add'));
     $submit->setAttribs(array('class' => 'submit'));
     $submit->setIgnore(true);
     $this->addElement($submit);
 }
Exemple #5
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAction('/main/new');
     $this->setAttrib('id', 'newRoute');
     $note = new Zend_Form_Element_Note('title', array('value' => '<h2 id="titleProductDetails">Create a New Route</h2>'));
     $intermed = new Zend_Form_Element_Hidden('intermed');
     $intermed->setAttrib('readonly', 'readonly');
     $intermed->addFilter('StripTags');
     $intermed->addFilter('HtmlEntities');
     $intermed->addFilter('StringTrim');
     $start = new Zend_Form_Element_Text('startForm');
     $start->setLabel('Starting Point*');
     $start->setAttrib('autocomplete', 'off');
     $start->addFilter('StripTags');
     $start->addFilter('HtmlEntities');
     $start->setAttrib('class', 'form-control');
     $start->addFilter('StringTrim');
     $start->setRequired(true)->addErrorMessage('Start Location Required');
     //        $start->addValidator('Regex', true, array('/^[a-zA-Z0-9.,:-\s]*$/'))->addErrorMessage('Invalid characters used');
     //        $start->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $end = new Zend_Form_Element_Text('endForm');
     $end->setLabel('Destination*');
     $end->setAttrib('autocomplete', 'off');
     $end->addFilter('StripTags');
     $end->setAttrib('class', 'form-control');
     $end->addFilter('HtmlEntities');
     $end->addFilter('StringTrim');
     $end->setRequired(true)->addErrorMessage('Destination Required');
     //        $end->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $routeDate = new Zend_Form_Element_Text('routeDate');
     $routeDate->setAttrib('autocomplete', 'off');
     $routeDate->setAttrib('readonly', 'readonly');
     $routeDate->setAttrib('maxlength', '10');
     $routeDate->setAttrib('class', 'form-control');
     $routeDate->setLabel('Date of Journey' . '*');
     $routeDate->addFilter('StripTags');
     $routeDate->addFilter('HtmlEntities');
     $routeDate->addFilter('StringTrim');
     $routeDate->setRequired(true)->addErrorMessage('Date Required');
     $routeDate->addValidator('Regex', true, array('/^[0-9.\\s]*$/'))->addErrorMessage('Invalid characters used');
     $routeDate->addValidator('StringLength', true, array(10, 10))->addErrorMessage('Required Field');
     $passangers = new Zend_Form_Element_Select('passangers');
     $passangers->setLabel('No of Passangers*');
     $passangers->setAttrib('autocomplete', 'off');
     $passangers->setAttrib('class', 'form-control');
     $passangers->addFilter('StripTags');
     $passangers->addFilter('HtmlEntities');
     $passangers->addFilter('StringTrim');
     $passangers->setRequired(true)->addErrorMessage('Password Required');
     $passangers->setMultiOptions(array('1' => '1 Passanger', '2' => '2 Passangers', '3' => '3 Passangers', '4' => '4 Passangers', '5' => '5 Passangers', '6' => '6 Passangers'));
     $submit = new Zend_Form_Element_Submit('newRoute');
     $submit->setLabel('New Route');
     $submit->setAttrib('class', 'btn btn-info');
     $submit->setAttrib('style', 'margin-top:20px');
     $this->addElements(array($note, $intermed, $start, $end, $passangers, $routeDate, $submit));
     $this->setElementDecorators(array('ViewHelper', 'Label', 'Errors'));
     $submit->setDecorators(array('ViewHelper'));
     $this->setDecorators(array('FormElements', 'Form', array('HtmlTag', array('tag' => 'div', 'id' => 'newRouteFormContainer'))));
 }
Exemple #6
0
 public function init()
 {
     $model_countries = new Locale_Model_Languages();
     $model_t_keys = new Locale_Model_TranslateKeys();
     $key_id = new Zend_Form_Element_Select('key_id');
     $key_id->addValidator(new Zend_Validate_Digits(), true);
     $key_id->setLabel('Key');
     $key_id->setRequired(true);
     $key_id->setMultiOptions($model_t_keys->getIdAndKeyArray(true));
     $this->addElement($key_id);
     $country_id = new Zend_Form_Element_Select('language_id');
     $country_id->addValidator(new Zend_Validate_Digits(), true);
     $country_id->setLabel('Language');
     $country_id->setRequired(true);
     $country_id->setMultiOptions($model_countries->getIdAndNameArray());
     $this->addElement($country_id);
     $value = new My_Form_Element_CKEditor('value');
     $value->setLabel('Translation');
     $value->setDescription('Tags for dynamic values: {1}, {2}, {3}...Double quotes (")are not allowed');
     $this->addElement($value);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Cancel');
     $cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black');
     $cancel->setAttrib("onClick", "window.location = window.location.origin+'/locale/translate-messages/'");
     $this->addElement($cancel);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($submit);
 }
Exemple #7
0
 public function init()
 {
     $this->setAttribs(array('id' => 'form-exposicao-add'));
     // exposicao_nome
     $exposicao_nome = new Zend_Form_Element_Text("exposicao_nome");
     $exposicao_nome->setLabel("Nome da Exposição:");
     $exposicao_nome->setAttrib('placeholder', 'Digite o nome de sua exposição');
     $exposicao_nome->setRequired();
     //exposicao_descricao
     $exposicao_descricao = new Zend_Form_Element_Textarea("exposicao_descricao");
     $exposicao_descricao->setLabel("Descrição da Exposição:");
     $exposicao_descricao->setAttrib('placeholder', 'Conte aos usuários sobre sua exposição');
     $exposicao_descricao->setAttrib('rows', 10);
     $exposicao_descricao->setRequired();
     // tipo_exposicao_id
     $tipo_exposicao_id = new Zend_Form_Element_Select("tipo_exposicao_id");
     $tipo_exposicao_id->setLabel("Categoria da Exposição:");
     $tipo_exposicao_id->setRequired();
     $tipo_exposicao_id->setMultiOptions($this->getTipoExposicao());
     //exposicao_capa
     $exposicao_capa = new Zend_Form_Element_File("files");
     $exposicao_capa->setLabel("Selecione a capa:");
     $exposicao_capa->setDestination(Zend_Registry::get('config')->path->images->exposicao->capa);
     $exposicao_capa->addValidator('Extension', false, 'jpg,png,gif');
     $exposicao_capa->addValidator('Size', false, 2097152)->setMaxFileSize(2097152);
     $exposicao_capa->setAttrib('id', 'exposicao_capa');
     $exposicao_capa->setRequired();
     // add elements
     $this->addElement($exposicao_nome);
     $this->addElement($exposicao_descricao);
     $this->addElement($tipo_exposicao_id);
     $this->addElement($exposicao_capa);
     parent::init();
 }
Exemple #8
0
 public function FrmProCate($frm = null)
 {
     $vendor_name = new Zend_Form_Element_Text("vendor_name");
     $vendor_name->setAttribs(array('class' => 'validate[required]', 'placeholder' => 'ឈ្មោះអ្នផ្ឌត់ផ្ឌង់'));
     $phone = new Zend_Form_Element_Text("phone");
     $phone->setAttribs(array('class' => 'validate[required]', 'placeholder' => ''));
     $contact = new Zend_Form_Element_Text("contact");
     $contact->setAttribs(array('class' => 'validate[required]', 'placeholder' => ''));
     $email = new Zend_Form_Element_Text("email");
     $email->setAttribs(array('class' => 'validate[required]', 'placeholder' => ''));
     $address = new Zend_Form_Element_Textarea("address");
     $address->setAttribs(array('class' => '', 'placeholder' => ''));
     $status = new Zend_Form_Element_Select('status');
     $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $status->setMultiOptions($_arr_status);
     $status->setAttribs(array('class' => 'form-control validate[required]'));
     $this->addElements(array($vendor_name, $phone, $contact, $email, $address, $status));
     if ($frm != "") {
         $vendor_name->setValue($frm["v_name"]);
         $phone->setValue($frm["phone"]);
         $contact->setValue($frm["contact_name"]);
         $email->setValue($frm["email"]);
         $address->setValue($frm["vendor_remark"]);
         $status->setValue($frm["is_active"]);
     }
     return $this;
 }
Exemple #9
0
 public function FrmBrand($frm = null)
 {
     $db = new Application_Model_DbTable_DbGlobal();
     $status = new Zend_Form_Element_Select('status');
     $_arr_status = array(1 => $this->tr->translate("ACTIVE"), 0 => $this->tr->translate("DACTIVE"));
     $status->setMultiOptions($_arr_status);
     $status->setAttribs(array('class' => 'form-control validate[required]'));
     $parent = new Zend_Form_Element_Select("parent_id");
     $parent->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
     $category = $db->getAllBrand();
     if (empty($category)) {
         $option_category = array('0' => 'No Brand To Select');
     } else {
         $option_category = array('0' => 'Choose Brand');
         foreach ($category as $row_cat) {
             $option_category[$row_cat["brand_id"]] = $row_cat["name_kh"];
         }
     }
     $parent->setMultiOptions($option_category);
     $brand_en = new Zend_Form_Element_Text("name_en");
     $brand_en->setAttribs(array('class' => 'validate[required]', 'placeholder' => ' Brand Name In English', "OnChange" => "GetBrandName(1)"));
     $brand_km = new Zend_Form_Element_Text("name_km");
     $brand_km->setAttribs(array('class' => 'validate[required]', 'placeholder' => ' Brand Name In Khmer', "OnChange" => "GetBrandName(2)"));
     $icon = new Zend_Form_Element_File("icon");
     $this->addElements(array($icon, $status, $brand_en, $brand_km, $parent));
     if ($frm != "") {
         $parent->setValue($frm["parent_id"]);
         $brand_en->setValue($frm["name_en"]);
         $brand_km->setValue($frm["name_kh"]);
         $status->setValue($frm["status"]);
     }
     return $this;
 }
 public function addBrand($data = null)
 {
     $tr = Application_Form_FrmLanguages::getCurrentlanguage();
     $db = new Application_Model_DbTable_DbGlobal();
     $rowsbrand = $db->getGlobalDb('SELECT branch_id, Name
 			FROM tb_branch WHERE Name!="" ');
     $options = array('' => $tr->translate('Please_Select'));
     if ($rowsbrand) {
         foreach ($rowsbrand as $readBrand) {
             $options[$readBrand['branch_id']] = $readBrand['Name'];
         }
     }
     $brandElement = new Zend_Form_Element_Select('Parent brand');
     $brandElement->setAttribs(array('class' => 'demo-code-language'));
     $brandElement->setMultiOptions($options);
     $this->addElement($brandElement);
     $b_nameElement = new Zend_Form_Element_Text('brand Name');
     $b_nameElement->setAttribs(array('class' => 'validate[required]'));
     $this->addElement($b_nameElement);
     $optionsStatus = array(1 => $tr->translate("ACTIVE"), 2 => $tr->translate('DEACTIVE'));
     $statusElement = new Zend_Form_Element_Select('status');
     $statusElement->setAttribs(array('class' => 'demo-code-language'));
     $statusElement->setMultiOptions($optionsStatus);
     $this->addElement($statusElement);
     if ($data != null) {
         $idElement = new Zend_Form_Element_Hidden('id');
         $this->addElement($idElement);
         $statusElement->setValue($data["IsActive"]);
         $idElement->setValue($data['branch_id']);
         $b_nameElement->setValue($data['Name']);
         $brandElement->setValue($data['parent_id']);
     }
     return $this;
 }
Exemple #11
0
 public function init()
 {
     // contato_nome
     $contato_nome = new Zend_Form_Element_Text("contato_nome");
     $contato_nome->setLabel("Nome");
     $contato_nome->setRequired();
     $contato_nome->setAttribs(array('class' => 'form-control'));
     $contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_email
     $contato_email = new Zend_Form_Element_Text("contato_email");
     $contato_email->setLabel("E-mail");
     $contato_email->setRequired();
     $contato_email->setAttribs(array('class' => 'form-control'));
     $contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // contato_assunto
     $contato_assunto = new Zend_Form_Element_Select("contato_assunto");
     $contato_assunto->setLabel("Assunto");
     $contato_assunto->setRequired();
     $contato_assunto->setAttribs(array('class' => 'form-control'));
     $contato_assunto->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $contato_assunto->setMultiOptions(array("" => "Selecione o assunto...", "Informação" => "Informação", "Elogio" => "Eologio", "Crítica" => "Crítica", "Sugestão" => "Sugestão", "Outros" => "Outros"));
     // contato_mensagem
     $contato_mensagem = new Zend_Form_Element_Textarea("contato_mensagem");
     $contato_mensagem->setLabel("mensagem");
     $contato_mensagem->setRequired();
     $contato_mensagem->setAttribs(array('class' => 'form-control', 'rows' => 5));
     $contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $this->addElements(array($contato_nome, $contato_email, $contato_assunto, $contato_mensagem));
     parent::init();
 }
Exemple #12
0
 public function FrmSaleOrderUpdate($frm = null)
 {
     $db = new saleorder_Model_DbTable_DbSaleOrder();
     $rs_table = $db->getAllTable();
     $option_table = array('0' => $this->tr->translate("CHOOSE_TABLE"));
     foreach ($rs_table as $row) {
         $option_table[$row["tab_id"]] = $row["code"] . ":" . $row["name_en"] . "-" . $row["name_km"];
     }
     $table = new Zend_Form_Element_Select("tables");
     $table->setAttribs(array('class' => 'select validate[required]', 'style' => 'width:100%'));
     $table->setMultiOptions($option_table);
     $rs_product = $db->getAllProduct();
     $option_product = array(0 => $this->tr->translate('CHOOSE_PRODUCT'));
     foreach ($rs_product as $row) {
         $option_product[$row["pro_id"]] = $row["item_code"] . '-' . $row["name_kh"] . '-' . $row["name_en"];
     }
     $product = new Zend_Form_Element_Select("product");
     $product->setAttribs(array('class' => 'select form-control', 'style' => 'width:100%'));
     $product->setMultiOptions($option_product);
     $c_date = date('Y-m-d');
     $date = new Zend_Form_Element_Text('dates');
     $date->setAttribs(array('id' => 'dates', 'style' => 'float:left;width:100%', 'class' => 'form-control validate[required]'));
     //$date->setValue($c_date);
     $saleorder_num = $db->getSaleOrderNo();
     $saleorder_no = new Zend_Form_Element_Text("saleorder_nos");
     $saleorder_no->setAttribs(array('class' => 'validate[required]', 'readOnly' => 'readOnly', 'style' => 'color:red'));
     $saleorder_no->setValue($saleorder_num);
     $this->addElements(array($product, $table, $date, $saleorder_no));
     if ($frm != "") {
         $saleorder_no->setValue($frm["saleorder_no"]);
         $table->setValue($frm["tab_id"]);
         $date->setValue($frm["date"]);
     }
     return $this;
 }
Exemple #13
0
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'leavereport');
     $id = new Zend_Form_Element_Hidden('id');
     $employeename = new Zend_Form_Element_Text('employeename');
     $employeename->setLabel('Leave Applied By');
     $employeename->setAttrib('onblur', 'clearautocompletename(this)');
     $department = new Zend_Form_Element_Select('department');
     $department->setLabel('Department');
     $department->addMultiOption('', 'Select Department');
     $department->setAttrib('class', 'selectoption');
     $department->setRegisterInArrayValidator(false);
     $leavestatus = new Zend_Form_Element_Select('leavestatus');
     $leavestatus->setLabel('Leave Status');
     $leavestatus->setMultiOptions(array('' => 'Select Leave Status', '1' => 'Pending for approval', '2' => 'Approved', '3' => 'Rejected', '4' => 'Cancel'));
     $leavestatus->setRegisterInArrayValidator(false);
     $from_date = new ZendX_JQuery_Form_Element_DatePicker('from_date');
     $from_date->setLabel('Applied Date');
     $from_date->setAttrib('readonly', 'true');
     $from_date->setAttrib('onfocus', 'this.blur()');
     $from_date->setOptions(array('class' => 'brdr_none'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $employeename, $department, $leavestatus, $from_date, $submit));
     $this->setElementDecorators(array('ViewHelper'));
     $this->setElementDecorators(array('UiWidgetElement'), array('from_date'));
 }
 public function init()
 {
     /**
      * projeto_id
      */
     $modelProjeto = new Model_DbTable_Projeto();
     $projeto_id = new Zend_Form_Element_Select("projeto_id");
     $projeto_id->setLabel("Projeto: ");
     $projeto_id->setAttribs(array('class' => 'form-control'));
     $projeto_id->setMultiOptions($modelProjeto->fetchPairs());
     $this->addElement($projeto_id);
     /**
      * tarefa_nome
      */
     $tarefa_nome = new Zend_Form_Element_Text("tarefa_nome");
     $tarefa_nome->setLabel("Título: ");
     $tarefa_nome->setAttribs(array('class' => 'form-control'));
     $tarefa_nome->setRequired();
     $this->addElement($tarefa_nome);
     /**
      * tarefa_descricao
      */
     $tarefa_descricao = new Zend_Form_Element_Textarea("tarefa_descricao");
     $tarefa_descricao->setLabel("Descrição: ");
     $tarefa_descricao->setAttribs(array('class' => 'form-control', 'rows' => 10));
     $tarefa_descricao->setRequired();
     $this->addElement($tarefa_descricao);
     parent::init();
 }
Exemple #15
0
 public function init()
 {
     $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled' ? false : true;
     $this->isSaas = $isSaas;
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_general.phtml', "isSaas" => $isSaas))));
     $defaultFade = Application_Model_Preference::GetDefaultFade();
     if ($defaultFade == "") {
         $defaultFade = '0.500000';
     }
     //Station name
     $this->addElement('text', 'stationName', array('class' => 'input_text', 'label' => 'Station Name', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetStationName(), 'decorators' => array('ViewHelper')));
     //Default station fade
     $this->addElement('text', 'stationDefaultFade', array('class' => 'input_text', 'label' => 'Default Fade (s):', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('regex', false, array('/^[0-9]{1,2}(\\.\\d{1,6})?$/', 'messages' => 'enter a time in seconds 0{.000000}'))), 'value' => $defaultFade, 'decorators' => array('ViewHelper')));
     $third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
     $third_party_api->setLabel('Allow Remote Websites To Access "Schedule" Info?<br> (Enable this to make front-end widgets work.)');
     $third_party_api->setMultiOptions(array("Disabled", "Enabled"));
     $third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
     $third_party_api->setDecorators(array('ViewHelper'));
     $this->addElement($third_party_api);
     /* Form Element for setting the Timezone */
     $timezone = new Zend_Form_Element_Select("timezone");
     $timezone->setLabel("Timezone");
     $timezone->setMultiOptions($this->getTimezones());
     $timezone->setValue(Application_Model_Preference::GetTimezone());
     $timezone->setDecorators(array('ViewHelper'));
     $this->addElement($timezone);
     /* Form Element for setting which day is the start of the week */
     $week_start_day = new Zend_Form_Element_Select("weekStartDay");
     $week_start_day->setLabel("Week Starts On");
     $week_start_day->setMultiOptions($this->getWeekStartDays());
     $week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
     $week_start_day->setDecorators(array('ViewHelper'));
     $this->addElement($week_start_day);
 }
Exemple #16
0
 public function init()
 {
     $seoFilter = new Core_Utils_SeoUrl();
     $objProj = new Admin_Model_Project();
     $obj = new Application_Model_DbTable_Banner();
     $primaryKey = $obj->getPrimaryKey();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     $this->setAttrib('idbanner', $primaryKey);
     $this->setAction('/banner/new');
     $e = new Zend_Form_Element_Hidden($primaryKey);
     $this->addElement($e);
     $e = new Zend_Form_Element_Select('codproy');
     $e->setMultiOptions($objProj->getFetchPairsAllProjects());
     $this->addElement($e);
     $i = new Zend_Form_Element_File('nombre');
     $this->addElement($i);
     $this->getElement('nombre')->setDestination(ROOT_IMG_DINAMIC . '/banner/origin/')->addValidator('Size', false, 10024000)->addValidator('Extension', true, 'jpg,png,gif,jpeg')->setRequired(false);
     $e = new Zend_Form_Element_Text('titulo');
     $this->addElement($e);
     $e = new Zend_Form_Element_Textarea('descripcion');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('fechainicio');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('fechafin');
     $this->addElement($e);
     $e = new Zend_Form_Element_Checkbox('vchestado');
     $e->setValue(true);
     $this->addElement($e);
     foreach ($this->getElements() as $element) {
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $element->removeDecorator('HtmlTag');
     }
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $emailCategoryOptionList = array('Invite non-sparks to join campaign' => $this->getView()->translate('Admin_Non-Sparks_Invitation'), 'Invite sparks to join campaign' => $this->getView()->translate('Admin_Sparks_Invitation'), 'Send mail to sparks' => $this->getView()->translate('Admin_Send_Mail_To_Sparks'));
     $emailCategory = new Zend_Form_Element_Select('emailCategory');
     $emailCategory->setMultiOptions($emailCategoryOptionList);
     $emailList = new Zend_Form_Element_Textarea('emailList');
     $emailList->setAttribs(array('rows' => 5, 'cols' => 150, 'onChange' => 'datetable()'))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535))));
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setAttribs(array('size' => 150))->addFilter('StringTrim');
     $message = new Zend_Form_Element_Textarea('message');
     $message->setAttribs(array('rows' => 30, 'cols' => 150))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535))));
     $optionList = array();
     $campaign = new Campaign();
     $campaigns = $campaign->fetchAll(null, "id desc", null, null);
     foreach ($campaigns as $campaign) {
         $optionList[$campaign->id] = $campaign->name;
     }
     $optionList['0'] = $this->getView()->translate('ADMIN_NOT_AUTO_INVITATION');
     $campaignId = new Zend_Form_Element_Select('campaignId');
     $campaignId->setMultiOptions($optionList);
     $code_source = new Zend_Form_Element_Text('code_source');
     $code_source->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel($this->getView()->translate('INVITATION_MAIL_SEND'));
     $this->addElements(array($emailCategory, $emailList, $subject, $message, $campaignId, $code_source, $submit));
 }
 public function init()
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $db = new Application_Model_DbTable_DbGlobal();
     /////////////Filter stock/////////////////
     $tr = Application_Form_FrmLanguages::getCurrentlanguage();
     $nameElement = new Zend_Form_Element_Text('s_name');
     $nameValue = $request->getParam('s_name');
     $nameElement->setValue($nameValue);
     $this->addElement($nameElement);
     $phonevalue = $request->getParam('phone');
     $phoneElement = new Zend_Form_Element_Text('phone');
     $phoneElement->setValue($phonevalue);
     $this->addElement($phoneElement);
     $rs = $db->getGlobalDb('SELECT LocationId,Name FROM tb_sublocation ORDER BY LocationId DESC ');
     $options = array('' => $tr->translate('Please_Select'));
     $agentValue = $request->getParam('stock_location');
     foreach ($rs as $read) {
         $options[$read['LocationId']] = $read['Name'];
     }
     $sale_agent = new Zend_Form_Element_Select('stock_location');
     $sale_agent->setMultiOptions($options);
     $sale_agent->setAttribs(array('id' => 'LocationId', 'class' => 'demo-code-language'));
     $sale_agent->setValue($agentValue);
     $this->addElement($sale_agent);
     return $this;
 }
Exemple #19
0
 /**
  * Form initialization
  *
  * @return void
  */
 public function init()
 {
     $url = Zend_Controller_Front::getInstance()->getRouter()->assemble(array('module' => "flex", 'controller' => 'panel', 'action' => 'form'), 'default');
     $this->setAction($url)->setMethod('post');
     $this->setLegend(sprintf(Zoo::_('Edit %s'), $this->target->name));
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name')->setRequired(true);
     $name->setDescription('Administration-side identifier');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title');
     $title->setDescription('User-visible title of panel');
     $layout = new Zend_Form_Element_Select('layout');
     $layout->setLabel('Layout');
     $layout->setMultiOptions($this->getLayouts());
     $category = new Zend_Form_Element_Text('category');
     $category->setLabel('Category');
     $category->setDescription('Administration-side grouping');
     $category->setRequired(true);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setLabel('save')->setOrder(100);
     $this->addElements(array($name, $title, $layout, $category));
     $legend = Zoo::_("Basic options");
     $this->addDisplayGroup(array('name', 'title', 'layout', 'category'), 'block_form', array('legend' => $legend));
     $this->addElement($submit);
     if ($this->target->id > 0) {
         $id_ele = new Zend_Form_Element_Hidden('id');
         $id_ele->setValue(intval($this->target->id));
         $this->addElement($id_ele);
     }
     $this->populate($this->target->toArray());
 }
 function __construct($user)
 {
     parent::__construct();
     $this->setName('Registration');
     $this->setMethod('POST');
     $this->setAction('/user/update');
     $gender = new Zend_Form_Element_Select('gender');
     $gender->setLabel('Gender');
     $gender->setMultiOptions(array('Male' => 'Male', 'Female' => 'Female'));
     $gender->setValue($user->gender);
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email');
     $email->setValue($user->email);
     $email->setRequired(true);
     $email->addValidator('NotEmpty', true);
     $email->addValidator(new User_Models_Forms_Validators_EmailAddress(), true);
     $paymentEmail = new Zend_Form_Element_Text('paymentEmail');
     $paymentEmail->setLabel('Payment Email');
     $paymentEmail->setRequired(true);
     $paymentEmail->addValidator('NotEmpty', true);
     $paymentEmail->addValidator(new User_Models_Forms_Validators_EmailAddress(), true);
     $paymentEmail->setValue($user->paymentEmail);
     $countries = new Zend_Form_Element_Select('country');
     $countries->setMultiOptions(self::getCountries());
     $countries->setLabel('Country');
     $countries->addValidator('NotEmpty');
     $countries->setValue($user->country);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Update');
     $this->addElements(array($gender, $email, $paymentEmail, $countries, $submit));
 }
Exemple #21
0
 public function init()
 {
     $CC_CONFIG = Config::getConfig();
     // Set the method for the display form to POST
     $this->setMethod('post');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/login.phtml'))));
     // Add username element
     $this->addElement('text', 'username', array('label' => _('Username:'******'class' => 'input_text', 'required' => true, 'value' => isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1 ? 'admin' : '', 'filters' => array('StringTrim'), 'validators' => array('NotEmpty'), 'decorators' => array('ViewHelper')));
     // Add password element
     $this->addElement('password', 'password', array('label' => _('Password:'******'class' => 'input_text', 'required' => true, 'value' => isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1 ? 'admin' : '', 'filters' => array('StringTrim'), 'validators' => array('NotEmpty'), 'decorators' => array('ViewHelper')));
     $locale = new Zend_Form_Element_Select("locale");
     $locale->setLabel(_("Language:"));
     $locale->setMultiOptions(Application_Model_Locale::getLocales());
     $locale->setDecorators(array('ViewHelper'));
     $this->addElement($locale);
     $recaptchaNeeded = false;
     if (Application_Model_LoginAttempts::getAttempts($_SERVER['REMOTE_ADDR']) >= 3) {
         $recaptchaNeeded = true;
     }
     if ($recaptchaNeeded) {
         // recaptcha
         $this->addRecaptcha();
     }
     // Add the submit button
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => _('Login'), 'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center', 'decorators' => array('ViewHelper')));
 }
 public function init()
 {
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/add-show-rebroadcast.phtml'))));
     $relativeDates = array();
     $relativeDates[""] = "";
     for ($i = 0; $i <= 30; $i++) {
         $relativeDates["{$i} days"] = "+{$i} " . _("days");
     }
     for ($i = 1; $i <= 10; $i++) {
         $select = new Zend_Form_Element_Select("add_show_rebroadcast_date_{$i}");
         $select->setAttrib('class', 'input_select');
         $select->setMultiOptions($relativeDates);
         $select->setRequired(false);
         $select->setDecorators(array('ViewHelper'));
         $this->addElement($select);
         $text = new Zend_Form_Element_Text("add_show_rebroadcast_time_{$i}");
         $text->setAttrib('class', 'input_text');
         $text->addFilter('StringTrim');
         $text->addValidator('date', false, array('HH:mm'));
         $text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')));
         $text->setRequired(false);
         $text->setDecorators(array('ViewHelper'));
         $this->addElement($text);
     }
 }
Exemple #23
0
 function getlibellesbyidcategorieAction()
 {
     $oMapper = new Application_Model_Mapper_RefItems();
     $oSelect = new Zend_Form_Element_Select(Form_AjoutProduit::LIBELLE);
     $oSelect->setMultiOptions($oMapper->getLibelleByIdCategorie($this->_getParam('idCategorie')))->setDecorators(array('ViewHelper'));
     $this->view->element = $oSelect->render();
 }
 public function init()
 {
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/preferences_soundcloud.phtml'))));
     //enable soundcloud uploads
     $this->addElement('checkbox', 'UseSoundCloud', array('label' => 'Upload Recorded Shows To SoundCloud', 'required' => false, 'value' => Application_Model_Preference::GetDoSoundCloudUpload(), 'decorators' => array('ViewHelper')));
     //SoundCloud Username
     $this->addElement('text', 'SoundCloudUser', array('class' => 'input_text', 'label' => 'SoundCloud Email:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudUser(), 'decorators' => array('ViewHelper')));
     //SoundCloud Password
     $this->addElement('password', 'SoundCloudPassword', array('class' => 'input_text', 'label' => 'SoundCloud Password:'******'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudPassword(), 'decorators' => array('ViewHelper')));
     // Add the description element
     $this->addElement('textarea', 'SoundCloudTags', array('label' => 'SoundCloud Tags: (separate tags with spaces)', 'required' => false, 'class' => 'input_text_area', 'value' => Application_Model_Preference::GetSoundCloudTags(), 'decorators' => array('ViewHelper')));
     //SoundCloud default genre
     $this->addElement('text', 'SoundCloudGenre', array('class' => 'input_text', 'label' => 'Default Genre:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetSoundCloudGenre(), 'decorators' => array('ViewHelper')));
     $select = new Zend_Form_Element_Select('SoundCloudTrackType');
     $select->setLabel('Default Track Type:');
     $select->setAttrib('class', 'input_select');
     $select->setMultiOptions(array("" => "", "original" => "Original", "remix" => "Remix", "live" => "Live", "recording" => "Recording", "spoken" => "Spoken", "podcast" => "Podcast", "demo" => "Demo", "in progress" => "Work in progress", "stem" => "Stem", "loop" => "Loop", "sound effect" => "Sound Effect", "sample" => "One Shot Sample", "other" => "Other"));
     $select->setRequired(false);
     $select->setValue(Application_Model_Preference::GetSoundCloudTrackType());
     $select->setDecorators(array('ViewHelper'));
     $this->addElement($select);
     $select = new Zend_Form_Element_Select('SoundCloudLicense');
     $select->setLabel('Default License:');
     $select->setAttrib('class', 'input_select');
     $select->setMultiOptions(array("" => "", "no-rights-reserved" => "The work is in the public domain", "all-rights-reserved" => "All rights are reserved", "cc-by" => "Creative Commons Attribution", "cc-by-nc" => "Creative Commons Attribution Noncommercial", "cc-by-nd" => "Creative Commons Attribution No Derivative Works", "cc-by-sa" => "Creative Commons Attribution Share Alike", "cc-by-nc-nd" => "Creative Commons Attribution Noncommercial Non Derivate Works", "cc-by-nc-sa" => "Creative Commons Attribution Noncommercial Share Alike"));
     $select->setRequired(false);
     $select->setValue(Application_Model_Preference::GetSoundCloudLicense());
     $select->setDecorators(array('ViewHelper'));
     $this->addElement($select);
 }
 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('action', DOMAIN . 'workeligibilitydoctypes/edit');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'workeligibilitydoctypes');
     $id = new Zend_Form_Element_Hidden('id');
     $documenttype = new Zend_Form_Element_Text('documenttype');
     $documenttype->setAttrib('maxLength', 50);
     $documenttype->setRequired(true);
     $documenttype->addValidator('NotEmpty', false, array('messages' => 'Please enter document type.'));
     $documenttype->addValidator("regex", true, array('pattern' => '/^(?=.*[a-zA-Z])([^ ][a-zA-Z0-9\\-\\s]*)$/', 'messages' => array('regexNotMatch' => 'Please enter valid document type.')));
     $documenttype->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_workeligibilitydoctypes', 'field' => 'documenttype', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
     $documenttype->getValidator('Db_NoRecordExists')->setMessage('Document type already exists.');
     $issuingauthority = new Zend_Form_Element_Select('issuingauthority');
     $issuingauthority->setRegisterInArrayValidator(false);
     $issuingauthority->setMultiOptions(array('' => 'Select issuing authority', '1' => 'Country', '2' => 'State', '3' => 'City'));
     $issuingauthority->setRequired(true);
     $issuingauthority->addValidator('NotEmpty', false, array('messages' => 'Please select issuing authority.'));
     $description = new Zend_Form_Element_Textarea('description');
     $description->setAttrib('rows', 10);
     $description->setAttrib('cols', 50);
     $description->setAttrib('maxlength', '200');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $documenttype, $issuingauthority, $description, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
 public function FrmInvoice($data = null)
 {
     $customer_id = new Zend_Form_Element_Select('customer_id');
     $customer_id->setAttribs(array('class' => 'form-control'));
     $general_opt = array("" => $this->tr->translate("GENERAL_CUSTOMER"));
     $customer_id->setMultiOptions($general_opt);
     $general = new Zend_Form_Element_Text('general');
     $general->setAttribs(array('class' => 'form-control'));
     $session = new Zend_Form_Element_Text('session');
     $session->setAttribs(array('class' => 'form-control'));
     $contact_name = new Zend_Form_Element_Select('contact_name');
     $contact_name->setAttribs(array('class' => 'form-control', 'required' => true));
     $check = new Zend_Form_Element_Text('check');
     $check->setAttribs(array('class' => 'form-control'));
     $phone = new Zend_Form_Element_Text('phone');
     $phone->setAttribs(array('class' => 'form-control'));
     $pay_date = new Zend_Form_Element_Text('pay_date');
     $pay_date->setAttribs(array('class' => 'form-control'));
     $fax = new Zend_Form_Element_Text('fax');
     $fax->setAttribs(array('class' => 'form-control'));
     $account_num = new Zend_Form_Element_Select('account_no');
     $account_num->setAttribs(array('class' => 'form-control'));
     $undeposit = new Zend_Form_Element_Text('undeposit');
     $undeposit->setAttribs(array('class' => 'form-control'));
     $address = new Zend_Form_Element_Text('address');
     $address->setAttribs(array('class' => 'form-control'));
     $address1 = new Zend_Form_Element_Text('address1');
     $address1->setAttribs(array('class' => 'form-control'));
     $pay_amount = new Zend_Form_Element_Text('pay_amount');
     $pay_amount->setAttribs(array('class' => 'form-control'));
     $remaining = new Zend_Form_Element_Text('remaining_amount');
     $remaining->setAttribs(array('class' => 'form-control'));
     $this->addElements(array($address1, $customer_id, $general, $contact_name, $session, $check, $phone, $pay_date, $fax, $account_num, $undeposit, $address, $pay_amount, $remaining));
     return $this;
 }
 public function FrmReceive($data = null)
 {
     $wherehouse_id = new Zend_Form_Element_Select('wherehouse_id');
     $wherehouse_id->setAttribs(array('class' => 'form-control'));
     $wherehouse_id_opt = array("1" => $this->tr->translate("..."), "2" => $this->tr->translate("..."));
     $wherehouse_id->setMultiOptions($wherehouse_id_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $handow = new Zend_Form_Element_Text('handow');
     $handow->setAttribs(array('class' => 'form-control'));
     $document = new Zend_Form_Element_Button('3');
     $document->setAttribs(array('class' => 'form-control'));
     $session = new Zend_Form_Element_Button('7');
     $session->setAttribs(array('class' => 'form-control'));
     $item_code = new Zend_Form_Element_Select('item_code');
     $item_code->setAttribs(array('class' => 'form-control'));
     $company_opt = array("1" => $this->tr->translate("SELECT_COMPANY"), "2" => $this->tr->translate("SELECT_COMPANY_NAME"));
     $item_code->setMultiOptions($company_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $ptd_usage_value = new Zend_Form_Element_Text('ptd_usage_value');
     $ptd_usage_value->setAttribs(array('class' => 'form-control'));
     $qty_onhand = new Zend_Form_Element_Text('demo3');
     $qty_onhand->setAttribs(array('class' => 'form-control', 'id' => 'demo3'));
     $branch = new Zend_Form_Element_Select('branch');
     $branch->setAttribs(array('class' => 'form-control'));
     $wherehouse_id_opt = array("1" => $this->tr->translate("..."), "2" => $this->tr->translate("..."));
     $branch->setMultiOptions($wherehouse_id_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $blank_smaler = new Zend_Form_Element_Select('blank_smaler');
     $blank_smaler->setAttribs(array('class' => 'form-control'));
     $company_opt = array("1" => $this->tr->translate("SELECT_COMPANY"), "2" => $this->tr->translate("SELECT_COMPANY_NAME"));
     $blank_smaler->setMultiOptions($company_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $average_cost = new Zend_Form_Element_Text('average_cost');
     $average_cost->setAttribs(array('class' => 'form-control'));
     $ptd_sale_value = new Zend_Form_Element_Text('ptd_sale_value');
     $ptd_sale_value->setAttribs(array('class' => 'form-control'));
     $unit_cost = new Zend_Form_Element_Radio('unit_cost');
     $unit_cost->setAttribs(array('class' => 'red'));
     $total_cost = new Zend_Form_Element_Radio('total_cost');
     $total_cost->setAttribs(array('class' => 'red'));
     $serial = new Zend_Form_Element_Text('serial');
     $serial->setAttribs(array('class' => 'form-control'));
     $lot = new Zend_Form_Element_Text('lot');
     $lot->setAttribs(array('class' => 'form-control'));
     $add_lind = new Zend_Form_Element_Button('add_lind');
     $add_lind->setAttribs(array('class' => 'form-control'));
     $edit_lind = new Zend_Form_Element_Button('edit_lind');
     $edit_lind->setAttribs(array('class' => 'form-control'));
     $delete_lind = new Zend_Form_Element_Button('delete_lind');
     $delete_lind->setAttribs(array('class' => 'form-control'));
     $concel_lind = new Zend_Form_Element_Button('concel_lind');
     $concel_lind->setAttribs(array('class' => 'form-control'));
     $this->addElements(array($combo, $wherehouse_id, $handow, $item_code, $branch, $document, $session, $blank_smaler, $ptd_usage_value, $qty_onhand, $unit_cost, $total_cost, $serial, $lot, $add_lind, $edit_lind, $delete_lind, $concel_lind));
     return $this;
 }
 public function checkIn()
 {
     $inviceno = new Zend_Form_Element_Text("invoiceno");
     $v_name = new Zend_Form_Element_Select("v_name");
     $opt_vname = array(1 => "abc", 2 => "ugu");
     $v_name->setMultiOptions($opt_vname);
     //	$v_name->setAttribs(array("readonly"=>"readonly"));
 }
 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oOrderEmailNotificationEditId = new Zend_Form_Element_Hidden("order_email_notification_edit_id");
     $oOrderEmailNotificationEditId->setValue(0);
     $oOrderEmailNotificationEditId->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oOrderEmailNotificationEditId);
     $oOrderStatusOldId = new Zend_Form_Element_Select("order_status_id_old");
     $oOrderStatusOldId->setMultiOptions($this->_aAllOrderStatus);
     $oOrderStatusOldId->setLabel("Status zamówienia - stary:");
     $oOrderStatusOldId->setRequired(TRUE);
     //$oOrderStatusOldId->setRequired(TRUE)->addValidator(new Zend_Validate_InArray($this->_aAllOrderStatus));
     $oOrderStatusOldId->setAttrib("class", "valid");
     $this->addElement($oOrderStatusOldId);
     $oOrderStatusNewId = new Zend_Form_Element_Select("order_status_id_new");
     $oOrderStatusNewId->setMultiOptions($this->_aAllOrderStatus);
     $oOrderStatusNewId->setLabel("Status zamówienia - nowy:");
     $oOrderStatusNewId->setRequired(TRUE);
     //$oOrderStatusNewId->setRequired(TRUE)->addValidator(new Zend_Validate_InArray($this->_aAllOrderStatus));
     $oOrderStatusNewId->setAttrib("class", "valid");
     $this->addElement($oOrderStatusNewId);
     $oNotificationSubject = new Zend_Form_Element_Textarea("notification_subject");
     $oNotificationSubject->setLabel("Temat:");
     $oNotificationSubject->setRequired(TRUE)->addValidator(new Zend_Validate_StringLength(array("max" => 160)));
     $oNotificationSubject->setAttrib("class", "valid");
     $this->addElement($oNotificationSubject);
     $oNotification = new Zend_Form_Element_Textarea("notification");
     $oNotification->setLabel("Treść:");
     $oNotification->setRequired(FALSE);
     $oNotification->setAttrib("class", "ckeditor");
     $this->addElement($oNotification);
     $oAppriseBorrower = new Zend_Form_Element_Checkbox("apprise_borrower");
     $oAppriseBorrower->setLabel("Powiadom czytelnika:");
     $this->addElement($oAppriseBorrower);
     $oAppriseLibrarian = new Zend_Form_Element_Checkbox("apprise_librarian");
     $oAppriseLibrarian->setLabel("Powiadom bibliotekarza:");
     $this->addElement($oAppriseLibrarian);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "submit");
     $oSubmit->setLabel("Zapisz");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/_defaultform.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
 public function Frm_table_type($data = null)
 {
     $menu_code = new Zend_Form_Element_Text('type_code');
     $menu_code->setAttribs(array('class' => 'form-control', 'required' => true));
     $description = new Zend_Form_Element_Text('description');
     $description->setAttribs(array('class' => 'form-control'));
     $lang_1 = new Zend_Form_Element_Text('lang_1');
     $lang_1->setAttribs(array('class' => 'form-control'));
     $lang_2 = new Zend_Form_Element_Text('lang_2');
     $lang_2->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     $lang_3 = new Zend_Form_Element_Text('lang_3');
     $lang_3->setAttribs(array('checked' => 'checked', 'class' => 'form-control'));
     if ($data != null) {
         // 			print_r($data);
     }
     $show_description = new Zend_Form_Element_Select('show_description');
     $show_description->setAttribs(array('class' => 'form-control'));
     $description_opt = array("" => $this->tr->translate("SELECT_DESCRIPTION"));
     $show_description->setMultiOptions($description_opt);
     $photo = new Zend_Form_Element_File('photo');
     $background = new Zend_Form_Element_Text('background');
     $background->setAttribs(array('class' => 'form-control color-picker-rgba'));
     $font_color = new Zend_Form_Element_Text('font_color');
     $font_color->setAttribs(array('class' => 'form-control', 'id' => "selected-color1"));
     $font_size = new Zend_Form_Element_Text('demo3');
     $font_size->setAttribs(array('class' => 'form-control', 'id' => "demo3", 'value' => 12, 'placeholder' => '12'));
     $apply = new Zend_Form_Element_Select('apply');
     $apply->setAttribs(array('class' => 'form-control'));
     $apply_opt = array("" => $this->tr->translate("SELECT_APPLY_TO_COMPANY"));
     $apply->setMultiOptions($apply_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $active = new Zend_Form_Element_Checkbox('active');
     $active->setAttribs(array('class' => 'red'));
     $format = new Zend_Form_Element_Text('demo4');
     $format->setAttribs(array('class' => 'form-control', 'id' => "demo4", 'value' => 12, 'placeholder' => '12'));
     $setting = new Zend_Form_Element_Select('setting');
     $setting->setAttribs(array('class' => 'form-control'));
     $setting_opt = array("" => $this->tr->translate("SELECT_SETTING"));
     $setting->setMultiOptions($setting_opt);
     $arrange = new Zend_Form_Element_Text('arrange');
     $arrange->setAttribs(array('class' => 'form-control'));
     $resize = new Zend_Form_Element_Text('resize');
     $resize->setAttribs(array('class' => 'form-control', 'id' => "resize", 'value' => 12, 'placeholder' => '12'));
     $note = new Zend_Form_Element_Textarea('note');
     $note->setAttribs(array('class' => 'form-control', 'style' => "margin-top: 0px; margin-bottom: 0px; height: 100px;"));
     $id = new Zend_Form_Element_Hidden('id');
     if ($data != null) {
         $id->setValue($data['id']);
         $menu_code->setValue($data['code']);
         $description->setValue($data['description']);
         $lang_1->setValue($data['lang1']);
         $lang_2->setValue($data['lang2']);
         $note->setValue($data['note']);
     }
     $this->addElements(array($id, $apply, $active, $combo, $menu_code, $description, $lang_1, $lang_2, $lang_3, $show_description, $background, $font_color, $font_size, $format, $setting, $arrange, $resize, $note));
     return $this;
 }