utility.php 1.48 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/ApiBill.php"; ?>
<?
	$obj = new ApiBill($_REQUEST);
	
	$result = $obj->getUtilityList() ;

	$list = $result["list"] ;
	$data = $result["data"] ;
	
	
// 	echo json_encode($list) ;
?>

<!-- 건물명/년도 -->
<div class="year">
	<ul>
		<li><a><?= $data["buildingName"] ?> <?= $data["roomName"] ?></a></li>
		<li><a class="jPopup" page="popupYear.php" rpage="utility.php"><?= $_REQUEST["year"] == "" ? date("Y") : $_REQUEST["year"] ?></a></li>
	</ul>
	<div style="clear:both"></div>
</div>
<!-- 건물명/년도 -->

<!-- 리스트 -->
<section>
	<? for($i=0; $i<sizeof($list); $i++) {
			$row = $list[$i] ;		
			$month = explode("-", $row["month"]) ;
	?>
	<!-- 리스트 1개당 ul반복 -->
	<ul class="jUtilityView" _no="<?= $row["no"] ?>">
		<li>
			<div class="date">
				<p><?= $month[1]?></p><!-- 날짜 -->
			</div>
		</li>
		<li>
			<p style="margin:20px 0px 7px 0px;"><?= $row["monthDate"] ?> (전기+가스+수도)</p>
			<p class="price"><?= number_format($row["current_month_charge"]) ?></p><!-- 금액 -->
		</li>
		<li class="status_box">
		<? if($row["is_paid"] == 1) { ?>
			<div class="status orange"><a>납입</a></div>
		<? } else if($row["is_paid"] == 0) {  ?>
			<div class="status red"><a>연체</a></div>
		<? } else if($row["is_paid"] == 2) {  ?>
			<div class="status orange"><a>청구</a></div>
		<? } ?>
		</li>
		<div style="clear:both;"></div>
	</ul>
	<!-- 리스트 1개당 ul반복 -->
	<? } ?>
</section>
<!-- 리스트 -->