<?
$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">
	td, span, div, a, textarea	{ font-family:Dotum; font-size:11px; letter-spacing:0px; }
	.line1		{ height:1px; }
	.clean		{ margin:10px; text-align:center; }
</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");
?>
<table width="100%" cellspacing="1" cellpadding="0">
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>
<tr class='bgcol1 bold col1 ht'>
	<td colspan='<?=$colspan?>'>> SMS 발송내역</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>

<tr height="22" align="center">
	<td width="7%">보낸사람</td>
	<td width="10%">보낸번호</td>
	<td width="7%">받는사람</td>
	<td width="10%">받는번호</td>
	<td width="35%">내용</td>
	<td width="15%">날짜</td>
	<td width="4%">전송</td>
	<td width="2%"></td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line1'></td></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>
<tr><td colspan='<?=$colspan?>' class='line1'></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");
?>
