<?
$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>
table tr td	{ color:#414141; }
table tr td input	{ color:#3C3D3E; font-family:Dotum; padding:3px; }
table tr td textarea	{ color:#3C3D3E; font-family:Dotum; padding:3px; line-height:160%; }
table tr td.col1	{ padding:3px; color:#71777F; font-weight:bold; }
table tr td.col2	{ padding:5px; color:#868687; }
.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; line-height:150%; }
</style>

<?//-- 모듈 선택
switch($zm_sms[sms_module]) {
	case "phps" : 
		$sSel[0]	= "selected";	//-- 스쿨호스팅
		break;
	case "tongkni" :
		$sSel[1]	= "selected";	//-- 통큰아이
		break;
}
?>
<?=subtitle("지음빌더 SMS")?>
<div class="subtitle_msg">SMS 모듈 설정을 할 수 있습니다.</div>

<table width="100%" cellspacing="1" cellpadding="0" class="tbl_box">
<colgroup width="20%">
<colgroup width="80%">
<tr>
	<td colspan='<?=$colspan?>'><b>SMS 발송모듈 선택</b></td>
</tr>
<tr class="list">
	<td class="col1">모듈선택</td>
	<td class="col2">
	<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="phps" <?=$sSel[0]?>>스쿨호스팅</option>
	<option value="tongkni" <?=$sSel[1]?>>통큰아이</option>
	</select>
	<input type="submit" value="선택" class="bttn_common">
	</form>
	</td>
</tr>
</table>
<?	
switch($zm_sms[sms_module]) {
	case "phps" :
		include("cfg_phps.php");			//-- 스쿨호스팅 SMS 모듈 설정
		break;
	case "tongkni" :
		include("cfg_tongkni.php");			//-- 통큰 아이 설정. 아이디/비밀번호 등록 등
		break;
	default :
		include("cfg_phps.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" class="tbl_box">
<colgroup width="5%">
<colgroup width="95%">
<tr>
	<td colspan='<?=$colspan?>'><b>SMS 환경설정</b></td>
</tr>
<tr class="list">
	<td class="col1"></td>
	<td>80Byte 넘는 문자는
	<select name="cutstring">
	<option value="1" <?=$sSel[0]?>>80Byte만</option>
	<!--<option value="2" <?=$sSel[1]?>>80Byte씩 잘라서 모두</option>-->
	</select> 전송하기
	</td>
</tr>
<tr><td colspan='<?=$colspan?>' class='line2'></td></tr>
<tr class="list">
	<td class="point"></td>
	<td>SMS 1건당(80Byte) <input type="text" name="consume" value="<?=number_format($zm_sms[consume]);?>" size="3" class="money">포인트 소모</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?>' align="center"><input type="submit" value="적용하기" class="bttn_adj"></td></tr>
</table>
</form>

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

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