}
    ?>
	
													</select>
												</td>
											</tr>
										</table><br>
<!--CÁC TIỆN ÍCH -->					<table class="table" width="100%" cellpadding="0" cellspacing="0">
											<tr style="background:#00397C;height:30px;">
												<td colspan="4" class="ButtonWithbackground">CÁC TIỆN ÍCH</td>
											</tr>
											<?php 
    include "../BUS/TienIchBUS.php";
    if (isset($_GET['update']) && $_GET['update'] != null) {
        include_once "../BUS/DichVu_TienIchBUS.php";
        $dv_tienich = DichVu_TienIchBUS::getAllByIDDichVu($capnhatDV[0]);
    }
    $rs = TienIchBUS::GetAllTienIch();
    $dem = 0;
    //echo "count=".count($rs);
    for ($i = 0; $i < count($rs); $i++) {
        if ($dem % 3 == 0) {
            echo "<tr>";
        }
        $dem++;
        $flag = true;
        if (isset($_GET['update']) && $_GET['update'] != null) {
            for ($j = 0; $j < count($dv_tienich); $j++) {
                if ($dv_tienich[$j][2] == $rs[$i][0]) {
                    echo "<td><input id='cbId[]'  name='cbId[]' type='checkbox' value='" . $dem . "' checked>";
                    $flag = 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) {
     $arraycheck = $_POST["cbId"];
     echo "<br>so=" . count($arraycheck);
     for ($i = 0; $i < count($arraycheck); $i++) {
         DichVu_TienIchBUS::Add((int) $rs, (int) $arraycheck[$i]);
     }
 }
 $length = strlen($_COOKIE["url"]);
 $url = $_COOKIE["url"];
 $url[$length - 1] = 2;
 if ($flagInsert == true) {
     if ($_GET["loaidvcandang"] == 1 || $_GET["loaidvcandang"] == 3) {
         if (isset($_GET['update']) && $_GET['update'] != null) {
             header("Location:" . $url . "&update=" . $_GET['update'] . "&newid=" . $rs);
         } else {
             header("Location:" . $url . "&newid=" . $rs);
         }
     } else {
         header("Location:" . $url . "&dangtin=success");
     }
?>
</b></td>
												<td>Số phòng tắm:</td>
												<td><b><?php 
echo $business['sophongtam'];
?>
</b></td>
											</tr>
										</table>
								</fieldset><br>
								<fieldset>
<?php 
include_once "../BUS/TienIchBUS.php";
include_once "../BUS/DichVu_TienIchBUS.php";
if (isset($_GET['iddichvu'])) {
    $dv_tienich = DichVu_TienIchBUS::getAllByIDDichVu($_GET['iddichvu']);
} else {
    header("Location:dichvu.php");
}
$rs = TienIchBUS::GetAllTienIch();
?>
									<legend style="font-size:14px;font-weight:bold;color: #006DB9;">Đặc Điểm</legend>
										<table cellpadding="0" cellspacing="0" width="100%" border="0">
											<?php 
$dem = 0;
$flag1 = true;
for ($i = 0; $i < count($rs); $i++) {
    if ($dem % 2 == 0) {
        if ($flag1 == true) {
            echo "<tr style=';background-color: #F1F1F1;'>";
            $flag1 = false;