"/> "/>
numRows($rs_doan)>0 || $sl_kle_chuagan>0){ ?>
Danh sách đoàn
Đang ở
Checkin hôm nay
Checkout hôm nay
Chờ thanh toán
0){ ?>
fetchRow($rs_doan)){ $class="group-staying"; if(strtotime($rwd['KLT_THOIDIEMTRADUKIEN'])strtotime(date('Y-m-d')." 00:00:01")){ $class="group-checkin-today"; } if($rwd['GR_SOLUONG']<=$rwd['SL_DATRA'] && $rwd['SL_DANGO']==0){ $class="group-wait-finish"; } ?>
Ở từ:
SL: , Đã gán: , Chưa gán:
Đang ở: , Đã trả:
; height:10px;margin-bottom:-5px;margin-left:-5px;margin-right:-5px'>
 Danh sách đặt phòng (numRows($rs_doan);?>)
In sơ đồ phòng"; echo "Báo cáo đặt phòng"; echo "Theo dõi đặt cọc"; } if(isset($ownerConfig['yc_donphong_tudong'][$cty_id])){ echo "YC dọn phòng"; } }elseif($branch_type==TYPE_IS_THUEPHONG){ echo "Báo cáo đặt phòng"; echo "Lịch phòng"; echo "Theo dõi đặt cọc"; };?>
>
 Còn trống    Đã đặt 0){echo "(chưa gán: ".$arrCountStatus['ungrant'].")";} ?>      Sắp nhận phòng        Đang ở    Trả trong ngày    Ở dài hạn  
       Cần sửa          Chưa dọn          Đang dọn   
getBranchType()==TYPE_IS_HOTEL && !$authModel->checkQuyenChucNang('gh_xemlichsuphong','xem')) || $branch_type==TYPE_IS_THUEPHONG ){ ?>
getBranchType(),array(TYPE_IS_RESTAURANT,TYPE_IS_BAR))){ ?>
>Rút gọn   >Theo loại    >Theo lầu   >Tùy chỉnh   
checkQuyenChucNang('bc_tamtru','xem')){ ?>
Báo cáo tạm trú
getThongTinTinhTienPhong($cty_id); //$arr_price_add = $mTinhQuaGio->getToArray($cty_id); $arr_themnguoi = array(); //$time_out_full = $webhelper->round_time_by_minute(date('Y-m-d H:i:s')); $time_out_full = date('Y-m-d H:i:s'); $plp_i = 0; $lau_i =0; $pnhom_i = 0; if($cty_id==4){ $time_show_future=108000; }else{ if(date('H:i:s') > '12:00:00' && in_array($cty_id,array(120)) ){ $time_show_future = ( strtotime(date('Y-m-d')." 23:59:59") - strtotime(date('Y-m-d H:i:s')) ) + 18000; }else{ $time_show_future = strtotime(date('Y-m-d')." 23:59:59") - strtotime(date('Y-m-d H:i:s')); } } $arr_klt_room_status = $mPhong->getArrayRoomStatusAll($chinhanh_id,$show_cus_info,$time_show_future); $sl_stay_checkout = 0; if($cty_id==33){ $arr_kyhieu_cachtinh = array( '2' => array('G','blue','white'), '5' => array('N','red','white'), '6' => array('D','red','white'), '7' => array('TT','red','white'), '8' => array('24H','red','white'), '9' => array('T','red','white'), '10' => array('TH','red','white'), ); }elseif($cty_id!=76){ $arr_kyhieu_cachtinh = array( '2' => array('H','blue','white'), '5' => array('N','green','white'), '6' => array('D','#777777','white'), '7' => array('TT','gold','green'), '8' => array('24H','#fb3990','white'), '9' => array('T','#ffffff','red'), '10' => array('TH','#ffffff','red'), ); }else{ $arr_kyhieu_cachtinh = array(); } $arr_color_nhom = array( 'green','blue','orange','#fb399','red','#6B9EE4','#fb399','blue','green','blue','orange','#fb399','red' ); $sl_daihan =0; $room_width = 145; $style_option = ""; $phannhom_thutu = 0; $view_group = ""; while($rw=$conn->fetchRow($rs)){ if($cty_id==151){ if($view_group!=$rw['VIEW_GROUP']){ if($view_group!=""){ echo "
"; } if($rw['VIEW_GROUP']%2==1){ $w_float="float:left"; }else{ $w_float="float:right"; } echo "
"; $view_group = $rw['VIEW_GROUP']; } } $danhgia = 0; $so_khach = " "; $style_option = ""; if($show_type=="OPT1" && in_array($cty_id,array(50,70))){ $room_width_padding = 230; $room_width = 200; $style_option = "style='width:200px; height:65px"; }elseif($show_type=="OPT1" && in_array($cty_id,array(102,136))){ $room_width_padding = 136; $room_width = 110; $style_option = "style='width:110px; height:65px"; }elseif($show_type=="OPT1"){ $room_width_padding = 112; $room_width = 80; $style_option = "style='width:90px; height:55px"; } $quoctich = ""; $quoctich_ma = ""; $dangkyluutru_status = "item-hide"; $car_show = "item-hide"; $moto_show = "item-hide"; $car_number = ""; $moto_number = ""; $has_birthday = false; $is_vip = false; $rw_status = $mTTP->getLastStatus($rw['PH_ID'],array('TTP_IDTRANGTHAI')); $class_by_status = $mTTP->getClassByStatus($rw_status['TTP_IDTRANGTHAI']); $card_count = intval($rw['PH_SOTHEKHOA']); $phong_id = $rw['PH_ID']; //$arrLuuTru = $mPhong->getArrayRoomStatus2($rw['PH_ID'],null,$show_cus_info,$time_show_future); if(isset($arr_klt_room_status[$phong_id])){ $arrLuuTru = $arr_klt_room_status[$phong_id]; $luot_phong = count($arrLuuTru); }else{ $arrLuuTru = array(); $luot_phong = 0; } $class_by_1 = ""; $class_group= ""; $style_group = ""; $has_order = false; $kh_hoten = ""; if(!empty($arrLuuTru)){ if($arrLuuTru[0]['LUOTO']> 0 && $arrLuuTru[0]['LUOTO']%$_SESSION['TSCN']['LUOTO_VIP']==0){ $is_vip = true; } } $cach_tinh_uu_tien = 0; $room_charge_total = -1; $home_sohd =""; $time_out = ""; $class_stay_night = ""; $class_stay_hour = ""; $class_checkin_today = ""; $class_stay_long =""; $room_name_color = ""; if($rw['PLP_COLOR']!=""){ $room_name_color = "style='color:".$rw['PLP_COLOR'].";font-weight:bold;font-size:18px;text-shadow: 1px 0px #fff;'"; } $kh_info_ok = 1; if(!empty($arrLuuTru) && $arrLuuTru[0]['KLT_LOAI']==2){ if($cty_id==33){ $room_name_color = "style='color:blue'"; } $home_sohd = $arrLuuTru[0]['KLT_SOHD']; $danhgia = $arrLuuTru[0]['KLTEX_DANHGIA']; $so_khach = $arrLuuTru[0]['SLKHACH']; $cach_tinh_uu_tien = $arrLuuTru[0]['CACHTINH']; $kh_info_ok = $arrLuuTru[0]['INFO_OK']; if($cach_tinh_uu_tien==CACHTINH_GIADEM){ $class_stay_night = "stay-night"; }elseif($cach_tinh_uu_tien==CACHTINH_GIAGIO){ $class_stay_hour = "stay-hour"; } if($cty_id==33){ $time_stay = strtotime(date('Y-m-d H:i:s'))- strtotime($arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT']); if($time_stay>=30*86400){ $cach_tinh_uu_tien = 10; // Tháng }elseif($time_stay>=7*86400){ $cach_tinh_uu_tien = 9;//Tuần } }elseif($arrLuuTru[0]['KLT_THOIDIEMTRADUKIEN']!=NULL){ $time_stay = strtotime($arrLuuTru[0]['KLT_THOIDIEMTRADUKIEN'])- strtotime($arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT']); if($time_stay){ if($time_stay>=30*86400){ $cach_tinh_uu_tien = 10; // Tháng }elseif($time_stay>=7*86400){ $cach_tinh_uu_tien = 9;//Tuần } } } if($branch_type==TYPE_IS_HOTEL && $cty_id!=71 && $cty_id!=43 && $cty_id!=60){ if(strtotime($arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT']) > strtotime(date('Y-m-d')." 05:00:00") && !in_array($chinhanh_id,array(156))){ $class_checkin_today = "checkin-today"; } if(in_array($cty_id,array(34,39)) && (strtotime($arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT']) < strtotime(date('Y-m-d')." 05:00:00") && (strtotime(date('Y-m-d')." 12:00:00") < strtotime(date('Y-m-d H:i:s')) || (strtotime($arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT'])< strtotime(date('Y-m-d')." 05:00:00") -86400 ) ) ) ){ $class_stay_long = "stay-long"; } } $quoctich_ma = $arrLuuTru[0]['KH_QUOCTICH']; if($quoctich_ma!=""){ $quoctich = $mCountry->getName($quoctich_ma); }else{ $quoctich = ""; } if($arrLuuTru[0]['KLT_DANGKYLUUTRU']==0 && $cty_id==33){ $dangkyluutru_status = ""; }elseif($cty_id!=33 && $arrLuuTru[0]['KLT_DANGKYLUUTRU']==1){ $dangkyluutru_status = ""; } $class_by_1 = "stayed"; if($cty_id==32 && $arrLuuTru[0]['DAIHAN']==1){ $class_by_1 .= " stayed-checkout"; $sl_daihan++; } if($cty_id!=43){ if($arrLuuTru[0]['COLOR_CODE']!=null && $arrLuuTru[0]['COLOR_CODE']!=""){ $style_group = "style='background:".$arrLuuTru[0]['COLOR_CODE']."'"; $class_group = " group_color_1"; }else{ $class_group = " group_color"; } } //Tinh tien phong if($show_charge){ $arr_price_early = $mKLT->getPhuThuVaoSom($arrLuuTru[0]['KLT_ID']); if(empty($arr_price_early)){ $arr_price_early = $mVaoSomPhong->getToArray($phong_id); } if(empty($arr_price_early)){ $arr_price_early = $arr_price_early_cty; } //Tra tre $arr_price_add = $mKLT->getPhuThuTraTre($arrLuuTru[0]['KLT_ID']); if(empty($arr_price_add)){ $arr_price_add = $mTraTrePhong->getToArray($phong_id); } if(empty($arr_price_add)){ $arr_price_add = $arr_price_add_cty; } $arr_price = $mPhong->getPriceToArray($phong_id,$arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT'],$arrLuuTru[0]['KLTEX_IDBOOKINGCODE']); $arr_giatheonguoi = $mGiaTheoNguoi->getGiaTheoNguoi($phong_id); // if($rw['PH_ID']==1148){ // print_r($arr_price); // } $room_charge = $mKLT->getRoomCharge($arrLuuTru[0],$arr_ts,$arr_price,$arr_price_early,$arr_price_add,$arr_giatheonguoi,$cachtinhphuthuthemnguoi); $tien_dichvu = $mDVSD->getTotalByKLT($arrLuuTru[0]['KLT_ID']); $tratruoc = $mTraTruoc->getTongTheoKLT($arrLuuTru[0]['KLT_ID']); $room_charge_total = $room_charge + $tien_dichvu - $tratruoc; } // if(count($arrLuuTru)>1){ $has_order = true; } $kh_hoten = $arrLuuTru[0]['KH_TEN']; if($arrLuuTru[0]['KH_SOXE']!=''){ $kh_hoten.=" (".$arrLuuTru[0]['KH_SOXE'].")"; } if($arrLuuTru[0]['KLT_XEHOI']!="0"){ $car_show = ""; if($arrLuuTru[0]['KLT_XEHOI']!="1"){ $car_number = $arrLuuTru[0]['KLT_XEHOI']; } } // $arrLuuTru[0]['KLT_MOTO'] = "45-5-55"; if($arrLuuTru[0]['KLT_MOTO']!="0"){ $moto_show = ""; if($arrLuuTru[0]['KLT_MOTO']!="1"){ $moto_number = $arrLuuTru[0]['KLT_MOTO']; } } if($arrLuuTru[0]['TENDOAN']!=NULL && isset($ownerConfig['home_show_groupname'][$cty_id])){//$arrLuuTru[0]['TENDOAN']!=$arrLuuTru[0]['KH_TEN'] && $kh_hoten =$arrLuuTru[0]['TENDOAN'];//."
".$kh_hoten.""; } if($arrLuuTru[0]['BOOKING_TEN']!=''){ $kh_hoten.="
(".$arrLuuTru[0]['BOOKING_TEN'].")"; } if($arrLuuTru[0]['KH_NGAYSINH']!=null){ $arrNS = explode("-", $arrLuuTru[0]['KH_NGAYSINH']); if(count($arrNS)==3 && intval(date('d'))==intval($arrNS[0]) && intval(date('m'))==intval($arrNS[1])){ $has_birthday = true; } } if(!$has_birthday && $arrLuuTru[0]['SLCUNGPHONG']>0){ $has_birthday = $mPhong->checkSinhNhat($arrLuuTru[0]['KLT_ID'],false); } if($arrLuuTru[0]['KLT_THOIDIEMTRADUKIEN']!=null){ if(strtotime($arrLuuTru[0]['KLT_THOIDIEMTRADUKIEN'])< strtotime(date('Y-m-d')." 23:59:59") && $branch_type==TYPE_IS_HOTEL){ $sl_stay_checkout++; if($cty_id!=32){ $class_by_1 .= " stayed-checkout"; } $time_out = "".$arrLuuTru[0]['KLT_THOIDIEMTRADUKIEN_TIME'].""; } } }elseif(!empty($arrLuuTru) && $arrLuuTru[0]['KLT_LOAI']==1){ $so_khach = $arrLuuTru[0]['SLKHACH']; $quoctich_ma = $arrLuuTru[0]['KH_QUOCTICH']; $home_sohd = $arrLuuTru[0]['KLT_SOHD']; if($quoctich_ma!=""){ $quoctich = $mCountry->getName($quoctich_ma); }else{ $quoctich = ""; } if($arrLuuTru[0]['KLT_SOHD']=='000'){ $class_by_1 = "room-repair"; }elseif(strtotime($arrLuuTru[0]['KLT_THOIDIEMDATPHONG']) < strtotime(date('Y-m-d H:i:s')) + 43200 && $cty_id==4){ $class_by_1 = "ordered ordered2"; }elseif(strtotime($arrLuuTru[0]['KLT_THOIDIEMDATPHONG']) < strtotime(date('Y-m-d H:i:s')) + $next_show){ $class_by_1 = "ordered"; }else{ $class_by_1 = "ordered-nocolor"; } if(in_array($cty_id,array(3,228)) && strtotime($arrLuuTru[0]['KLT_THOIDIEMDATPHONG']) < strtotime(date('Y-m-d H:i:s'))){ if($style_option==""){ $style_option .= "style='background:#897e7e"; }else{ $style_option .= ";background:#897e7e"; } } if($cty_id!=43){ if($arrLuuTru[0]['COLOR_CODE']!=null && $arrLuuTru[0]['COLOR_CODE']!="" ){ $style_group = "style='background:".$arrLuuTru[0]['COLOR_CODE']."'"; $class_group = " group_color_1"; }else{ $class_group = " group_color"; } } $kh_hoten = $arrLuuTru[0]['KH_TEN']; if($arrLuuTru[0]['KH_SOXE']!=''){ $kh_hoten.=" (".$arrLuuTru[0]['KH_SOXE'].")"; } if($arrLuuTru[0]['BOOKING_TEN']!=''){ $kh_hoten.="
(".$arrLuuTru[0]['BOOKING_TEN'].")"; } }else{ if($cty_id==33){ $room_name_color = "style='color:blue'"; } } if($cty_id==33){ $cus_name_color = "style='color:#000 !important'"; }else{ $cus_name_color = ""; } $status_count = count($arrLuuTru); if($show_type=="PLP"){ if($plp_i!=$rw['PH_IDPLP']){ if(isset($arr_status_plp[$rw['PH_IDPLP']])){ $info = "
  Còn trống: ".$arr_status_plp[$rw['PH_IDPLP']]['free'].",   "; $info .= "Đã đặt: ".($arr_status_plp[$rw['PH_IDPLP']]['order']+$arr_status_plp[$rw['PH_IDPLP']]['ungrant'])." "; if($arr_status_plp[$rw['PH_IDPLP']]['ungrant']>0){ $info .= "(chưa gán: ".$arr_status_plp[$rw['PH_IDPLP']]['ungrant'].")"; } $info .= ",  Đang ở: ".($arr_status_plp[$rw['PH_IDPLP']]['stay']-$arr_status_plp[$rw['PH_IDPLP']]['staycheckout']).""; $info .= ",  Trả trong ngày: ".$arr_status_plp[$rw['PH_IDPLP']]['staycheckout']."
"; }else{ $info = "
Không thống kê tình trạng phòng
"; } echo "
".$arrPLP2[$rw['PH_IDPLP']].":
   ".$info."
"; } $plp_i=$rw['PH_IDPLP']; } if($show_type=="LAU"){ if($lau_i!=$rw['PH_IDLAU']){ echo "
".$arrLau2[$rw['PH_IDLAU']]."
"; } $lau_i=$rw['PH_IDLAU']; } if($show_type=="OPT1"){ if($pnhom_i!=$rw['PH_IDPN']){ if($pnhom_i!=0){ echo "
"; if($rw['PN_XUONGDONG']==1){ echo "
"; } } $border_left = "border:1px solid #ddd;border-top:2px solid ".$arr_color_nhom[$phannhom_thutu].";".WebHelper::decodeSpecialChar($rw['PN_STYLE']); echo "
"; if($cty_id!=102){ echo "
".WebHelper::decodeSpecialChar($rw['PN_TEN'])."
"; } $phannhom_thutu++; } if($rw['PN_ITEM_FLOAT']=='right'){ $style_option.=";float:right"; } $pnhom_i=$rw['PH_IDPN']; } if($style_option!=""){ $style_option.="'"; } $title_lockcard = ""; if($_SESSION['TSCN']['TICHHOPKHOA']==1){ if($rw['LOCKCARD_RA']!=NULL){ $title_lockcard = "Hết hạn thẻ: ".date("H:i d/m/Y",strtotime($rw['LOCKCARD_RA'])); } } if($branch_type==TYPE_IS_HOTEL) { //roomstatus-default | roomstatus-ok | roomstatus-needrepair | roomstatus-repairing $class_roomstatus = 'roomstatus-ok roomstatus-id-'.$rw['PH_ID']; $rw_rstatus = $mPhong->getLastRoomStatus2($rw['PH_ID']); if (count($rw_rstatus) > 0){ if ($rw_rstatus['TTP2_IDTRANGTHAI'] == 1){ $class_roomstatus = 'roomstatus-ok roomstatus-id-'.$rw['PH_ID']; }elseif ($rw_rstatus['TTP2_IDTRANGTHAI'] == 2){ $class_roomstatus = 'roomstatus-needrepair roomstatus-id-'.$rw['PH_ID']; }elseif ($rw_rstatus['TTP2_IDTRANGTHAI'] == 3){ $class_roomstatus = 'roomstatus-repairing roomstatus-id-'.$rw['PH_ID']; } } } ?>
" id="" >
>
>
>".$rw['PH_SHOW_IN_MAP']."";};?>
  ".$rw['PH_SHOW_IN_MAP']."
";}; ?>
2000000){ echo "style='background:green; color:#fff'"; };?>>
".$kh_hoten."
"; };?>
0 && $cty_id!=43 && $cty_id!=76 && $branch_type==TYPE_IS_HOTEL){ ?>
0 && $branch_type==TYPE_IS_THUEPHONG){ ?>
>
calcStayTime($arr_ts, $arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT'],$time_out_full); if($arrLuuTru[0]['UUTIENGIO']){ $time_stay = strtotime($time_out_full)- strtotime($arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT']); echo "".$webhelper->timeToHourMinite($time_stay).""; }elseif(!isset($data['middle']) && !isset($data['last'])){ if($cty_id==6){ $arr_price = $mPhong->getPriceToArray($rw['PH_ID'],$arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT']); if(empty($arr_price['GIAGIO']) || $data['first']['day']==1){ echo "01d"; }else{ echo "".$webhelper->timeToHourMinite($data['first']['stayin']).""; } }else{ echo "".$webhelper->timeToHourMinite($data['first']['stayin']).""; } }elseif(!isset($data['middle'])){ if($data['first']['day']==1 && $data['last']['day']==1){ echo "02d"; }elseif($data['first']['day']==1 ){ echo "01d"; }else{ echo "".$webhelper->timeToHourMinite($data['last']['stayin']).""; } }else{ $d = $data['first']['day'] + $data['middle']['day'] + $data['last']['day']; if($d<10){ $d = "0".$d."d"; }else{ $d = $d."d"; } echo "".$d.""; } }else{ echo " "; } if($show_cus_info==1){ if($cty_id==33){ $time_text_color = "#000"; }elseif($cty_id==1){ $time_text_color = "#000"; }else{ $time_text_color = "#fff"; } echo "
"; if(!empty($arrLuuTru)){ if($arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_NOFORMAT']==null){ echo $arrLuuTru[0]['KLT_THOIDIEMDATPHONG_SHORT']; }else{ echo $arrLuuTru[0]['KLT_THOIDIEMNHANPHONG_SHORT']; } echo " - ".$arrLuuTru[0]['KLT_THOIDIEMTRADUKIEN_SHORT']; }; echo " ".$time_out; echo "
"; } ?>
0 && $rw['LOCKCARD_RA'] !=NULL && strtotime($rw['LOCKCARD_RA'])<= strtotime(date('Y-m-d H:i:s'))){ $title_card = date("H:i d/m/Y",strtotime($rw['LOCKCARD_RA'])); ?>
' title="Hết hạn: " style='position:absolute; bottom:15px; right:0px; background:url(images/expire_card.png) right no-repeat;padding-right:16px; font-weight:bold;color:gold'>
0 && $rw['LOCKCARD_RA'] !=NULL && strtotime($rw['LOCKCARD_RA'])<= strtotime(date('Y-m-d')." 12:00:00")){ $title_card = date("H:i d/m/Y",strtotime($rw['LOCKCARD_RA'])); ?>
' title="Hết hạn: " style='position:absolute; bottom:15px; right:0px; background:url(images/card_key.png) right no-repeat;padding-right:16px; font-weight:bold;color:gold'>
' title="Hết hạn: " style='position:absolute; bottom:15px; right:0px; background:url(images/s_key.png) right no-repeat;padding-right:16px; font-weight:bold;color:gold '>
>
">
">
 
"; } if($pnhom_i>0){ echo ""; } ?>
fetchRowBy('LYNB_IDCNH',$chinhanh_id); if (count($info_lynb) == 0){ $luuy_idnv = $authModel->getId(); $thoidiem = date('Y-m-d H:i:s'); $r2 = $mLYNB->insert(array('LYNB_NOIDUNG','LYNB_THOIDIEM','LYNB_IDNV','LYNB_IDCNH'),array('',$thoidiem,$luuy_idnv,$chinhanh_id)); $luuynv = ''; }else{ $luuynv = $info_lynb['LYNB_NOIDUNG']; } ?>
 
getBranchType()==TYPE_IS_HOTEL){echo "Khách đang ở và đã đặt"; }else{echo "Danh sách khách hàng"; };?>
 
getListElecRoom($chinhanh_id); ?>
fetchRow($rsph_elec)){ if($rw11['PH_TRANGTHAIDIEN']==1){ $class_elec_status = "red"; }else{ $class_elec_status = "orange"; } echo "
".$rw11['PH_TEN']."
"; } ?>