<?
$sub_menu	= "400520";												//-- sms 관리 2011. 05. 28
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]	= "SMS 관리";
include_once("../admin.head.php");
include_once("$g4[path]/zm.extend/sms/sms_ini.php");
?>
<style type="text/css">
.tbl_box	{ border:1px solid #CBCBCB; border-top:2px solid #989898; }
.tbl_box tr th	{ background:#F7F7F7; height:30px; border-right:1px solid #EFEFEF; border-bottom:1px solid #EFEFEF; }
.tbl_box tr th:last-child	{ border-right:0; }
.tbl_box tr td	{ padding:6px; border-right:1px solid #EFEFEF; border-bottom:1px solid #EFEFEF; }
.tbl_box tr td:last-child	{ border-right:0; }
.tbl_box tr:last-child td	{ border-bottom:0; }
div.msg		{ font:normal 11px Dotum; padding:4px; }
</style>
<script language="javascript">
</script>
<?
$cfgListCnt		= 25;											//-- 목록 수
$cfgGrpPageCnt	= 10;	

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

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

$aSndTyp		= array("2"=>"R");
$colspan		= 8;
$sRes			= mysql_query("select * from zm_sms_history order by ds_send_date desc limit $startRecordNo, $cfgListCnt");
?>
<?=subtitle("SMS 발송내역")?>
<div class="subtitle_msg">지음빌더에서 SMS 모듈을 통해서 전송 된 SMS 내역입니다.</div>

<table width="100%" cellspacing="1" cellpadding="0" class="tbl_box">
<tr height="22" align="center">
	<th width="7%">보낸사람</th>
	<th width="10%">보낸번호</th>
	<th width="7%">받는사람</th>
	<th width="10%">받는번호</th>
	<th width="35%">내용</th>
	<th width="15%">날짜</th>
	<th width="4%">전송</th>
	<th width="2%"></th>
</tr>
<? while($rdHsy = mysql_fetch_array($sRes)) : ?>
<tr height="20" align="center">
	<td><?=$rdHsy[ds_send_name]?></td>
	<td><?=$rdHsy[ds_send_pcs]?></td>
	<td><?=$rdHsy[ds_receive_name]?></td>
	<td><?=$rdHsy[ds_receive_pcs]?></td>
	<td align="left"><a href="#" title="<?=$rdHsy[ds_send_msg]?>"><?=cut_str($rdHsy[ds_send_msg], 75)?></a></td>
	<td><?=date("y-m-d H:i:s", $rdHsy[ds_send_date])?></td>
	<td><?=$aSndTyp[$rdHsy[ds_send_type]]?></td>
	<td><a href="#" onClick="if(confirm('전송 내역을 제거 합니다. (<?=$rdHsy[ds_receive_pcs]?>)')) document.location.href='sms_process.php?mode=hstydel&recno=<?=$rdHsy[ds_recno]?>';"><img src="img/icon_del.gif"></a></td>
</tr>
<? endwhile; ?>
</table>
<div><? include("listNo.php"); ?></div>
<div class="clean">
<form name="FRM_CLN" method="post" action="sms_process.php">
<input type="hidden" name="mode" value="oldlistdrop">
<select name="termdate">
<? for($i = 3; $i <= 60; $i++) : ?>
	<option value="<?=$i?>"><?=$i?></option>
<? endfor; ?>
</select>일 이상 지난 기록 모두 <input type="button" value="삭제" onclick="if(confirm('기록을 삭제 할까요?')) FRM_CLN.submit();">
</form>
</div>
<?
include_once("../admin.tail.php");
?>
