echo $formtp; echo "nhap dung"; foreach ($param as $key => $item) { if ($num->isValid($key)) { // them vao caytp $mydata = array('MaCTP' => null, 'SoMetVai' => $item, 'MaKhoTP' => $param['khotp']); $caytp->insert($mydata); //update caymoc $maxindex = $caytp->getMaxIndex(); $caymocrow = $caymoc->getWhere($key); $update = array('MaLoNhuom' => $param['malonhuom'], 'MaCTP' => $maxindex); $caymoc->update_data($key, $update); echo "<script>window.location.href='" . HOST_PROJECT . "/index/xem/caythanhpham/true';</script>"; } } $lonhuom->update_data($param['malonhuom'], array('TrangThai' => 1)); unset($mysession->checked); } else { $malonhuom = $param['malonhuom']; $formtp->createForm($malonhuom); $formtp->populate($param); echo $formtp; echo "<div class='long_message' style='margin:auto !important;width:400px !important;'>"; echo $message; echo "</div>"; } } } } ?> </div>
echo $this->headMeta(); echo $this->headLink(); $id_ln = $this->param->getParam('malonhuom'); $id_hopdong = $this->param->getParam('mahopdong'); $fupdate = new Form_Update_Lonhuom(); $fupdate->createForm($id_ln); if ($this->param->isPost()) { $param = $this->param->getPost(); $check = new Form_Valid_Lonhuom($param); if ($check->valid($param)) { $mydate = Zend_Locale_Format::getDate($this->param->getParam("ngaynhuom"), array("date_format" => "dd.MM.yyyy")); $date_str = $mydate['year'] . "-" . $mydate['month'] . "-" . $mydate['day']; $data = array("MaLoNhuom" => $id_ln, "TenLoNhuom" => $this->param->getParam("tenlonhuom"), "NgayNhuom" => $date_str, "MaMau" => $this->param->getParam("mamau")); $kh = new Model_Lonhuom(); $kh->update_data($id_ln, $data); //echo "<script>window.location.href='".HOST_PROJECT."/index/main/lonhuom_detail/true/malonhuom/".$id_ln."/';</script>"; if (array_key_exists('option', $this->param->getParams())) { echo "<script>window.location.href='" . HOST_PROJECT . "/index/xem/lonhuom/true';</script>"; } else { echo "<script>window.location.href='" . HOST_PROJECT . "/index/main/hopdong_detail/true/mahopdong/" . $id_hopdong . "/right/lonhuom/malonhuom/" . $id_ln . "/';</script>"; } } else { echo $fupdate; foreach ($check->messages as $item) { echo $item . "<br/>"; } echo "</div>"; } } else { echo $fupdate;