<?
$sub_menu	= "400600";			//-- kcp 결제 내역 13. 12. 25
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");
$token		= get_token();
$adm_sub_path	= true;			//-- 관리 디렉토리가 adm/sub.dir처럼 adm 하위에 있을 때 admin.head.php에서 경로 따로 지정

$g4[title]	= "KCP 결제 내역";
include_once("../admin.head.php");
include_once("config.php");
?>
<link href="style.css" rel="stylesheet">
<div class="h_title">KCP 결제 내역
	<div class="search_txt"><a href="?stx=">전체보기</a><? foreach($a_status as $k => $v) : ?><a href="?stx=<?=$k?>"><?=$v?>▽</a><? endforeach; ?></div>
</div>

<?
$cfgListCnt		= 25;											//-- 목록 수
$cfgGrpPageCnt	= 10;	

if(!$goPageNo)		$goPageNo	= 1;
$startRecordNo		= ($goPageNo - 1) * $cfgListCnt;
if($startRecordNo < 0) $strRecordNo	= 0;

//-- 목록 번호 구하기 ---------------------------
$lQuery			= "select count(db_recno) as totRec from zm_kcp_history";
$lResult		= mysql_query($lQuery);
$rdTotRec		= mysql_result($lResult, 0, totRec);
$iRecNo			= @intval($rdTotRec - (($goPageNo - 1) * $cfgListCnt));

$colspan		= 8;
if($stx) $s_where = "and db_status='$stx'";
$sRes			= mysql_query("select * from zm_kcp_history where 1 $s_where order by db_pay_datetime desc limit $startRecordNo, $cfgListCnt");
?>
<form name="pay_list" method="post">
<table width="100%" cellspacing="0" cellpadding="0">
<tr height="25" align="center">
	<td width="10%">아이디</td>
	<td width="20%">주문번호</td>
	<td width="7%">결제방법</td>
	<td width="10%">결제시간</td>
	<td width="7%">결제금액</td>
	<td width="20%">결제상품</td>
	<td width="10%">상태</td>
	<td width="6%">처리</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<? while($rdHsy = mysql_fetch_array($sRes)) : ?>
<tr height="25" align="center" class="his_rec">
	<td><?=$rdHsy[db_id]?></td>
	<td align="left"><?=$rdHsy[db_order_id]?> <?=($rdHsy[db_buyer_name])?"(".$rdHsy[db_buyer_name].")":""?></td>
	<td><?=$a_pay_way[$rdHsy[db_pay_way]]?></td>
	<td><?=$rdHsy[db_pay_datetime]?></td>
	<td align="right"><?=number_format($rdHsy[db_payment])?></td>
	<td align="left">&nbsp;&nbsp;&nbsp;<?=$rdHsy[db_product_name]?></td>
	<td><?=$a_status[$rdHsy[db_status]]?></td>
	<td><input type="button" onClick="if(confirm('내용을 삭제 합니다.')) document.location.href='kcp_process.php?mode=del&recno=<?=$rdHsy[db_recno]?>&goPageNo=<?=$goPageNo?>';" class="btn_del" value="삭제"></td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<? endwhile; ?>
<tr height="30">
	<td colspan='<?=$colspan-1?>'></td>
	<td><input type="button" onClick="if(confirm('지금까지 결제 내용을 모두 삭제합니다.')) if(confirm('한번 삭제 된 자료는 다시 복구되지 않습니다. 계속 진행 하시겠습니까?')) document.location.href='kcp_process.php?mode=alldel';" class="btn_del" value="모두삭제"></td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
</table>
</form>
<div><? include("listNo.php"); ?></div>
<?
include_once("../admin.tail.php");
?>
