if ($arrType[0] != "image") {
                $flagInsert = false;
                $flag = false;
            }
            $PATH_BASE = str_replace("//", "/", dirname(__FILE__) . "/");
            $random = rand(1, 1000000);
            $path = $PATH_BASE . "../../images/upload";
            if (!is_dir("{$path}/{$chusohuu}")) {
                mkdir("{$path}/{$chusohuu}");
            }
            if (!is_dir("{$path}/{$chusohuu}/Picture_House")) {
                mkdir("{$path}/{$chusohuu}/Picture_House");
            }
            $path = "{$path}/{$chusohuu}/Picture_House/";
            move_uploaded_file($_FILES["ffImage" . $i]["tmp_name"], $path . $random . $_FILES["ffImage" . $i]["name"]);
            $picture_path = "images/upload/{$chusohuu}/Picture_House/" . $random . $_FILES["ffImage" . $i]["name"];
            echo "<br>path=" . $picture_path;
            $kq = HinhAnhBUS::insert($picture_path, (int) $_GET["newid"]);
            if ($kq == false) {
                $flagInsert = false;
                echo "<br>Insert image = false";
            } else {
                echo "upload picture finish!";
            }
        }
    }
    $length = strlen($_COOKIE["url"]);
    $url = $_COOKIE["url"];
    $url[$length - 1] = 3;
    header("Location:" . $url);
}
 public static function display($strLink, $business, $totalItems, $curPage, $maxPages, $maxItems)
 {
     $strResult = "";
     $strResult .= "<table id='tblist' width='100%' border='0' style='border:solid 1px #D3D3D3;' cellpadding='0' cellspacing='0'>";
     $strResult .= "<tr style='height:36px; font-weight:bold; font-size:13px; background:#8BC5F4;'>";
     $strResult .= "<td style='border-right:solid 1px #D3D3D3; padding:4px;' align='center'>Hình Ảnh</td>";
     $strResult .= "<td style='border-right:solid 1px #D3D3D3; padding:4px;'>Mô Tả</td>";
     $strResult .= "<td style='border-right:solid 1px #D3D3D3; padding:4px;width:65px;'>Loại Hình</td>";
     $strResult .= "<td style='border-right:solid 1px #D3D3D3; padding:4px;width:65px;'>Cập Nhật</td>";
     $strResult .= "<td style='padding:4px;' align='center'>Giá</td>";
     $strResult .= "</tr>";
     if (count($business) > 0) {
         for ($i = 0; $i < count($business); $i++) {
             $images = HinhAnhBUS::getAllHinhAnhByDichVu($business[$i]['id']);
             $donviDV = DonviDichVuBUS::selectId($business[$i]['donvidv']);
             $donviTien = DonviTienBUS::selectId($business[$i]['donvitien']);
             $loaidv = LoaiDichVuBUS::getById($business[$i]['loaidv']);
             $tinh = TinhBUS::getTinhById($business[$i]['tinh']);
             $quan = QuanBUS::getQuanById($business[$i]['quan']);
             $phuong = PhuongBUS::getPhuongById($business[$i]['phuong']);
             $strResult .= "<tr>";
             $strResult .= "<td style='border-right:solid 1px #D3D3D3; padding:4px;' width='150px'>";
             if ($images[0]['path'] != null) {
                 $strResult .= "<a href='chitietdiaoc.php?iddichvu=" . $business[$i]['id'] . "'><img src='../" . $images[0]['path'] . "' width='150px' /></a></td>";
             } else {
                 $strResult .= "<a href='chitietdiaoc.php?iddichvu=" . $business[$i]['id'] . "'><img src='../images/upload/minhhoa/minhhoa.png' width='150px' /></a></td>";
             }
             $strResult .= "<td style='border-right:solid 1px #D3D3D3; padding:4px;'>";
             $strResult .= "<a href='chitietdiaoc.php?iddichvu=" . $business[$i]['id'] . "'><b style='color:blue;'>" . $business[$i]['tieude'] . "</b></a><br>";
             $strResult .= "Vị trí: " . $business[$i]['duong'] . ", " . $phuong['ten'] . ", " . $quan['ten'] . ", " . $tinh['ten'] . "<br>";
             $strResult .= "Diện tích: " . $business[$i]['dai'] . " X " . $business[$i]['rong'] . "<br>";
             $strResult .= "Số phòng ngủ:" . $business[$i]['sophongngu'] . "<br>";
             $strResult .= "Tầng: " . $business[$i]['tang'] . "<br><br>";
             if ($business[$i]['khuyenmai'] != null) {
                 $strResult .= "<img src='../images/icon_promotion.gif' /> <span style='position:relative; top:-6px;'>" . $business[$i]['khuyenmai'] . "</span>";
             }
             $strResult .= "</td>";
             $strResult .= "<td style='border-right:solid 1px #D3D3D3; padding:4px;'>" . $loaidv['ten'] . "</td>";
             if ($business[$i]['ngaydang'] != null) {
                 $ngaycapnhat = Utils::convertTimeDMY($business[$i]['ngaydang']);
             } else {
                 $ngaycapnhat = date('Y-m-d');
             }
             $strResult .= "<td align='center' style='border-right:solid 1px #D3D3D3; padding:4px;'>";
             if ($business[$i]['status'] == 2) {
                 $strResult .= "<img src='../images/vip.gif'/>";
             }
             $strResult .= $ngaycapnhat . "</br></td>";
             if ($business[$i]['giaban'] != null) {
                 $money = Utils::convert_Money($business[$i]['giaban']);
             } else {
                 $money = "0,00";
             }
             $strResult .= "<td style='padding:4px;'>" . $money . "<br>" . $donviTien['ten'] . "/" . $donviDV['ten'] . "</td>";
             $strResult .= "</tr>";
         }
     } else {
         echo "<tr><td align='center' colspan='3'><h3 style='color: #336699; font-size: 14px;margin: 0;padding: 0;'>Chưa có tin đăng !</h3></td></tr>";
         echo "<tr><td></td></tr>";
     }
     $strResult .= "</table>";
     $strResult .= "<script>\$(\"table[id='tblist'] tr:odd\").css('background-color', '#EFEFEF');</script>";
     $strPaging = Utils::paging($strLink, $totalItems, $curPage, $maxPages, $maxItems);
     //echo $strPaging;
     $strResult .= $strPaging;
     return $strResult;
 }
include_once "../BUS/DonViTienBUS.php";
include_once "../BUS/LoaiNhaBUS.php";
include_once "../module/Utils/Utils.php";
include_once "../BUS/HuongNhaBUS.php";
include_once "../BUS/PhapLyBUS.php";
include_once "../BUS/HinhAnhBUS.php";
$objCanHo = DichVuBUS::select($_REQUEST["aid"]);
$loaidv = LoaiDVBUS::GetLoaiDVByID($objCanHo["loaidv"]);
$tinh = TinhBUS::getTinhById($objCanHo["tinh"]);
$quan = QuanBUS::getQuanById($objCanHo["quan"]);
$phuong = PhuongBUS::getPhuongById($objCanHo["phuong"]);
$donvitien = DonViTienBUS::selectId($objCanHo["donvitien"]);
$loainha = LoaiNhaBUS::getById($objCanHo["loainha"]);
$huongnha = HuongNhaBUS::GetHuongNhaById($objCanHo["huongnha"]);
$phaply = PhapLyBUS::GetPhapLyById($objCanHo["phaply"]);
$hinhanh = HinhAnhBUS::getAllHinhAnhByDichVuID($objCanHo['id']);
?>
<div style="margin:10px">
    <div class="tl"></div>
    <div class="tr"></div>
    <div class="tm"></div>
    <div class="mid">
	<script src="js/common.js" language="javascript"></script>
	<form action="index.php?view=article" method="post" name="frmRegister" id="frmRegister" >
		<div style="float:left;width:60%;">
			<table width="90%" align="center" border="0" cellpadding="0" cellspacing="0">
				<tr style="background:#F1F1F1;">
					<td width="100px"><b>Loại dịch vụ:</b></td>
					<td><b><?php 
echo $loaidv[1];
?>
	<div style="margin-left: 10px; margin-top: 10px; font-family: tahoma; font-size: 18px;
		font-weight: bold; color:#890C29;">
		CĂN HỘ NỔI BẬT	
	</div>
	<hr width="680" size="1" style="color: rgb(211, 232, 248);">
	<?php 
include_once "../BUS/DichVuBUS.php";
include_once "../BUS/HinhAnhBUS.php";
$canho = DichVuBUS::getCanHoNoiBat();
?>
	<div class="mid_content">

		<?php 
for ($i = 0; $i < count($canho); $i++) {
    if ($i < 4) {
        $hinhanh = HinhAnhBUS::getAllHinhAnhByDichVuID($canho[$i]['id']);
        echo "<div style='width:170px;float:left;'>";
        echo "<a class='chnoibat' href='chitietdiaoc.php?iddichvu=" . $canho[$i]['id'] . "'>";
        echo "<img src='../" . $hinhanh[0]['path'] . "' style='height:100px; width:160px;'/><br>";
        echo "<b style='color: #006DB9;'>" . $canho[$i]['tieude'] . "</b>";
        echo "</a></div>";
    } else {
        break;
    }
}
?>
		
		
	</div>	
	<div style="clear:both;">
	</div>
    include_once "../BUS/PhuongBUS.php";
    include_once "Utils/Utils.php";
    include_once "../BUS/LoaiDVBUS.php";
    include_once "../BUS/LoaiNhaBUS.php";
    include_once "../BUS/PhapLyBUS.php";
    include_once "../BUS/HuongNhaBUS.php";
    $business = DichVuBUS::select($_REQUEST['iddichvu']);
    $quan = QuanBUS::getQuanById($business['quan']);
    $phuong = PhuongBUS::getPhuongById($business['phuong']);
    $tinh = TinhBUS::getTinhById($business['tinh']);
    $loaidichvu = LoaiDVBUS::GetLoaiDVByID($business['loaidv']);
    $loainha = LoaiNhaBUS::getById($business['loainha']);
    $phaply = PhapLyBUS::GetPhapLyById($business['phaply']);
    $huongnha = HuongNhaBUS::GetHuongNhaById($business['huongnha']);
    $donvitien = DonViTienBUS::selectId($business['donvitien']);
    $hinhanh = HinhAnhBUS::getAllHinhAnhByDichVuID($business['id']);
    // echo count($hinhanh);
    // echo "<br>aaaaaaaaa=".$hinhanh[0]['path'];
}
?>
							<div style="width: 686px; padding-top:20px;float:left;">
								<div style="margin-left: 10px; margin-top: 10px; font-family: tahoma; font-size: 18px;
									font-weight: bold; color:#890C29;">
									<?php 
echo $business['tieude'];
?>
 </div>
								<hr style="color: rgb(211, 232, 248);" width="680" size="1"/>
								<div class="mid_content">
									<p style="margin-top:0;">
										<b style="padding-right:10px;">Mã số tin: <?php