private function _addElementPerson()
 {
     $translate = Zend_Registry::get("Zend_Translate");
     $url = new Zend_View_Helper_Url();
     $urlSearch = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'search-form'), null, true);
     $urlNew = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'create'), null, true);
     $append = '';
     $this->addElement('text', 'person_name', array('label' => 'Person', 'value' => $this->_model ? $this->_model->getPerson()->getName() : '', 'dimension' => 6, 'disabled' => true, 'placeholder' => $translate->_('Use the links aside to search a person or create a new one'), 'append' => $append . ' | ' . '<a class="hide" id="btnPersonDetails" href="#" rel="colorbox-details">' . $translate->_("Details") . '</a>' . ' | ' . '<a class="hide" id="btnPersonCreate" href="' . $urlNew . '" rel="colorbox">' . '<i class="icon-plus-sign" rel="tooltip" data-original-title="' . $translate->_("Add new") . ' ' . $translate->_("person") . '"></i>' . '</a>'));
 }
Example #2
0
 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $ma = new Zend_Form_Element_Text('ma');
     $ma->setLabel('Mã (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 10))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $mo_ta = new Zend_Form_Element_Textarea('mo_ta');
     $mo_ta->setLabel('Mô tả')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta', 'class' => 'textarea', 'rows' => '4'));
     $loai_lv = new Default_Model_LoaiLinhVuc();
     $llvOptions = array("multiOptions" => $loai_lv->getMultiOptions());
     $ma_loai = new Zend_Form_Element_Select('ma_loai', $llvOptions);
     $ma_loai->setLabel('Loại lĩnh vực')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'linh-vuc', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($id, $ma, $ten, $mo_ta, $ma_loai, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'linh_vuc')), 'Form'));
 }
Example #3
0
 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $ma = new Zend_Form_Element_Text('ma');
     $ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToUpper')->addValidator(new Zend_Validate_StringLength(0, 10))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input'));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 250))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $ofSGUOptions = array("multiOptions" => array('1' => 'Thuộc', '0' => 'Không thuộc'));
     $thuoc_sgu = new Zend_Form_Element_Radio('thuoc_sgu', $ofSGUOptions);
     $thuoc_sgu->setRequired(true)->setLabel('Thuộc SGU')->setValue('1')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'thuoc_sgu'));
     $deptOptions = array("multiOptions" => array('1' => 'Khoa - Bộ môn TT', '0' => 'Phòng ban - Trung tâm'));
     $la_khoa = new Zend_Form_Element_Radio('la_khoa', $deptOptions);
     $la_khoa->setRequired(true)->setLabel('Loại đơn vị')->setValue('1')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'la_khoa', 'class' => 'radio_inline'))));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'don-vi', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($id, $ma, $ten, $thuoc_sgu, $la_khoa, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'don_vi')), 'Form'));
 }
Example #4
0
 /**
  * Generates an url given the name of a route.
  *
  * @access public
  *
  * @param  array $urlOptions Options passed to the assemble method of the Route object.
  * @param  mixed $name The name of a Route to use. If null it will use the current Route
  * @param  bool $reset Whether or not to reset the route defaults with those provided
  * @return string Url for the link href attribute.
  */
 public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
 {
     if ('' != ($queryString = Zend_Controller_Front::getInstance()->getRequest()->getServer('QUERY_STRING'))) {
         $queryString = '?' . $queryString;
     }
     return parent::url($urlOptions, $name, $reset, $encode) . $queryString;
 }
Example #5
0
 public function init()
 {
     $this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setAttrib('class', 'form_create_tai_lieu');
     $this->addElement('Hidden', 'search', array('value' => 1));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Chuyên đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $noi_dung = new Zend_Form_Element_Textarea('noi_dung');
     $noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
     $thoi_gian = new Zend_Form_Element_Text('thoi_gian');
     $thoi_gian->setLabel('Ngày tổ chức')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'thoi_gian'));
     $dia_diem = new Zend_Form_Element_Text('dia_diem');
     $dia_diem->setLabel('Địa điểm')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Upload file')->setDescription('(*.doc, *.docx, *.pdf , < 10MB )')->setDestination(BASE_PATH . '/upload/files/sinh_hoat_chuyen_de')->addValidator(new Zend_Validate_File_Extension(array('doc,docx,pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setLabel('Lưu và tiếp tục')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setLabel('Lưu và thoát')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'sinh-hoat-chuyen-de', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Không lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ten, $noi_dung, $thoi_gian, $dia_diem, $file, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
Example #6
0
 public function init()
 {
     $this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setAttrib('class', 'form_create_bai_bao');
     $this->addElement('Hidden', 'search', array('value' => 1));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên sản phẩm (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $so_luong_thanh_vien = new Zend_Form_Element_Text('so_luong_thanh_vien');
     $so_luong_thanh_vien->setRequired(true)->setLabel('Số lượng thành viên')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'so_luong_thanh_vien'))->setAttrib('class', 'text-input small-input');
     $mo_ta = new Zend_Form_Element_Textarea('mo_ta');
     $mo_ta->setLabel('Nội dung')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta', 'class' => 'text-input textarea'));
     $thong_tin = new Zend_Form_Element_Text('thong_tin');
     $thong_tin->setRequired(true)->setLabel('Thông tin')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'thong_tin'))->setAttrib('class', 'text-input large-input');
     $thangOptions = Default_Model_Constraints::lichct_thang();
     $thang = new Zend_Form_Element_Select('thang');
     $thang->setLabel('Tháng')->addMultiOptions($thangOptions)->setValue(date('m'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $namOptions = Default_Model_Constraints::years();
     $nam = new Zend_Form_Element_Select('nam');
     $nam->setLabel('Năm')->addMultiOptions($namOptions)->setValue(date('Y'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $dot = new Zend_Form_Element_Text('dot');
     $dot->setRequired(true)->setLabel('Đợt')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'dot'));
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Upload file')->setDescription('(*.doc, *.docx, *.pdf , < 10MB )')->setDestination(BASE_PATH . '/upload/files/bai_bao')->addValidator(new Zend_Validate_File_Extension(array('doc,docx,pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setLabel('Lưu và tiếp tục')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setLabel('Lưu và thoát')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'bai-bao', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Không lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ten, $thong_tin, $mo_ta, $so_luong_thanh_vien, $thang, $nam, $dot, $file, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
Example #7
0
 public function init()
 {
     //$this->_adminModel = new Application_Model_Admin();
     $this->setMethod('post');
     $this->setName('addproduct');
     $this->setAction('');
     //nome del prodotto
     $this->addElement('text', 'Nome', array('label' => 'Nome', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('StringLength', true, array(1, 25))), 'decorators' => $this->elementDecorators));
     $this->addElement('select', 'idCategoria', array('label' => 'Categoria', 'required' => true, 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
     $this->addElement('file', 'Foto', array('label' => 'Immagine', 'destination' => APPLICATION_PATH . '/../public/images/products', 'validators' => array(array('Count', false, 1), array('Size', false, 102400), array('Extension', false, array('jpg', 'gif'))), 'decorators' => $this->fileDecorators));
     $this->addElement('text', 'DescrizioneBreve', array('label' => 'Descrizione Breve', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('StringLength', true, array(1, 250))), 'decorators' => $this->elementDecorators));
     $this->addElement('textarea', 'DescrizioneLunga', array('label' => 'Descrizione Estesa', 'cols' => '60', 'rows' => '10', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('StringLength', true, array(1, 2500))), 'decorators' => $this->elementDecorators));
     $this->addElement('multiCheckbox', 'Componenti', array('label' => 'Componenti', 'required' => 'true', 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
     $urlHelper = new Zend_View_Helper_Url();
     $url = $urlHelper->url(array('controller' => 'admin', 'action' => 'addcomponent'), 'default');
     $this->addElement('Note', 'AddComponenti', array('value' => '<a href="' . $url . '">Inserisci un nuovo componente</a>', 'decorators' => $this->elementDecorators));
     $this->addElement('multiCheckbox', 'Ntbu', array('label' => 'Note tecniche di buon uso', 'required' => 'true', 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
     $urlHelper = new Zend_View_Helper_Url();
     $url = $urlHelper->url(array('controller' => 'admin', 'action' => 'addntbu'), 'default');
     $this->addElement('Note', 'AddNtbu', array('value' => '<a href="' . $url . '">Inserisci una nuova ntbu</a>', 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'Cilindrata', array('label' => 'Cilindrata', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('Between', true, array(0, 10000))), 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'Potenza', array('label' => 'Potenza (kW)', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'MassaVuoto', array('label' => 'Massa a vuoto', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'VelocitaMax', array('label' => 'Velocità massima', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
     $this->addElement('submit', 'add', array('label' => 'Aggiungi Prodotto', 'decorators' => $this->buttonDecorators));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), array('Description', array('placement' => 'prepend', 'class' => 'formerror')), 'Form'));
 }
Example #8
0
 function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
 {
     if (!empty($urlOptions['name'])) {
         $urlOptions['name'] = $this->slug($urlOptions['name']);
     }
     return parent::url($urlOptions, $name, $reset, $encode);
 }
Example #9
0
 public function init()
 {
     $this->_adminModel = new Application_Model_Admin();
     $this->setMethod('post');
     $this->setName('editproduct');
     $this->setAction('');
     //recupero il prodotto da modificare
     //$this->_default = $this->_adminModel->getProdById($this->_id);
     //nome del prodotto
     $this->addElement('text', 'Nome', array('label' => 'Nome', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('StringLength', true, array(1, 25))), 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'DescrizioneBreve', array('label' => 'Descrizione Breve', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('StringLength', true, array(1, 250))), 'decorators' => $this->elementDecorators));
     $this->addElement('textarea', 'DescrizioneLunga', array('label' => 'Descrizione Estesa', 'cols' => '60', 'rows' => '10', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('StringLength', true, array(1, 2500))), 'decorators' => $this->elementDecorators));
     $this->addElement('multiCheckbox', 'Componenti', array('label' => 'Componenti', 'required' => 'true', 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
     $urlHelper = new Zend_View_Helper_Url();
     $url = $urlHelper->url(array('controller' => 'admin', 'action' => 'addcomponent'), 'default');
     $this->addElement('Note', 'AddComponenti', array('value' => '<a href="' . $url . '">Inserisci un nuovo componente</a>', 'decorators' => $this->elementDecorators));
     $this->addElement('multiCheckbox', 'Ntbu', array('label' => 'Note tecniche di buon uso', 'required' => 'true', 'decorators' => $this->elementDecorators, 'registerInArrayValidator' => false));
     $urlHelper = new Zend_View_Helper_Url();
     $url = $urlHelper->url(array('controller' => 'admin', 'action' => 'addntbu'), 'default');
     $this->addElement('Note', 'AddNtbu', array('value' => '<a href="' . $url . '">Inserisci una nuova ntbu</a>', 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'Cilindrata', array('label' => 'Cilindrata', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('Between', true, array(0, 10000))), 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'Potenza', array('label' => 'Potenza (kW)', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'MassaVuoto', array('label' => 'Massa a vuoto', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
     $this->addElement('text', 'VelocitaMax', array('label' => 'Velocità massima', 'filters' => array('StringTrim'), 'required' => true, 'validators' => array(array('Int', true), array('GreaterThan', true, array(0))), 'decorators' => $this->elementDecorators));
     $this->addElement('submit', 'add', array('label' => 'Modifica Prodotto', 'decorators' => $this->buttonDecorators));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), array('Description', array('placement' => 'prepend', 'class' => 'formerror')), 'Form'));
 }
Example #10
0
 public function init()
 {
     $this->setName('f3')->setMethod('get');
     $linh_vuc = new Default_Model_LinhVuc();
     $lv = $linh_vuc->getDSLV();
     $lv = array('0' => '========= Tất cả =========') + $lv;
     $lvOptions = array("multiOptions" => $lv);
     $ma_linh_vuc = new Zend_Form_Element_Select('ma_linh_vuc', $lvOptions);
     $ma_linh_vuc->setRequired(true)->setLabel('Lĩnh vực')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_linh_vuc'));
     $nams = Default_Model_Constraints::nam();
     $nams = array('0' => '== Tất cả ==') + $nams;
     ksort($nams);
     $namOption = array("multiOptions" => $nams);
     $nam = new Zend_Form_Element_Select('nam', $namOption);
     $nam->setLabel('Năm')->setValue(date('Y'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'nam'));
     $submit = new Zend_Form_Element_Submit('loc');
     $submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'danh-sach-hdd'), null, true);
     $reset = new Zend_Form_Element_Button('reset');
     $reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ma_linh_vuc, $nam, $submit, $reset));
     // Element: order
     $this->addElement('Hidden', 'order', array('order' => 10004));
     // Element: direction
     $this->addElement('Hidden', 'direction', array('order' => 10005));
     $this->addDisplayGroup(array('ma_linh_vuc', 'nam', 'loc', 'reset'), 'group1', array('order' => 1, 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_hdd', 'style' => 'width : 65%')), 'Form'));
 }
Example #11
0
 public function init()
 {
     $this->setName('f2')->setMethod('post')->setAttribs(array('id' => 'user'));
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int')->removeDecorator('label');
     $username = new Zend_Form_Element_Text('ten_dang_nhap');
     $username->setLabel('Tên đăng nhập (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 32))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 83%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ten_dang_nhap', 'class' => 'text-input'));
     $password = new Zend_Form_Element_Password('mat_khau');
     $password->setLabel('Mật khẩu (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mat_khau', 'class' => 'text-input'));
     $repassword = new Zend_Form_Element_Password('mat_khau_2');
     $repassword->setLabel('Nhập lại mật khẩu (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_Identical('mat_khau'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mat_khau_2', 'class' => 'text-input'));
     $ho = new Zend_Form_Element_Text('ho');
     $ho->setLabel('Họ (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 100))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 83%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ho', 'class' => 'text-input'));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 20))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ten', 'class' => 'text-input'));
     $ngay_sinh = new Zend_Form_Element_Text('ngay_sinh');
     $ngay_sinh->setLabel('Ngày sinh (*)')->setDescription('(dd-mm-YYYY)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ngay_sinh', 'class' => 'text-input'));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_EmailAddress())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'email', 'class' => 'text-input'));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'index', 'action' => 'index'));
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($id, $username, $password, $repassword, $ho, $ten, $ngay_sinh, $email, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submitbtn', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
Example #12
0
 public function init()
 {
     $this->setName('f2')->setAttrib('class', 'form_create_nhan_su');
     $ho_ten = new Zend_Form_Element_Text('ho_ten');
     $ho_ten->setLabel('Họ tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $chuc_vu = new Zend_Form_Element_Text('chuc_vu');
     $chuc_vu->setLabel('Chức vụ')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $website = new Zend_Form_Element_Text('website');
     $website->setLabel('Website')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $so_dien_thoai = new Zend_Form_Element_Text('so_dien_thoai');
     $so_dien_thoai->setLabel('Số điện thoại')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Ảnh cá nhân')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/nhan_su/')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $maxOrder = Khcn_Api::_()->getDbTable('nhan_su', 'default')->getMaxOrder();
     $order = new Zend_Form_Element_Text('order');
     $order->setLabel('Số thứ tự')->setValue($maxOrder)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input tinysmall-input');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'gioi-thieu', 'action' => 'nhan-su'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Không lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ho_ten, $chuc_vu, $email, $website, $so_dien_thoai, $file, $order, $submit, $cancel));
     $this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
Example #13
0
 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $thangOptions = Default_Model_Constraints::lichct_thang();
     $thang = new Zend_Form_Element_Select('thang');
     $thang->setLabel('Tháng (*)')->setValue(date('m'))->setRequired(true)->addMultiOptions($thangOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
     $this->addElement($thang);
     $tuanOptions = Default_Model_Constraints::lichct_tuan();
     $tuan = new Zend_Form_Element_Select('tuan');
     $tuan->setLabel('Tuần (*)')->setRequired(true)->addMultiOptions($tuanOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
     $this->addElement($tuan);
     $ngay_bat_dau = new Zend_Form_Element_Text('ngay_bat_dau');
     $ngay_bat_dau->setLabel('Ngày bắt đầu (*)')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'ngay_bat_dau'));
     $this->addElement($ngay_bat_dau);
     $ngay_ket_thuc = new Zend_Form_Element_Text('ngay_ket_thuc');
     $ngay_ket_thuc->setLabel('Ngày kết thúc (*)')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'ngay_ket_thuc'));
     $this->addElement($ngay_ket_thuc);
     $ghi_chu = new Zend_Form_Element_Textarea('ghi_chu');
     $ghi_chu->setLabel('Ghi chú')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ghi_chu', 'class' => 'text-input textarea', 'rows' => 4));
     $this->addElement($ghi_chu);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $this->addElement($submit);
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'lich-cong-tac', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Không lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElement($cancel);
     $this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
Example #14
0
 public function url($urlOptions = array(), $name = null, $reset = false, $encode = true)
 {
     if (!$urlOptions) {
         $urlOptions = array();
     }
     if (!$name) {
         if (Staticroute::getCurrentRoute() instanceof Staticroute) {
             $name = Staticroute::getCurrentRoute()->getName();
         }
     }
     if ($name && ($route = Staticroute::getByName($name))) {
         return $route->assemble($urlOptions, $reset, $encode);
     }
     // this is to add support for arrays as values for the default Zend_View_Helper_Url
     $unset = array();
     foreach ($urlOptions as $optionName => $optionValues) {
         if (is_array($optionValues)) {
             foreach ($optionValues as $key => $value) {
                 $urlOptions[$optionName . "[" . $key . "]"] = $value;
             }
             $unset[] = $optionName;
         }
     }
     foreach ($unset as $optionName) {
         unset($urlOptions[$optionName]);
     }
     try {
         return parent::url($urlOptions, $name, $reset, $encode);
     } catch (Exception $e) {
         throw new Exception("Route '" . $name . "' for building the URL not found");
     }
 }
Example #15
0
 public function init()
 {
     $this->setName('f3')->setMethod('get');
     $ma = new Zend_Form_Element_Text('ma');
     $ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 70px'));
     $ho = new Zend_Form_Element_Text('ho');
     $ho->setLabel('Họ')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 100px'));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('class' => 'text-input', 'style' => 'width: 50px', 'id' => 'ten'));
     $don_vi = new Default_Model_DonVi();
     $dv = $don_vi->getDSDV();
     $dv = array('0' => '=============== Tất cả ===============') + $dv;
     $dvOptions = array("multiOptions" => $dv);
     $ma_don_vi = new Zend_Form_Element_Select('ma_don_vi', $dvOptions);
     $ma_don_vi->setRequired(true)->setLabel('Đơn vị')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_don_vi'));
     $submit = new Zend_Form_Element_Button('loc', array('type' => 'submit'));
     $submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'giang-vien', 'action' => 'index'), null, true);
     $reset = new Zend_Form_Element_Button('reset');
     $reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ma, $ho, $ten, $ma_don_vi, $submit, $reset));
     // Element: order
     $this->addElement('Hidden', 'order', array('order' => 10004));
     // Element: direction
     $this->addElement('Hidden', 'direction', array('order' => 10005));
     $this->addDisplayGroup(array('ma', 'ho', 'ten', 'ma_don_vi', 'loc', 'reset'), 'filter', array('order' => '0', 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_gv')), 'Form'));
 }
Example #16
0
 public function init()
 {
     $this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
     $this->addElement('Hidden', 'search', array('value' => 1));
     $tieu_de = new Zend_Form_Element_Text('tieu_de');
     $tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $quan_trong = new Zend_Form_Element_Select('quan_trong');
     $quan_trong->setLabel('Quan Trọng')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $noi_bat = new Zend_Form_Element_Select('noi_bat');
     $noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $photo = new Zend_Form_Element_File('photo');
     $photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $image = new Zend_Form_Element_Image('image');
     $image->setLabel('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
     $trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
     $trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $mo_ta_tom_tat = new Zend_Form_Element_Textarea('mo_ta_tom_tat');
     $mo_ta_tom_tat->setLabel('Mô tả tóm tắt')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_tom_tat', 'class' => 'textarea', 'rows' => '4'));
     $mo_ta_chi_tiet = new Zend_Form_Element_Textarea('mo_ta_chi_tiet');
     $mo_ta_chi_tiet->setLabel('Mô tả chi tiết (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_chi_tiet', 'class' => 'text-input textarea'));
     $pdf = new Zend_Form_Element_File('pdf');
     $pdf->setLabel('Upload PDF')->setDescription('(*.pdf < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'tin-tuc', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($tieu_de, $quan_trong, $noi_bat, $photo, $image, $pdf, $trang_thai, $mo_ta_tom_tat, $mo_ta_chi_tiet, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'tin_tuc')), 'Form'));
 }
Example #17
0
 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $nams = Default_Model_Constraints::nam();
     $namOption = array("multiOptions" => $nams);
     $nam = new Zend_Form_Element_Select('nam', $namOption);
     $nam->setValue(date('Y'))->setLabel('Năm (*)')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'nam'));
     $bizHDD = new Default_Model_Hdd();
     $hdds = $bizHDD->getDSHDByNam(date('Y'));
     if ($hdds == null) {
         $hdsOptions = array("multiOptions" => array('-1' => '== Chưa thành lập =='));
     } else {
         $hdds = array('0' => '== Tất cả ==') + $hdds;
         $hddsOptions = array("multiOptions" => $hdds);
     }
     $noi_nhan = new Zend_Form_Element_Select('noi_nhan', $hddsOptions);
     $noi_nhan->setRequired(true)->setLabel('Hội đồng')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_nhan'))->setRegisterInArrayValidator(false);
     $tieu_de = new Zend_Form_Element_Text('tieu_de');
     $tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
     $noi_dung = new Zend_Form_Element_Textarea('noi_dung');
     $noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'ds-mail-tb'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($nam, $noi_nhan, $tieu_de, $noi_dung, $submit, $cancel));
     $this->addDisplayGroup(array('submit', 'cancel'), 'btn_submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
 }
Example #18
0
 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input medium-input'));
     $statusOptions = array("multiOptions" => array(1 => 'Thuộc SGU', 0 => 'Liên kết trang mạng'));
     $is_sgu = new Zend_Form_Element_Radio('is_sgu', $statusOptions);
     $is_sgu->setRequired(true)->setLabel('Liên kết')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $url = new Zend_Form_Element_Text('url');
     $url->setLabel('Url (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/small/images/lien_ket')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $maxOrder = Khcn_Api::_()->getDbTable('lien_ket', 'default')->getMaxOrderItem();
     $order = new Zend_Form_Element_Text('order');
     $order->setLabel('Thứ tự *')->setValue($maxOrder->order + 1)->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input tinysmall-input'));
     $submitCon = new Zend_Form_Element_Submit('submitCon');
     $submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $submitExit = new Zend_Form_Element_Submit('submitExit');
     $submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $Url = new Zend_View_Helper_Url();
     $link = $Url->url(array('module' => 'admin', 'controller' => 'lien-ket', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ten, $is_sgu, $url, $file, $order, $submitCon, $submitExit, $cancel));
     $this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'lien_ket')), 'Form'));
 }
Example #19
0
 private function _addElementPersonPerformed()
 {
     $translate = Zend_Registry::get("Zend_Translate");
     $url = new Zend_View_Helper_Url();
     $urlSearch = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'search-form'), null, true);
     $urlNew = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'create'), null, true);
     $append = '';
     if ($this->_action == self::ACTION_ADD) {
         $append .= '<a id="btnPersonPerformedSearch" href="' . $urlSearch . '" ' . ' rel="colorbox-search" search-return-id="id" search-return-value="person_name">' . '<i class="icon-search" rel="tooltip" data-original-title="' . $translate->_("Search person") . '"></i>' . '</a>';
     }
     $description = new Agana_Form_Element_Html('person_performed_name', array());
     //$description->addDecorator('Agana_Form_Decorator_Highlighted');
     $description->setLabel('Person');
     $this->addElement($description);
     $this->addElement('text', 'person_performed_name', array('label' => 'Person', 'value' => $this->_model ? $this->_model->getPerson()->getName() : '', 'dimension' => 2, 'disabled' => true, 'placeholder' => $translate->_('Use the links aside to search a person or create a new one'), 'append' => $append . ' | ' . '<a class="hide" id="btnPersonDetails" href="#" rel="colorbox-details">' . $translate->_("Details") . '</a>' . ' | ' . '<a class="hide" id="btnPersonCreate" href="' . $urlNew . '" rel="colorbox">' . '<i class="icon-plus-sign" rel="tooltip" data-original-title="' . $translate->_("Add new") . ' ' . $translate->_("person") . '"></i>' . '</a>'));
 }
 public function themAction()
 {
     // TODO Auto-generated {0}::indexAction() default action
     $form = new Admin_Form_DanhSachLop();
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'danh-sach-lop', 'action' => 'index'), null, true);
     $form->submitCon->setLabel('Lưu và tiếp tục');
     $form->submitExit->setLabel('Lưu và thoát');
     $form->cancel->setLabel('Không lưu')->setAttribs(array('onclick' => 'window.location.href="' . $link . '"'));
     $this->view->form = $form;
     if (!$this->getRequest()->isPost()) {
         return;
     }
     if (!$form->isValid($this->getRequest()->getPost())) {
         return;
     }
     $values = $form->getValues();
     $table = Khcn_Api::_()->getDbTable('danh_sach_lop', 'default');
     $danh_sach_lop = $table->createRow();
     $danh_sach_lop->setFromArray($values);
     $danh_sach_lop->save();
     $_SESSION['msg'] = 'Thành công !. Dữ liệu đã được lưu trữ .';
     $_SESSION['type_msg'] = 'success';
     if ($form->submitCon->isChecked()) {
         $this->_redirect('/admin/danh-sach-lop/them');
     } else {
         $this->_redirect('/admin/danh-sach-lop/index');
     }
 }
Example #21
0
 public function init()
 {
     $this->setName('form_giang_vien_create')->setMethod('post')->setAttrib('class', 'global_form form_giang_vien_create');
     $this->addElement('Heading', 'account', array('value' => 'Thông tin giảng viên'));
     $this->account->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
     $this->addElement('Text', 'ma', array('label' => 'Mã giảng viên (*)', 'allowEmpty' => false, 'required' => true, 'filters' => array('StripTags'), 'validators' => array(array('StringLength', false, array(5, 10)), 'Alnum')));
     $this->addElement('Heading', 'ma_giang_vien', array('label' => 'Mã giảng viên'));
     $ho = new Khcn_Form_Element_Text('ho');
     $ho->setLabel('Họ (*)')->setOptions(array('size' => '36'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 128))->setAttribs(array('id' => 'ho'));
     $this->addElement($ho);
     $ten = new Khcn_Form_Element_Text('ten');
     $ten->setLabel('Tên (*)')->setOptions(array('size' => '36'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 32))->setAttribs(array('id' => 'ten'));
     $this->addElement($ten);
     $email = new Khcn_Form_Element_Text('email');
     $email->setLabel('Email (*)')->setRequired(true)->setOptions(array('size' => '36'))->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_EmailAddress())->setAttribs(array('id' => 'email'));
     $this->addElement($email);
     $don_vi = new Default_Model_DonVi();
     $this->addElement('Select', 'ma_don_vi', array('label' => 'Đơn vị (*)', 'multiOptions' => $don_vi->getDSDVSGU(), 'value' => 1));
     $hoc_vi = new Default_Model_HocVi();
     $this->addElement('Select', 'ma_hoc_vi', array('label' => 'Học vị (*)', 'multiOptions' => $hoc_vi->getDSHV()));
     $this->addElement('Text', 'chuc_vu', array('label' => 'Chức vụ', 'filters' => array('StripTags')));
     $this->addElement('Text', 'so_dien_thoai', array('label' => 'Số điện thoại', 'filters' => array('StripTags')));
     $this->addElement('Button', 'submit', array('label' => 'Lưu', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper'), 'attribs' => array('class' => 'art-button')));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'default', 'controller' => 'index', 'action' => 'index'));
     $this->addElement('Cancel', 'cancel', array('label' => 'Không lưu', 'onclick' => 'window.location.href="' . $link . '"', 'decorators' => array('ViewHelper'), 'attribs' => array('class' => 'art-button')));
     $this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn');
 }
Example #22
0
File: Url.php Project: GEANT/CORE
 public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
 {
     if (!isset($urlOptions['controller'])) {
         $urlOptions['controller'] = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
     }
     return parent::url($urlOptions, $name, $reset, $encode);
 }
Example #23
0
 public function __construct($model = null, $options = null)
 {
     $this->_model = $model;
     parent::__construct($options);
     $url = new Zend_View_Helper_Url();
     $urlAction = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'search'), null, true);
     $this->setAction($urlAction);
 }
Example #24
0
    public function init()
    {
        $this->setName('form_giang_vien_ncs')->setMethod('post')->setAttrib('class', 'global_form');
        $this->addElement('Heading', 'account', array('value' => 'Thông tin cá nhân'));
        $this->account->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $viewer = Khcn_Api::_()->getViewer();
        $this->addElement('Text', 'ho_ten', array('label' => 'Họ và tên (*)', 'allowEmpty' => false, 'required' => true, 'filters' => array('StripTags'), 'value' => $viewer->getDisplayname()));
        $this->addElement('Calendar', 'ngay_sinh', array('label' => 'Ngày tháng năm sinh'));
        $don_vi = new Default_Model_DonVi();
        $this->addElement('Select', 'ma_don_vi', array('label' => 'Đơn vị công tác(*)', 'multiOptions' => $don_vi->getDSDVSGU(), 'value' => 1));
        $this->addElement('Text', 'ten_luan_an', array('label' => 'Tên luận án *', 'allowEmpty' => false, 'required' => true, 'filters' => array('StripTags')));
        $this->addElement('Text', 'chuyen_nganh_dao_tao', array('label' => 'Chuyên ngành đào tạo'));
        $this->addElement('Text', 'co_so_dao_tao', array('label' => 'Cơ sở đào tạo'));
        $this->addElement('Heading', 'thoi_gian_dao_tao', array('label' => 'Thời gian đào tạo'));
        $this->addElement('Calendar', 'tgdt_from', array('label' => 'Từ', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Calendar', 'tgdt_to', array('label' => 'Đến', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Heading', 'qd_ncs', array('value' => 'Quyết định công nhận Nghiên cứu sinh'));
        $this->qd_ncs->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Text', 'ncs_so', array('label' => 'Số'));
        $this->addElement('Calendar', 'ngay_ky', array('label' => 'Ký ngày', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Text', 'nguoi_ky', array('label' => 'Người ký'));
        $this->addElement('Heading', 'ke_hoach_bao_ve_chuyen_de', array('value' => 'Kế hoạch bảo vệ chuyên đề'));
        $this->ke_hoach_bao_ve_chuyen_de->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Heading', 'chuyen_de_1', array('label' => 'Chuyên đề 1'));
        $this->addElement('Calendar', 'thoi_gian_chuyen_de_1', array('label' => 'Thời gian', 'calendarOptions' => array('yearRangeCount' => 10), 'attribs' => array('name' => 'thoi_gian_chuyen_de[]')));
        $this->addElement('Text', 'ten_chuyen_de_1', array('label' => 'Tên chuyên đề', 'attribs' => array('name' => 'ten_chuyen_de[]')));
        $this->addElement('Hidden', 'tong_chuyen_de', array('value' => 1));
        $this->addElement('Dummy', 'them_chuyen_de', array('content' => '<a href="javascript:void(0)" onclick="themChuyenDe()" id="them_chuyen_de">Thêm chuyên đề</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="xoaChuyenDe()" id="xoa_chuyen_de" style="display: none;">Xóa chuyên đề</a>'));
        $this->addElement('Heading', 'ke_hoach_bao_ve_luan_an', array('value' => 'Kế hoạch bảo vệ luận án'));
        $this->ke_hoach_bao_ve_luan_an->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Dummy', 'bvla_cap_bo_mon', array('content' => 'Dự kiến kế hoạch bảo về luận án cấp bộ môn'));
        $this->addElement('Calendar', 'thoi_gian_bvla_cap_bo_mon', array('label' => 'Thời gian', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Text', 'dia_diem_bvla_cap_bo_mon', array('label' => 'Địa điểm'));
        $this->addElement('Dummy', 'bvla_cap_truong', array('content' => 'Dự kiến kế hoạch bảo về luận án cấp trường'));
        $this->addElement('Calendar', 'thoi_gian_bvla_cap_truong', array('label' => 'Thời gian', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Text', 'dia_diem_bvla_cap_truong', array('label' => 'Địa điểm'));
        $this->addElement('Heading', 'bai_bao_ctkh', array('value' => 'Bài báo/công trình khoa học đã công bố'));
        $this->bai_bao_ctkh->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Text', 'ten_san_pham', array('label' => 'Tên sản phẩm'));
        $this->addElement('Textarea', 'phuong_thuc_pho_bien', array('label' => 'Phương thức phổ biến'));
        $this->addElement('Dummy', 'phuong_thuc_pho_bien_luu_y', array('content' => '*Lưu ý: 	</br>- Đối với Tạp chí cần nêu rõ xếp loại tạp chí (SCI, SCIE…); Số kỳ, thời gian phát hành…
									</br>- Đối với Kỷ yếu Hội thảo cần nêu rõ: Quy mô của Hội thảo; Hình thức phát hành kỷ yếu (Bài viết có phản biện…), có báo cáo tại Hội thảo hay không?
'));
        $this->addElement('Heading', 'ket_qua_bao_ve_luan_an', array('value' => 'Kết quả bảo vệ luận văn/luận án'));
        $this->ket_qua_bao_ve_luan_an->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Calendar', 'thoi_gian_bao_ve', array('label' => 'Thời gian', 'calendarOptions' => array('yearRangeCount' => 10)));
        $this->addElement('Text', 'dia_diem_bao_ve', array('label' => 'Địa điểm'));
        $this->addElement('Text', 'ket_qua_bao_ve', array('label' => 'Kết quả'));
        $this->addElement('Dummy', 'ho_so_nop_cho_phong_qlkhsdh', array('content' => "<strong>Hồ sơ nộp cho Phòng QLKH-SĐH:</strong></br>\n\t\t\t- Văn bản luận án đóng thành tập: 1 cuốn;</br>\n\t\t\t- Đĩa CD chứa nội dung luận án: 1 đĩa;</br>\n\t\t\t- Văn bản liên quan:</br>\n\t\t\t<span style='margin-left: 20px'>+ Quyết định bảo vệ của cơ sở đào tạo;</span></br>\n\t\t\t<span style='margin-left: 20px'>+ Giấy chứng nhận đã bảo về luận án.</span>"));
        $this->addElement('Heading', 'y_kien_ncs_heading', array('value' => 'Các ý kiến của Nghiên cứu sinh (nếu có)'));
        $this->y_kien_ncs_heading->removeDecorator('Label')->removeDecorator('HtmlTag')->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper-heading');
        $this->addElement('Textarea', 'y_kien_ncs', array());
        $this->addElement('Button', 'submit', array('label' => 'Lưu', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper'), 'attribs' => array('class' => 'art-button')));
        $url = new Zend_View_Helper_Url();
        $link = $url->url(array('module' => 'default', 'controller' => 'index', 'action' => 'index'));
        $this->addElement('Cancel', 'cancel', array('label' => 'Không lưu', 'onclick' => 'window.location.href="' . $link . '"', 'decorators' => array('ViewHelper'), 'attribs' => array('class' => 'art-button')));
        $this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn');
    }
Example #25
0
 /**
  * Generates an url given the name of a route.
  *
  * @access public
  *
  * @param  array $urlOptions Options passed to the assemble method of the Route object.
  * @param  mixed $name The name of a Route to use. If null it will use the current Route
  * @param  bool $reset Whether or not to reset the route defaults with those provided
  * @return string Url for the link href attribute.
  */
 public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
 {
     if (isset($urlOptions['includeGetParams'])) {
         // search pagination fix
         unset($urlOptions['includeGetParams']);
         $urlOptions = array_merge($_GET, $urlOptions);
     }
     return parent::url($urlOptions, $name, $reset, $encode);
 }
Example #26
0
 /**
  * Generates an url given the name of a route.
  *
  * @access public
  *
  * @param  array $urlOptions Options passed to the assemble method of the Route object.
  * @param  mixed $name The name of a Route to use. If null it will use the current Route
  * @param  bool $reset Whether or not to reset the route defaults with those provided
  * @return string Url for the link href attribute.
  */
 public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
 {
     $locale = trim(Axis_Locale::getLanguageUrl(), '/ ');
     if (!empty($locale)) {
         $urlOptions = array_merge(array('locale' => $locale), $urlOptions);
     }
     $urlOptions = array_merge($_GET, $urlOptions);
     return parent::url($urlOptions, $name, $reset, $encode);
 }
Example #27
0
 public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true, $autoConvertToRelative = true)
 {
     $url = parent::url($urlOptions, $name, $reset, $encode);
     // Convert to relative URL if hostname is the same as current one
     if ($autoConvertToRelative && $_SERVER['HTTP_HOST'] == parse_url($url, PHP_URL_HOST)) {
         $position = strpos($url, $_SERVER['HTTP_HOST']) + strlen($_SERVER['HTTP_HOST']);
         $url = substr($url, $position);
     }
     return $url;
 }
Example #28
0
File: Url.php Project: phpscr/usvn
 /**
  * Generates an url given the name of a route.
  *
  * @access public
  *
  * @param  array $urlOptions Options passed to the assemble method of the Route object.
  * @param  mixed $name The name of a Route to use. If null it will use the current Route
  * @param  bool $reset Whether or not to reset the route defaults with those provided
  * @return string Url for the link href attribute.
  */
 public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
 {
     foreach ($urlOptions as $key => $value) {
         if ($key === 'project' || $key === 'group' || $key === 'name') {
             $urlOptions[$key] = str_replace('/', USVN_URL_SEP, $value);
         }
     }
     $url = parent::url($urlOptions, $name, $reset, $encode);
     return $url;
 }
Example #29
0
 public function themAction()
 {
     // TODO Auto-generated {0}::indexAction() default action
     $form = new Admin_Form_ThongBao();
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'thong-bao', 'action' => 'index'), null, true);
     $form->submitCon->setLabel('Lưu và tiếp tục');
     $form->submitExit->setLabel('Lưu và thoát');
     $form->cancel->setLabel('Không lưu')->setAttribs(array('onclick' => 'window.location.href="' . $link . '"'));
     $form->removeElement('image');
     $this->view->form = $form;
     if (!$this->getRequest()->isPost()) {
         return;
     }
     if (!$form->isValid($this->getRequest()->getPost())) {
         return;
     }
     $table = Khcn_Api::_()->getDbTable('thong_bao', 'default');
     $thong_bao = $table->createRow();
     if ($form->photo->getFileName(null, false) != null) {
         //determine filename and extension
         $info = pathinfo($form->photo->getFileName(null, false));
         $filename = $info['filename'];
         $ext = $info['extension'] ? "." . $info['extension'] : "";
         //filter for renaming.. prepend with current time
         $file = time() . '_' . Default_Model_Functions::convert_vi_to_en($filename) . $ext;
         $form->photo->addFilter(new Zend_Filter_File_Rename(array("target" => $file, "overwrite" => true)))->addFilter(new Khcn_Filter_File_Resize(array('width' => 720, 'height' => 720, 'keepRatio' => true)));
         $form->getValue('photo');
         $thong_bao->file = $file;
     }
     if ($form->pdf->getFileName(null, false) != null) {
         //determine filename and extension
         $info = pathinfo($form->pdf->getFileName(null, false));
         $filename = $info['filename'];
         $ext = $info['extension'] ? "." . $info['extension'] : "";
         //filter for renaming.. prepend with current time
         $file = time() . '_' . Default_Model_Functions::convert_vi_to_en($filename) . $ext;
         $form->pdf->addFilter(new Zend_Filter_File_Rename(array("target" => $file, "overwrite" => true)));
         $form->getValue('pdf');
         $thong_bao->file_pdf = $file;
     }
     $viewer = Khcn_Api::_()->getViewer();
     $values = $form->getValues();
     $values['ma_quan_tri'] = $viewer->getIdentity();
     $thong_bao->setFromArray($values);
     $thong_bao->save();
     $_SESSION['msg'] = 'Thành công !. Dữ liệu đã được lưu trữ .';
     $_SESSION['type_msg'] = 'success';
     if ($form->submitCon->isChecked()) {
         $this->_redirect('/admin/thong-bao/them');
     } else {
         $this->_redirect('/admin/thong-bao/index');
     }
 }
Example #30
0
 public function dsLichCT()
 {
     $lichCTs = Khcn_Api::_()->getDbTable('lich_cong_tac', 'default')->getLichCTs(array('trang_thai' => 1, 'limit' => 5));
     $link = new Zend_View_Helper_Url();
     $str = '<ul>';
     foreach ($lichCTs as $lichCT) {
         $url = $link->url(array('controller' => 'lich-cong-tac', 'action' => 'chi-tiet', 'id' => $lichCT['id']), null, true);
         $str .= '<li><a class="Normal" href="' . $url . '">Tuần ' . $lichCT['tuan'] . ' tháng ' . $lichCT['thang'] . ' (' . date('d/m/Y', strtotime($lichCT['ngay_bat_dau'])) . ' - ' . date('d/m/Y', strtotime($lichCT['ngay_ket_thuc'])) . ')</a></li>';
     }
     $str .= '</ul>';
     return $str;
 }