public function init() { $this->setDisableLoadDefaultDecorators(true); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'formnoindex/hopdong_layout.phtml')), 'Form')); $data = new My_Data(); $opMau = $data->getOptionMau(); $opLoaiVai = $data->getOptionLoaiVai(); $opNCC = $data->getOptionNCC(); $tenhopdong = $this->createElement('text', 'tenhopdong', array('decorators' => array('ViewHelper'))); $mota = $this->createElement('text', 'mota', array('decorators' => array('ViewHelper'))); $ngayky = $this->createElement('text', 'ngayky', array('decorators' => array('ViewHelper'), 'data-type' => 'date')); $sotansoi = $this->createElement('text', 'sotansoi', array('decorators' => array('ViewHelper'))); $thanhtien = $this->createElement('text', 'thanhtien', array('decorators' => array('ViewHelper'))); $mamau = $this->createElement('select', 'mamau', array('multioptions' => $opMau, 'decorators' => array('ViewHelper'))); $maloaivai = $this->createElement('select', 'maloaivai', array('multioptions' => $opLoaiVai, 'decorators' => array('ViewHelper'))); $manhacungcap = $this->createElement('select', 'manhacungcap', array('multioptions' => $opNCC, 'decorators' => array('ViewHelper'))); $them = $this->createElement('submit', 'them', array('decorators' => array('ViewHelper'), 'label' => 'Thêm')); // $registry = $this->createElement('submit', 'logout', array('decorators' => array('ViewHelper'),'label'=>'Ä�ăng Ký')); $mamau->setAttrib('class', 'formEdit'); $maloaivai->setAttrib('class', 'formEdit'); $manhacungcap->setAttrib('class', 'formEdit'); $this->addElement($tenhopdong)->addElement($mota)->addElement($ngayky)->addElement($sotansoi)->addElement($thanhtien)->addElement($mamau)->addElement($maloaivai)->addElement($manhacungcap)->addElement($them); // $this->addElement('submit', 'nhap', array( // 'decorators' => array( // 'ViewHelper' // ), // 'label' => 'NháºÂp' // )); }
public function createForm($id_hopdong) { $kh = new Model_Hopdong(); $hopdong = $kh->getWhereIdHopDong($id_hopdong); $this->setDisableLoadDefaultDecorators(true); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'formnoindex/hopdong_layout.phtml')), 'Form')); $data = new My_Data(); $opMau = $data->getOptionMau(); $opLoaiVai = $data->getOptionLoaiVai(); $opNCC = $data->getOptionNCC(); $tenhopdong = $this->createElement('text', 'tenhopdong', array('decorators' => array('ViewHelper'))); $mota = $this->createElement('text', 'mota', array('decorators' => array('ViewHelper'))); $ngayky = $this->createElement('text', 'ngayky', array('decorators' => array('ViewHelper'))); $sotansoi = $this->createElement('text', 'sotansoi', array('decorators' => array('ViewHelper'))); $thanhtien = $this->createElement('text', 'thanhtien', array('decorators' => array('ViewHelper'))); $mamau = $this->createElement('select', 'mamau', array('multioptions' => $opMau, 'decorators' => array('ViewHelper'))); $maloaivai = $this->createElement('select', 'maloaivai', array('multioptions' => $opLoaiVai, 'decorators' => array('ViewHelper'))); $manhacungcap = $this->createElement('select', 'manhacungcap', array('multioptions' => $opNCC, 'decorators' => array('ViewHelper'))); $them = $this->createElement('submit', 'them', array('decorators' => array('ViewHelper'), 'label' => 'Chỉnh sửa')); $mydate = Zend_Locale_Format::getDate($hopdong['NgayKy'], array("date_format" => "yyyy.MM.dd")); $date_str = $mydate['day'] . "/" . $mydate['month'] . "/" . $mydate['year']; $tenhopdong->setAttrib('class', 'formEdit')->setValue($hopdong['TenHopDong']); $mota->setAttrib('class', 'formEdit')->setValue($hopdong['MoTa']); $ngayky->setAttrib('class', 'formEdit')->setValue($date_str); $sotansoi->setAttrib('class', 'formEdit')->setValue($hopdong['SoTanSoi']); $thanhtien->setAttrib('class', 'formEdit')->setValue($hopdong['ThanhTien']); $mamau->setAttrib('class', 'formEdit')->setValue($hopdong['MaMau']); $maloaivai->setAttrib('class', 'formEdit')->setValue($hopdong['MaLoaiVai']); $manhacungcap->setAttrib('class', 'formEdit')->setValue($hopdong['MaNhaCungCap']); $this->addElement($tenhopdong)->addElement($mota)->addElement($ngayky)->addElement($sotansoi)->addElement($thanhtien)->addElement($mamau)->addElement($maloaivai)->addElement($manhacungcap)->addElement($them); }
public function init() { $this->setDisableLoadDefaultDecorators(true); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'formnoindex/chonncc_layout.phtml')), 'Form')); $data = new My_Data(); $opNCC = $data->getOptionNCC(); $nhacungcap = $this->createElement('select', 'manhacungcap', array('multioptions' => $opNCC, 'decorators' => array('ViewHelper'))); $them = $this->createElement('submit', 'them', array('decorators' => array('ViewHelper'), 'label' => 'Chọn')); $nhacungcap->setAttrib('class', 'formEdit'); //->setValue($khohang[0]['MaKho']); $this->addElement($nhacungcap)->addElement($them); }
public function init() { $this->setDisableLoadDefaultDecorators(true); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'formmoi/muasoi_layout.phtml')), 'Form')); $data = new My_Data(); $opSoi = $data->getOptionLoaiSoi(); $opNCC = $data->getOptionNCC(); $opKhoSoi = $data->getOpKhoSoi(); $nhacungcap = $this->createElement('select', 'nhacungcap', array('multioptions' => $opNCC, 'decorators' => array('ViewHelper'))); $loaisoi = $this->createElement('select', 'loaisoi', array('multioptions' => $opSoi, 'decorators' => array('ViewHelper'))); $sotansoi = $this->createElement('text', 'sotansoi', array('decorators' => array('ViewHelper'))); $ngaymua = $this->createElement('text', 'ngaymua', array('decorators' => array('ViewHelper'))); $tongtien = $this->createElement('text', 'thanhtien', array('decorators' => array('ViewHelper'))); $nhapkhosoi = $this->createElement('select', 'nhapkhosoi', array('multioptions' => $opKhoSoi, 'decorators' => array('ViewHelper'))); $them = $this->createElement('submit', 'them', array('decorators' => array('ViewHelper'), 'label' => 'Thêm')); $nhacungcap->setAttrib('class', 'formEdit'); $loaisoi->setAttrib('class', 'formEdit'); $nhapkhosoi->setAttrib('class', 'formEdit'); $this->addElement($nhacungcap)->addElement($loaisoi)->addElement($sotansoi)->addElement($tongtien)->addElement($ngaymua)->addElement($nhapkhosoi)->addElement($them); }