public function createForm($idkhosoi) { $ks = new Model_Khosoi(); $khosoirow = $ks->getWhere($idkhosoi); $this->setDisableLoadDefaultDecorators(true); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'formmoi/caymoc_layout.phtml')), 'Form')); $data = new My_Data(); $loaisoi = new Model_Loaisoi(); $loaisoirow = $loaisoi->getWhere($khosoirow['MaSoi']); $kho = new Model_Khohang(); $khohang = $kho->getWhere($khosoirow['MaKho']); $opvai = $data->getOpLoaiVaiWithIdSoi($khosoirow['MaSoi']); $khosoi = $this->createElement('text', 'makho', array('decorators' => array('ViewHelper'))); $loaisoi = $this->createElement('text', 'masoi', array('decorators' => array('ViewHelper'))); $sokgsoi = $this->createElement('text', 'sokgsoi', array('decorators' => array('ViewHelper'))); $loaivai = $this->createElement('select', 'mavai', array('multioptions' => $opvai, 'decorators' => array('ViewHelper'))); $sometvai = $this->createElement('text', 'sometvai', array('decorators' => array('ViewHelper'))); $them = $this->createElement('submit', 'them', array('decorators' => array('ViewHelper'), 'label' => 'Thêm')); $khosoi->setAttrib('class', 'formEdit')->setValue($khohang['TenKho']); $loaisoi->setAttrib('class', 'formEdit')->setValue($loaisoirow['TenSoi']); $loaivai->setAttrib('class', 'formEdit')->setAttrib('id', 'idvai'); $sokgsoi->setAttrib('class', 'smallfield'); $sometvai->setAttrib('class', 'formEdit'); $this->addElement($loaisoi)->addElement($loaivai)->addElement($sometvai)->addElement($sokgsoi)->addElement($khosoi)->addElement($them); }
public function createForm($id_kho) { $kho = new Model_Khohang(); $khohang = $kho->getWhere($id_kho); $this->setDisableLoadDefaultDecorators(true); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'formnoindex/chonkhohang_layout.phtml')), 'Form')); $data = new My_Data(); $opKhoHang = $data->getOptionKhoHang(); $chonkhohang = $this->createElement('select', 'khohang', array('multioptions' => $opKhoHang, 'decorators' => array('ViewHelper'))); $them = $this->createElement('submit', 'them', array('decorators' => array('ViewHelper'), 'label' => 'Chọn')); $chonkhohang->setAttrib('class', 'formEdit')->setValue($khohang[0]['MaKho']); $this->addElement($chonkhohang)->addElement($them); }
public function createForm($id_kho) { $kho = new Model_Khohang(); $khohang = $kho->getWhere($id_kho); $this->setDisableLoadDefaultDecorators(true); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/khohang_layout.phtml')), 'Form')); $data = new My_Data(); $op = $data->getOpKhoHang(); $tenkhohang = $this->createElement('text', 'tenkhohang', array('decorators' => array('ViewHelper'))); $diachi = $this->createElement('text', 'diachi', array('decorators' => array('ViewHelper'))); $sdt = $this->createElement('text', 'sdt', array('decorators' => array('ViewHelper'))); $loaikho = $this->createElement('select', 'loaikho', array('multioptions' => $op, 'decorators' => array('ViewHelper'))); $them = $this->createElement('submit', 'them', array('decorators' => array('ViewHelper'), 'label' => 'Chỉnh Sửa')); $tenkhohang->setAttrib('class', 'formEdit')->setValue($khohang[0]['TenKho']); $diachi->setAttrib('class', 'formEdit')->setValue($khohang[0]['Diachi']); $sdt->setAttrib('class', 'formEdit')->setValue($khohang[0]['sdt']); $loaikho->setAttrib('class', 'formEdit')->setValue($khohang[0]['MaLoaiKho']); $this->addElement($tenkhohang)->addElement($diachi)->addElement($sdt)->addElement($loaikho)->addElement($them); }
<?php echo $this->headMeta(); echo $this->headLink(); $khang = new Model_Khohang(); $khohang = $khang->getWhere($this->param->getParam("makho")); // echo "<pre>"; // print_r($khachhang); // echo "</pre>"; ?> <?php if (count($khohang) > 0) { ?> <div class = "qlykhachhang"> <div class="panel panel-success"> <div class="panel-heading"> <h4> Thông Tin Kho Hàng</h4> </div> <!-- Table --> <table class="table"> <thread> <tr> <th>Tên Kho</th> <th>Địa Chỉ</th> <th>Số Điện Thoại</th> <th>Chỉnh Sửa</th> </tr> </thread> <tbody>
public function getOpHopdong($masoi, $makho, $mancc) { $op = array(); $soi = new Model_Loaisoi(); $loaisoi = $soi->getWhere($masoi); $op['tensoi'] = $loaisoi['TenSoi']; $kho = new Model_Khohang(); $khohang = $kho->getWhere($makho); $op['tenkho'] = $khohang['TenKho']; $ncc = new Model_Nhacungcap(); $myncc = $ncc->getWhere($mancc); $op['tenncc'] = $myncc['TenNhaCungCap']; return $op; }
// echo "</pre>"; $form->populate($param); echo $form; $makho = $this->param->getParam("mykhohang"); $ctp = new Model_Caythanhpham(); $loaivai = new Model_Loaivai(); $lonhuom = new Model_Lonhuom(); $mau = new Model_Mau(); $caymoc = new Model_Caymoc(); $khohang = new Model_Khohang(); $caythanhphamall = $ctp->getWhere_khohang($makho); if ($caythanhphamall) { $maincontent = array(); $title = array("Mã Cây TP", "Loại Vải", "Màu Vải", "Số Mét Vải", "Tùy Chỉnh"); $data = new My_Data(); $khotp = $khohang->getWhere($makho); echo '<h1 class="title">' . $khotp['TenKho'] . '</h1>'; foreach ($caythanhphamall as $caytp) { $caymocrow = $caymoc->getWhere_ctp($caytp['MaCTP']); $loaivairow = $loaivai->getWhere($caymocrow['MaVai']); $lonhuomrow = $lonhuom->getWhere($caymocrow['MaLoNhuom']); $maurow = $mau->getWhereIdMau($lonhuomrow['MaMau']); $chinhsua = '<a href="' . HOST_PROJECT . "/index/chinhsua/caytp/true/mactp/" . $caytp['MaCTP'] . '/option/caytp/">Sửa</a> | ' . '<a href="' . HOST_PROJECT . "/index/xoa/caytp/true/mactp/" . $caytp['MaCTP'] . '/option/ctp/" onclick="return confirm(' . "'bạn có chắc muốn xóa ?'" . ')">Xóa</a>'; $button = "<a class ='thembutton' href='" . HOST_PROJECT . "/index/xem/ctp_detail/true/mactp/" . $caytp['MaCTP'] . "'/>Nhập Kho</a>"; $content = array($caytp['MaCTP'], $loaivairow['TenLoaiVai'], $maurow['TenMau'], $caytp['SoMetVai'], $chinhsua); $maincontent[] = $content; } $table = $data->createTable($title, $maincontent, "550px"); echo $table; } else { echo "<div class='message'>";
$title = array("Mã Mộc", "Loại Vải", "Số Mét Vải", "Mã Lô", "Tùy Chỉnh", "Nhập Kho"); $loaivai = new Model_Loaivai(); $data = new My_Data(); $khohang = new Model_Khohang(); foreach ($caymocall as $caymoc) { if ($caymoc['MaKhoMoc']) { $loaivairow = $loaivai->getWhere($caymoc['MaVai']); $chinhsua = '<a href="' . HOST_PROJECT . "/index/chinhsua/caymoc/true/mamoc/" . $caymoc['MaMoc'] . '/option/caymoc/">Sửa</a> | ' . '<a href="' . HOST_PROJECT . "/index/xoa/caymoc/true/mamoc/" . $caymoc['MaMoc'] . '/option/xem/" onclick="return confirm(' . "'bạn có chắc muốn xóa ?'" . ')">Xóa</a>'; $button = "<a class ='thembutton' href='" . HOST_PROJECT . "/index/xem/caymoc_detail/true/mamoc/" . $caymoc['MaMoc'] . "'/>Nhập Kho</a>"; $nhapkho = ""; if ($caymoc['MaKhoMoc']) { $nhapkho = " Đã Nhập"; } else { $nhapkho = $button; } $khohangrow = $khohang->getWhere($caymoc['MaKhoMoc']); $tenkho = $khohangrow['TenKho']; $content = array($caymoc['MaMoc'], $loaivairow['TenLoaiVai'], $caymoc['SoMetVai'], $caymoc['MaLo'], $chinhsua, $tenkho); $maincontent[] = $content; } } $table = $data->createTable($title, $maincontent, "600px"); echo $table; } else { echo "<div class='message'>"; echo "Chưa tồn tại Cây Mộc"; echo "</div>"; } $mamoc = $this->param->getParam("mamoc"); //echo $mamoc; ?>
echo $this->headMeta(); echo $this->headLink(); $ctp = new Model_Caythanhpham(); $loaivai = new Model_Loaivai(); $lonhuom = new Model_Lonhuom(); $mau = new Model_Mau(); $caymoc = new Model_Caymoc(); $khohang = new Model_Khohang(); $caythanhphamall = $ctp->getAll(); if ($caythanhphamall) { $maincontent = array(); $title = array("Mã Cây TP", "Loại Vải", "Màu Vải", "Số Mét Vải", "Kho TP", "Tùy Chỉnh"); $data = new My_Data(); foreach ($caythanhphamall as $caytp) { $caymocrow = $caymoc->getWhere_ctp($caytp['MaCTP']); $loaivairow = $loaivai->getWhere($caymocrow['MaVai']); $lonhuomrow = $lonhuom->getWhere($caymocrow['MaLoNhuom']); $khotp = $khohang->getWhere($caytp['MaKhoTP']); $maurow = $mau->getWhereIdMau($lonhuomrow['MaMau']); $chinhsua = '<a href="' . HOST_PROJECT . "/index/chinhsua/caytp/true/mactp/" . $caytp['MaCTP'] . '/option/caytp/">Sửa</a> | ' . '<a href="' . HOST_PROJECT . "/index/xoa/caytp/true/mactp/" . $caytp['MaCTP'] . '/option/ctp/" onclick="return confirm(' . "'bạn có chắc muốn xóa ?'" . ')">Xóa</a>'; $button = "<a class ='thembutton' href='" . HOST_PROJECT . "/index/xem/ctp_detail/true/mactp/" . $caytp['MaCTP'] . "'/>Nhập Kho</a>"; $content = array($caytp['MaCTP'], $loaivairow['TenLoaiVai'], $maurow['TenMau'], $caytp['SoMetVai'], $khotp['TenKho'], $chinhsua); $maincontent[] = $content; } $table = $data->createTable($title, $maincontent, "700px"); echo $table; } else { echo "<div class='message'>"; echo "Chưa tồn tại Cây Thành Phẩm"; echo "</div>"; }