<?
$sub_menu	= "400500";			//-- 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]/adm/zm.sms/sms_createtable.php");
include_once($g4[path]."/zm.extend/sms/sms_ini.php");

$colspan		= 2;
?>
<script language="javascript">
function artsms(th) {
	if(th.checked) {
		alert("SMS 사용 기록 정보를 모두 초기화 합니다.\n한번 삭제한 자료는 다시 복구되지 않습니다.");
	}
}
</script>

<style type="text/css">
	td, span, div, a, textarea	{ font-family:Dotum; font-size:11px; letter-spacing:-1px; }
	.list		{ padding:5px; height:22px; }
	.frm		{ margin:0px; }
	.point		{ color:#808000; font-size:11px; }
	.money		{ color:#FF0000; text-align:right; }
	.divbtn		{ text-align:center; padding:5px; }

	.btnadj		{ border:2px solid #878F87; backgrouind-color:#F0FFF0; padding:3px; cursor:hand; }
</style>
<?//-- 모듈 선택
if($zm_sms[sms_module] == "sms_tongkni")	$sSel[0]	= "selected";
?>
<div>zmb.sms_00.00.20 for G4</div>
<table width="100%" cellspacing="1" cellpadding="0">
<colgroup width="20%">
<colgroup width="80%">
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<tr class='bgcol1 bold col1 ht'>
	<td colspan='<?=$colspan?>'>> SMS 발송모듈 선택</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<tr class="list">
	<td>모듈선택</td>
	<td>
	<form name="frm_smsmdl" method="post" class="frm" action="./sms_process.php">
	<input type="hidden" name="mode" value="sms_module">
	<select name="sms_module">
	<option value="tongkni" <?=$sSel[0]?>>통큰아이</option>
	</select>
	<input type="submit" value="선택">
	</form>
	</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
</table>
<?	
switch($zm_sms[sms_module]) {
	case "sms_tongkni" :
		include("cfg_tongkni.php");
		break;
	default :
		include("cfg_tongkni.php");
		break;
}

if($zm_sms[cutstring] == "1")	$sSel[0]		= "selected";
else								$sSel[1]		= "selected";
?>
<p />
<!-- 공통 환경 설정 -->
<form name="frmzm_sms" method="post" class="frm" onSubmit="return sendCfg(this);">
<input type="hidden" name="mode" value="sms_common">
<table width="100%" cellspacing="1" cellpadding="0">
<colgroup width="5%">
<colgroup width="95%">
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<tr class='bgcol1 bold col1 ht'>
	<td colspan='<?=$colspan?>'>> SMS 환경설정</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<tr class="list">
	<td class="point">></td>
	<td>90Byte 넘는 문자는
	<select name="cutstring">
	<option value="1" <?=$sSel[0]?>>90Byte만</option>
	<option value="2" <?=$sSel[1]?>>90Byte씩 잘라서 모두</option>
	</select> 전송하기
	</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<tr class="list">
	<td class="point">></td>
	<td>SMS 1건당(90Byte) <input type="text" name="consume" value="<?=number_format($zm_sms[consume]);?>" size="3" class="money">포인트 소모</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<tr class="list">
	<td class="point">></td>
	<td>회원등급이 
	<select name="memlevel">
<?	for($i = 1; $i <= 10; $i++) : 
		if($zm_sms[memlevel] == "$i") $sSel = "selected"; else $sSel = ""; ?>
		<option value="<?=$i?>" <?=$sSel?>><?=$i?></option>
<?	endfor; ?>
	</select> 이상은 SMS 발송 해도 포인트가 소모되지 않는다.</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line1'></td></tr>
<tr><td colspan='<?=$colspan?>' class="divbtn"><input type="submit" value=" 적 용 하 기 " class="btnadj"></td></tr>
</table>
</form>

<script language="javascript">
function sendCfg(f) {
	f.action		= "./sms_process.php";

	return true;
}
</script>
<?
include_once("../admin.tail.php");
?>
