Esempio n. 1
0
function displayWithSumRow($business, $loai, $monthFrom, $monthTo, $year)
{
    $str = null;
    $str .= '<table width="70%" border="0" align="center" cellspacing="0" cellpadding="0" id="tblist">';
    $str .= '<tr class="title">';
    $str .= '<td width="30px" align="center">#</td>';
    $str .= '<td width="30px" align="center">';
    $str .= '<input type="checkbox" name="cbAll" id="cbAll" onclick="checkALL()"/></td>';
    $str .= '<td width="70px" align="center">Ngày thu</td>';
    $str .= '<td align="center">Công việc</td>';
    $str .= '<td width="20%">Nhân viên thu</td>';
    $str .= '<td align="right" width="100px">Số tiền</td>';
    $str .= '</tr>';
    for ($i = 0; $i < count($business); $i++) {
        $user = UsersBUS::GetUserByID($business[$i]['nhanvien']);
        $dvTien = DonViTienBUS::selectId($business[$i]['donvi']);
        $str .= '<tr>';
        $str .= '<td align="center">' . ($i + 1) . '</td>';
        $str .= '<td align="center"><input type="checkbox" name="cbId[]" id="cbId[]" value="' . $business[$i]['id'] . '"></td>';
        $str .= '<td align="center">' . $business[$i]["ngay"] . '</td>';
        $str .= '<td>' . $business[$i]["congviec"] . '</td>';
        $str .= '<td>' . $user['hoten'] . '</td>';
        $str .= '<td align="right">' . number_format($business[$i]["sotien"]) . ' ' . $dvTien['ten'] . '</td>';
        $str .= '</tr>';
    }
    $str .= '<tr>';
    $str .= '<td align="right" colspan="5"><b>Tổng thu:</b></td>';
    $sumRow = null;
    if ($monthTo == null && $monthFrom == null && $year == null) {
        $sumRow = ThuChiBUS::SumTongTien($loai);
    } else {
        $sumRow = ThuChiBUS::SumTongTienByMonth($loai, $monthFrom, $monthTo, $year);
    }
    $str .= '<td align="right"><b>' . $sumRow[0] . ' vnd</b></td>';
    $str .= '</tr>';
    $str .= '</table>';
    $str .= "<script>\$(\"table[id='tblist'] tr:even\").css('background-color', '#EFEFEF');</script>";
    return $str;
}
Esempio n. 2
0
 public static function getMoneyPerHouse($business)
 {
     //1.000.000 => 1
     require_once "../BUS/DonviTienBUS.php";
     $dvTien = DonViTienBUS::selectId($business['donvitien']);
     $money = $business['giaban'];
     $money = $money * $dvTien['tigia'];
     if ($business['donvidv'] == 1) {
         //so tien tren m2
         $money = $money * $business['dai'] * $business['rong'];
     }
     //    echo "alibaba".$money;
     return $money;
 }
		</script>
		<form action="index.php?view=user" method="post" name="frmRegister" id="frmRegister" >
			<input name="btUpdate" type="hidden" value="Cập nhật" />
			<input name="uid" id="uid" type="hidden" value="<?php 
echo $user[0];
?>
" />	
			<table align="center" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td width="130px">Số tiền: <span style="color:red;">(*)</span></td>
					<td width="280px">
						<input type="text" id="txtSotien" onkeypress="return keypress(event);" onkeyup="FormatCurrency(this);" />
                        <select id="cbbDvTien">
                        <?php 
include_once "../BUS/DonviTienBUS.php";
$dvTien = DonViTienBUS::GetAllDonViTien();
for ($i = 0; $i < count($dvTien); $i++) {
    if ($dvTien[$i]['id'] == 2) {
        echo '<option value="' . $dvTien[$i]['id'] . '" selected>' . $dvTien[$i]['ten'] . '</option>';
    } else {
        echo '<option value="' . $dvTien[$i]['id'] . '">' . $dvTien[$i]['ten'] . '</option>';
    }
}
?>
                        </select>
                        </td>
				</tr>
				<tr>
					<td valign="top" style="padding-top:6px;">Công việc: <span style="color:red;">(*)</td>
					<td>
						<textarea style="width:99%;" id="txtCongviec"></textarea>
												<td width="200px" ><b>Giá:</b><span style="color:red;"> *</span></td>
												<td>
												<div style="width:310px;float:left;">
													<?php 
    if (isset($_GET['update']) && $_GET['update'] != null) {
        echo "<input name='txtGia' id='txtGia' type='text' onkeypress='return keypress(event);' onkeyup='FormatCurrency(this);' style='width:123px;text-align:right;' value='" . number_format($capnhatDV['giaban']) . "'>";
    } else {
        ?>
													<input id="txtGia" name="txtGia" class="Textbox" type="text" style="width:123px;text-align:right;" onkeypress="return keypress(event);" onkeyup="FormatCurrency(this);" />
													<?php 
    }
    ?>
													<select id="cbbDonViTien" class="DropDownList" name="cbbDonViTien">
													<?php 
    include "../BUS/DonViTienBUS.php";
    $rs = DonViTienBUS::GetAllDonViTien();
    for ($i = 0; $i < count($rs); $i++) {
        if (isset($_GET['update']) && $_GET['update'] != null && $capnhatDV['donvitien'] == $rs[$i][0]) {
            echo "<option value='" . ($i + 1) . "' selected>" . $rs[$i][1] . "</option>";
        } else {
            if ($rs[$i][0] == 2) {
                echo "<option selected value='" . ($i + 1) . "'>" . $rs[$i][1] . "</option>";
            } else {
                echo "<option value='" . ($i + 1) . "'>" . $rs[$i][1] . "</option>";
            }
        }
    }
    ?>
													</select> / 
													<select id="cbbDonViDichVu" name="cbbDonViDichVu" class="DropDownList" >
													<?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">
	<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;">
    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;
									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;">
</td>
						<?php 
    $loaidv = LoaiDVBUS::GetLoaiDVByID($listTinDang[$i]["loaidv"]);
    echo "<td align='center'>" . $loaidv[1] . "</td>";
    $loainha = LoaiNhaBUS::getById($listTinDang[$i]["loainha"]);
    echo "<td align='center'>" . $loainha[1];
    if ($listTinDang[$i]["rank"] == 1) {
        echo "&nbsp;&nbsp;<img src='images/hot.gif' />";
    }
    echo "</td>";
    $phuong = PhuongBUS::getPhuongById($listTinDang[$i]["phuong"]);
    $quan = QuanBUS::getQuanById($listTinDang[$i]["quan"]);
    echo "<td>" . $listTinDang[$i]["sonha"] . " " . $listTinDang[$i]["duong"] . ", " . $phuong[1] . ", " . $quan[1] . ", ";
    $tinh = TinhBUS::getTinhById($listTinDang[$i]["tinh"]);
    echo $tinh[1] . "</td>";
    $donviTien = DonViTienBUS::selectId($listTinDang[$i]["donvitien"]);
    echo "<td align='right'>" . number_format($listTinDang[$i]["giaban"]) . " {$donviTien['1']}</td>";
    if ($listTinDang[$i]["ngaydang"] != null) {
        $date = Utils::convertTimeDMY($listTinDang[$i]["ngaydang"]);
        echo "<td align='center'>" . $date . "</td>";
    } else {
        echo "<td></td>";
    }
    $tinvip = DichVuVIPBUS::GetTinVipById($listTinDang[$i]["id"]);
    if (count($tinvip) > 0) {
        //echo "<td align='center'><img src='images/vip.gif' /></td>";
        echo "<td align='center'><img style='width:16px;heigh:16px;' src='images/up.gif' /></td>";
    } else {
        echo "<td></td>";
    }
    $str = "<td><select id='status[{$i}]' style='font-size:96%;color:";
 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;
 }