Esempio n. 1
0
<?php

echo $this->headMeta();
echo $this->headLink();
$form = new Form_Searchs_Lonhuom();
echo $form;
if ($this->param->isPost()) {
    $model = new Model_Lonhuom();
    $key = $this->param->getParam("key");
    $lonhuoms = $model->getWhereLike($key);
    if ($lonhuoms != false) {
        $title = array("Tên Lô Nhuộm", "Ngày Nhuộm", "Màu", "Tùy Chỉnh");
        $data = new My_Data();
        $maincontent = array();
        foreach ($lonhuoms as $item) {
            $mydate = Zend_Locale_Format::getDate($item['NgayNhuom'], array("date_format" => "yyyy.MM.dd"));
            $date_str = $mydate['day'] . "/" . $mydate['month'] . "/" . $mydate['year'];
            $cm = new Model_Caymoc();
            $caymoc = $cm->getWhere_lonhuom($item['MaLoNhuom']);
            // $tenlonhuom = "<a href='".HOST_PROJECT."/index/main/hopdong_detail/true/mahopdong/".$caymoc['MaHopDong']."/right/lonhuom/malonhuom/".$item['MaLoNhuom']."/'>". $item['TenLoNhuom']."</a>";
            $content = array($item['TenLoNhuom'], $date_str, $data->getNameMau($item['MaMau']), '<a href="' . HOST_PROJECT . "/index/chinhsua/lonhuom/true/malonhuom/" . $item['MaLoNhuom'] . '/option/lonhuom">Sửa</a>&nbsp|&nbsp' . '<a href="' . HOST_PROJECT . "/index/xoa/lonhuom/true/malonhuom/" . $item['MaLoNhuom'] . '/option/lonhuom" onclick="return confirm(' . "'bạn có chắc muốn xóa ?'" . ')">Xóa</a>');
            $maincontent[] = $content;
        }
        $data = new My_Data();
        $table = $data->createTable($title, $maincontent, "800px");
        echo $table;
    }
}
Esempio n. 2
0
<?php

echo $this->headMeta();
echo $this->headLink();
$id_lonhuom = $this->param->getParam('malonhuom');
$cm = new Model_Caymoc();
$caymoc = $cm->getWhere_lonhuom($id_lonhuom);
if ($caymoc['MaCTP'] != null) {
    echo "<div class='long_message'>";
    echo "Không thể xóa Lô Nhuộm đã tạo Cây Thành Phẩm!";
    echo "</div>";
} else {
    $update = array("MaLoNhuom" => null);
    $caymoc1 = $cm->update_data($caymoc['MaMoc'], $update);
    $ln = new Model_Lonhuom();
    $ln->delete_lonhuom($id_lonhuom);
    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/" . $caymoc['MaHopDong'] . "/right/caymoc/macaymoc/" . $caymoc['MaMoc'] . "/';</script>";
    }
}