public static function display($business)
 {
     $str = "";
     for ($i = 0; $i < count($business); $i++) {
         $loaidv = LoaiDichVuBUS::getById($business[$i]['loaidv']);
         $loainha = LoaiNhaBUS::getById($business[$i]['loainha']);
         $user = UsersBUS::GetUserByID($business[$i]['chusohuu']);
         $str .= '<tr>';
         $str .= '<td align="center">' . ($i + 1) . '</td>';
         $str .= '<td>' . $user['hoten'] . '</td>';
         $str .= '<td>' . $business[$i]['tieude'] . '<img src="images/vip.gif"></td>';
         $str .= '<td>' . $loainha['ten'];
         if ($business[$i]["rank"] == 1) {
             $str .= "&nbsp;&nbsp;<img src='images/hot.gif' />";
         }
         $str .= '</td>';
         $str .= '<td>' . $business[$i]['sonha'] . '/' . $business[$i]['duong'] . ', ' . $business[$i]['phuong'] . ', ' . $business[$i]['quan'] . ', ' . $business[$i]['tinh'] . '</td>';
         $str .= '<td align="center">' . $business[$i]['ngaydang'] . '</td>';
         $str .= '<td align="center">' . $business[$i]['thoihantin'] . '</td>';
         $str .= '<td align="center" style="color:green;">';
         switch ($business[$i]['status']) {
             case 0:
                 $str .= "Tin chờ duyệt";
                 break;
             case 1:
                 $str .= "Tin đã duyệt";
                 break;
             case 2:
                 $str .= "Tin đăng VIP";
                 break;
             case 3:
                 $str .= "Tin hết hạn";
                 break;
             default:
                 $str .= "Tin bị xóa";
                 break;
         }
         $str .= '</td>';
         $str .= '<td align="center">' . $loaidv['ten'] . '</td>';
         $str .= '</tr>';
     }
     return $str;
 }
                        url="module/thongke/VipProcessor.php?view=statistic&do=vip&action=view&loaidv="+type+"&ngayfrom="+ngayfrom+"&ngayto="+ngayto+"&page=1";         
                        $("#dsNha").load(url);
                        $('#btnExport').attr("href","module/thongke/VipProcessor.php?view=statistic&do=vip&action=export&loaidv="+type+"&ngayfrom="+ngayfrom+"&ngayto="+ngayto+"&page=1")
                   
                    });
                });
    </script>
    <div class="mid">
		<form action="index.php?view=user" method="post" name="frmRegister" id="frmRegister">
			<div style="text-align:center;padding-bottom:30px;">
            Loại nhà &nbsp;&nbsp;&nbsp;&nbsp;
			<select id="cbbType">
					<option value="-1"> Tất cả nhà </option>
					<?php 
include "../BUS/LoaiDichVuBUS.php";
$loaidv = LoaiDichVuBUS::getALL();
for ($i = 0; $i < count($loaidv); $i++) {
    echo "<option value='" . $loaidv[$i]['id'] . "'>" . $loaidv[$i]['ten'] . "</option>";
}
?>
			</select>
            <script>
			$(function() {
			     $( "#txtDateFrom" ).datepicker({dateFormat:'yy-mm-dd', showButtonPanel: true});
                 $( "#txtDateTo" ).datepicker({dateFormat:'yy-mm-dd', showButtonPanel: true});
			});
			</script>
            &nbsp;&nbsp;&nbsp;&nbsp;
			    Ngày đăng: &nbsp;&nbsp;&nbsp;&nbsp;<input id="txtDateFrom" type="text" style="width:70px;">
				&nbsp;&nbsp;&nbsp;&nbsp;
                đến 	&nbsp;&nbsp;&nbsp;&nbsp;
 public static function getLoaiDichVuChiTiet()
 {
     if (isset($_REQUEST['loaidv'])) {
         $loaidv = LoaiDichVuBUS::getById($_REQUEST['loaidv']);
         return $loaidv['ten'];
     }
     return "CÁC CĂN HỘ LIÊN QUAN";
 }
 public static function display($strLink, $business, $totalItems, $curPage, $maxPages, $maxItems)
 {
     $strResult = "";
     if (count($business) > 0) {
         for ($i = 0; $i < count($business); $i++) {
             $strResult .= "<tr bgcolor='#ffffff'>";
             $strResult .= "<td width='60' valign='middle' align='center' style='border-bottom:solid 1px #CCCCCC;'>";
             $strResult .= "<b>" . $business[$i][0] . "</b></td>";
             //id
             $strResult .= "<td valign='top' align='left' style='border-left: 1px solid rgb(204, 204, 204); border-bottom: 1px solid rgb(204, 204, 204);'>";
             if ($business[$i]['status'] == 0) {
                 $strResult .= "<div style='float:right;'><b style='color:#FF0000;'>Chờ duyệt</b></div><br>";
                 //loai tin
                 $strResult .= "<b>" . $business[$i][1] . "</b><br>";
                 //tên tiêu đề
             } else {
                 if ($business[$i]['status'] == 1) {
                     $strResult .= "<span style='color: rgb(255, 0, 0);'>Tin đã duyệt</span><div style='float:right;'><b style='color:#FF0000;'>Miễn Phí</b></div><br>";
                     //loai tin
                     $strResult .= "<b>" . $business[$i][1] . "</b><br>";
                     //tên tiêu đề
                 } else {
                     if ($business[$i]['status'] == 2) {
                         $strResult .= "<div style='float:right;'><b style='color:#FF0000;'>Tin VIP</b></div><br>";
                         //loai tin
                         $strResult .= "<b>" . $business[$i][1] . "</b><br>";
                         //tên tiêu đề
                     } else {
                         $strResult .= "<div style='float:right;'><b style='color:#FF0000;'>Hết hạn</b></div><br>";
                         //loai tin
                         $strResult .= "<b>" . $business[$i][1] . "</b><br>";
                         //tên tiêu đề
                     }
                 }
             }
             //load data
             $loaidv = LoaiDichVuBUS::getById($business[$i][19]);
             $huongnha = HuongNhaBUS::GetHuongNhaById($business[$i]['huongnha']);
             $donvitien = DonViTienBUS::selectId($business[$i]['donvitien']);
             $donvidv = DonViDichVuBUS::selectId($business[$i]['donvidv']);
             $loainha = LoaiNhaBUS::getById($business[$i]['loainha']);
             if ($business[$i]['ngaydang'] != null) {
                 $date = Utils::convertTimeDMY($business[$i]['ngaydang']);
                 $declinetime = Utils::convertDecline_Time($business[$i]['ngaydang']);
             } else {
                 $date = "00:00:00";
                 $declinetime = "00:00:00";
             }
             //endload
             $strResult .= "- <b style='color: #0D5DA8;font-weight:bold;font-size:11px;text-decoration: none;'\t>Loại nhà:" . $loainha['ten'] . " </b><br> - <a target='_blank' href='#'>" . $loaidv[1] . "</a>";
             //tên loại dv
             $strResult .= "- Hướng nhà:" . $huongnha[1] . "<br>";
             //Hướng nhà
             $strResult .= "- Giá: <b>" . number_format($business[$i]['giaban']) . "</b> " . $donvitien['ten'] . "/" . $donvidv['ten'] . "  - Kích thước: " . $business[$i]['dai'] . "x" . $business[$i]['rong'] . " m<sup>2</sup> </b><br>";
             //giá nhà và kt
             if ($business[$i]['status'] == 1) {
                 $strResult .= "<div style='float:left; padding:3px; font-weight: bold;'><a style='color:red;' href='nangcaptinvip.php?iddv=" . $business[$i]['id'] . "'><img align='left' src='../images/uprade.png'>Nâng cấp lên VIP 275.000 /tháng</a></div></td>";
                 //giá nhà và kt
             }
             $strResult .= "<td width='260' valign='top' style='border-left: 1px solid rgb(204, 204, 204); border-bottom: 1px solid rgb(204, 204, 204);'>";
             //column 3
             $strResult .= "<div style='margin-bottom: 5px; font-weight: normal; color: rgb(51, 51, 51);'>";
             //$strResult.="- 1 lượt xem tin <br>"; //so nguoi xem tin
             $strResult .= "- Ngày đăng: &nbsp;&nbsp;&nbsp;&nbsp;" . $date . "<br>";
             //ngay dang
             $strResult .= "- Ngày hết hạn: " . $declinetime . "<br>";
             //ngay het han
             $strResult .= "</div>";
             $strResult .= "<div style='padding: 3px; background-color: rgb(242, 245, 249); border: 1px solid rgb(204, 204, 204);font-weight: bold;'>";
             $strResult .= "<b title='23-06-2011' style='color: green;'>";
             $strResult .= "<img align='center' style='margin: 0px;position:relative;top:-4px;' src='../images/action_check2.png'>Đã cập nhật</b>&nbsp;&nbsp;";
             //update
             $strResult .= "<a href='dangtindichvu.php?update=" . $business[$i][0] . "&loaidvcandang=" . $business[$i]['loaidv'] . "&step=" . '1' . "' style='color: #0D5DA8;font-weight:bold;font-size:11px;text-decoration: none;'>";
             $strResult .= "<img align='center' style='margin: 0px;position:relative;top:-4px;' src='../images/edit.png'>Sửa tin</a>&nbsp;&nbsp;";
             //repare
             $strResult .= "<a onclick='return xoatindang(" . $business[$i][0] . ");' href='' style='color: #0D5DA8;font-weight:bold;font-size:11px;text-decoration: none;'>";
             $strResult .= "<img align='center' style='margin: 0px;position:relative;top:-4px;' src='../images/action_delete2.png' >Xóa tin</a></div>";
             //delete
             $strResult .= "</td></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>";
     $strPaging = Utils::paging($strLink, $totalItems, $curPage, $maxPages, $maxItems);
     $strResult .= "<center>" . $strPaging;
     return $strResult;
 }