public static function findBusiness($strLink, $strSQL)
 {
     $curPage = 1;
     if (isset($_REQUEST['page'])) {
         $curPage = $_REQUEST['page'];
     }
     $maxItems = 5;
     $maxPages = 25;
     $offset = ($curPage - 1) * $maxItems;
     $strCountSQL = str_replace("*", " count(*) ", $strSQL);
     $totalItems = DichVuBUS::countAllBySQL($strCountSQL);
     $strSQL .= " limit {$offset},{$maxItems}";
     $business = DichVuBUS::getAllBySQL($strSQL);
     if (isset($_REQUEST['cbbGia']) && $_REQUEST['cbbGia'] != -1) {
         $array = null;
         switch ($_REQUEST['cbbGia']) {
             case 1:
                 $array = BusinessProcessor::findPrice($business, 0, 5000000);
                 break;
             case 2:
                 $array = BusinessProcessor::findPrice($business, 5000000, 50000000);
                 break;
             case 3:
                 $array = BusinessProcessor::findPrice($business, 50000000, 500000000);
                 break;
             case 4:
                 $array = BusinessProcessor::findPrice($business, 500000000, 1000000000);
                 break;
             case 5:
                 $array = BusinessProcessor::findPrice($business, 1000000000, 1500000000);
                 break;
             case 6:
                 $array = BusinessProcessor::findPrice($business, 1500000000, 3000000000.0);
                 break;
             case 7:
                 $array = BusinessProcessor::findPrice($business, 3000000000.0, 10000000000.0);
                 break;
             case 8:
                 $array = BusinessProcessor::findPrice($business, 10000000000.0, 999999999999999.0);
                 break;
         }
         $business = $array;
         $totalItems = count($business);
     }
     return BusinessProcessor::display($strLink, $business, $totalItems, $curPage, $maxPages, $maxItems);
 }
 public static function loadByType($curPage, $type)
 {
     $totalItems = null;
     $business = null;
     $maxItems = 5;
     $maxPages = 25;
     $offset = ($curPage - 1) * $maxItems;
     if ($type > 0) {
         $business = DichVuBUS::getAllBySQL("select * from dichvu where loaidv={$type} limit {$offset},{$maxItems}");
         $totalItems = DichVuBUS::countAllBySQL("select count(*) from dichvu where loaidv={$type}");
     } else {
         $business = DichVuBUS::getAllBySQL("select * from dichvu limit {$offset},{$maxItems}");
         $totalItems = DichVuBUS::countAllBySQL("select count(*) from dichvu");
     }
     $display = HouseProcessor::displayHeader($totalItems);
     $display .= HouseProcessor::display($business);
     $display .= HouseProcessor::displayFooter();
     $strPaging = Utils::paging('', $totalItems, $curPage, $maxPages, $maxItems);
     return $display . $strPaging;
 }
Пример #3
0
 echo "<br>phuong=" . $_COOKIE["ccbPhuongXa"];
 if ($quan == -1) {
     $quan = 25;
     $phuong = 23;
 }
 if ($phuong == -1) {
     //$quan = 25;
     $phuong = 23;
 }
 //add or update into dichvu
 if (isset($_GET['update']) && $_GET['update'] != null) {
     $rank_Update = DichVuBUS::select($_GET['update']);
     $rs = DichVuBUS::Update($_GET['update'], $tieude, $mota, $chusohuu, $phuong, $quan, $tinh, $time, $timeupdate, $duong, $dai, $rong, $tang, $phongngu, $phongtam, $giaban, $donvitien, $rank_Update['status'], $thoihandangtin, $loainha, $phaply, $huongnha, $khuyenmai, $loaiDV, $donviDV, $X, $Y, $khanang, $rank_Update['rank'], $sonha);
     echo "<br>rs in update=" . $rs;
 } else {
     $rs = DichVuBUS::Add($tieude, $mota, $chusohuu, $phuong, $quan, $tinh, $time, $timeupdate, $duong, $dai, $rong, $tang, $phongngu, $phongtam, $giaban, $donvitien, $status, $thoihandangtin, $loainha, $phaply, $huongnha, $khuyenmai, $loaiDV, $donviDV, $X, $Y, $khanang, $rank, $sonha);
     echo "<br>rs in add=" . $rs;
 }
 if ($rs == false) {
     $flagInsert = false;
     echo "Can't insert or update into database.Please check again!";
 }
 //check and update or add into dichvu_tienich table
 if (isset($_GET['update']) && $_GET['update'] != null) {
     $dv_tienich = DichVu_TienIchBUS::getAllByIDDichVu($_GET['update']);
     for ($i = 0; $i < count($dv_tienich); $i++) {
         $kqDelete = DichVu_TienIchBUS::Delete($dv_tienich[$i][0]);
     }
     $rs = $_GET['update'];
 }
 if (isset($_POST["cbId"]) && count($_POST["cbId"]) > 0) {
 public static function loadByType($curPage, $loaidv, $ngayfrom, $ngayto)
 {
     $totalItems = null;
     $business = null;
     $maxItems = 5;
     $maxPages = 25;
     $offset = ($curPage - 1) * $maxItems;
     $condition = VipProcessor::getCondition($loaidv, $ngayfrom, $ngayto);
     $business = DichVuBUS::getAllBySQL("select * from dichvu where status=2 " . $condition . " limit {$offset},{$maxItems}");
     $totalItems = DichVuBUS::countAllBySQL("select count(*) from dichvu where status=2 " . $condition);
     $display = VipProcessor::displayHeader($totalItems);
     $display .= VipProcessor::display($business);
     $display .= VipProcessor::displayFooter();
     $strPaging = Utils::paging('', $totalItems, $curPage, $maxPages, $maxItems);
     return $display . $strPaging;
 }
				<p class="menu_item">
					<a href="thongtinkhachhang.php">Thông tin thành viên</a></p>
				<p class="menu_item">
					<a href="doimatkhau.php">Thay đổi mật khẩu</a></p>
				<p class="menu_item">
					<a href="noiquidangtin.php">Đăng tin nhà đất</a></p>
				<p class="menu_item">
					<a href="tindadang.php?type=1">Nâng cấp tin VIP</a></p>
				<p class="menu_item">
<?php 
include_once "../BUS/DichVuBUS.php";
if (isset($curUserId)) {
    $vip = (int) DichVuBUS::countStatusType(2, $curUserId);
    $daduyet = (int) DichVuBUS::countStatusType(1, $curUserId);
    $choduyet = (int) DichVuBUS::countStatusType(0, $curUserId);
    $hethan = (int) DichVuBUS::countStatusType(3, $curUserId);
    $tongcong = $vip + $daduyet + $choduyet + $hethan;
    echo "<a href='tindadang.php'>Các tin đã đăng (" . $tongcong . ")</a><br>";
    echo "<span><a href='tindadang.php?type=2'>- Tin VIP (" . $vip . ")</a><br>";
    echo "<a href='tindadang.php?type=1'>- Tin đã duyệt (" . $daduyet . ")</a><br>";
    echo "<a href='tindadang.php?type=0'>- Tin chờ duyệt (" . $choduyet . ")</a><br>";
    echo "<a href='tindadang.php?type=3' style='color:red;'>- Tin hết hạn (" . $hethan . ")</a><br></span>";
} else {
    header("Location:dichvu.php");
}
?>
					
				</p>
			</td>
		</tr>
	</table>
Пример #6
0
<?php

if (isset($_REQUEST["idtin"]) && $_REQUEST["idtin"] != null) {
    $PATH_BASE = str_replace('//', '/', dirname(__FILE__) . '/');
    include_once $PATH_BASE . '../../BUS/DichVuBUS.php';
    $user = DichVuBUS::UpdateStatus($_REQUEST["idtin"], -1);
    if ($user == true) {
        echo "abc";
    }
}
								<?php 
    }
}
?>
								</div>
								<hr width="680" size="1" style="color: rgb(211, 232, 248);">
								<div style="padding:20px 0;">
									<center>
										<table class="table" border="0">
											<tr>
												<td align="right">Mã số tin rao:</td>
												<td align="left">
												<b><?php 
if (isset($_GET['iddv'])) {
    include_once "../BUS/DichVuBUS.php";
    $process = DichVuBUS::select($_GET['iddv']);
    echo $_GET['iddv'];
}
?>
</b>
												</td>
											</tr>
											<tr>
												<td align="right">Tiêu đề tin rao:</td>
												<td align="left">
												<b><?php 
if (isset($_GET['iddv'])) {
    echo $process['tieude'];
}
?>
</b>
Пример #8
0
<div style="width: 686px;float:left;" >
	<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;">
				<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="986;">
					<tr>
						<td style="border-right: 1px solid rgb(180, 215, 232); background-repeat: repeat-y;"
							background="1_files/menubg_all.jpg" valign="top" width="270">
							<?php 
include "../include/box_left_thanhvien.php";
?>
						</td>
						<td style="padding: 10px;" valign="top">	
							<div style="width: 686px;">
								<div id="messLoaiDangTin" name="messLoaiDangTin" style="margin-left: 10px; margin-top: 10px; font-family: tahoma; font-size: 18px;font-weight: bold; color:#890C29;">
								<?php 
$ltdv = $_GET['loaidvcandang'];
if (isset($_GET['update']) && $_GET['update'] != null) {
    echo "Cập Nhật ";
    $capnhatDV = DichVuBUS::select($_GET['update']);
}
if ($ltdv == 1) {
    echo "Đăng Tin Cần Bán";
} else {
    if ($ltdv == 2) {
        echo "Đăng Tin Cần Mua";
    } else {
        if ($ltdv == 3) {
            echo "Đăng Tin Cho Thuê";
        } else {
            echo "Đăng Tin Cần Thuê";
        }
    }
}
?>
Пример #10
0
<div class="br"></div>
<div class="bm"></div>
</div>
<?php 
include_once "../BUS/DichVuBUS.php";
include_once "../BUS/LoaiDVBUS.php";
include_once "../BUS/TinhBUS.php";
include_once "../BUS/QuanBUS.php";
include_once "../BUS/PhuongBUS.php";
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">
Пример #11
0
                echo "upload picture finish!";
            }
        }
    }
    $length = strlen($_COOKIE["url"]);
    $url = $_COOKIE["url"];
    $url[$length - 1] = 3;
    header("Location:" . $url);
}
if (isset($_GET["action"])) {
    $action = $_GET["action"];
    switch ($action) {
        case "delete":
            $uid = explode(',', $_GET["uid"]);
            for ($i = 0; $i < count($uid); $i++) {
                DichVuBUS::delete($uid[$i]);
            }
            break;
        case "noibat1":
            include "../../../BUS/TinDangBUS.php";
            $aid = $_GET["idtin"];
            TinDangBUS::setTinDangNoiBat($aid, 1);
            break;
        case "noibat0":
            include "../../../BUS/TinDangBUS.php";
            $aid = $_GET["idtin"];
            TinDangBUS::setTinDangNoiBat($aid, 0);
            break;
        case "status":
            include "../../../BUS/TinDangBUS.php";
            include "../../../BUS/DichVuVIPBUS.php";
Пример #12
0
                            <?php 
$business = null;
if (isset($_REQUEST['iddichvu'])) {
    include_once "../BUS/DichVuBUS.php";
    include_once "../BUS/HinhAnhBUS.php";
    include_once "../BUS/DonviDichVuBUS.php";
    include_once "../BUS/DonViTienBUS.php";
    include_once "../BUS/TinhBUS.php";
    include_once "../BUS/QuanBUS.php";
    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;
 public static function findSearchContext2($strLink, $strSQL)
 {
     $curPage = 1;
     $totalItems = null;
     $business = null;
     if (isset($_REQUEST['page'])) {
         $curPage = $_REQUEST['page'];
     }
     $maxItems = 5;
     $maxPages = 25;
     $offset = ($curPage - 1) * $maxItems;
     $strCountSQL = str_replace("*", " count(*) ", $strSQL);
     $totalItems = DichVuBUS::countAllBySQL($strCountSQL);
     $strSQL .= " limit {$offset},{$maxItems}";
     $business = DichVuBUS::getAllBySQL($strSQL);
     return MessageTypeProcessor::display($strLink, $business, $totalItems, $curPage, $maxPages, $maxItems);
 }