billRoomList.php 9.48 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminRent.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?> 
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftRentManage.php" ?>
<?
	$obj = new AdminOperate($_REQUEST, "") ;
	
	$list = $obj->getListOfRoomHistory() ;
	//$current_info = $obj->getInfoOfRoomForBill();
	//$list = array();
	$vnum = $obj->virtualNum ;
	$rurl		= pack("H*", $_REQUEST["rurl"]) ;
	//echo $rurl;
?>
<script type="text/javascript">
	var _rurl = "<?=$rurl?>";
	
	$(document).ready(function(){
		//=====프레입웤 변수들==================================================================================//
		var FORM_TARGET_CLS_NM		= "DIV#Contents"	;		// 폼을 동적 wrap 할 타겟 ID이름
		var FORM_NAME				= "nf"		;		// 폼이름
		var FORM_METHOD				= "GET"		;		// 폼 메쏘드
		var FORM_USE_FILE			= false		;		// 파일폼 사용 여부
		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 }) ;
		
		// 페이징
		$(".jPage").click2(function(){
			jForm.ci() ;
			jForm.mi("page",$(this).attr("page")) ;			
			jForm.submit() ;
		}) ;
		

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

		$(".jCancel").click2(function(){
			location.href = _rurl;
		});
		
		
		$(".jSearch").click2(function(){
			jForm.ci() ;
			jForm.submit() ;
		});

		$(".jView").click2(function(){
			var no = $(this).attr("no");
			location.href = "/admin/rentManage/buildingView.php?no=" + no + "&rurl=" + jQuery.rich.bin2hex(document.URL);
		});


		$(".jAdd").click2(function(){
			location.href = "/admin/rentManage/buildingView.php?rurl=" + jQuery.rich.bin2hex(document.URL);
		});


		$(".jAddUserExcel").click2(function(){
			alert("준비중입니다.");
			return false;
			window.open('/admin/popup/addUserExcelUpload.php','',"width=700,height=800,scrollbars=yes");		
		});


		$(".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);
			}
			
		});

		$(".jTypeMonth").click2(function(){
			var no =$(this).attr("no");
			var monthPopup = window.open("/admin/popup/billMonth.php?no="+ <?=$_GET["no"]?>, '_blank' , "width=1200,height=800,top=100,left=200,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,titlebar=no,toolbar=no");
		});

		$(".jTypeUtil").click2(function(){
			var utilPopup = window.open("/admin/popup/billUtil.php?no="+ <?=$_GET["no"]?>, '_blank' , "width=1200,height=800,top=100,left=200,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,titlebar=no,toolbar=no");
		});

		$(".jTypeEnd").click2(function(){
			var endPopup = window.open("/admin/popup/billEnd.php?no="+ <?=$_GET["no"]?>, '_blank' , "width=1200,height=800,top=100,left=200,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,titlebar=no,toolbar=no");
		});


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



	function deleteAction(noArr)
	{
		$.ajax({
			url : "/action_front.php?cmd=AdminRent.delBuilding",
			async : false,
			cache : false,
			dataType : "json",
			data : {
				"no"	: noArr
			},
			success : function(data){
				alert("삭제되었습니다");
				location.reload();
			}
		});
	}



</script>


<div id="Contents"  class="notice">
    
    <h1>청구서리스트</h1>
    
    
    <div class="data">
    <input type="hidden" name="no" value="<?=$_REQUEST[no]?>" />
		<div class="btngroupright">
			<input type="button" class="button medium gray jTypeMonth" value="월세" />
			<input type="button" class="button medium gray jTypeUtil" value="공과금" />
			<input type="button" class="button medium gray jTypeEnd" value="퇴실정산서" />
		</div>
        <table class="datacList">
            <thead>
                <tr>
                    <th class="no" width="5%">No</th>
                    <th width="10%">년/월</th>
                    <th width="10%">입주자</th>
                    <th width="10%">관리유형</th>
                    <th width="15%">보증금</th>
                    <th width="10%">예치금</th>
                    <th width="10%">계약일</th>
                    <th width="10%">입주일</th>
                    <th width="10%">계약만료일</th>
                    <th width="10%">퇴실예정일</th>
                </tr>
            </thead>
            <tbody><!-- 10줄 리스트// 마지막 tr에 class="last" 넣어주세요 -->
            
           	 <?if(sizeof($current_info) != 0){ $vnum++;?>
            		<tr class="last" >
                    <td class="no center">
                        <?=$vnum--?>
                    </td>
					<td class="center">
					<?=$current_info["in_year"]."/".$current_info["in_month"]?>
                    </td>
                    <td class="center">
                    <?=$current_info["contractor_name"]?>
                    </td>
                    <td class="center">
                    <?
                    if($current_info["manage_type"] == $obj->BUILDING_MANAGE_TYPE_LONG_CONS) echo "장기위탁";
                    else if($current_info["manage_type"] == $obj->BUILDING_MANAGE_TYPE_SHORT_CONS) echo "단기위탁";
                    else if($current_info["manage_type"] == $obj->BUILDING_MANAGE_TYPE_LONG_SELF) echo "장기자기";
                    else if($current_info["manage_type"] == $obj->BUILDING_MANAGE_TYPE_SHORT_SELF) echo "단기자기";
                    ?>
                    </td>
                    <td class="center">
                    <?=$current_info["deposit"]?>
                    </td>
                    <td class="center">
                    <?=$current_info["balance"]?>
                    </td>
                    <td class="center">
                    <?=$current_info["contract_date"]?>
                    </td>
                    <td class="center">
                    <?=$current_info["move_in_date"]?>
                    </td>
                    <td class="center">
                    <?=$current_info["contract_expire_date"]?>
                    </td>
                    <td class="center">
                    	<?=$current_info["leaving_due_date"]?>
                    </td>

                </tr>
            	<?}?>
            	
                <? for($i=0; $i<sizeof($list); $i++){ ?>
                <tr class="<?=(sizeof($list)-1 == $i) ? "last" : "datacLists"?>">
                    <td class="no center">
                        <?=$vnum--?>
                    </td>
					<td class="center">
					<?=$list[$i]["in_year"]."/".$list[$i]["in_month"]?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["contractor_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_SHORT_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_SELF) echo "단기자기";
                    ?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["deposit"]?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["balance"]?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["contract_date"]?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["move_in_date"]?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["contract_expire_date"]?>
                    </td>
                    <td class="center">
                    	<?=$list[$i]["leaving_due_date"]?>
                    </td>

                </tr>
                <? } ?>
                
                
                
                
                <?if(sizeof($list) == 0 && sizeof($current_info) == 0){?>
                <tr class="last">
                    <td class="no center" colspan="11">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 jCancel">목록으로</span>
         </div>
    </div>

        
</div>

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