560976c8f5f9ea4b5d570d2a74d68456c33b0e30.svn-base 10.3 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminRent.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/popupHeader.php" ?> 

<? 
	$obj = new AdminRent($_REQUEST, "") ;
	
	//$list = $obj->getListOfGroup() ;
	$list = $obj->getListOfRoom();
	$vnum = $obj->virtualNum ;
	$bKey = $_REQUEST["no"]
?>
<script language="javascript">
	$(document).ready(function(){
		//alert(<?=$_REQUEST["no"]?>);
		//=====프레입웤 변수들==================================================================================//
		var FORM_TARGET_CLS_NM		= "DIV#Contents"	;		// 폼을 동적 wrap 할 타겟 ID이름
		var FORM_NAME				= "alf"		;		// 폼이름
		var FORM_METHOD				= "GET"	;		// 폼 메쏘드
		var FORM_USE_FILE			= true		;		// 파일폼 사용 여부
		//var FORM_ACTION				= "/action_front.php" ; 
		var FORM_ACTION = document.URL;
		
		var NEXT_CMD				= ""			;		// 다은 수행 할 cmd
		//=====================================================================================================//
		
		var jForm = $(FORM_TARGET_CLS_NM).mf({ "name" : FORM_NAME , "method" : FORM_METHOD , "action" : FORM_ACTION , "useFile" : FORM_USE_FILE }) ;
		var dates = $('.jRsvDate').datepicker({
			showMonthAfterYear:true,
			inline: true,
			changeMonth: true,
			changeYear: true,   
			dateFormat : 'yy-mm-dd',
			dayNamesMin:['일', '월', '화', '수', '목', '금', ' 토'],
			monthNames:['1월','2월','3월','4월','5월','6월','7 월','8월','9월','10월','11월','12월'],
			monthNamesShort:['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
			showButtonPanel: true, currentText: '오늘 ' , closeText: '닫기',   
			onSelect: function(selectedDate) {
		}
	});
		// 페이징
		$(".jPage").click2(function(){
			jForm.ci() ;
			jForm.mi("page",$(this).attr("page")) ;			
			jForm.submit() ;
		});
		
		$(".jSubmit").click2(function(){
			
		});

		$(".jClose").click2(function(){
			window.close();
		});

		$(".jAdd").click2(function(){
			location.href = "/admin/popup/roomView.php?Bno="+<?=$_GET["no"]?>+ "&rurl=" + jQuery.rich.bin2hex(document.URL);
		});

		$(".jView").click2(function(){
			var no = $(this).attr("no");
			location.href = "/admin/popup/roomView.php?no=" + no +"&Bno="+ <?=$_GET["no"]?>+ "&rurl=" + jQuery.rich.bin2hex(document.URL);
		});


		$(".jSearch").click2(function(){
			jForm.ci() ;
			jForm.submit() ;
		});

		$(".jDel").click2(function(){
			
			var no = $(this).attr("no");
			var noArr = new Array(no);

			if(confirm("정말 삭제하시겠습니까?"))
			{
				deleteAction(noArr);
			}
		}) ;

		// 단체 삭제
		$(".jDelMulti").click2(function(){
			

			var noArr = new Array();
			var noCount = $(".jNo:checked").length;

			if(noCount == 0)
			{
				alert("삭제할 대상을 하나 이상 선택해주세요.");
				return false;
			}


			if(confirm("정말 삭제하시겠습니까?"))
			{
				for(var i = 0; i < noCount; i++ )
				{
					noArr[i] = $(".jNo:checked:eq(" + i + ")").val();
				}

				deleteAction(noArr);
			}
			
		});

		$("#jCheckAll").change(function(){
			if($(this).is(":checked"))
				$(".jNo").prop("checked", true);
			else
				$(".jNo").prop("checked", false);
		});

		$("#search_type").change(function(){
			jForm.ci() ;
			jForm.submit() ;
		});

	}) ;

	function deleteAction(noArr)
	{
		$.ajax({
			url : "/action_front.php?cmd=AdminRent.delRoom",
			async : false,
			cache : false,
			dataType : "json",
			data : {
				"no"	: noArr
			},
			success : function(data){
				alert("삭제되었습니다");
				location.reload();
			}
		});
	}
	
</script>
	
<div id="Contents"  class="notice" style="width:1000px;">
    <h1>호실 리스트</h1>
    
    <div class="btngroupright" style="width:auto;">
		<input type="button" class="button bigrounded blue jAdd" style="margin-top:20px" value="등록" />
		<input type="button" class="button bigrounded blue jDelMulti" value="삭제" />
		<input type="hidden" name="no" value="<?=$_GET["no"]?>" />
		
	</div>
    <div style="margin-top:30px">
    <select name="search_type" id="search_type">
			<option value="">전체</option>
			<option value="<?=$obj->ROOM_TYPE_RESIDENT?>" <?= ($_REQUEST["search_type"] == $obj->ROOM_TYPE_RESIDENT) ? "SELECTED" : "" ?>>입주</option>
			<option value="<?=$obj->ROOM_TYPE_EMPTY?>" <?= ($_REQUEST["search_type"] == $obj->ROOM_TYPE_EMPTY) ? "SELECTED" : "" ?>>공실</option>
			<option value="LV"  <?= ($_REQUEST["search_type"] == "LV") ? "SELECTED" : "" ?>>퇴실예정</option>
			<option value="ET"  <?= ($_REQUEST["search_type"] == "ET") ? "SELECTED" : "" ?>>입실예정</option>
			<option value="<?=$obj->ROOM_TYPE_UNDER_CONTRACT?>" <?=($_REQUEST["search_type"] == $obj->ROOM_TYPE_UNDER_CONTRACT) ? "SELECTED" : "" ?>>협의중</option>
			<option value="<?=$obj->ROOM_TYPE_CONTRACT_EXTENSION?>" <?= ($_REQUEST["search_type"] == $obj->ROOM_TYPE_CONTRACT_EXTENSION) ? "SELECTED" : "" ?>>계약연장</option>
		</select>
    </div>
    <div class="data">
    
        <fieldset class="search" style="margin-top:10px;">
            
            <div class="jSearchArea" >
                <label for='search_text'>
                    <span># 호실, 입주자, 연락처, 차량번호</span>
					<input type="text" id="search_text" name="search_text" class="wm" value="<?=$_REQUEST['search_text']?>" />
                </label>
                
                <label for='in_date'>
                    <span># 입주일</span>
					<input type="text" name="in_date" value="<?=$_REQUEST['in_date']?>" class="jRsvDate"  />
                </label>
                
                <label for='expire_date'>
                    <span># 계약만료일</span>	
					<input type="text" name="expire_date" value="<?=$_REQUEST['expire_date']?>" class="jRsvDate" />
                </label>
				<input type="button" class="button bigrounded blue jSearch" style="margin-left:30px;" value="검색" />
				
            </div>

        </fieldset>
	
        <table class="datacList" id="datacList">
            <thead>
                <tr>
                	<th class="no" width="8%">No</th>
                    <th width="8%"><input type="checkbox" id="jCheckAll"></th>
                    <th width="8%">호실</th>
                    <th width="8%">관리유형</th>
                    <th width="8%">입주자</th>
                    <th width="8%">연락처</th>
                    <th width="8%">상태</th>
                    <th width="8%">계약일</th>
                    <th width="8%">입주일</th>
                    <th width="8%">계약만료일</th>
                    <th width="8%">차량번호</th>
                    <th width="8%">-</th>
                </tr>
            </thead>
            <tbody><!-- 10줄 리스트// 마지막 tr에 class="last" 넣어주세요 -->
                <? for($i=0; $i<sizeof($list); $i++){ ?>
                <tr class="<?=(sizeof($list)-1 == $i) ? "last" : "datacLists"?>">
                    <td class="no center">
                        <?=$vnum--?>
                    </td>
					<td class="center">
                        <input type="checkbox" class="jNo" value="<?=$list[$i]["no"] ?>" >
                    </td>
                    <td class="center">
                    	<?=$list[$i]["name"]?>
                    </td>
					<td class="center">               
						<?
						if($list[$i]["manage_type"] == $obj->BUILDING_MANAGE_TYPE_LONG_CONS)
							echo "장기위탁";
						else if($list[$i]["manage_type"] == $obj->BUILDING_MANAGE_TYPE_LONG_SELF)
							echo "장기자기";
						else if($list[$i]["manage_type"] == $obj->BUILDING_MANAGE_TYPE_SHORT_CONS)
							echo "단기위탁";
						else if($list[$i]["manage_type"] == $obj->BUILDING_MANAGE_TYPE_SHORT_SELF)
							echo "단기자기";
						?>
                    </td>
                    <td class="center">
                    	<?=$list[$i]["contractor_name"]?>
                    </td>
                    <td class="center">
                    	<?=$list[$i]["contractor_tel"]?>
                    </td>
                    <td class="center">
                    	<?
                    	if($list[$i]["contract_status"] == $obj->ROOM_TYPE_RESIDENT)
                    		echo "입주";
                    	else if($list[$i]["contract_status"] == $obj->ROOM_TYPE_EMPTY)
                    		echo "공실";
                    	else if($list[$i]["contract_status"] == $obj->ROOM_TYPE_UNDER_CONTRACT)
                    		echo "협의중";
                    	else if($list[$i]["contract_status"] == $obj->ROOM_TYPE_CONTRACT_EXTENSION)
                    		echo "계약연장";
                    	?>
                    </td>
                    <td class="center">
                    	<?
                    	if($list[$i]["contract_date"] != "0000-00-00")
                    		echo $list[$i]["contract_date"];
                    	?>
                    </td>
                    <td class="center">
                    	<?
                    	if($list[$i]["move_in_date"] != "0000-00-00")
                    		echo $list[$i]["move_in_date"];
                    	?>
                    </td>
                    <td class="center">
                    	<?
                    	if($list[$i]["contract_expire_date"] != "0000-00-00")
                    		echo $list[$i]["contract_expire_date"];
                    	?>
                    </td>
                    <td class="center">
                    	<?=$list[$i]["contractor_car_no"]?>
                    </td>
                    <td class="center">
                    	<input type="button" class="button searchsmall white jView" value="상세보기" no="<?=$list[$i]["no"]?>" />
                    	<input type="button" class="button searchsmall white jDel" value="삭제" no="<?=$list[$i]["no"]?>" />
                    </td>

                </tr>
                <? } ?>
                <?if(sizeof($list) == 0){?>
                <tr class="last">
                    <td class="no center" colspan="12">No Data</td>
                </tr>
                <?}?>
            </tbody>
        </table>  
        
        <!-- Pagination -->
        <? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/pageNavigation.php" ?>
        <!--//Pagination -->
        <div class="btngroupright">
           <span class="button bigrounded blue jClose">닫기</span>
        </div>
    </div>

<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/footer.php" ?>