그누보드5 정식버전

This commit is contained in:
chicpro
2014-06-09 14:48:44 +09:00
parent 0243dabe20
commit 7983affa68
1174 changed files with 136960 additions and 0 deletions

15
adm/sms_admin/_common.php Normal file
View File

@ -0,0 +1,15 @@
<?php
define('G5_IS_ADMIN', true);
include_once ('../../common.php');
include_once(G5_ADMIN_PATH.'/admin.lib.php');
if (!strstr($_SERVER['PHP_SELF'], 'install.php')) {
if(!mysql_num_rows(mysql_query(" show tables like '{$g5['sms5_config_table']}' ")))
goto_url('install.php');
// SMS 설정값 배열변수
//$sms5 = sql_fetch("select * from ".$g5['sms5_config_table'] );
}
add_stylesheet('<link rel="stylesheet" href="'.G5_SMS5_ADMIN_URL.'/css/sms5.css">', 0);
?>

View File

@ -0,0 +1,51 @@
<?php
$sub_menu = "900800";
include_once("./_common.php");
@include_once(G5_PLUGIN_PATH."/sms5/JSON.php");
if( !function_exists('json_encode') ) {
function json_encode($data) {
$json = new Services_JSON();
return( $json->encode($data) );
}
}
ajax_auth_check($auth[$sub_menu], "r");
$err = '';
$arr_ajax_msg = array();
$exist_hplist = array();
if( !$bk_hp )
$err = '휴대폰번호를 입력해 주십시오.';
$bk_hp = get_hp($bk_hp);
$sql = " select count(*) as cnt from {$g5['sms5_book_table']} where bk_hp = '$bk_hp' ";
if($w == 'u' && $bk_no)
$sql .= " and bk_no <> '$bk_no' ";
$row = sql_fetch($sql);
if($row['cnt'])
$err = '같은 번호가 존재합니다.';
// 수정일 때 회원정보에서 중복체크
if(!$row['cnt'] && $w == 'u') {
$sql = " select mb_id from {$g5['member_table']} where mb_hp = '{$bk_hp}' and mb_hp <> '' ";
if( $mb_id )
$sql .= " and mb_id <> '{$mb_id}' ";
$result = sql_query($sql);
while($row = sql_fetch_array($result)){
$exist_hplist[] = $row['mb_id'];
}
}
$arr_ajax_msg['error'] = $err;
$arr_ajax_msg['exist'] = $exist_hplist;
die( json_encode($arr_ajax_msg) );
?>

View File

@ -0,0 +1,83 @@
<?php
$sub_menu = "900300";
include_once("./_common.php");
@include_once(G5_PLUGIN_PATH."/sms5/JSON.php");
if( !function_exists('json_encode') ) {
function json_encode($data) {
$json = new Services_JSON();
return( $json->encode($data) );
}
}
ajax_auth_check($auth[$sub_menu], "r");
$page_size = 6;
if (!$page) $page = 1;
if (is_numeric($fg_no))
$sql_group = " and fg_no='$fg_no' ";
else
$sql_group = "";
if ($st == 'all') {
$sql_search = "and (fo_name like '%{$sv}%' or fo_content like '%{$sv}%')";
} else if ($st == 'name') {
$sql_search = "and fo_name like '%{$sv}%'";
} else if ($st == 'content') {
$sql_search = "and fo_content like '%{$sv}%'";
} else {
$sql_search = '';
}
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_form_table']} where 1 $sql_group $sql_search");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
$group = array();
$qry = sql_query("select * from {$g5['sms5_form_group_table']} order by fg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_form_table']} where fg_no=0");
$no_count = $res['cnt'];
$count = 1;
$qry = sql_query("select * from {$g5['sms5_form_table']} where 1 $sql_group $sql_search order by fo_no desc limit $page_start, $page_size");
$list_text = "";
if( !$total_count ){
$list_text .="
<li class=\"empty_list\">
데이터가 없습니다.
</li>
";
}
while($res = sql_fetch_array($qry))
{
$tmp = sql_fetch("select fg_name from {$g5['sms5_form_group_table']} where fg_no='{$res['fg_no']}'");
if (!$tmp)
$group_name = '미분류';
else
$group_name = $tmp['fg_name'];
$list_text .="
<li class=\"screen_list sms5_box\">
<span class=\"box_ico\"></span>
<textarea readonly class=\"sms_textarea box_txt box_square\" onclick=\"emoticon_list.go({$res['fo_no']})\">{$res['fo_content']}</textarea>
<textarea id=\"fo_contents_{$res['fo_no']}\" style=\"display:none\">{$res['fo_content']}</textarea>
<strong class=\"emo_tit\">".cut_str($res['fo_name'],20)."</strong>
</li>
";
}
$arr_ajax_msg['error'] = "";
$arr_ajax_msg['list_text'] = $list_text;
$arr_ajax_msg['page'] = $page;
$arr_ajax_msg['total_count'] = $total_count;
$arr_ajax_msg['total_page'] = $total_page;
die( json_encode($arr_ajax_msg) );
?>

View File

@ -0,0 +1,43 @@
<?php
$sub_menu = "900300";
include_once("./_common.php");
$colspan = 3;
auth_check($auth[$sub_menu], "r");
$no_group = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no=1");
$group = array();
$qry = sql_query("select * from {$g5['sms5_book_group_table']} where bg_no>1 order by bg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
?>
<div class="tbl_head01 tbl_wrap">
<table>
<thead>
<tr>
<th scope="col">그룹명</th>
<th scope="col">수신가능</th>
<th scope="col">추가</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="javascript:sms_obj.person(1)"><?php echo $no_group['bg_name']?></a></td>
<td class="td_num"><?php echo number_format($no_group['bg_receipt'])?></td>
<td class="td_mngsmall"><button type="button" class="btn_frmline" onclick="sms_obj.group_add(1, '<?php echo $no_group['bg_name']?>', '<?php echo number_format($no_group['bg_receipt'])?>')">추가</button></td>
</tr>
<?php
$line = 1;
for ($i=0; $i<count($group); $i++) {
$bg = 'bg'.($line++%2);
?>
<tr class="<?php echo $bg; ?>">
<td><a href="javascript:sms_obj.person(<?php echo $group[$i]['bg_no']?>)"><?php echo $group[$i]['bg_name']?></a></td>
<td class="td_num"><?php echo number_format($group[$i]['bg_receipt'])?></td>
<td class="td_mngsmall"><button type="button" class="btn_frmline" onclick="sms_obj.group_add(<?php echo $group[$i]['bg_no']?>, '<?php echo $group[$i]['bg_name']?>', '<?php echo number_format($group[$i]['bg_receipt'])?>')">추가</button></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>

View File

@ -0,0 +1,57 @@
<?php
$sub_menu = "900300";
include_once("./_common.php");
@include_once(G5_PLUGIN_PATH."/sms5/JSON.php");
if( !function_exists('json_encode') ) {
function json_encode($data) {
$json = new Services_JSON();
return( $json->encode($data) );
}
}
ajax_auth_check($auth[$sub_menu], "r");
$lev = array();
for ($i=1; $i<=10; $i++)
{
$lev[$i] = 0;
}
$qry = sql_query("select mb_level, count(*) as cnt from {$g5['member_table']} where mb_sms=1 and not (mb_hp='') group by mb_level");
while ($row = sql_fetch_array($qry))
{
$lev[$row['mb_level']] = $row['cnt'];
}
$str_json = array();
$tmp_str = '';
$tmp_str .= '
<div class="tbl_head01 tbl_wrap">
<table>
<thead>
<tr>
<th scope="col">권한</th>
<th scope="col">수신가능</th>
<th scope="col">추가</th>
</tr>
</thead>
<tbody>';
for ($i=1; $i<=10; $i++) {
$bg = 'bg'.($line++%2);
$tmp_str .= '
<tr class="'.$bg.'">
<td>'.$i.' 레벨</td>
<td class="td_numbig">'.number_format($lev[$i]).'</td>
<td class="td_mng"><button type="button" class="btn_frmline" onclick="sms_obj.level_add('.$i.', \''.number_format($lev[$i]).'\')">추가</button></td>
</tr>';
}
$tmp_str .= '
</tbody>
</table>
</div>';
$str_json['html'] = $tmp_str;
echo json_encode($str_json);
?>

View File

@ -0,0 +1,166 @@
<?php
$sub_menu = "900300";
include_once("./_common.php");
$page_size = 10;
$colspan = 5;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "휴대폰번호 관리";
if ($page < 1) $page = 1;
if (is_numeric($bg_no))
$sql_group = " and bg_no='$bg_no' ";
else
$sql_group = "";
if ($st == 'all') {
$sql_search = "and (bk_name like '%{$sv}%' or bk_hp like '%{$sv}%')";
} else if ($st == 'name') {
$sql_search = "and bk_name like '%{$sv}%'";
} else if ($st == 'hp') {
$sql_search = "and bk_hp like '%{$sv}%'";
} else {
$sql_search = '';
}
if ($ap > 0)
$sql_korean = korean_index('bk_name', $ap-1);
else {
$sql_korean = '';
$ap = 0;
}
if ($no_hp == 'yes') {
set_cookie('cookie_no_hp', 'yes', 60*60*24*365);
$no_hp_checked = 'checked';
} else if ($no_hp == 'no') {
set_cookie('cookie_no_hp', '', 0);
$no_hp_checked = '';
} else {
if (get_cookie('cookie_no_hp') == 'yes')
$no_hp_checked = 'checked';
else
$no_hp_checked = '';
}
//if ($no_hp_checked == 'checked')
$sql_no_hp = "and bk_hp <> '' and bk_receipt=1";
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where 1 $sql_group $sql_search $sql_korean $sql_no_hp");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where bk_receipt=1 $sql_group $sql_search $sql_korean $sql_no_hp");
$receipt_count = $res['cnt'];
$reject_count = $total_count - $receipt_count;
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where mb_id='' $sql_group $sql_search $sql_korean $sql_no_hp");
$no_member_count = $res['cnt'];
$member_count = $total_count - $no_member_count;
$no_group = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no=1");
$group = array();
$qry = sql_query("select * from {$g5['sms5_book_group_table']} where bg_no>1 order by bg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
?>
<div class="tbl_head01 tbl_wrap">
<table>
<thead>
<tr>
<th scope="col">
<label for="all_checked" class="sound_only">회원 전체</label>
<input type="checkbox" id="all_checked" onclick="sms_obj.book_all_checked(this.checked)">
</th>
<th scope="col">이름</th>
<th scope="col">휴대폰번호</th>
<th scope="col">등급</th>
<th scope="col">추가</th>
</tr>
</thead>
<tbody>
<?php if (!$total_count) { ?>
<tr>
<td colspan="<?php echo $colspan?>" class="td_mbstat">데이터가 없습니다.</td>
</tr>
<?php
}
$line = 0;
$qry = sql_query("select * from {$g5['sms5_book_table']} where 1 $sql_group $sql_search $sql_korean $sql_no_hp order by bk_no desc limit $page_start, $page_size");
while($res = sql_fetch_array($qry))
{
$bg = 'bg'.($line++%2);
$tmp = sql_fetch("select bg_name from {$g5['sms5_book_group_table']} where bg_no='{$res['bg_no']}'");
if (!$tmp)
$group_name = '미분류';
else
$group_name = $tmp['bg_name'];
?>
<tr class="<?php echo $bg; ?>">
<td class="td_chk">
<label for="bk_no_<?php echo $res['bk_no']; ?>" class="sound_only"><?php echo $res['bk_name']?></label>
<input type="checkbox" name="bk_no" value="<?php echo $res['bk_no']?>" id="bk_no_<?php echo $res['bk_no']; ?>">
</td>
<!-- <td class="td_name"><?php echo $group_name?></td> -->
<td class="td_mbname"><?php echo $res['bk_name']?></td>
<td><?php echo $res['bk_hp']?></td>
<!-- <td class="td_boolean"><?php echo $res['bk_receipt'] ? '수신' : '거부'?></td> -->
<!-- <td class="td_boolean"><?php echo $res['bk_receipt'] ? '예' : ''?></td> -->
<td class="td_boolean"><?php echo $res['mb_id'] ? '회원' : '비회원'?></td>
<td class="td_mngsmall"><button type="button" class="btn_frmline" onclick="sms_obj.person_add(<?php echo $res['bk_no']?>, '<?php echo $res['bk_name']?>', '<?php echo $res['bk_hp']?>')">추가</button></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<button type="button" onclick="sms_obj.person_multi_add()">선택추가</button>
<button type="button" onclick="sms_obj.triggerclick('#book_group')" >그룹목록</button>
</div>
<nav class="pg_wrap">
<span class="pg" id="person_pg"></span>
</nav>
<form name="search_form" id="sms_person_form" method="get" action="<?php echo $_SERVER['PHP_SELF']?>">
<input type="hidden" name="total_pg" value="<?php echo $total_page?>">
<input type="hidden" name="page" value="<?php echo $page?>">
<input type="hidden" name="bg_no" value="<?php echo $bg_no?>">
<label for="bg_no" class="sound_only">그룹</label>
<select name="bg_no" id="bg_no">
<option value=""<?php echo get_selected('', $bg_no); ?>> 전체 </option>
<option value="1"<?php echo get_selected(1, $bg_no); ?>> <?php echo $no_group['bg_name']?> (<?php echo number_format($no_group['bg_receipt'])?> 명) </option>
<?php for($i=0; $i<count($group); $i++) {?>
<option value="<?php echo $group[$i]['bg_no']?>" <?php echo get_selected($bg_no, $group[$i]['bg_no']); ?>> <?php echo $group[$i]['bg_name']?> (<?php echo number_format($group[$i]['bg_receipt'])?> 명) </option>
<?php } ?>
</select>
<label for="stt" class="sound_only">검색대상</label>
<select name="st" id="stt">
<option value="all"<?php echo get_selected('all', $st); ?>>이름 + 번호</option>
<option value="name"<?php echo get_selected('name', $st); ?>>이름</option>
<option value="hp"<?php echo get_selected('hp', $st); ?>>번호</option>
</select>
<label for="svv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" size="15" name="sv" value="<?php echo $sv?>" id="svv" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<!--
총 건수 : <?php echo number_format($total_count)?> /
회원 : <?php echo number_format($member_count)?> /
비회원 : <?php echo number_format($no_member_count)?> /
수신 : <?php echo number_format($receipt_count)?> /
거부 : <?php echo number_format($reject_count)?>
-->

172
adm/sms_admin/config.php Normal file
View File

@ -0,0 +1,172 @@
<?php
$sub_menu = "900100";
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");
$g5['title'] = "SMS 기본설정";
if (!$config['cf_icode_server_ip']) $config['cf_icode_server_ip'] = '211.172.232.124';
if (!$config['cf_icode_server_port']) $config['cf_icode_server_port'] = '7295';
if ($config['cf_icode_id'] && $config['cf_icode_pw'])
{
$res = get_sock('http://www.icodekorea.com/res/userinfo.php?userid='.$config['cf_icode_id'].'&userpw='.$config['cf_icode_pw']);
$res = explode(';', $res);
$userinfo = array(
'code' => $res[0], // 결과코드
'coin' => $res[1], // 고객 잔액 (충전제만 해당)
'gpay' => $res[2], // 고객의 건수 별 차감액 표시 (충전제만 해당)
'payment' => $res[3] // 요금제 표시, A:충전제, C:정액제
);
}
if (!$config['cf_icode_id'])
$config['cf_icode_id'] = 'sir_';
if (!$sms5['cf_skin'])
$sms5['cf_skin'] = 'basic';
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<?php if (!$config['cf_icode_pw']) { ?>
<div class="local_desc01 local_desc">
<p>
SMS 기능을 사용하시려면 먼저 아이코드에 서비스 신청을 하셔야 합니다.<br>
<a href="http://icodekorea.com/res/join_company_fix_a.php?sellid=sir2" target="_blank">아이코드 서비스 신청하기</a>
</p>
</div>
<?php } ?>
<?php
if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
?>
<form name="fconfig" method="post" action="./config_update.php" enctype="multipart/form-data" >
<input type="hidden" name="cf_icode_server_ip" value="<?php echo $config['cf_icode_server_ip']?>">
<input type="hidden" name="cf_sms_use" value="<?php echo $config['cf_sms_use']?>">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?></caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="cf_icode_id">아이코드 회원아이디<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("아이코드에서 사용하시는 회원아이디를 입력합니다."); ?>
<input type="text" name="cf_icode_id" value="<?php echo $config['cf_icode_id']; ?>" id="cf_icode_id" required class="frm_input required">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_icode_pw">아이코드 비밀번호<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("아이코드에서 사용하시는 비밀번호를 입력합니다."); ?>
<input type="password" name="cf_icode_pw" value="<?php echo $config['cf_icode_pw']; ?>" id="cf_icode_pw" required class="frm_input required">
<?php if (!$config['cf_icode_pw']) { ?>현재 비밀번호가 입력되어 있지 않습니다.<?php } ?>
</td>
</tr>
<tr>
<th scope="row">요금제</th>
<td>
<?php
if ($userinfo['payment'] == 'A') {
echo '충전제';
echo '<input type="hidden" name="cf_icode_server_port" value="7295">';
} else if ($userinfo['payment'] == 'C') {
echo '정액제';
echo '<input type="hidden" name="cf_icode_server_port" value="7296">';
} else {
echo '가입해주세요.';
echo '<input type="hidden" name="cf_icode_server_port" value="7295">';
}
?>
</td>
</tr>
<?php if ($userinfo['payment'] == 'A') { ?>
<tr>
<th scope="row">충전 잔액</th>
<td>
<?php echo number_format($userinfo['coin'])?> 원
<input type="button" value="충전하기" class="btn_frmline" onclick="window.open('http://icodekorea.com/company/credit_card_input.php?icode_id=<?php echo $config['cf_icode_id']?>&icode_passwd=<?php echo $config['cf_icode_pw']?>','icode_payment','width=650,height=500')">
</td>
</tr>
<tr>
<th scope="row">건별 금액</th>
<td><?php echo number_format($userinfo['gpay'])?> 원</td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="cf_phone">회신번호<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회신받을 휴대폰 번호를 입력하세요. '-' 를 꼭 입력하세요.<br>예) 010-123-4567"); ?>
<input type="text" name="cf_phone" value="<?php echo $sms5['cf_phone']; ?>" id="cf_phone" required class="frm_input required" size="12">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_member">회원간 문자전송</label></th>
<td>
<?php echo help("허용에 체크하면 회원끼리 문자전송이 가능합니다.");?>
<input type="checkbox" name="cf_member" value="1" id="cf_member" <?php echo get_checked(1, $sms5['cf_member']); ?>> <label for="cf_member">허용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_level">문자전송가능 레벨</label></th>
<td>
<?php echo help("문자전송을 허용할 회원레벨을 선택해주세요.");?>
<select name="cf_level" id="cf_level">
<?php for ($i=1; $i<=10; $i++) { ?>
<option value="<?php echo $i?>"<?php echo get_selected($i, $sms5['cf_level']);?>> <?php echo $i?> </option>
<?php } ?>
</select>
레벨 이상
</td>
</tr>
<tr>
<th scope="row"><label for="cf_point">문자전송 차감 포인트<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회원이 문자를 전송할시에 차감할 포인트를 입력해주세요. 0이면 포인트를 차감하지 않습니다.");?>
<input type="text" name="cf_point" value="<?php echo $sms5['cf_point']; ?>" id="cf_point" required class="frm_input required" size="5">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_day_count">문자전송 하루제한 갯수<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회원이 하루에 보낼수 있는 문자 갯수를 입력해주세요. 0이면 제한하지 않습니다.");?>
<input type="text" name="cf_day_count" value="<?php echo $sms5['cf_day_count']; ?>" id="cf_day_count" required class="frm_input required" size="5">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_skin">스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo get_sms5_skin_select('skin', 'cf_skin', 'cf_skin', $sms5['cf_skin'], 'required'); ?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s">
</div>
</form>
<?php } else { ?>
<section>
<h2 class="h2_frm">SMS 문자전송 서비스를 사용할 수 없습니다.</h2>
<div class="local_desc01 local_desc">
<p>
SMS 를 사용하지 않고 있기 때문에, 문자 전송을 할 수 없습니다.<br>
SMS 사용 설정은 <a href="../config_form.php#anc_cf_sms" class="btn_frmline">환경설정 &gt; 기본환경설정 &gt; SMS설정</a> 에서 SMS 사용을 아이코드로 변경해 주셔야 사용하실수 있습니다.
</p>
</div>
</section>
<?php } ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,49 @@
<?php
$sub_menu = "900100";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
check_demo();
$g5['title'] = "SMS 기본설정";
$res = get_sock("http://www.icodekorea.com/res/userinfo.php?userid=$cf_icode_id&userpw=$cf_icode_pw");
$res = explode(';', $res);
$userinfo = array(
'code' => $res[0], // 결과코드
'coin' => $res[1], // 고객 잔액 (충전제만 해당)
'gpay' => $res[2], // 고객의 건수 별 차감액 표시 (충전제만 해당)
'payment' => $res[3] // 요금제 표시, A:충전제, C:정액제
);
if ($userinfo['code'] == '202')
alert('아이코드 아이디와 패스워드가 맞지 않습니다.');
if ($cf_member == '1')
$cf_member = 1;
else
$cf_member = 0;
$res = sql_fetch("select * from ".$g5['sms5_config_table']." limit 1");
if (!$res)
$sql = "insert into ";
else
$sql = "update ";
$sql .= $g5['sms5_config_table']." set cf_phone='$cf_phone', cf_member='$cf_member', cf_level='$cf_level', cf_point='$cf_point', cf_day_count='$cf_day_count', cf_skin = '$cf_skin' ";
sql_query($sql);
// 아이코드 설정
$sql = " update {$g5['config_table']}
set cf_sms_use = '$cf_sms_use',
cf_icode_id = '$cf_icode_id',
cf_icode_pw = '$cf_icode_pw',
cf_icode_server_ip = '$cf_icode_server_ip',
cf_icode_server_port = '$cf_icode_server_port' ";
sql_query($sql);
goto_url("./config.php");
?>

140
adm/sms_admin/css/sms5.css Normal file
View File

@ -0,0 +1,140 @@
@charset "utf-8";
/* SIR 지운아빠 */
/* 설치 */
#sms5_install {padding:20px 20px 0}
#sms5_install h2 {margin:0;padding:0 0 20px}
#sms5_install ol {margin:0 0 20px;padding:0 0 0 20px}
#sms5_install li {margin:0 0 10px}
/* 공통 */
.sms5_txt_success {color:blue}
.sms5_txt_fail {color:red}
/* 회원정보업데이트 */
#sms5_mbup dl {zoom:1}
#sms5_mbup dl:after {display:block;visibility:hidden;clear:both;content:''}
#sms5_mbup dt {clear:both;float:left;margin:0 0 5px;width:100px}
#sms5_mbup dd {float:left;margin:0 0 5px}
#sms5_mbup p {clear:both}
/* SMS BOX */
.sms5_box {position:relative;padding:10px;border-radius:5px;background:#fbec99}
.sms5_box .box_ico {position:absolute;top:20px;left:-7px;width:7px;height:13px;background:url('../img/box_ico.gif') no-repeat}
.sms5_box .box_txt {border:0;background:transparent;word-break:break-all;resize:none;overflow:hidden}
.sms5_box .box_square {width:100px;height:90px}
#write_wrap {z-index:9}
#wr_message_lbl {position:absolute;top:50px;left:50px;color:#999;font-size:0.95em;letter-spacing:-0.1em}
.write_scemo_btn {position:absolute;right:10px !important;right:50px;margin:0;padding:0;width:28px;height:28px;border:0;background:transparent;color:#999;font-size:0.95em}
#write_sc_btn {top:15px}
#write_emo_btn {top:50px}
.write_scemo {display:none;z-index:10;position:absolute;left:150px;border:1px solid #e9e9e9;background:#f7f7f7}
.scemo_ico {position:absolute;top:10px;left:-7px;width:7px;height:13px;background:url('../img/scemo_ico.gif') no-repeat}
.write_scemo .scemo_list {z-index:11;margin:0;padding:0;width:190px;height:150px;background:#fff;overflow-y:scroll}
.write_scemo .scemo_add {margin:0;padding:0;height:25px;border:0;background:transparent}
#write_sc {top:10px}
#write_sc .scemo_add {width:25px}
#write_emo {top:45px}
#write_emo .scemo_add {width:50px}
#write_emo .emo_long {width:80px}
.write_scemo .scemo_cls {text-align:right}
.write_scemo .scemo_cls button {margin:5px;padding:0;border:0;background:transparent;color:#666;font-size:0.95em}
/* 문자보내기 */
#sms5_send {position:relative;margin:-10px 0 0 20px;padding:0 0 0 490px;height:600px}
#sms5_send h2 {font-size:1em}
#sms5_send ul {margin:0;padding:0;list-style:none;zoom:1}
#sms5_send ul:after {display:block;visibility:hidden;clear:both;content:''}
#sms5_send #send_emo {position:absolute;top:0;left:0;padding:20px 0 0;width:280px}
#sms5_send #send_emo h2 {padding:0 0 10px}
#sms5_send #send_write {position:absolute;top:0;left:290px;padding:20px 20px 0 !important;padding:20px 0 0 20px;width:160px;height:600px;border-left:1px solid #efefef}
#sms5_send #send_write h2 {padding:0 0 10px}
#sms5_send #send_book {position:relative;margin:0 0 0 -1px;padding:20px 0 0;width:100%;height:600px;border-left:1px solid #efefef}
#sms5_send #send_book h2 {padding-bottom:10px}
#sms5_send .tmp_loading {display:block;padding:180px 0 0;text-align:center}
#sms5_send #send_emo #emo_sel {position:absolute;top:20px;right:10px;margin:0}
#sms5_send #send_emo li {float:left;margin:0 10px 10px 0 !important;margin:0 5px 10px 0;width:110px}
#sms5_send #send_emo .sms5_box {background:#f7f7f7}
#sms5_send #send_emo .box_ico {display:none}
#sms5_send #send_emo .box_txt {cursor:pointer}
#sms5_send #send_emo .emo_tit {display:block;height:20px;line-height:2em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#sms5_send #send_emo .btn_submit {padding:0 5px;height:24px;border:1px solid #ccc;background:#fafafa;color:#000;font-size:0.95em;vertical-align:middle;cursor:pointer}
#sms5_send #send_write {z-index:3}
#sms5_send .write_inner {position:relative;left:-20px;padding:15px 20px;width:160px;border-top:1px solid #efefef}
#sms5_send .write_inner h2 {margin:0;padding:0 0 10px !important}
#sms5_send .write_floater {position:absolute;top:15px;right:20px;text-align:right}
#sms5_send .write_floater_btn {margin:0;padding:0;border:0;background:transparent;color:#999;font-size:0.95em;letter-spacing:-0.1em}
#sms5_send .write_inner label, #sms5_send .write_inner input {margin:0 0 3px}
#sms5_send .write_inner label {display:inline-block}
#sms5_send #send_write .sms5_box {margin:0 0 5px}
#sms5_send #sms_byte {position:absolute;top:-37px;right:0;color:#999}
#sms5_send #write_preset {margin:10px 0;color:#999;font-size:0.95em;letter-spacing:-0.1em}
#sms5_send #write_reply {margin:0 0 15px}
#sms5_send #hp_list {width:100%;margin:0 0 5px}
#sms5_send #recv_add {position:relative}
#sms5_send #recv_add button {position:absolute;top:0;right:0 !important;right:20px;margin:0;padding:0;width:45px;height:51px;border:1px solid #ccc;background:#fafafa}
#sms5_send #write_rsv {line-height:1.8em}
#sms5_send #send_book {z-index:2}
#sms5_send #num_book {margin:0 0 10px;width:auto !important;width:95%;height:500px;overflow-y:auto !important;overflow-y:scroll}
#sms5_send #book_tab {margin:0 35px 10px;text-align:right}
#sms5_send #book_tab a {display:inline-block;width:30px;text-align:center}
#sms5_send #sms_person_form {margin:0 20px}
#sms5_send #send_book .btn_submit {padding:0 5px;height:24px}
#sms5_send #book_desc {margin:0 20px;color:#999;font-size:0.95em;letter-spacing:-0.1em}
#sms5_send .td_mngsmall button.btn_frmline,#sms5_send .td_mng button.btn_frmline {padding: 0 7px;background: #444;}
/* 문자전송상세내역 */
#sms5_sent {}
#sms5_sent #sent_overlap {margin:0 20px 20px;padding:0;border-top:1px solid #e9e9e9;list-style:none}
#sms5_sent #sent_overlap li {padding:10px 0;border-bottom:1px solid #e9e9e9}
#sms5_sent #con_sms {margin:0 20px 20px}
/* 이모티콘 관리 */
.sms_preset_sch form {display:inline-block}
#sms5_preset_sel {float:left;padding:8px 20px 0}
.btn_add {float:right}
#sms5_preset {clear:both;margin:0 0 10px;padding:30px 20px 20px 40px;background:#363a3d;list-style:none;zoom:1}
#sms5_preset:after {display:block;visibility:hidden;clear:both;content:''}
#sms5_preset li {float:left;margin:0 20px 20px 0;width:270px;height:125px;background:#fbec99;zoom:1}
#sms5_preset li:after {display:block;visibility:hidden;clear:both;content:''}
#sms5_preset .li_chk {position:absolute;bottom:10px;left:10px;}
#sms5_preset .li_preview {float:left;width:110px}
#sms5_preset .box_square {padding-right:7px;border-right:1px solid #e2d693}
#sms5_preset .li_info {float:left;margin:0 0 0 10px;width:150px;line-height:1.5em}
#sms5_preset .li_date {position:absolute;bottom:10px;left:30px;color:#86857d}
#sms5_preset .li_cmd {position:absolute;bottom:10px;right:10px}
#sms5_preset .li_cmd a {color:#86857d;font-size:0.95em;letter-spacing:-0.1em}
#sms5_emo_add {position:relative}
#sms5_emo_add .sms5_box {padding:10px !important;padding:10px 5px;width:160px}
#sms5_emo_add .box_txt {margin:0 0 5px}
#sms5_emo_add .write_scemo_btn {right:10px}
#sms5_emo_add .write_scemo {left:170px}
/* 휴대폰번호 관리 */
#hp_check_el {width:148px}
#hp_check_el ul {margin:5px 0 0;padding:0;border:1px solid #f7c3cf;background:#f8e8eb;list-style:none}
#hp_check_el li {position:relative;padding:5px;border-bottom:1px solid #f6dae1}
#hp_check_el strong {position:absolute;top:6px;right:5px;color:#ff3061;font-size:0.95em;font-weight:normal;letter-spacing:-0.1em}
/* 휴대폰번호 파일 */
#sms5_fileup_frm {margin:0 0 10px;padding:0 20px 5px;border-bottom:1px solid #e9e9e9}
#sms5_fileup_frm div {padding:0 0 5px;margin:0 0 5px;border-bottom:1px solid #f4f4f4}
#sms5_fileup_frm div.sch_last {margin:0;border:0}
#sms5_fileup_frm strong {display:inline-block;width:80px}
#sms5_fileup_frm strong.sch_long {width:160px}
#sms5_fileup_frm label {display:inline-block;margin:0 5px 0 0}
#sms5_fileup_frm .btn_submit {padding:0 5px;height:24px}
#sms5_fileup_frm #sms5_fileup {border:0}
#sms5_fileup_frm #upload_info {margin:20px 0}
#sms5_fileup_frm #upload_result {margin:0;padding:10px 0;border-top:3px solid #383838;border-bottom:3px solid #383838;list-style:none}
#sms5_fileup_frm #upload_result li {margin:0 0 5px}
#sms5_fileup_frm #upload_result .local_desc01 {margin:5px 0;padding:10px}
#sms5_fileup_frm #btn_fileup {margin:5px 0 0}
#sms5_fileup_frm .sms_fileup_hide {display:none;border:0}

View File

@ -0,0 +1,114 @@
<?php
$sub_menu = "900600";
include_once('./_common.php');
if ($sw != 'move'){
alert('sw 값이 제대로 넘어오지 않았습니다.');
}
auth_check($auth[$sub_menu], "r");
$g5['title'] = '이모티콘그룹 이동';
include_once(G5_PATH.'/head.sub.php');
$fo_no_list = implode(',', $_POST['fo_no']);
$sql = " select * from {$g5['sms5_form_group_table']} order by fg_no ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = $row;
}
?>
<div id="copymove" class="new_win">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<form name="fboardmoveall" method="post" action="./emoticon_move_update.php" onsubmit="return fboardmoveall_submit(this);">
<input type="hidden" name="sw" value="<?php echo $sw ?>">
<input type="hidden" name="fo_no_list" value="<?php echo $fo_no_list ?>">
<input type="hidden" name="url" value="<?php echo $_SERVER['HTTP_REFERER'] ?>">
<div class="tbl_head01 tbl_wrap">
<table>
<caption>이동할 그룹을 한개 이상 선택하여 주십시오.</caption>
<thead>
<tr>
<th scope="col">선택</th>
<th scope="col">그룹</th>
</tr>
</thead>
<tbody>
<?php for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td class="td_chk">
<input type="radio" value="<?php echo $list[$i]['fg_no'] ?>" id="chk<?php echo $i ?>" name="chk_fg_no[]">
</td>
<td>
<label for="chk<?php echo $i ?>"><?php echo $list[$i]['fg_name'] ?></label>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="win_btn">
<input type="submit" value="이동" id="btn_submit" class="btn_submit">
<button type="button" class="btn_cancel">창닫기</button>
</div>
</form>
</div>
<script>
(function($) {
$(".win_btn button").click(function(e) {
window.close();
return false;
});
})(jQuery);
function all_checked(sw) {
var f = document.fboardmoveall;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_fg_no[]")
f.elements[i].checked = sw;
}
}
function fboardmoveall_submit(f)
{
var check = false;
if (typeof(f.elements['chk_fg_no[]']) == 'undefined')
;
else {
if (typeof(f.elements['chk_fg_no[]'].length) == 'undefined') {
if (f.elements['chk_fg_no[]'].checked)
check = true;
} else {
for (i=0; i<f.elements['chk_fg_no[]'].length; i++) {
if (f.elements['chk_fg_no[]'][i].checked) {
check = true;
break;
}
}
}
}
if (!check) {
alert('이모티콘을 '+f.act.value+'할 그룹을 한개 이상 선택해 주십시오.');
return false;
}
document.getElementById('btn_submit').disabled = true;
return true;
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,60 @@
<?php
include_once('./_common.php');
auth_check($auth[$sub_menu], "r");
if(!count($_POST['chk_fg_no']))
alert('이모티콘을 이동할 그룹을 한개 이상 선택해 주십시오.', $url);
$sql = "select * from {$g5['sms5_form_table']} where fo_no in ($fo_no_list) order by fo_no desc ";
$result = sql_query($sql);
$save = array();
for ($kk=0;$row = sql_fetch_array($result);$kk++)
{
$fo_no = $row['fo_no'];
for ($i=0; $i<count($_POST['chk_fg_no']); $i++)
{
$fg_no = $_POST['chk_fg_no'][$i];
if( !$fg_no ) continue;
$group = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no = '$fg_no'");
$sql = " insert into {$g5['sms5_form_table']}
set fg_no='$fg_no',
fg_member='".$group['fg_member']."',
fo_name='".addslashes($row['fo_name'])."',
fo_content='".addslashes($row['fo_content'])."',
fo_datetime='".G5_TIME_YMDHIS."' ";
sql_query($sql);
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count + 1 where fg_no='$fg_no'");
}
$save[$kk]['fo_no'] = $row['fo_no'];
$save[$kk]['fg_no'] = $row['fg_no'];
}
if ($sw == 'move')
{
foreach ($save as $v)
{
if( empty($v['fo_no']) ) continue;
sql_query(" delete from {$g5['sms5_form_table']} where fo_no = '{$v['fo_no']}' ");
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count - 1 where fg_no='{$v['fg_no']}'");
}
}
$msg = '해당 이모티콘을 선택한 그룹으로 이동 하였습니다.';
$opener_href = './form_list.php?page='.$page;
echo <<<HEREDOC
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script>
alert("$msg");
opener.document.location.href = "$opener_href";
window.close();
</script>
<noscript>
<p>
"$msg"
</p>
<a href="$opener_href">돌아가기</a>
</noscript>
HEREDOC;
?>

View File

@ -0,0 +1,177 @@
<?php
$sub_menu = "900500";
include_once("./_common.php");
$colspan = 5;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "이모티콘 그룹";
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_form_group_table']}");
$total_count = $res['cnt'];
$group = array();
$qry = sql_query("select * from {$g5['sms5_form_group_table']} order by fg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<script>
function move(fg_no, fg_name, sel) {
var msg = '';
if (sel.value)
{
msg = "'" + fg_name + "' 그룹에 속한 모든 데이터를\n\n'";
msg += sel.options[sel.selectedIndex].text + "' 그룹으로 이동하시겠습니까?";
if (confirm(msg))
location.href = 'form_group_move.php?fg_no=' + fg_no + '&move_no=' + sel.value;
else
sel.selectedIndex = 0;
}
}
function empty(fg_no) {
if (confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n그룹에 속한 데이터를 정말로 비우시겠습니까?"))
location.href = 'form_group_update.php?w='+ fg_no +'&fg_no=' + fg_no;
}
function grouplist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n삭제되는 그룹에 속한 자료는 '미분류'로 이동됩니다.\n\n그래도 삭제하시겠습니까?")) {
f.w.value = "de";
} else {
return false;
}
}
if(document.pressed == "선택비우기") {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n그룹에 속한 데이터를 정말로 비우시겠습니까?")) {
f.w.value = "em";
} else {
return false;
}
}
return true;
}
</script>
<form name="group<?php echo $res['fg_no']?>" method="post" action="./form_group_update.php" class="local_sch02 local_sch">
<input type="hidden" name="fg_no" value="<?php echo $res['fg_no']?>">
<div>
<label for="fg_name">그룹명<strong class="sound_only"> 필수</strong></label>
<input type="text" id="fg_name" name="fg_name" required class="required frm_input">
<input type="submit" value="추가" class="btn_submit">
</div>
<div class="sch_last">
<span class="count_add01">건수 : <?php echo $total_count ?></span>
</div>
</form>
<div class="local_desc01 local_desc">
<p>그룹명순으로 정렬됩니다.</p>
</div>
<form name="group<?php echo $group[$i]['fg_no']?>" method="post" action="./form_group_update.php" onsubmit="return grouplist_submit(this);">
<input type="hidden" name="w" value="u">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">
<label for="chkall" class="sound_only">그룹 전체</label>
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<th scope="col">그룹명</th>
<th scope="col">이모티콘수</th>
<th scope="col">이동</th>
<th scope="col">보기</th>
</tr>
</thead>
<tbody>
<?php
$qry = sql_query("select count(*) as cnt from {$g5['sms5_form_table']} where fg_no=0");
$res = sql_fetch_array($qry);
?>
<tr>
<td></td>
<td>미분류</td>
<td class="td_numbig"><?php echo number_format($res['cnt'])?></td>
<td class="td_mng">
<label for="select_fg_no_999" class="sound_only">그룹명</label>
<select name="select_fg_no_999" id="select_fg_no_999" onchange="move(0, '미분류', this);">
<option value=""></option>
<?php for ($i=0; $i<count($group); $i++) { ?>
<option value="<?php echo $group[$i]['fg_no']?>"> <?php echo $group[$i]['fg_name']?> </option>
<?php } ?>
</select>
</td>
<td class="td_mng">
<a href="./form_list.php?fg_no=0">보기</a>
<!-- <button type="button" onclick="empty('no');">비우기</button> -->
</td>
</tr>
<?php
for ($i=0; $i<count($group); $i++) {
$bg = 'bg'.(($i + 1)%2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_mng">
<input type="hidden" name="fg_no[<?php echo $i ?>]" value="<?php echo $group[$i]['fg_no']?>" id="fg_no_<?php echo $i ?>">
<label for="chk_<?php echo $i ?>" class="sound_only"><?php echo $group[$i]['fg_name']?></label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td>
<label for="fg_name_<?php echo $i; ?>" class="sound_only">그룹명</label>
<input type="text" name="fg_name[<?php echo $i; ?>]" value="<?php echo $group[$i]['fg_name']?>" id="fg_name_<?php echo $i; ?>" class="frm_input">
<input type="checkbox" name="fg_member[<?php echo $i; ?>]" value="1" id="fg_member_<?php echo $i; ?>" <?php if ($group[$i]['fg_member']) echo 'checked';?>>
<label for="fg_member_<?php echo $i; ?>">회원</label>
</td>
<td class="td_numbig">
<?php echo number_format($group[$i]['fg_count'])?>
</td>
<td class="td_mng">
<label for="select_fg_no_<?php echo $i; ?>" class="sound_only">그룹명</label>
<select name="select_fg_no[<?php echo $i; ?>]" id="select_fg_no_<?php echo $i; ?>" onchange="move(<?php echo $group[$i]['fg_no']?>, '<?php echo $group[$i]['fg_name']?>', this);">
<option value=''></option>
<option value='0'>미분류</option>
<?php for ($j=0; $j<count($group); $j++) { ?>
<?php if ($group[$i]['fg_no']==$group[$j]['fg_no']) continue; ?>
<option value="<?php echo $group[$j]['fg_no']?>"> <?php echo $group[$j]['fg_name']?></option>
<?php } ?>
</select>
</td>
<td class="td_mng">
<a href="./form_list.php?fg_no=<?php echo $group[$i]['fg_no']?>">보기</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택비우기" onclick="document.pressed=this.value">
</div>
</form>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,30 @@
<?php
// 이모티콘 그룹 이동
$sub_menu = "900500";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
if ($fg_no)
{
$res = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no = '$fg_no'");
if ($res)
$fg_count = $res['fg_count'];
else
$fg_count = 0;
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count + $fg_count where fg_no = '$move_no'");
sql_query("update {$g5['sms5_form_group_table']} set fg_count = 0 where fg_no='$fg_no'");
}
else
{
$fg_count = sql_fetch("select count(*) as cnt from {$g5['sms5_form_table']} where fg_no = 0");
$fg_count = $fg_count['cnt'];
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count + $fg_count where fg_no = '$move_no'");
}
$group = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no = '$move_no'");
sql_query("update {$g5['sms5_form_table']} set fg_no = '$move_no', fg_member = '{$group['fg_member']}' where fg_no = '$fg_no'");
goto_url('./form_group.php');
?>

View File

@ -0,0 +1,92 @@
<?php
$sub_menu = "900500";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
if ($w == 'u') // 업데이트
{
for ($i=0; $i<count($_POST['chk']); $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$fg_no = $_POST['fg_no'][$k];
$fg_name = $_POST['fg_name'][$k];
$fg_member = $_POST['fg_member'][$k];
if (!is_numeric($fg_no))
alert('그룹 고유번호가 없습니다.');
$res = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no='$fg_no'");
if (!$res)
alert('존재하지 않는 그룹입니다.');
if (!strlen(trim($fg_name)))
alert('그룹명을 입력해주세요');
$res = sql_fetch("select fg_name from {$g5['sms5_form_group_table']} where fg_no<>'$fg_no' and fg_name='$fg_name'");
if ($res)
alert('같은 그룹명이 존재합니다.');
sql_query("update {$g5['sms5_form_group_table']} set fg_name='$fg_name', fg_member='$fg_member' where fg_no='$fg_no'");
sql_query("update {$g5['sms5_form_table']} set fg_member = '$fg_member' where fg_no = '$fg_no'");
}
}
else if ($w == 'de') // 그룹삭제
{
for ($i=0; $i<count($_POST['chk']); $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$fg_no = $_POST['fg_no'][$k];
if (!is_numeric($fg_no))
alert('그룹 고유번호가 없습니다.');
$res = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no='$fg_no'");
if (!$res)
alert('존재하지 않는 그룹입니다.');
sql_query("delete from {$g5['sms5_form_group_table']} where fg_no='$fg_no'");
sql_query("update {$g5['sms5_form_table']} set fg_no = 0, fg_member = 0 where fg_no='$fg_no'");
}
}
else if ($w == 'em')
{
for ($i=0; $i<count($_POST['chk']); $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$fg_no = $_POST['fg_no'][$k];
if ($fg_no == 'no') $fg_no = 0;
if ($fg_no)
sql_query("update {$g5['sms5_form_group_table']} set fg_count = 0 where fg_no = '$fg_no'");
sql_query("delete from {$g5['sms5_form_table']} where fg_no = '$fg_no'");
}
}
else if ($w == 'no')
{
if ($fg_no == 'no') $fg_no = 0;
if ($fg_no)
sql_query("update {$g5['sms5_form_group_table']} set fg_count = 0 where fg_no = '$fg_no'");
sql_query("delete from {$g5['sms5_form_table']} where fg_no = '$fg_no'");
}
else // 등록
{
if (!strlen(trim($fg_name)))
alert('그룹명을 입력해주세요');
$res = sql_fetch("select fg_name from {$g5['sms5_form_group_table']} where fg_name = '$fg_name'");
if ($res)
alert('같은 그룹명이 존재합니다.');
sql_query("insert into {$g5['sms5_form_group_table']} set fg_name = '$fg_name'");
}
goto_url('./form_group.php');
?>

238
adm/sms_admin/form_list.php Normal file
View File

@ -0,0 +1,238 @@
<?php
$sub_menu = "900600";
include_once("./_common.php");
$page_size = 12;
$colspan = 2;
auth_check($auth[$sub_menu], "r");
$token = get_token();
$g5['title'] = "이모티콘 관리";
if ($page < 1) $page = 1;
if (is_numeric($fg_no))
$sql_group = " and fg_no='$fg_no' ";
else
$sql_group = "";
if ($st == 'all') {
$sql_search = "and (fo_name like '%{$sv}%' or fo_content like '%{$sv}%')";
} else if ($st == 'name') {
$sql_search = "and fo_name like '%{$sv}%'";
} else if ($st == 'content') {
$sql_search = "and fo_content like '%{$sv}%'";
} else {
$sql_search = '';
}
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_form_table']} where 1 $sql_group $sql_search");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
$group = array();
$qry = sql_query("select * from {$g5['sms5_form_group_table']} order by fg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_form_table']} where fg_no=0");
$no_count = $res['cnt'];
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<script>
function book_all_checked(chk)
{
if (chk) {
jQuery('[name="fo_no[]"]').attr('checked', true);
} else {
jQuery('[name="fo_no[]"]').attr('checked', false);
}
}
function book_del(fo_no)
{
if (confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n그래도 삭제하시겠습니까?"))
location.href = "./form_update.php?w=d&fo_no=" + fo_no + "&page=<?php echo $page?>&fg_no=<?php echo $fg_no?>&st=<?php echo $st?>&sv=<?php echo $sv?>";
}
function multi_update(sel)
{
var fo_no = document.getElementsByName('fo_no');
var ck_no = '';
var count = 0;
if (!sel.value) {
sel.selectedIndex = 0;
return;
}
for (i=0; i<fo_no.length; i++) {
if (fo_no[i].checked==true) {
count++;
ck_no += fo_no[i].value + ',';
}
}
if (!count) {
alert('하나이상 선택해주세요.');
sel.selectedIndex = 0;
return;
}
if (sel.value == 'del') {
if (!confirm("선택한 이모티콘를 삭제합니다.\n\n비회원만 삭제됩니다.\n\n회원을 삭제하려면 회원관리 메뉴를 이용해주세요.\n\n실행하시겠습니까?"))
{
sel.selectedIndex = 0;
return;
}
} else if (!confirm("선택한 이모티콘를 " + sel.options[sel.selectedIndex].innerHTML + "\n\n실행하시겠습니까?")) {
sel.selectedIndex = 0;
return;
}
location.href = "./form_multi_update.php?w=" + sel.value + "&ck_no=" + ck_no;
}
</script>
<div class="local_ov01 local_ov">
건수 : <?php echo number_format($total_count);?>
</div>
<div class="local_sch01 local_sch sms_preset_sch">
<form>
<label for="fg_no" class="sound_only">그룹명</label>
<select name="fg_no" onchange="location.href='<?php echo $_SERVER['PHP_SELF']?>?fg_no='+this.value;">
<option value="" <?php echo $fg_no?'':'selected'?>> 전체 </option>
<option value="0" <?php echo $fg_no=='0'?'selected':''?>> 미분류 (<?php echo number_format($no_count)?>) </option>
<?php for($i=0; $i<count($group); $i++) {?>
<option value="<?php echo $group[$i]['fg_no']?>" <?php echo ($fg_no==$group[$i]['fg_no'])?'selected':''?>> <?php echo $group[$i]['fg_name']?> (<?php echo number_format($group[$i]['fg_count'])?>) </option>
<?php } ?>
</select>
</form>
<form name="search_form" method="get" action="<?php echo $_SERVER['PHP_SELF']?>">
<input type="hidden" name="fg_no" value="<?php echo $fg_no;?>">
<label for="st" class="sound_only">검색대상</label>
<select name="st" id="st">
<option value="all"<?php echo get_selected('all', $st); ?>>제목 + 이모티콘</option>
<option value="name"<?php echo get_selected('name', $st); ?>>제목</option>
<option value="content"<?php echo get_selected('content', $st); ?>>이모티콘</option>
</select>
<label for="sv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="sv" value="<?php echo $sv;?>" id="sv" required class="frm_input required" >
<input type="submit" value="검색" class="btn_submit">
</form>
</div>
<div id="sms5_preset_sel">
<input type="checkbox" id="book_all" onclick="book_all_checked(this.checked);">
<label for="book_all">전체선택</label>
</div>
<div class="btn_add01 btn_add">
<a href="./form_write.php?page=<?php echo $page?>&amp;fg_no=<?php echo $fg_no?>">이모티콘 추가</a>
</div>
<form name="emoticonlist" id="emoticonlist" method="post" action="./form_multi_update.php" onsubmit="return emoticonlist_submit(this);" >
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="hidden" name="sw" value="">
<input type="hidden" name="atype" value="del">
<ul id="sms5_preset" class="sms5_box">
<?php
$count = 1;
$qry = sql_query("select * from {$g5['sms5_form_table']} where 1 $sql_group $sql_search order by fo_no desc limit $page_start, $page_size");
for($i=0;$res = sql_fetch_array($qry);$i++)
{
$tmp = sql_fetch("select fg_name from {$g5['sms5_form_group_table']} where fg_no='{$res['fg_no']}'");
if (!$tmp)
$group_name = '미분류';
else
$group_name = $tmp['fg_name'];
if ($i == 0) $li_i = 1;
else {
if ($li_i < 12) $li_i += 1;
else if ($li_i == 12) $li_i = 1;
}
?>
<li class="li_<?php echo $li_i; ?> sms5_box">
<span class="box_ico"></span>
<div class="li_chk">
<label for="fo_no_<?php echo $i; ?>" class="sound_only"><?php echo $group_name?>의 <?php echo cut_str($res['fo_name'],10)?></label>
<input type="checkbox" name="fo_no[]" value="<?php echo $res['fo_no']?>" id="fo_no_<?php echo $i; ?>">
</div>
<div class="li_preview">
<textarea readonly class="box_txt box_square"><?php echo $res['fo_content']?></textarea>
</div>
<div class="li_info">
<span class="sound_only">그룹 </span><b><?php echo $group_name?></b><br>
<span class="sound_only">제목 </span><?php echo cut_str($res['fo_name'],10)?><br>
</div>
<div class="li_date">
<span class="sound_only">등록 </span><?php echo date('Y-m-d', strtotime($res['fo_datetime']))?>
</div>
<div class="li_cmd">
<a href="./form_write.php?w=u&amp;fo_no=<?php echo $res['fo_no']?>&amp;page=<?php echo $page;?>&amp;fg_no=<?php echo $fg_no;?>&amp;st=<?php echo $st;?>&amp;sv=<?php echo $sv;?>">수정</a>
<a href="javascript:void(book_del('<?php echo $res['fo_no']?>'));">삭제</a>
<a href="./sms_write.php?fo_no=<?php echo $res['fo_no']?>">보내기</a>
</div>
</li>
<?php } ?>
</ul>
<div class="btn_list01 btn_list" style="position:relative">
<input type="submit" name="act_button" value="선택이동" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
</div>
</form>
<script>
function emoticonlist_submit(f){
if (!is_checked("fo_no[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택이동") {
select_copy("move", f);
return;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
// 선택한 이모티콘 그룹 이동
function select_copy(sw, f) {
if( !f ){
var f = document.emoticonlist;
}
if (sw == "copy")
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./emoticon_move.php";
f.submit();
}
</script>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF']."?fg_no=$fg_no&amp;st=$st&amp;sv=$sv&amp;page="); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,27 @@
<?php
$sub_menu = "900600";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
check_token();
if($atype == "del"){
$count = count($_POST['fo_no']);
if(!$count)
alert('선택삭제 하실 항목을 하나이상 선택해 주세요.');
for ($i=0; $i<$count; $i++)
{
// 실제 번호를 넘김
$fo_no = $_POST['fo_no'][$i];
if (!trim($fo_no)) continue;
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no='$fo_no'");
if (!$res) continue;
sql_query("delete from {$g5['sms5_form_table']} where fo_no='$fo_no'");
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count - 1 where fg_no='{$res['fg_no']}'");
}
}
goto_url('./form_list.php');

View File

@ -0,0 +1,78 @@
<?php
$sub_menu = "900600";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
$g5['title'] = "이모티콘 업데이트";
if ($w == 'u') // 업데이트
{
if (!$fg_no) $fg_no = 0;
if (!$fo_receipt) $fo_receipt = 0; else $fo_receipt = 1;
if (!strlen(trim($fo_name)))
alert('이름을 입력해주세요');
if (!strlen(trim($fo_content)))
alert('이모티콘을 입력해주세요');
/*
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no<>'$fo_no' and fo_content='$fo_content'");
if ($res)
alert('같은 이모티콘이 존재합니다.');
*/
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no='$fo_no'");
if (!$res)
alert('존재하지 않는 데이터 입니다.');
if ($fg_no != $res['fg_no']) {
if ($res['fg_no'])
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count - 1 where fg_no='{$res['fg_no']}'");
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count + 1 where fg_no='$fg_no'");
}
$group = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no = '$fg_no'");
sql_query("update {$g5['sms5_form_table']} set fg_no='$fg_no', fg_member='{$group['fg_member']}', fo_name='$fo_name', fo_content='$fo_content', fo_datetime='".G5_TIME_YMDHIS."' where fo_no='$fo_no'");
}
else if ($w == 'd') // 삭제
{
if (!is_numeric($fo_no))
alert('고유번호가 없습니다.');
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no='$fo_no'");
if (!$res)
alert('존재하지 않는 데이터 입니다.');
sql_query("delete from {$g5['sms5_form_table']} where fo_no='$fo_no'");
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count - 1 where fg_no = '{$res['fg_no']}'");
$get_fg_no = $fg_no;
}
else // 등록
{
if (!$fg_no) $fg_no = 0;
if (!strlen(trim($fo_name)))
alert('이름을 입력해주세요');
if (!strlen(trim($fo_content)))
alert('이모티콘을 입력해주세요');
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_content='$fo_content'");
if ($res)
alert('같은 이모티콘이 존재합니다.');
$group = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no = '$fg_no'");
sql_query("insert into {$g5['sms5_form_table']} set fg_no='$fg_no', fg_member='{$group['fg_member']}', fo_name='$fo_name', fo_content='$fo_content', fo_datetime='".G5_TIME_YMDHIS."'");
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count + 1 where fg_no = '$fg_no'");
$get_fg_no = $fg_no;
}
$go_url = './form_list.php?page='.$page.'&amp;fg_no='.$get_fg_no;
goto_url($go_url);
?>

View File

@ -0,0 +1,233 @@
<?php
$sub_menu = "900600";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
$g5['title'] = "이모티콘 ";
if ($w == 'u' && is_numeric($fo_no)) {
$write = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no='$fo_no'");
$g5['title'] .= '수정';
}
else {
$write['fg_no'] = $fg_no;
$g5['title'] .= '추가';
}
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="book_form" method="post" action="form_update.php">
<input type="hidden" name="w" value="<?php echo $w?>">
<input type="hidden" name="page" value="<?php echo $page?>">
<input type="hidden" name="fo_no" value="<?php echo $write['fo_no']?>">
<input type="hidden" name="get_fg_no" value="<?php echo $fg_no?>">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption><?php echo $g5['title'];?> 목록</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="fg_no">그룹<strong class="sound_only"> 필수</strong></label></th>
<td>
<select name="fg_no" id="fg_no" required class="required">
<option value="0">미분류</option>
<?php
$qry = sql_query("select * from {$g5['sms5_form_group_table']} order by fg_name");
while($res = sql_fetch_array($qry)) {
?>
<option value="<?php echo $res['fg_no']?>"<?php echo get_selected($res['fg_no'], $write['fg_no']); ?>><?php echo $res['fg_name']?></option>
<?php } ?>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="fo_name">제목<strong class="sound_only"> 필수</strong></label></th>
<td><input type="text" name="fo_name" id="fo_name" required value="<?php echo $write['fo_name']?>" class="frm_input required" size="70"></td>
</tr>
<tr>
<th scope="row">메세지</th>
<td id="sms5_emo_add">
<div class="sms5_box write_wrap">
<span class="box_ico"></span>
<label for="sms_contents" id="wr_message_lbl">내용</label>
<textarea name="fo_content" id="sms_contents" class="box_txt box_square" onkeyup="byte_check('sms_contents', 'sms_bytes');" accesskey="m"><?php echo $write['fo_content']?></textarea>
<div id="sms_byte"><span id="sms_bytes">0</span> / 80 byte</div>
<button type="button" id="write_sc_btn" class="write_scemo_btn">특수<br>기호</button>
<div id="write_sc" class="write_scemo">
<span class="scemo_ico"></span>
<div class="scemo_list">
<button type="button" class="scemo_add" onclick="javascript:add('■')">■</button>
<button type="button" class="scemo_add" onclick="javascript:add('□')">□</button>
<button type="button" class="scemo_add" onclick="javascript:add('▣')">▣</button>
<button type="button" class="scemo_add" onclick="javascript:add('◈')">◈</button>
<button type="button" class="scemo_add" onclick="javascript:add('◆')">◆</button>
<button type="button" class="scemo_add" onclick="javascript:add('◇')">◇</button>
<button type="button" class="scemo_add" onclick="javascript:add('♥')">♥</button>
<button type="button" class="scemo_add" onclick="javascript:add('♡')">♡</button>
<button type="button" class="scemo_add" onclick="javascript:add('●')">●</button>
<button type="button" class="scemo_add" onclick="javascript:add('○')">○</button>
<button type="button" class="scemo_add" onclick="javascript:add('▲')">▲</button>
<button type="button" class="scemo_add" onclick="javascript:add('▼')">▼</button>
<button type="button" class="scemo_add" onclick="javascript:add('▶')">▶</button>
<button type="button" class="scemo_add" onclick="javascript:add('▷')">▷</button>
<button type="button" class="scemo_add" onclick="javascript:add('◀')">◀</button>
<button type="button" class="scemo_add" onclick="javascript:add('◁')">◁</button>
<button type="button" class="scemo_add" onclick="javascript:add('☎')">☎</button>
<button type="button" class="scemo_add" onclick="javascript:add('☏')">☏</button>
<button type="button" class="scemo_add" onclick="javascript:add('♠')">♠</button>
<button type="button" class="scemo_add" onclick="javascript:add('♤')">♤</button>
<button type="button" class="scemo_add" onclick="javascript:add('♣')">♣</button>
<button type="button" class="scemo_add" onclick="javascript:add('♧')">♧</button>
<button type="button" class="scemo_add" onclick="javascript:add('★')">★</button>
<button type="button" class="scemo_add" onclick="javascript:add('☆')">☆</button>
<button type="button" class="scemo_add" onclick="javascript:add('☞')">☞</button>
<button type="button" class="scemo_add" onclick="javascript:add('☜')">☜</button>
<button type="button" class="scemo_add" onclick="javascript:add('▒')">▒</button>
<button type="button" class="scemo_add" onclick="javascript:add('⊙')">⊙</button>
<button type="button" class="scemo_add" onclick="javascript:add('㈜')">㈜</button>
<button type="button" class="scemo_add" onclick="javascript:add('№')">№</button>
<button type="button" class="scemo_add" onclick="javascript:add('㉿')">㉿</button>
<button type="button" class="scemo_add" onclick="javascript:add('♨')">♨</button>
<button type="button" class="scemo_add" onclick="javascript:add('™')">™</button>
<button type="button" class="scemo_add" onclick="javascript:add('℡')">℡</button>
<button type="button" class="scemo_add" onclick="javascript:add('∑')">∑</button>
<button type="button" class="scemo_add" onclick="javascript:add('∏')">∏</button>
<button type="button" class="scemo_add" onclick="javascript:add('♬')">♬</button>
<button type="button" class="scemo_add" onclick="javascript:add('♪')">♪</button>
<button type="button" class="scemo_add" onclick="javascript:add('♩')">♩</button>
<button type="button" class="scemo_add" onclick="javascript:add('♭')">♭</button>
</div>
<div class="scemo_cls"><button type="button" class="scemo_cls_btn">닫기</button></div>
</div>
<button type="button" id="write_emo_btn" class="write_scemo_btn">이모<br>티콘</button>
<div id="write_emo" class="write_scemo">
<span class="scemo_ico"></span>
<div class="scemo_list">
<button type="button" class="scemo_add" onclick="javascript:add('*^^*')">*^^*</button>
<button type="button" class="scemo_add" onclick="javascript:add('♡.♡')">♡.♡</button>
<button type="button" class="scemo_add" onclick="javascript:add('@_@')">@_@</button>
<button type="button" class="scemo_add" onclick="javascript:add('☞_☜')">☞_☜</button>
<button type="button" class="scemo_add" onclick="javascript:add('ㅠ ㅠ')">ㅠ ㅠ</button>
<button type="button" class="scemo_add" onclick="javascript:add('Θ.Θ')">Θ.Θ</button>
<button type="button" class="scemo_add" onclick="javascript:add('^_~♥')">^_~♥</button>
<button type="button" class="scemo_add" onclick="javascript:add('~o~')">~o~</button>
<button type="button" class="scemo_add" onclick="javascript:add('★.★')">★.★</button>
<button type="button" class="scemo_add" onclick="javascript:add('(!.!)')">(!.!)</button>
<button type="button" class="scemo_add" onclick="javascript:add('⊙.⊙')">⊙.⊙</button>
<button type="button" class="scemo_add" onclick="javascript:add('q.p')">q.p</button>
<button type="button" class="scemo_add emo_long" onclick="javascript:add('┏( \'\')┛')">┏( \'\')┛</button>
<button type="button" class="scemo_add emo_long" onclick="javascript:add('@)-)--')">@)-)--')</button>
<button type="button" class="scemo_add emo_long" onclick="javascript:add('↖(^-^)↗')">↖(^-^)↗</button>
<button type="button" class="scemo_add emo_long" onclick="javascript:add('(*^-^*)')">(*^-^*)</button>
</div>
<div class="scemo_cls"><button type="button" class="scemo_cls_btn">닫기</button></div>
</div>
</div>
</td>
</tr>
<?php if ($w == 'u') {?>
<tr>
<th scope="row">업데이트</th>
<td> <?php echo $write['fo_datetime']?> </td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s">
<a href="./form_list.php?<?php echo $_SERVER['QUERY_STRING']?>">목록</a>
</div>
</form>
<script>
function add(str) {
var conts = document.getElementById('sms_contents');
var bytes = document.getElementById('sms_bytes');
conts.focus();
conts.value+=str;
byte_check('sms_contents', 'sms_bytes');
return;
}
function byte_check(sms_contents, sms_bytes)
{
var conts = document.getElementById(sms_contents);
var bytes = document.getElementById(sms_bytes);
var i = 0;
var cnt = 0;
var exceed = 0;
var ch = '';
for (i=0; i<conts.value.length; i++)
{
ch = conts.value.charAt(i);
if (escape(ch).length > 4) {
cnt += 2;
} else {
cnt += 1;
}
}
bytes.innerHTML = cnt;
if (cnt > 80)
{
exceed = cnt - 80;
alert('메시지 내용은 80바이트를 넘을수 없습니다.\n\n작성하신 메세지 내용은 '+ exceed +'byte가 초과되었습니다.\n\n초과된 부분은 자동으로 삭제됩니다.');
var tcnt = 0;
var xcnt = 0;
var tmp = conts.value;
for (i=0; i<tmp.length; i++)
{
ch = tmp.charAt(i);
if (escape(ch).length > 4) {
tcnt += 2;
} else {
tcnt += 1;
}
if (tcnt > 80) {
tmp = tmp.substring(0,i);
break;
} else {
xcnt = tcnt;
}
}
conts.value = tmp;
bytes.innerHTML = xcnt;
return;
}
}
byte_check('sms_contents', 'sms_bytes');
document.getElementById('sms_contents').focus();
</script>
<script>
$(function(){
$(".box_txt").bind("focus keydown", function(){
$("#wr_message_lbl").hide();
});
$(".write_scemo_btn").click(function(){
$(".write_scemo").hide();
$(this).next(".write_scemo").show();
});
$(".scemo_cls_btn").click(function(){
$(".write_scemo").hide();
});
});
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,98 @@
<?php
$sub_menu = "900400";
include_once("./_common.php");
$page_size = 20;
$colspan = 11;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "문자전송 내역";
if ($page < 1) $page = 1;
if ($st && trim($sv))
$sql_search = " and wr_message like '%$sv%' ";
else
$sql_search = "";
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_write_table']} where wr_renum=0 $sql_search");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="search_form" id="search_form" action=<?php echo $_SERVER['PHP_SELF'];?> class="local_sch01 local_sch" method="get">
<label for="st" class="sound_only">검색대상</label>
<input type="hidden" name="st" id="st" value="wr_message" >
<label for="sv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="sv" value="<?php echo $sv ?>" id="sv" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">메세지</th>
<th scope="col">회신번호</th>
<th scope="col">전송일시</th>
<th scope="col">예약</th>
<th scope="col">총건수</th>
<th scope="col">성공</th>
<th scope="col">실패</th>
<th scope="col">중복</th>
<th scope="col">재전송</th>
<th scope="col">관리</th>
</tr>
</thead>
<tbody>
<?php if (!$total_count) { ?>
<tr>
<td colspan="<?php echo $colspan?>" class="empty_table" >
데이터가 없습니다.
</td>
</tr>
<?php
}
$qry = sql_query("select * from {$g5['sms5_write_table']} where wr_renum=0 $sql_search order by wr_no desc limit $page_start, $page_size");
while($res = sql_fetch_array($qry)) {
$bg = 'bg'.($line++%2);
$tmp_wr_memo = @unserialize($res['wr_memo']);
$dupli_count = $tmp_wr_memo['total'] ? $tmp_wr_memo['total'] : 0;
?>
<tr class="<?php echo $bg; ?>">
<td class="td_numsmall"><?php echo $vnum--?></td>
<td><span title="<?php echo $res['wr_message']?>"><?php echo $res['wr_message']?></span></td>
<td class="td_numbig"><?php echo $res['wr_reply']?></td>
<td class="td_datetime"><?php echo date('Y-m-d H:i', strtotime($res['wr_datetime']))?></td>
<td class="td_boolean"><?php echo $res['wr_booking']!='0000-00-00 00:00:00'?"<span title='{$res['wr_booking']}'>예약</span>":'';?></td>
<td class="td_num"><?php echo number_format($res['wr_total'])?></td>
<td class="td_num"><?php echo number_format($res['wr_success'])?></td>
<td class="td_num"><?php echo number_format($res['wr_failure'])?></td>
<td class="td_num"><?php echo $dupli_count;?></td>
<td class="td_num"><?php echo number_format($res['wr_re_total'])?></td>
<td class="td_mngsmall">
<a href="./history_view.php?page=<?php echo $page;?>&amp;st=<?php echo $st;?>&amp;sv=<?php echo $sv;?>&amp;wr_no=<?php echo $res['wr_no'];?>">수정</a>
<!-- <a href="./history_del.php?page=<?php echo $page;?>&amp;st=<?php echo $st;?>&amp;sv=<?php echo $sv;?>&amp;wr_no=<?php echo $res['wr_no'];?>">삭제</a> -->
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF']."?st=$st&amp;sv=$sv&amp;page="); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,90 @@
<?php
$sub_menu = "900410";
include_once("./_common.php");
$page_size = 20;
$colspan = 7;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "문자전송 내역 (회원)";
if ($page < 1) $page = 1;
if ($st && trim($sv))
$sql_search = " and $st like '%$sv%' ";
else
$sql_search = "";
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_member_history_table']} where 1 $sql_search");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="search_form" method="get" action="<?php echo $_SEVER['PHP_SELF']?>" class="local_sch01 local_sch">
<label for="st" class="sound_only">검색대상</label>
<select name="st" id="st">
<option value="mb_id"<?php echo get_selected('mh_name', $st); ?>>아이디</option>
<option value="mh_hp"<?php echo get_selected('mh_hp', $st); ?>>받는번호</option>
<option value="mh_reply"<?php echo get_selected('mh_reply', $st); ?>>보내는번호</option>
</select>
<label for="sv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="sv" value="<?php echo $sv ?>" id="sv" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">회원</th>
<th scope="col">보내는번호</th>
<th scope="col">받는번호</th>
<th scope="col">전송일시</th>
<th scope="col">예약</th>
<th scope="col">Log</th>
</tr>
</thead>
<tbody>
<?php if (!$total_count) { ?>
<tr>
<td colspan="<?php echo $colspan?>" class="empty_table" >
데이터가 없습니다.
</td>
</tr>
<?php
}
$qry = sql_query("select * from {$g5['sms5_member_history_table']} where 1 $sql_search order by mh_no desc limit $page_start, $page_size");
while($row = sql_fetch_array($qry)) {
$bg = 'bg'.($line++%2);
$mb = get_member($row['mb_id']);
$mb_id = get_sideview($row['mb_id'], $mb['mb_nick']);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_num"><?php echo $vnum--?></td>
<td class="td_mbid"><?php echo $mb_id?></td>
<td class="td_numbig"><?php echo $row['mh_reply']?></td>
<td class="td_numbig"><?php echo $row['mh_hp']?></td>
<td class="td_datetime"><?php echo $row['mh_datetime']?></td>
<td class="td_boolean"><?php echo $row['mh_booking']!='0000-00-00 00:00:00'?"<span title='{$row['mh_booking']}'>예약</span>":'';?></td>
<td><?php echo $row['mh_log']?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF']."?st=$st&amp;sv=$sv&amp;page="); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,107 @@
<?php
$sub_menu = '900400';
include_once('./_common.php');
$page_size = 20;
$colspan = 10;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "문자전송 내역 (번호별)";
if ($page < 1) $page = 1;
if ($st && trim($sv))
$sql_search = " and $st like '%$sv%' ";
else
$sql_search = "";
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_history_table']} where 1 $sql_search");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="search_form" method="get" action="<?echo $_SERVER['PHP_SELF']?>" class="local_sch01 local_sch" >
<label for="st" class="sound_only">검색대상</label>
<select name="st" id="st">
<option value="hs_name"<?php echo get_selected('hs_name', $st); ?>>이름</option>
<option value="hs_hp"<?php echo get_selected('hs_hp', $st); ?>>휴대폰번호</option>
<option value="bk_no"<?php echo get_selected('bk_no', $st); ?>>고유번호</option>
</select>
<label for="sv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="sv" value="<?php echo $sv; ?>" id="sv" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">그룹</th>
<th scope="col">이름</th>
<th scope="col">회원ID</th>
<th scope="col">전화번호</th>
<th scope="col">전송일시</th>
<th scope="col">예약</th>
<th scope="col">전송</th>
<th scope="col">메세지</th>
<th scope="col">관리</th>
</tr>
</thead>
<tbody>
<?php if (!$total_count) { ?>
<tr>
<td colspan="<?php echo $colspan; ?>" class="empty_table" >
데이터가 없습니다.
</td>
</tr>
<?php
}
$qry = sql_query("select * from {$g5['sms5_history_table']} where 1 $sql_search order by hs_no desc limit $page_start, $page_size");
while($res = sql_fetch_array($qry)) {
$bg = 'bg'.($line++%2);
$write = sql_fetch("select * from {$g5['sms5_write_table']} where wr_no='{$res['wr_no']}' and wr_renum=0");
$group = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no='{$res['bg_no']}'");
if ($group)
$bg_name = $group['bg_name'];
else
$bg_name = '없음';
if ($res['mb_id'])
$mb_id = '<a href="'.G5_ADMIN_URL.'/member_form.php?w=u&amp;mb_id='.$res['mb_id'].'">'.$res['mb_id'].'</a>';
else
$mb_id = '비회원';
?>
<tr class="<?php echo $bg; ?>">
<td class="td_num"><?php echo $vnum--; ?></td>
<td class="td_mbname"><?php echo $bg_name; ?></td>
<td class="td_mbname"><a href="./num_book_write.php?w=u&amp;bk_no=<?php echo $res['bk_no']; ?>"><?php echo $res['hs_name']; ?></a></td>
<td class="td_mbid"><?php echo $mb_id; ?></td>
<td class="td_numbig"><?php echo $res['hs_hp']; ?></td>
<td class="td_datetime"><?php echo date('Y-m-d H:i', strtotime($write['wr_datetime']))?></td>
<td class="td_boolean"><?php echo $write['wr_booking']!='0000-00-00 00:00:00'?"<span title='{$write['wr_booking']}'>예약</span>":'';?></td>
<td class="td_boolean"><?php echo $res['hs_flag']?'성공':'실패'?></td>
<td><span title="<?php echo $write['wr_message']?>"><?php echo $write['wr_message']?></span></td>
<td class="td_mngsmall">
<a href="./history_view.php?page=<?php echo $page; ?>&amp;st=<?php echo $st; ?>&amp;sv=<?php echo $sv; ?>&amp;wr_no=<?php echo $res['wr_no']; ?>">수정</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF']."?st=$st&amp;sv=$sv&amp;page="); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,138 @@
<?php
$sub_menu = "900400";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
$g5['title'] = "문자전송중";
$list = array();
$write = sql_fetch("select * from {$g5['sms5_write_table']} where wr_no='$wr_no' and wr_renum=0");
$res = sql_fetch("select max(wr_renum) as wr_renum from {$g5['sms5_write_table']} where wr_no='$wr_no'");
$new_wr_renum = $res['wr_renum'] + 1;
if ($w == 'f')
$sql_flag = " and hs_flag=0 ";
else
$sql_flag = "";
if ($wr_renum)
$sql_renum = " and wr_renum='$wr_renum' ";
else
$sql_renum = " and wr_renum=0 ";
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_history_table']} where wr_no='$wr_no' $sql_renum $sql_flag");
if (!$res['cnt']) {
?>
<script>
act = window.open('sms_ing.php', 'act', 'width=300, height=200');
act.close();
alert('재전송할 내역이 없습니다.');
history.back();
</script>
<?php
exit;
}
$sql = sql_query("select * from {$g5['sms5_history_table']} where wr_no='$wr_no' $sql_renum $sql_flag");
while ($res = sql_fetch_array($sql))
{
$res['bk_hp'] = get_hp($res['bk_hp'], 0);
if ($g5['sms5_demo'])
$res['bk_hp'] = '0100000000';
array_push($list, $res);
}
$wr_total = count($list);
if ($config['cf_sms_use'] != 'icode') {
alert('기본환경설정에서 icode sms 사용이 비활성화 되어 있습니다.');
}
include_once(G5_ADMIN_PATH.'/admin.head.php');
$SMS = new SMS5;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$reply = str_replace('-', '', trim($write['wr_reply']));
$result = $SMS->Add($list, $reply, '', '', $write['wr_message'], '', $wr_total);
if ($result)
{
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', wr_reply='{$write['wr_reply']}', wr_message='{$write['wr_message']}', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
$wr_success = 0;
$wr_failure = 0;
$count = 0;
foreach ($SMS->Result as $result)
{
list($phone, $code) = explode(":", $result);
if (substr($code,0,5) == "Error")
{
$hs_code = substr($code,6,2);
switch ($hs_code) {
case '02': // "02:형식오류"
$hs_memo = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$hs_memo = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$hs_memo = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$hs_memo = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$hs_memo = "알 수 없는 오류로 전송이 실패하었습니다.";
break;
}
$wr_failure++;
$hs_flag = 0;
}
else
{
$hs_code = $code;
$hs_memo = get_hp($phone, 1)."로 전송했습니다.";
$wr_success++;
$hs_flag = 1;
}
$row = array_shift($list);
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
$log = array_shift($SMS->Log);
sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='{$row['hs_name']}', hs_hp='{$row['hs_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'");
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
sql_query("update {$g5['sms5_write_table']} set wr_success='$wr_success', wr_failure='$wr_failure' where wr_no='$wr_no' and wr_renum='$new_wr_renum'");
sql_query("update {$g5['sms5_write_table']} set wr_re_total=wr_re_total+1 where wr_no='$wr_no' and wr_renum=0");
}
else alert("에러: SMS 서버와 통신이 불안정합니다.");
}
else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
?>
<script>
act = window.open('sms_ing.php', 'act', 'width=300, height=200');
act.close();
location.href = 'history_view.php?wr_no=<?php echo $wr_no?>&wr_renum=<?php echo $new_wr_renum?>';
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,246 @@
<?php
$sub_menu = "900400";
include_once("./_common.php");
$spage_size = 20;
$colspan = 10;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "문자전송 상세내역";
if (!is_numeric($wr_no))
alert('전송 고유 번호가 없습니다.');
if ($spage < 1) $spage = 1;
if ($sst && trim($ssv))
$sql_search = " and $sst like '%$ssv%' ";
else
$sql_search = "";
if ($wr_renum) {
$sql_renum = " and wr_renum='$wr_renum' ";
$re_text = " <span style='font-weight:normal; color:red;'>(재전송)</span>";
} else
$sql_renum = " and wr_renum='0'";
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_history_table']} where wr_no='$wr_no' $sql_search $sql_renum");
$total_count = $total_res['cnt'];
$total_spage = (int)($total_count/$spage_size) + ($total_count%$spage_size==0 ? 0 : 1);
$spage_start = $spage_size * ( $spage - 1 );
$vnum = $total_count - (($spage-1) * $spage_size);
$write = sql_fetch("select * from {$g5['sms5_write_table']} where wr_no='$wr_no' $sql_renum");
if ($write['wr_booking'] == '0000-00-00 00:00:00')
$write['wr_booking'] = '즉시전송';
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<script>
function re_send()
{
<?php if (!$write['wr_failure']) { ?>
alert('실패한 전송이 없습니다.');
<?php } else { ?>
if (!confirm('전송에 실패한 SMS 를 재전송 하시겠습니까?'))
return;
act = window.open('sms_ing.php', 'act', 'width=300, height=200');
act.focus();
location.href = './history_send.php?w=f&page=<?php echo $page?>&st=<?php echo $st?>&sv=<?php echo $sv?>&wr_no=<?php echo $wr_no?>&wr_renum=<?php echo $wr_renum?>';
<?php } ?>
}
function all_send()
{
if (!confirm('전체 SMS 를 재전송 하시겠습니까?\n\n예약전송일 경우 예약일시는 다시 설정하셔야 합니다.'))
return;
location.href = './sms_write.php?wr_no=<?php echo $wr_no?>';
}
</script>
<form name="search_form" method="get" action="<?php echo $_SERVER['PHP_SELF']?>" class="local_sch01 local_sch">
<input type="hidden" name="wr_no" value="<?php echo $wr_no?>">
<input type="hidden" name="wr_renum" value="<?php echo $wr_renum?>">
<input type="hidden" name="page" value="<?php echo $page?>">
<input type="hidden" name="st" value="<?php echo $st?>">
<input type="hidden" name="sv" value="<?php echo $sv?>">
<label for="sst" class="sound_only">검색대상</label>
<select name="sst" id="sst">
<option value="hs_name" <?php echo get_selected('hs_name', $sst); ?>>이름</option>
<option value="hs_hp" <?php echo get_selected('hs_hp', $sst); ?>>휴대폰번호</option>
</select>
<label for="ssv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="ssv" value="<?php echo $ssv?>" id="ssv" class="frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<div id="sms5_sent">
<div class="local_ov01 local_ov">
<span class="ov_listall">전송건수 <?php echo number_format($write['wr_total'])?> 건</span>
<span class="ov_listall">성공건수 <span class="txt_succeed"><?php echo number_format($write['wr_success'])?> 건</span></span>
<span class="ov_listall">실패건수 <span class="txt_fail"><?php echo number_format($write['wr_failure'])?> 건</span></span>
<span class="ov_listall">전송일시 <?php echo $write['wr_datetime']?></span>
<span class="ov_listall">예약일시 <?php echo $write['wr_booking']?></span>
<span class="ov_listall">회신번호 <?php echo $write['wr_reply']?></span>
</div>
<h2>전송내용</h2>
<div id="con_sms" class="sms5_box">
<span class="box_ico"></span>
<textarea class="box_txt" readonly><?php echo $write['wr_message'];?></textarea>
</div>
<?php if ($write['wr_re_total'] && !$wr_renum) { ?>
<h2>전송실패 문자 재전송 내역</h2>
<table>
<thead>
<tr>
<th scope="col">번호</th>
<!-- <th scope="col"><input type=checkbox></th> -->
<!-- <th scope="col">메세지</th> -->
<!-- <th scope="col">회신번호</th> -->
<th scope="col">전송일시</th>
<th scope="col">총건수</th>
<th scope="col">성공</th>
<th scope="col">실패</th>
<th scope="col">관리</th>
</tr>
</thead>
<tbody>
<?php
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_write_table']} where wr_no='$wr_no' and wr_renum>0");
$re_vnum = $res['cnt'];
$qry = sql_query("select * from {$g5['sms5_write_table']} where wr_no='$wr_no' and wr_renum>0 order by wr_renum desc");
while($res = sql_fetch_array($qry)) {
?>
<tr>
<td><?php echo $re_vnum--?></td>
<!-- <td><input type=checkbox></td> -->
<!-- <td><?php echo $res[wr_message]; ?></span></td>-->
<!-- <td><?php echo $res[wr_reply]; ?></td>-->
<td><?php echo $res['wr_datetime']?></td>
<td><?php echo number_format($res['wr_total'])?></td>
<td><?php echo number_format($res['wr_success'])?></td>
<td><?php echo number_format($res['wr_failure'])?></td>
<td>
<a href="./history_view.php?page=<?php echo $page?>&amp;st=<?php echo $st?>&amp;sv=<?php echo $sv?>&amp;wr_no=<?php echo $res['wr_no']?>&amp;wr_renum=<?php echo $res['wr_renum']?>">수정</a>
<!-- <a href="./history_del.php?page=<?php echo $page?>&amp;st=<?php echo $st?>&amp;sv=<?php echo $sv?>&amp;wr_no=<?php echo $res[wr_no]?>&amp;wr_renum=<?php echo $res[wr_renum]?>">삭제</a> -->
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<?php
if( $write['wr_memo'] ){
$tmp_wr_memo = @unserialize($write['wr_memo']);
if( count($tmp_wr_memo) && is_array($tmp_wr_memo) ){
$arr_wr_memo = array_count_values( $tmp_wr_memo['hp'] );
?>
<h2>중복번호 <?php echo $tmp_wr_memo['total'];?>건</h2>
<ul id="sent_overlap">
<?php
foreach( $arr_wr_memo as $key=>$v){
if( empty($v) ) continue;
?>
<li><b><?php echo $key;?></b> 중복 <?php echo $v;?>건</li>
<?php } ?>
</ul>
<?php
}
}
?>
<h2>문자전송 목록 <?php echo $re_text?></h2>
<div class="btn_add01 btn_add">
<a href="javascript:all_send()">전체 재전송</a>
<a href="javascript:re_send()">실패내역 재전송</a>
<?php if (!$wr_renum) {?>
<a href="./history_list.php?page=<?php echo $page?>&amp;st=<?php echo $st?>&amp;sv=<?php echo $sv?>">목록</a>
<?php } else { ?>
<a href="./history_view.php?page=<?php echo $page?>&amp;st=<?php echo $st?>&amp;sv=<?php echo $sv?>&amp;wr_no=<?php echo $wr_no?>">뒤로가기</a>
<?php } ?>
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">그룹</th>
<th scope="col">이름</th>
<th scope="col">회원ID</th>
<th scope="col">휴대폰번호</th>
<th scope="col">전송일시</th>
<th scope="col">결과</th>
<th scope="col">비고</th>
<th scope="col">내역</th>
</tr>
</thead>
<tbody>
<?php if (!$total_count) { ?>
<tr>
<td colspan="<?php echo $colspan?>" class="empty_table">
데이터가 없습니다.
</td>
</tr>
<?php
}
$qry = sql_query("select * from {$g5['sms5_history_table']} where wr_no='$wr_no' $sql_search $sql_renum order by hs_no desc limit $spage_start, $spage_size");
while($res = sql_fetch_array($qry)) {
$bg = 'bg'.($line++%2);
$group = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no='{$res['bg_no']}'");
if ($group)
$bg_name = $group['bg_name'];
else
$bg_name = '없음';
if ($res['mb_id'])
$mb_id = get_sideview($res['mb_id'], $res['mb_id']);
else
$mb_id = '비회원';
$res['hs_log'] = str_replace($config['cf_icode_pw'], '**********', $res['hs_log']);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_numsmall"><?php echo number_format($vnum--)?></td>
<td class="td_name"><?php echo $bg_name?></td>
<td class="td_mbname"><?php echo $res['hs_name']?></a></td>
<td class="td_mbid"><?php echo $mb_id?></td>
<td class="td_numbig"><?php echo $res['hs_hp']?></td>
<td class="td_datetime"><?php echo $res['hs_datetime']?></td>
<td class="td_boolean"><?php echo $res['hs_flag']?'성공':'실패'?></td>
<td>
<u>결과코드</u> : <?php echo $res['hs_code']?><br>
<u>로그</u> : <?php echo $res['hs_log']?><br>
<u>메모</u> : <?php echo $res['hs_memo']?>
</td>
<td class="td_mngsmall">
<?php if ($res['bk_no']) { ?>
<a href="./history_num.php?wr_id=<?php echo $res['wr_no']?>&amp;st=bk_no&amp;sv=<?php echo $res['bk_no']?>">내역</a>
<?php } else { ?>
<a href="./history_num.php?wr_id=<?php echo $res['wr_no']?>&amp;st=hs_hp&amp;sv=<?php echo $res['hs_hp']?>">내역</a>
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php echo sms5_sub_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $spage, $total_spage, $_SERVER['PHP_SELF']."?wr_no=$wr_no&amp;wr_renum=$wr_renum&amp;page=$page&amp;st=$st&amp;sv=$sv&amp;sst=$sst&amp;ssv=$ssv", "", "spage"); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

86
adm/sms_admin/install.php Normal file
View File

@ -0,0 +1,86 @@
<?php
$sub_menu = "900000";
include_once("./_common.php");
auth_check($auth[$sub_menu], 'r');
$g5['title'] = "SMS5 솔루션 설치";
$setup = $_POST['setup'];
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="hidden_form" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
<input type="hidden" name="setup">
</form>
<?php
//SMS 설정 정보 테이블이 있는지 검사한다.
if( isset($g5['sms5_config_table']) && sql_query(" DESCRIBE {$g5['sms5_config_table']} ", false)) {
if(!$setup){
echo '<script>
var answer = confirm("이미 SMS5가 설치되어 있습니다.새로 설치 할 경우 DB 자료가 망실됩니다. 새로 설치하시겠습니까?");
if (answer){
document.hidden_form.setup.value = "1";
document.hidden_form.submit();
} else {
history.back();
}
</script>
';
exit;
}
}
?>
<div id="sms5_install">
<ol>
<li>SMS5 설치가 시작되었습니다.</li>
<li id="sms5_job_01">전체 테이블 생성중</li>
<li id="sms5_job_02">DB설정 중</li>
<li id="sms5_job_03"></li>
</ol>
<p><button type="button" id="sms5_btn_next" disabled class="btn_frmline" onclick="location.href='config.php';">SMS 기본설정</button></p>
</div>
<?php
flush(); usleep(50000);
// 테이블 생성 ------------------------------------
$file = implode("", file("./sms5.sql"));
eval("\$file = \"$file\";");
$f = explode(";", $file);
for ($i=0; $i<count($f); $i++) {
if (trim($f[$i]) == "") continue;
mysql_query($f[$i]) or die(mysql_error());
}
// 테이블 생성 ------------------------------------
echo "<script>document.getElementById('sms5_job_01').innerHTML='전체 테이블 생성 완료';</script>";
flush(); usleep(50000);
$read_point = -1;
$write_point = 5;
$comment_point = 1;
$download_point = -20;
//-------------------------------------------------------------------------------------------------
// config 테이블 설정
$sql = " insert into {$g5['sms5_book_group_table']} set bg_name='미분류'";
mysql_query($sql) or die(mysql_error() . "<p>" . $sql);
echo "<script>document.getElementById('sms5_job_02').innerHTML='DB설정 완료';</script>";
flush(); usleep(50000);
//-------------------------------------------------------------------------------------------------
echo "<script>document.getElementById('sms5_job_03').innerHTML='SMS 기본 설정 변경 후 사용하세요.';</script>";
flush(); usleep(50000);
?>
<script>document.getElementById('sms5_btn_next').disabled = false;</script>
<script>document.getElementById('sms5_btn_next').focus();</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,63 @@
<?php
$sub_menu = "900200";
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");
$g5['title'] = "회원정보 업데이트";
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<div id="sms5_mbup">
<form name="mb_update_form" id="mb_update_form" action="./member_update_run.php" >
<div class="local_desc02 local_desc">
<p>
새로운 회원정보로 업데이트 합니다.<br>
실행 후 '완료' 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
</p>
</div>
<div class="local_desc01 local_desc">
<p>
마지막 업데이트 일시 : <span id="datetime"><?php echo $sms5['cf_datetime']?></span> <br>
</p>
</div>
<div id="res_msg" class="local_desc01 local_desc">
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="실행" class="btn_submit">
</div>
</form>
</div>
<script>
(function($){
$( "#mb_update_form" ).submit(function( e ) {
e.preventDefault();
$("#res_msg").html('업데이트 중입니다. 잠시만 기다려 주십시오...');
var params = { mtype : 'json' };
$.ajax({
url: $(this).attr("action"),
cache:false,
timeout : 30000,
dataType:"json",
data:params,
success: function(data) {
$("#datetime").html( data.datetime );
$("#res_msg").html( data.res_msg );
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
return false;
});
})(jQuery);
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,122 @@
<?php
$sub_menu = "900200";
include_once("./_common.php");
@include_once(G5_PLUGIN_PATH."/sms5/JSON.php");
if( !function_exists('json_encode') ) {
function json_encode($data) {
$json = new Services_JSON();
return( $json->encode($data) );
}
}
if( $mtype == "json" ){
ajax_auth_check($auth[$sub_menu], "w");
} else {
auth_check($auth[$sub_menu], "w");
}
$count = 0;
$hp_yes = 0;
$hp_no = 0;
$hp_empty = 0;
$leave = 0;
$receipt = 0;
// 회원 데이터 마이그레이션
$qry = sql_query("select mb_id, mb_name, mb_hp, mb_sms, mb_leave_date from ".$g5['member_table']." order by mb_datetime");
while ($res = sql_fetch_array($qry))
{
if ($res['mb_leave_date'] != '')
$leave++;
else if ($res['mb_hp'] == '')
$hp_empty++;
else if (is_hp($res['mb_hp']))
$hp_yes++ ;
else
$hp_no++;
$hp = get_hp($res['mb_hp']);
if ($hp == '') $bk_receipt = 0; else $bk_receipt = $res['mb_sms'];
$field = "mb_id='{$res['mb_id']}', bk_name='{$res['mb_name']}', bk_hp='{$hp}', bk_receipt='{$bk_receipt}', bk_datetime='".G5_TIME_YMDHIS."'";
$res2 = sql_fetch("select * from {$g5['sms5_book_table']} where mb_id='{$res['mb_id']}'");
if ($res2) // 기존에 등록되어 있을 경우 업데이트
{
$res3 = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where mb_id='{$res2['mb_id']}'");
$mb_count = $res3['cnt'];
// 회원이 삭제되었다면 휴대폰번호 DB 에서도 삭제한다.
if ($res['mb_leave_date'])
{
sql_query("delete from {$g5['sms5_book_table']} where mb_id='{$res2['mb_id']}'");
$sql = "update {$g5['sms5_book_group_table']} set bg_count = bg_count - $mb_count, bg_member = bg_member - $mb_count";
if ($res2['bk_receipt'] == 1)
$sql .= ", bg_receipt = bg_receipt - $mb_count";
else
$sql .= ", bg_reject = bg_reject - $mb_count";
$sql .= " where bg_no='{$res2['bg_no']}'";
sql_query($sql);
}
else
{
if ($bk_receipt != $res2['bk_receipt']) {
if ($bk_receipt == 1)
$sql_sms = "bg_receipt = bg_receipt + $mb_count, bg_reject = bg_reject - $mb_count";
else
$sql_sms = "bg_receipt = bg_receipt - $mb_count, bg_reject = bg_reject + $mb_count";
sql_query("update {$g5['sms5_book_group_table']} set $sql_sms where bg_no='{$res2['bg_no']}'");
}
if ($bk_receipt) $receipt++;
sql_query("update {$g5['sms5_book_table']} set $field where mb_id='{$res['mb_id']}'");
}
}
else if ($res['mb_leave_date'] == '') // 기존에 등록되어 있지 않을 경우 추가 (삭제된 회원이 아닐 경우)
{
if ($bk_receipt == 1) {
$sql_sms = "bg_receipt = bg_receipt + 1";
$receipt++;
} else {
$sql_sms = "bg_reject = bg_reject + 1";
}
sql_query("insert into {$g5['sms5_book_table']} set $field, bg_no=1");
sql_query("update {$g5['sms5_book_group_table']} set bg_count = bg_count + 1, bg_member = bg_member + 1, $sql_sms where bg_no=1");
}
$count++;
}
sql_query("update {$g5['sms5_config_table']} set cf_datetime='".G5_TIME_YMDHIS."'");
$msg = '';
$msg .= '<p>회원정보를 휴대폰번호 DB로 업데이트 하였습니다.</p>';
$msg .= '<dl id="sms_mbup">';
$msg .= '<dt>총 회원 수</dt><dd>'.number_format($count).'명</dd>';
$msg .= '<dt>삭제된 회원</dt><dd>'.number_format($leave).'명</dd>';
$msg .= '<dt><span style="gray">휴대폰번호 없음</span></dt><dd>'.number_format($hp_empty).' 명</dd>';
$msg .= '<dt><span style="color:blue;">휴대폰번호 정상</span></dt><dd>'.number_format($hp_yes).' 명</span>&nbsp;';
$msg .= '(<span style="color:blue;">수신</span>'.number_format($receipt).' 명';
$msg .= ' / ';
$msg .= '<span style="color:red;">거부</span>'.number_format($hp_yes-$receipt).' 명)</dd>';
$msg .= '<dt><span style="color:red;">휴대폰번호 오류</span></dt><dd>'.number_format($hp_no).' 명</span></dd>';
$msg .= '</dl>';
$msg .= '<p>프로그램의 실행을 끝마치셔도 좋습니다.</p>';
if( $mtype == "json" ){
$json_msg = array();
$json_msg['datetime'] = G5_TIME_YMDHIS;
$json_msg['res_msg'] = $msg;
die( json_encode($json_msg) );
} else {
die( $msg );
}
?>

263
adm/sms_admin/num_book.php Normal file
View File

@ -0,0 +1,263 @@
<?php
$sub_menu = "900800";
include_once("./_common.php");
$page_size = 20;
$colspan = 9;
auth_check($auth[$sub_menu], "r");
$token = get_token();
$g5['title'] = "휴대폰번호 관리";
if ($page < 1) $page = 1;
if (is_numeric($bg_no))
$sql_group = " and bg_no='$bg_no' ";
else
$sql_group = "";
if ($st == 'all') {
$sql_search = "and (bk_name like '%{$sv}%' or bk_hp like '%{$sv}%')";
} else if ($st == 'name') {
$sql_search = "and bk_name like '%{$sv}%'";
} else if ($st == 'hp') {
$sql_search = "and bk_hp like '%{$sv}%'";
} else {
$sql_search = '';
}
if ($ap > 0)
$sql_korean = korean_index('bk_name', $ap-1);
else {
$sql_korean = '';
$ap = 0;
}
if ($no_hp == 'yes') {
set_cookie('cookie_no_hp', 'yes', 60*60*24*365);
$no_hp_checked = 'checked';
} else if ($no_hp == 'no') {
set_cookie('cookie_no_hp', '', 0);
$no_hp_checked = '';
} else {
if (get_cookie('cookie_no_hp') == 'yes')
$no_hp_checked = 'checked';
else
$no_hp_checked = '';
}
if ($no_hp_checked == 'checked')
$sql_no_hp = "and bk_hp <> ''";
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where 1 $sql_group $sql_search $sql_korean $sql_no_hp");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where bk_receipt=1 $sql_group $sql_search $sql_korean $sql_no_hp");
$receipt_count = $res['cnt'];
$reject_count = $total_count - $receipt_count;
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where mb_id='' $sql_group $sql_search $sql_korean $sql_no_hp");
$no_member_count = $res['cnt'];
$member_count = $total_count - $no_member_count;
$no_group = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no = 1");
$group = array();
$qry = sql_query("select * from {$g5['sms5_book_group_table']} where bg_no>1 order by bg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<script>
function book_all_checked(chk)
{
if (chk) {
jQuery('[name="bk_no[]"]').attr('checked', true);
} else {
jQuery('[name="bk_no[]"]').attr('checked', false);
}
}
function no_hp_click(val)
{
var url = './num_book.php?bg_no=<?php echo $bg_no?>&st=<?php echo $st?>&sv=<?php echo $sv?>';
if (val == true)
location.href = url + '&no_hp=yes';
else
location.href = url + '&no_hp=no';
}
</script>
<div class="local_ov01 local_ov">
<span class="ov_listall">회원정보 최근 업데이트 <?php echo $sms5['cf_datetime']?></span>
<span class="ov_listall">총 건수 <?php echo number_format($total_count)?>명</span>
<span class="ov_listall">회원 <?php echo number_format($member_count)?>명</span>
<span class="ov_listall">비회원 <?php echo number_format($no_member_count)?>명</span>
<span class="ov_listall">수신 <?php echo number_format($receipt_count)?>명</span>
<span class="ov_listall">거부 <?php echo number_format($reject_count)?>명</span>
</div>
<form name="search_form" method="get" action="<?php echo $_SERVER['PHP_SELF']?>" class="local_sch01 local_sch">
<input type="hidden" name="bg_no" value="<?php echo $bg_no?>" >
<label for="st" class="sound_only">검색대상</label>
<select name="st" id="st">
<option value="all"<?php echo get_selected('all', $st); ?>>이름 + 휴대폰번호</option>
<option value="name"<?php echo get_selected('name', $st); ?>>이름</option>
<option value="hp" <?php echo get_selected('hp', $st); ?>>휴대폰번호</option>
</select>
<label for="sv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="sv" value="<?php echo $sv?>" id="sv" required class="frm_input required">
<input type="submit" value="검색" class="btn_submit">
</form>
<form name="search_form" class="local_sch01 local_sch">
<label for="bg_no" class="sound_only">그룹명</label>
<select name="bg_no" id="bg_no" onchange="location.href='<?php echo $_SERVER['PHP_SELF']?>?bg_no='+this.value;">
<option value=""<?php echo get_selected('', $bg_no); ?>> 전체 </option>
<option value="<?php echo $no_group['bg_no']?>"<?php echo get_selected($bg_no, $no_group['bg_no']); ?>> <?php echo $no_group['bg_name']?> (<?php echo number_format($no_group['bg_count'])?> 명) </option>
<?php for($i=0; $i<count($group); $i++) {?>
<option value="<?php echo $group[$i]['bg_no']?>"<?php echo get_selected($bg_no, $group[$i]['bg_no']);?>> <?php echo $group[$i]['bg_name']?> (<?php echo number_format($group[$i]['bg_count'])?> 명) </option>
<?php } ?>
</select>
<input type="checkbox" name="no_hp" id="no_hp" <?php echo $no_hp_checked?> onclick="no_hp_click(this.checked)">
<label for="no_hp">휴대폰 소유자만 보기</label>
</form>
<div class="btn_add01 btn_add">
<a href="./num_book_write.php?page=<?php echo $page?>&amp;bg_no=<?php echo $bg_no?>">번호추가</a>
</div>
<form name="hp_manage_list" id="hp_manage_list" method="post" action="./num_book_multi_update.php" onsubmit="return hplist_submit(this);" >
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="hidden" name="sw" value="">
<input type="hidden" name="atype" value="del">
<input type="hidden" name="str_query" value="<?php echo $_SERVER['QUERY_STRING']?>" >
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">
<label for="chk_all" class="sound_only">현재 페이지 전체</label>
<input type="checkbox" id="chk_all" onclick="book_all_checked(this.checked)">
</th>
<th scope="col">번호</th>
<th scope="col">그룹</th>
<th scope="col">이름</th>
<th scope="col">휴대폰</th>
<th scope="col">수신</th>
<th scope="col">아이디</th>
<th scope="col">업데이트</th>
<th scope="col">관리</th>
</tr>
</thead>
<tbody>
<?php if (!$total_count) { ?>
<tr>
<td colspan="<?php echo $colspan?>" class="empty_table">데이터가 없습니다.</td>
</tr>
<?php
}
$line = 0;
$qry = sql_query("select * from {$g5['sms5_book_table']} where 1 $sql_group $sql_search $sql_korean $sql_no_hp order by bk_no desc limit $page_start, $page_size");
while($res = sql_fetch_array($qry))
{
$bg = 'bg'.($line++%2);
$tmp = sql_fetch("select bg_name from {$g5['sms5_book_group_table']} where bg_no='{$res['bg_no']}'");
$group_name = $tmp['bg_name'];
?>
<tr class="<?php echo $bg; ?>">
<td class="td_chk">
<label for="bk_no_<?php echo $i; ?>" class="sound_only"><?php echo $group_name?>의 <?php echo $res['bk_name']?></label>
<input type="checkbox" name="bk_no[]" value="<?php echo $res['bk_no']?>" id="bk_no_<?php echo $i; ?>">
</td>
<td class="td_num"><?php echo number_format($vnum--)?></td>
<td><?php echo $group_name?></td>
<td class="td_mbname"><?php echo $res['bk_name']?></td>
<td class="td_numbig"><?php echo $res['bk_hp']?></td>
<td class="td_boolean"><?php echo $res['bk_receipt'] ? '<font color=blue>수신</font>' : '<font color=red>거부</font>'?></td>
<td class="td_mbid"><?php echo $res['mb_id'] ? $res['mb_id'] : '비회원'?></td>
<td class="td_datetime"><?php echo $res['bk_datetime']?></td>
<td class="td_mng">
<a href="./num_book_write.php?w=u&amp;bk_no=<?php echo $res['bk_no']?>&amp;page=<?php echo $page?>&amp;bg_no=<?php echo $bg_no?>&amp;st=<?php echo $st?>&amp;sv=<?php echo $sv?>&amp;ap=<?php echo $ap?>">수정</a>
<a href="./sms_write.php?bk_no=<?php echo $res['bk_no']?>">보내기</a>
<a href="./history_num.php?st=hs_hp&amp;sv=<?php echo $res['bk_hp']?>">내역</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="수신허용" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="수신거부" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택이동" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택복사" onclick="document.pressed=this.value">
</div>
</form>
<script>
function hplist_submit(f){
if (!is_checked("bk_no[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택이동") {
select_copy("move", f);
return;
}
if(document.pressed == "선택복사") {
select_copy("copy", f);
return;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
if(document.pressed == "수신허용") {
f.atype.value="receipt";
}
if(document.pressed == "수신거부") {
f.atype.value="reject";
}
return true;
}
// 선택한 이모티콘 그룹 이동
function select_copy(sw, f) {
if( !f ){
var f = document.emoticonlist;
}
if (sw == "copy")
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./num_book_move.php";
f.submit();
}
</script>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF']."?bg_no=$bg_no&amp;st=$st&amp;sv=$sv&amp;ap=$ap&amp;page="); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,158 @@
<?php
$sub_menu = "900900";
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");
$g5['title'] = "휴대폰번호 파일";
$no_group = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no = 1");
$group = array();
$qry = sql_query("select * from {$g5['sms5_book_group_table']} where bg_no > 1 order by bg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<h2>파일 업로드</h2>
<div class="local_desc01 local_desc">
<p>
엑셀에 저장된 휴대폰번호 목록을 데이터베이스에 저장할 수 있습니다.
</p>
<p>
엑셀에는 이름과 휴대폰번호 두개만 저장해주세요. 첫번째 라인부터 저장됩니다.<br>
※ 휴대폰번호에 하이픈(-)은 포함되어도 되고 포함되지 않아도 됩니다.
</p>
<p>
엑셀파일은 XLS( Excel 97 - 2003 통합 문서 ) 또는 CSV형식만 업로드 할수 있습니다. (xlsx 불가)<br>
<strong>CSV 저장방법 : 파일 > 다른 이름으로 저장 > 파일형식 : CSV (쉼표로 분리) (*.CSV)</strong>
</p>
<p>
이 작업을 실행하기 전에 <a href="<?php echo G5_SMS5_ADMIN_URL; ?>/member_update.php" target="_blank">회원정보업데이트</a>를 먼저 실행해주세요.
</p>
</div>
<form name="upload_form" method="post" enctype="multipart/form-data" id="sms5_fileup_frm">
<div>
<label for="upload_bg_no">그룹선택</label>
<select name="upload_bg_no" id="upload_bg_no">
<option value=""></option>
<option value="1"> <?php echo $no_group['bg_name']?> (<?php echo number_format($no_group['bg_count'])?>) </option>
<?php for ($i=0; $i<count($group); $i++) { ?>
<option value="<?php echo $group[$i]['bg_no']?>"> <?php echo $group[$i]['bg_name']?> (<?php echo number_format($group[$i]['bg_count'])?>) </option>
<?php } ?>
</select>
</div>
<div id="sms5_fileup">
<label for="csv">파일선택</label>
<input type="file" name="csv" id="csv" onchange="document.getElementById('upload_info').style.display='none';">
<span id="upload_button">
<input type="button" value="파일전송" onclick="upload();" class="btn_submit">
</span>
<span id="uploading" class="sms_fileup_hide">
파일을 업로드 중입니다. 잠시만 기다려주세요.
</span>
<div id="upload_info" class="sms_fileup_hide"></div>
<div id="register" class="sch_last sms_fileup_hide">
휴대폰번호를 DB에 저장중 입니다. 잠시만 기다려주세요.
</div>
</div>
</form>
<h2>파일 다운로드</h2>
<div class="local_desc01 local_desc">
<p>
저장된 휴대폰번호 목록을 엑셀(xls) 파일로 다운로드 할 수 있습니다.<br>
다운로드 할 휴대폰번호 그룹을 선택해주세요.
</p>
</div>
<div class="local_sch01 local_sch">
<p>
<input type="checkbox" value="1" id="no_hp">
<label for="no_hp">휴대폰 번호 없는 회원 포함</label><br>
<input type="checkbox" value="1" id="hyphen">
<label for="hyphen">하이픈 '―' 포함</label>
</p>
<label for="download_bg_no">그룹선택</label>
<select name="download_bg_no" id="download_bg_no">
<option value=""> </option>
<option value="all"> 전체 </option>
<option value="1"> <?php echo $no_group['bg_name']?> (<?php echo number_format($no_group['bg_count'])?>) </option>
<?php for ($i=0; $i<count($group); $i++) { ?>
<option value="<?php echo $group[$i]['bg_no']?>"> <?php echo $group[$i]['bg_name']?> (<?php echo number_format($group[$i]['bg_count'])?>) </option>
<?php } ?>
</select>
<button type="button" onclick="download()" class="btn_submit">다운로드</button>
</div>
<script>
function upload(w)
{
var f = document.upload_form;
if (typeof w == 'undefined') {
document.getElementById('upload_button').style.display = 'none';
document.getElementById('uploading').style.display = 'inline';
document.getElementById('upload_info').style.display = 'none';
f.action = 'num_book_file_upload.php?confirm=1';
} else {
document.getElementById('upload_button').style.display = 'none';
document.getElementById('upload_info').style.display = 'none';
document.getElementById('register').style.display = 'block';
f.action = 'num_book_file_upload.php';
}
(function($){
if(!document.getElementById("fileupload_fr")){
var i = document.createElement('iframe');
i.setAttribute('id', 'fileupload_fr');
i.setAttribute('name', 'fileupload_fr');
i.style.display = 'none';
document.body.appendChild(i);
}
f.target = 'fileupload_fr';
f.submit();
})(jQuery);
}
function download()
{
var bg_no = document.getElementById('download_bg_no');
var no_hp = document.getElementById('no_hp');
var hyphen = document.getElementById('hyphen');
var par = '';
if (!bg_no.value.length) {
alert('다운로드 할 휴대폰번호 그룹을 선택해주세요.');
return;
}
if (no_hp.checked) no_hp = 1; else no_hp = 0;
if (hyphen.checked) hyphen = 1; else hyphen = 0;
par += '?bg_no=' + bg_no.value;
par += '&no_hp=' + no_hp;
par += '&hyphen=' + hyphen;
(function($){
if(!document.getElementById("fileupload_fr")){
var i = document.createElement('iframe');
i.setAttribute('id', 'fileupload_fr');
i.setAttribute('name', 'fileupload_fr');
i.style.display = 'none';
document.body.appendChild(i);
}
fileupload_fr.location.href = './num_book_file_download.php' + par;
})(jQuery);
}
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,67 @@
<?php
$sub_menu = "900900";
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");
if ($bg_no != 'all' && $bg_no < 1)
alert_just('다운로드 할 휴대폰번호 그룹을 선택해주세요.');
if ($bg_no == 'all') $sql_bg = ""; else $sql_bg = "and bg_no='$bg_no'";
if ($no_hp) $sql_hp = ""; else $sql_hp = "and bk_hp<>''";
$sql = "select count(*) as cnt from {$g5['sms5_book_table']} where 1 $sql_bg $sql_hp order by bk_name";
$total = sql_fetch($sql);
if (!$total['cnt']) alert_just('데이터가 없습니다.');
$qry = sql_query("select * from {$g5['sms5_book_table']} where 1 $sql_bg $sql_hp order by bk_name");
/*================================================================================
php_writeexcel http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/
=================================================================================*/
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_workbook.inc.php');
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_worksheet.inc.php');
$fname = tempnam(G5_DATA_PATH, "tmp.xls");
$workbook = new writeexcel_workbook($fname);
$worksheet = $workbook->addworksheet();
$num2_format =& $workbook->addformat(array(num_format => '\0#'));
// Put Excel data
$data = array('이름', '전화번호');
$data = array_map('iconv_euckr', $data);
$col = 0;
foreach($data as $cell) {
$worksheet->write(0, $col++, $cell);
}
for($i=1; $res=sql_fetch_array($qry); $i++)
{
$res = array_map('iconv_euckr', $res);
$hp = get_hp($res['bk_hp'], $hyphen);
if ($no_hp && $res['bk_hp'] != '' && !$hp) continue;
$worksheet->write($i, 0, $res['bk_name']);
$worksheet->write($i, 1, $hp, $num2_format);
}
$workbook->close();
$filename = "휴대폰번호목록-".date("ymd", time()).".xls";
if( is_ie() ) $filename = utf2euc($filename);
header("Content-Type: application/x-msexcel; name=".$filename);
header("Content-Disposition: inline; filename=".$filename);
$fh=fopen($fname, "rb");
fpassthru($fh);
unlink($fname);
exit;
?>

View File

@ -0,0 +1,166 @@
<?php
$sub_menu = "900900";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
if (!$upload_bg_no)
alert_after('그룹을 선택해주세요.');
$bg_no = $upload_bg_no;
if (!$_FILES['csv']['size'])
alert_after('파일을 선택해주세요.');
$file = $_FILES['csv']['tmp_name'];
$filename = $_FILES['csv']['name'];
$pos = strrpos($filename, '.');
$ext = strtolower(substr($filename, $pos, strlen($filename)));
switch ($ext) {
case '.csv' :
$data = file($file);
$num_rows = count($data) + 1;
$csv = array();
foreach ($data as $item)
{
$item = explode(',', $item);
$item[1] = get_hp($item[1]);
array_push($csv, $item);
if (count($item) < 2)
alert_after('올바른 파일이 아닙니다.');
}
break;
case '.xls' :
include_once(G5_LIB_PATH.'/Excel/reader.php');
$data = new Spreadsheet_Excel_Reader();
// Set output Encoding.
$data->setOutputEncoding('UTF-8');
$data->read($file);
$num_rows = $data->sheets[0]['numRows'];
break;
default :
alert_after('xls파일과 csv파일만 허용합니다.');
}
$counter = 0;
$success = 0;
$failure = 0;
$inner_overlap = 0;
$overlap = 0;
$arr_hp = array();
$encode = array('ASCII','UTF-8','EUC-KR');
for ($i = 1; $i <= $num_rows; $i++) {
$counter++;
$j = 1;
switch ($ext) {
case '.csv' :
$name = $csv[$i][0];
$str_encode = @mb_detect_encoding($name, $encode);
if( $str_encode == "EUC-KR" ){
$name = iconv_utf8( $name );
}
$name = addslashes($name);
$hp = addslashes($csv[$i][1]);
break;
case '.xls' :
$name = addslashes($data->sheets[0]['cells'][$i][$j++]);
$str_encode = @mb_detect_encoding($name, $encode);
if( $str_encode == "EUC-KR" ){
$name = iconv_utf8( $name );
}
$hp = addslashes(get_hp($data->sheets[0]['cells'][$i][$j++]));
break;
}
if (!(strlen($name)&&$hp))
{
$failure++;
} else {
if (in_array($hp, $arr_hp))
{
$inner_overlap++;
} else {
array_push($arr_hp, $hp);
$res = sql_fetch("select * from {$g5['sms5_book_table']} where bk_hp='$hp'");
if ($res)
{
$overlap++;
}
else if (!$confirm && $hp)
{
sql_query("insert into {$g5['sms5_book_table']} set bg_no='$bg_no', bk_name='".addslashes($name)."', bk_hp='$hp', bk_receipt=1, bk_datetime='".G5_TIME_YMDHIS."'");
sql_query("update {$g5['sms5_book_group_table']} set bg_count = bg_count + 1, bg_nomember = bg_nomember + 1, bg_receipt = bg_receipt + 1 where bg_no='$bg_no'");
$success++;
}
}
}
if ($inner_overlap > 0) $overlap += $inner_overlap;
}
unlink($_FILES['csv']['tmp_name']);
if ($success){
$sql = "select count(*) as cnt from {$g5['sms5_book_table']} where bg_no='$bg_no'";
$total = sql_fetch($sql);
sql_query("update {$g5['sms5_book_group_table']} set bg_count = ".$total['cnt']." where bg_no='$bg_no'");
}
$result = $counter - $failure - $overlap;
echo "<script>
var info = parent.document.getElementById('upload_info');
var html = '';
html += \"<ul id=\\\"upload_result\\\"><li>총 건수 : ".number_format($counter)." 건</li>\";
html += \"<li class=\\\"sms5_txt_fail\\\">등록불가 ".number_format($failure)." 건</li>\";
html += \"<li>중복번호 ".number_format($overlap)." 건<div id=\\\"overlap\\\" class=\\\"local_desc01 local_desc\\\"></div></li>\";";
if ($result)
{
if ($confirm) {
echo "html += \"<li class=\\\"sms5_txt_success\\\">등록가능 ".number_format($result)."\";";
echo "html += \"<br><button type=\\\"button\\\" id=\\\"btn_fileup\\\" class=\\\"btn_submit\\\" onclick=\\\"upload(1)\\\">등록하기</button>\";";
}
else
echo "html += \"<br><span class=\\\"sms5_txt_success\\\">총 ".number_format($success)." 건의 휴대폰번호 등록을 완료하였습니다.</span>\";";
}
else
echo "html += \"<br><span class=\\\"sms5_txt_fail\\\">등록할 수 없습니다.</font>\";";
echo "html += \"</li></ul>\";";
echo "
parent.document.getElementById('upload_button').style.display = 'inline';
parent.document.getElementById('uploading').style.display = 'none';
parent.document.getElementById('register').style.display = 'none';
info.style.display = 'block';
info.innerHTML = html;
parent.document.getElementById('overlap').innerHTML = '<p><b>중복번호 목록</b><br>';";
for ($i=0; $i<count($arr_hp); $i++){
echo "parent.document.getElementById('overlap').innerHTML += '".$arr_hp[$i]."<br>';\n";
}
echo "parent.document.getElementById('overlap').innerHTML += '</p>';\n";
echo "</script>";
function alert_after($str) {
echo "<script>
parent.document.getElementById('upload_button').style.display = 'inline';
parent.document.getElementById('uploading').style.display = 'none';
parent.document.getElementById('register').style.display = 'none';
parent.document.getElementById('upload_info').style.display = 'none';
</script>";
alert_just($str);
}
?>

View File

@ -0,0 +1,128 @@
<?php
$sub_menu = "900600";
include_once('./_common.php');
$inputbox_type="checkbox";
if ($sw == 'move'){
$act = '이동';
} else if ($sw == 'copy') {
$act = '복사';
} else {
alert('sw 값이 제대로 넘어오지 않았습니다.');
}
auth_check($auth[$sub_menu], "r");
$g5['title'] = '번호그룹 ' . $act;
include_once(G5_PATH.'/head.sub.php');
$bk_no_list = implode(',', $_POST['bk_no']);
$sql = " select * from {$g5['sms5_book_group_table']} order by bg_no ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = $row;
}
?>
<div id="copymove" class="new_win">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<form name="fboardmoveall" method="post" action="./number_move_update.php" onsubmit="return fboardmoveall_submit(this);">
<input type="hidden" name="sw" value="<?php echo $sw ?>">
<input type="hidden" name="bk_no_list" value="<?php echo $bk_no_list ?>">
<input type="hidden" name="act" value="<?php echo $act ?>">
<input type="hidden" name="url" value="<?php echo $_SERVER['HTTP_REFERER'] ?>">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $act ?>할 그룹을 한개 이상 선택하여 주십시오.</caption>
<thead>
<tr>
<th scope="col">
<?php if ( $inputbox_type == "checkbox" ){ //복사일때만 ?>
<label for="chkall" class="sound_only">그룹 전체</label>
<input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);">
<?php } ?>
</th>
<th scope="col">그룹</th>
</tr>
</thead>
<tbody>
<?php for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td class="td_chk">
<label for="chk<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['bg_name'] ?></label>
<input type="<?php echo $inputbox_type; ?>" value="<?php echo $list[$i]['bg_no'] ?>" id="chk<?php echo $i ?>" name="chk_bg_no[]">
</td>
<td>
<label for="chk<?php echo $i ?>">
<?php echo $list[$i]['bg_name'] ?>
</label>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="win_btn">
<input type="submit" value="<?php echo $act ?>" id="btn_submit" class="btn_submit">
<button type="button" class="btn_cancel">창닫기</button>
</div>
</form>
</div>
<script>
(function($) {
$(".win_btn button").click(function(e) {
window.close();
return false;
});
})(jQuery);
function all_checked(sw) {
var f = document.fboardmoveall;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_bg_no[]")
f.elements[i].checked = sw;
}
}
function fboardmoveall_submit(f)
{
var check = false;
if (typeof(f.elements['chk_bg_no[]']) == 'undefined')
;
else {
if (typeof(f.elements['chk_bg_no[]'].length) == 'undefined') {
if (f.elements['chk_bg_no[]'].checked)
check = true;
} else {
for (i=0; i<f.elements['chk_bg_no[]'].length; i++) {
if (f.elements['chk_bg_no[]'][i].checked) {
check = true;
break;
}
}
}
}
if (!check) {
alert('이모티콘을 '+f.act.value+'할 그룹을 한개 이상 선택해 주십시오.');
return false;
}
document.getElementById('btn_submit').disabled = true;
return true;
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,63 @@
<?php
$sub_menu = "900800";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
$g5['title'] = "전화번호부";
for ($i=0; $i<count($_POST['bk_no']); $i++)
{
$bk_no = $_POST['bk_no'][$i];
if (!trim($bk_no)) continue;
$res = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$bk_no'");
if (!$res) continue;
if ($atype == 'reject') // 수신거부
{
sql_query("update {$g5['sms5_book_table']} set bk_receipt=0 where bk_no='$bk_no'");
if ($res['mb_id'])
sql_query("update {$g5['member_table']} set mb_sms=0 where mb_id='{$res['mb_id']}'");
if ($res['bk_receipt'] == 1)
sql_query("update {$g5['sms5_book_group_table']} set bg_receipt= case bg_receipt when 0 then 0 else bg_receipt - 1 end, bg_reject=bg_reject+1 where bg_no='{$res['bg_no']}'");
}
else if ($atype == 'receipt') // 수신허용
{
sql_query("update {$g5['sms5_book_table']} set bk_receipt=1 where bk_no='$bk_no'");
if ($res['mb_id'])
sql_query("update {$g5['member_table']} set mb_sms=1 where mb_id='{$res['mb_id']}'");
if ($res['bk_receipt'] == 0)
sql_query("update {$g5['sms5_book_group_table']} set bg_receipt=bg_receipt+1, bg_reject= case bg_reject when 0 then 0 else bg_reject - 1 end where bg_no='{$res['bg_no']}'");
}
else if ($atype == 'del') // 삭제
{
sql_query("delete from {$g5['sms5_book_table']} where bk_no='$bk_no'");
if ($res['bk_receipt'] == 1) $bg_sms = 'bg_receipt'; else $bg_sms = 'bg_reject';
if ($res['mb_id']) $bg_mb = 'bg_member'; else $bg_mb = 'bg_nomember';
sql_query("update {$g5['sms5_book_group_table']} set $bg_sms = case $bg_sms when 0 then 0 else $bg_sms - 1 end , $bg_mb = case $bg_mb when 0 then 0 else $bg_mb - 1 end, bg_count = case bg_count when 0 then 0 else bg_count - 1 end where bg_no='{$res['bg_no']}'");
/*
if (!$res['mb_id']) {
sql_query("delete from {$g5['sms5_book_table']} where bk_no='$bk_no'");
sql_query("update {$g5['sms5_book_group_table']} set bg_count = bg_count - 1 where bg_no='{$res['bg_no']}'");
if ($res['bk_receipt'] == 1)
sql_query("update {$g5['sms5_book_group_table']} set bg_receipt = bg_receipt - 1, bg_count = bg_count - 1 where bg_no='{$res['bg_no']'}");
else
sql_query("update {$g5['sms5_book_group_table']} set bg_reject = bg_reject - 1, bg_count = bg_count - 1 where bg_no='{$res['bg_no']}'");
}
*/
}
}
if( $str_query ){
$str_query = '?'.$str_query;
}
goto_url('./num_book.php'.$str_query);
?>

View File

@ -0,0 +1,137 @@
<?php
$sub_menu = "900800";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
$g5['title'] = "휴대폰번호 업데이트";
$g5['sms5_demo'] = 0;
$is_hp_exist = false;
$bk_hp = get_hp($bk_hp);
if ($w=='u') // 업데이트
{
if (!$bg_no) $bg_no = 0;
if (!$bk_receipt) $bk_receipt = 0; else $bk_receipt = 1;
if (!strlen(trim($bk_name)))
alert('이름을 입력해주세요');
if ($bk_hp == '')
alert('휴대폰번호만 입력 가능합니다.');
/*
$res = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no<>'$bk_no' and bk_hp='$bk_hp'");
if ($res)
alert('같은 번호가 존재합니다.');
*/
$res = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$bk_no'");
if (!$res)
alert('존재하지 않는 데이터 입니다.');
if ($bg_no != $res['bg_no']) {
if ($res['mb_id']) $mem = "bg_member"; else $mem = "bg_nomember";
if ($res['bk_receipt'] == 1) $sms = "bg_receipt"; else $sms = "bg_reject";
sql_query("update {$g5['sms5_book_group_table']} set bg_count = bg_count - 1, $mem = $mem - 1, $sms = $sms - 1 where bg_no='{$res['bg_no']}'");
sql_query("update {$g5['sms5_book_group_table']} set bg_count = bg_count + 1, $mem = $mem + 1, $sms = $sms + 1 where bg_no='$bg_no'");
}
if ($bk_receipt != $res['bk_receipt']) {
if ($bk_receipt == 1)
sql_query("update {$g5['sms5_book_group_table']} set bg_receipt = bg_receipt + 1, bg_reject = bg_reject - 1 where bg_no='$bg_no'");
else
sql_query("update {$g5['sms5_book_group_table']} set bg_receipt = bg_receipt - 1, bg_reject = bg_reject + 1 where bg_no='$bg_no'");
}
sql_query("update {$g5['sms5_book_table']} set bg_no='$bg_no', bk_name='$bk_name', bk_hp='$bk_hp', bk_receipt='$bk_receipt', bk_datetime='".G5_TIME_YMDHIS."', bk_memo='".addslashes($bk_memo)."' where bk_no='$bk_no'");
if ($res['mb_id']){ //만약에 mb_id가 있다면...
// 휴대폰번호 중복체크
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$res['mb_id']}' and mb_hp = '{$bk_hp}' ";
$mb_hp_exist = sql_fetch($sql);
if ($mb_hp_exist['mb_id']) { //중복된 회원 휴대폰번호가 있다면
$is_hp_exist = true;
} else {
sql_query("update {$g5['member_table']} set mb_name='".addslashes($bk_name)."', mb_hp='$bk_hp', mb_sms='$bk_receipt' where mb_id='{$res['mb_id']}'", false);
}
}
$get_bg_no = $bg_no;
$go_url = './num_book_write.php?bk_no='.$bk_no.'&amp;w='.$w.'&amp;page='.$page;
if( $is_hp_exist ){ //중복된 회원 휴대폰번호가 있다면
//alert( "중복된 회원 휴대폰번호가 있어서 회원정보에는 반영되지 않았습니다.", $go_url );
goto_url($go_url);
} else {
goto_url($go_url);
}
exit;
}
else if ($w=='d') // 삭제
{
if (!is_numeric($bk_no))
alert('고유번호가 없습니다.');
$res = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$bk_no'");
if (!$res)
alert('존재하지 않는 데이터 입니다.');
if ($res['bk_receipt'] == 1) $bg_sms = 'bg_receipt'; else $bg_sms = 'bg_reject';
if ($res['mb_id']) $bg_mb = 'bg_member'; else $bg_mb = 'bg_nomember';
sql_query("delete from {$g5['sms5_book_table']} where bk_no='$bk_no'");
sql_query("update {$g5['sms5_book_group_table']} set bg_count = bg_count - 1, $bg_mb = $bg_mb - 1, $bg_sms = $bg_sms - 1 where bg_no = '{$res['bg_no']}'");
/*
if (!is_numeric($bk_no))
alert('고유번호가 없습니다.');
$res = sql_fetch("select * from $g5[sms5_book_table] where bk_no='$bk_no'");
if (!$res)
alert('존재하지 않는 데이터 입니다.');
if (!$res[mb_id])
{
if ($res[receipt] == 1)
$sql_sms = "bg_receipt = bg_receipt - 1";
else
$sql_sms = "bg_reject = bg_reject - 1";
sql_query("delete from $g5[sms5_book_table] where bk_no='$bk_no'");
sql_query("update $g5[sms5_book_group_table] set bg_count = bg_count - 1, bg_nomember = bg_nomember - 1, $sql_sms where bg_no = '$res[bg_no]'");
}
else
alert("회원은 삭제할 수 없습니다.\\n\\n회원관리 메뉴에서 삭제한 후\\n\\n회원정보업데이트 메뉴를 실행 해주세요.");
*/
}
else // 등록
{
if (!$bg_no) $bg_no = 1;
if (!$bk_receipt) $bk_receipt = 0; else $bk_receipt = 1;
if (!strlen(trim($bk_name)))
alert('이름을 입력해주세요');
if ($bk_hp == '')
alert('휴대폰번호만 입력 가능합니다.');
$res = sql_fetch("select * from {$g5['sms5_book_table']} where bk_hp='$bk_hp'");
if ($res)
alert('같은 번호가 존재합니다.');
if ($bk_receipt == 1)
$sql_sms = "bg_receipt = bg_receipt + 1";
else
$sql_sms = "bg_reject = bg_reject + 1";
sql_query("insert into {$g5['sms5_book_table']} set bg_no='$bg_no', bk_name='".addslashes($bk_name)."', bk_hp='$bk_hp', bk_receipt='$bk_receipt', bk_datetime='".G5_TIME_YMDHIS."', bk_memo='".addslashes($bk_memo)."'");
sql_query("update {$g5['sms5_book_group_table']} set bg_count = bg_count + 1, bg_nomember = bg_nomember + 1, $sql_sms where bg_no = '$bg_no'");
$get_bg_no = $bg_no;
}
$go_url = './num_book.php?page='.$page.'&amp;bg_no='.$get_bg_no.'&amp;ap='.$ap;
goto_url($go_url);
?>

View File

@ -0,0 +1,216 @@
<?php
$sub_menu = "900800";
include_once("./_common.php");
$colspan = 4;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "휴대폰번호 ";
$exist_hplist = array();
if ($w == 'u' && is_numeric($bk_no)) {
$write = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$bk_no'");
if (!$write)
alert('데이터가 없습니다.');
if ($write['mb_id']) {
$res = sql_fetch("select mb_id from {$g5['member_table']} where mb_id='{$write['mb_id']}'");
$write['mb_id'] = $res['mb_id'];
$sql = "select mb_id from {$g5['member_table']} where mb_hp = '{$write['bk_hp']}' and mb_id <> '{$write['mb_id']}' and mb_hp <> '' ";
$result = sql_query($sql);
while($tmp = sql_fetch_array($result)){
$exist_hplist[] = $tmp;
}
$exist_msg_1 = '(수정시 회원정보에 반영되지 않습니다.)';
$exist_msg_2 = '(수정시 회원정보에 반영됩니다.)';
$exist_msg = count($exist_hplist) ? $exist_msg_1 : $exist_msg_2;
}
$g5['title'] .= '수정';
}
else {
$write['bg_no'] = $bg_no;
$g5['title'] .= '추가';
}
if (!is_numeric($write['bk_receipt']))
$write['bk_receipt'] = 1;
$no_group = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no = 1");
include_once(G5_ADMIN_PATH."/admin.head.php");
?>
<form name="book_form" id="book_form" method="post" action="./num_book_update.php">
<input type="hidden" name="w" value="<?php echo $w?>">
<input type="hidden" name="page" value="<?php echo $page?>">
<input type="hidden" name="ap" value="<?php echo $ap?>">
<input type="hidden" name="bk_no" value="<?php echo $write['bk_no']?>">
<input type="hidden" name="mb_id" id="mb_id" value="<?php echo $write['mb_id']?>">
<input type="hidden" name="get_bg_no" value="<?php echo $bg_no?>">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?></caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="bg_no">그룹 <strong class="sound_only"> 필수</strong></label></th>
<td>
<select name="bg_no" id="bg_no" required class="required">
<option value="1"><?php echo $no_group['bg_name']?> (<?php echo number_format($no_group['bg_count'])?> 명)</option>
<?php
$qry = sql_query("select * from {$g5['sms5_book_group_table']} where bg_no> 1 order by bg_name");
while($res = sql_fetch_array($qry)) {
?>
<option value="<?php echo $res['bg_no']?>" <?php echo $res['bg_no']==$write['bg_no']?'selected':''?>> <?php echo $res['bg_name']?> (<?php echo number_format($res['bg_count'])?> 명) </option>
<?php } ?>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="bk_name">이름<strong class="sound_only"> 필수</strong></label></th>
<td><input type="text" name="bk_name" id="bk_name" maxlength="50" value="<?php echo $write['bk_name']?>" required class="frm_input required"></td>
</tr>
<tr>
<th scope="row"><label for="bk_hp">휴대폰번호<strong class="sound_only"> 필수</strong></label></th>
<td>
<input type="text" name="bk_hp" id="bk_hp" value="<?php echo $write['bk_hp']?>" required class="frm_input required">
<?php if( count($exist_hplist) ) { // 중복되는 목록이 있다면 ?>
<div id="hp_check_el">
<ul>
<?php
foreach( $exist_hplist as $v ) {
if( empty($v) ) continue;
$href = G5_ADMIN_URL."/member_form.php?w=u&amp;mb_id={$v['mb_id']}";
?>
<li><strong>중복됨 </strong><a href="<?php echo $href; ?>" target="_blank"><?php echo $v['mb_id']; ?></a></li>
<?php
}
?>
</ul>
</div>
<?php } ?>
</td>
</tr>
<tr>
<th scope="row">수신여부</th>
<td>
<input type="radio" name="bk_receipt" id="bk_receipt_1" value="1" <?php echo $write['bk_receipt']?'checked':''?>>
<label for="bk_receipt_1">수신허용</label>
<input type="radio" name="bk_receipt" id="bk_receipt_2" value="0" <?php echo !$write['bk_receipt']?'checked':''?>>
<label for="bk_receipt_2">수신거부</label>
</td>
</tr>
<?php if ($w == 'u') { ?>
<tr>
<th scope="row">회원아이디</th>
<td> <?php echo $write['mb_id'] ? '<a href="'.G5_ADMIN_URL.'/member_form.php?w=u&amp;mb_id='.$write['mb_id'].'">'.$write['mb_id'].'</a>' : '비회원'?> </td>
</tr>
<tr>
<th scope="row">업데이트</th>
<td> <?php echo $write['bk_datetime']?> </td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="bk_memo">메모</label></th>
<td>
<textarea name="bk_memo" id="bk_memo"><?php echo $write['bk_memo']?></textarea>
</td>
</tr>
</tbody>
</table>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s" onclick="return book_submit();">
<a href="./num_book.php?<?php echo $_SERVER['QUERY_STRING']?>">목록</a>
</div>
</form>
<script>
function book_submit(){
var f = document.book_form;
var regExp_hp = /^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$/;
if(!f.bk_hp.value){
f.bk_hp.focus();
alert("휴대폰번호를 입력하세요.");
return false;
} else if ( !regExp_hp.test(f.bk_hp.value) )
{
f.bk_hp.focus();
alert("휴대폰번호 입력이 올바르지 않습니다.");
return false;
}
var w = "<?php echo $w; ?>";
var bk_no = "<?php echo $bk_no; ?>";
var mb_id = f.mb_id.value;
var bk_hp = f.bk_hp.value;
var params = { w: w, bk_no: bk_no, mb_id : mb_id, bk_hp : bk_hp };
var is_submit;
$.ajax({
url: "./ajax.hp_chk.php",
type: "POST",
cache:false,
timeout : 30000,
dataType:"json",
data:params,
success: function(data) {
if(data.error) {
is_submit = false;
alert( data.error );
} else {
var list_text = "";
var list_data;
$.each( data.exist , function(num) {
list_data = data.exist[num];
if(list_data) {
var href = "<?php echo G5_ADMIN_URL ?>/member_form.php?w=u&mb_id="+list_data;
list_text += "<li><a href=\""+href+"\" target=\"_blank\">"+list_data+"</a></li>";
}
});
var $check_msg = $("#hp_check_el");
if( !list_text ){ // 중복 휴대폰 번호가 없다면 submit
if($check_msg.size()> 0)
$check_msg.remove();
// $("#exist_msg").text("<?php echo $exist_msg_2; ?>");
is_submit = true;
} else {
if($check_msg.size() < 1)
$("input#bk_hp").after("<div id=\"hp_check_el\"><h3>이 번호를 쓰는 회원 정보</h3><ul></ul></div>");
$("#hp_check_el").find("ul").html( list_text );
// $("#exist_msg").html("<?php echo $exist_msg_1 ?>");
if(confirm("회원 정보에 중복 휴대폰 번호가 있습니다.수정하실 경우 회원정보에 반영되지 않습니다.\n수정하시겠습니까?"))
is_submit = true;
else
is_submit = false;
}
}
if(is_submit)
f.submit();
}
});
return false;
}
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

186
adm/sms_admin/num_group.php Normal file
View File

@ -0,0 +1,186 @@
<?php
$sub_menu = "900700";
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");
$g5['title'] = "휴대폰번호 그룹";
$res = sql_fetch("select count(*) as cnt from {$g5['sms5_book_group_table']}");
$total_count = $res['cnt'];
$no_group = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no = 1");
$group = array();
$qry = sql_query("select * from {$g5['sms5_book_group_table']} where bg_no > 1 order by bg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<script>
function del(bg_no) {
if (confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n삭제되는 그룹에 속한 자료는 '<?php echo $no_group['bg_name']?>'로 이동됩니다.\n\n그래도 삭제하시겠습니까?"))
location.href = 'num_group_update.php?mw=d&bg_no=' + bg_no;
}
function move(bg_no, bg_name, sel) {
var msg = '';
if (sel.value)
{
msg = "'" + bg_name + "' 그룹에 속한 모든 데이터를\n\n'";
msg += sel.options[sel.selectedIndex].text + "' 그룹으로 이동하시겠습니까?";
if (confirm(msg))
location.href = 'num_group_move.php?bg_no=' + bg_no + '&move_no=' + sel.value;
else
sel.selectedIndex = 0;
}
}
function empty(bg_no) {
if (confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n그룹에 속한 데이터를 정말로 비우시겠습니까?"))
location.href = 'num_group_update.php?mw=empty&bg_no=' + bg_no;
}
function num_group_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n삭제되는 그룹에 속한 자료는 '<?php echo $no_group['bg_name']?>'로 이동됩니다.\n\n그래도 삭제하시겠습니까?")) {
f.w.value = "de";
} else {
return false;
}
}
if(document.pressed == "선택비우기") {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n그룹에 속한 데이터를 정말로 비우시겠습니까?")) {
f.w.value = "em";
} else {
return false;
}
}
return true;
}
</script>
<form name="group<?php echo $res['bg_no']?>" method="get" action="./num_group_update.php" class="local_sch02 local_sch">
<input type="hidden" name="bg_no" value="<?php echo $res['bg_no']?>">
<div>
<label for="bg_name" class="sound_only">그룹추가<strong class="sound_only"> 필수</strong></label>
<input type="text" id="bg_name" name="bg_name" required class="required frm_input">
<input type="submit" value="그룹추가" class="btn_submit">
</div>
<div class="sch_last">
<span>건수 : <?php echo $total_count; ?></span>
</div>
</form>
<div class="local_desc01 local_desc">
<p>그룹명순으로 정렬됩니다.</p>
</div>
<form name="group_hp_form" id="group_hp_form" method="post" action="./num_group_update.php" onsubmit="return num_group_submit(this);">
<input type="hidden" name="w" value="u">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">
<label for="chkall" class="sound_only">그룹 전체</label>
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<th scope="col">그룹명</th>
<th scope="col">총</th>
<th scope="col">회원</th>
<th scope="col">비회원</th>
<th scope="col">수신</th>
<th scope="col">거부</th>
<th scope="col">이동</th>
<th scope="col">보기</th>
</tr>
</thead>
<tbody>
<!-- 미분류 시작 -->
<tr>
<td></td>
<td><?php echo $no_group['bg_name']?></td>
<td class="td_num"><?php echo number_format($no_group['bg_count'])?></td>
<td class="td_num"><?php echo number_format($no_group['bg_member'])?></td>
<td class="td_num"><?php echo number_format($no_group['bg_nomember'])?></td>
<td class="td_num"><?php echo number_format($no_group['bg_receipt'])?></td>
<td class="td_num"><?php echo number_format($no_group['bg_reject'])?></td>
<td class="td_mng">
<label for="select_bg_no_999" class="sound_only">이동할 그룹</label>
<select name="select_bg_no_999" id="select_bg_no_999" onchange="move(<?php echo $no_group['bg_no']?>, '<?php echo $no_group['bg_name']?>', this);" >
<option value=""></option>
<?php for ($i=0; $i<count($group); $i++) { ?>
<option value="<?php echo $group[$i]['bg_no']?>"> <?php echo $group[$i]['bg_name']?> </option>
<?php } ?>
</select>
</td>
<td class="td_mng">
<a href="./num_book.php?bg_no=1">보기</a>
</td>
</tr>
<!-- 미분류 끝 -->
<?php
for ($i=0; $i<count($group); $i++) {
$bg = 'bg'.(($i + 1)%2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_mng">
<input type="hidden" name="bg_no[<?php echo $i ?>]" value="<?php echo $group[$i]['bg_no']?>" id="bg_no_<?php echo $i ?>">
<label for="chk_<?php echo $i ?>" class="sound_only">그룹명</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td>
<label for="bg_name_<?php echo $i; ?>" class="sound_only">그룹명</label>
<input type="text" name="bg_name[<?php echo $i; ?>]" value="<?php echo $group[$i]['bg_name']?>" id="bg_name_<?php echo $i; ?>" class="frm_input">
</td>
<td class="td_num"><?php echo number_format($group[$i]['bg_count'])?></td>
<td class="td_num"><?php echo number_format($group[$i]['bg_member'])?></td>
<td class="td_num"><?php echo number_format($group[$i]['bg_nomember'])?></td>
<td class="td_num"><?php echo number_format($group[$i]['bg_receipt'])?></td>
<td class="td_num"><?php echo number_format($group[$i]['bg_reject'])?></td>
<td class="td_mbstat">
<label for="select_bg_no_<?php echo $i; ?>" class="sound_only">이동할 그룹</label>
<select name="select_bg_no[<?php echo $i ?>]" id="select_bg_no_<?php echo $i; ?>" onchange="move(<?php echo $group[$i]['bg_no']?>, '<?php echo $group[$i]['bg_name']?>', this);" >
<option value=""></option>
<option value="<?php echo $no_group['bg_no']?>"><?php echo $no_group['bg_name']?></option>
<?php for ($j=0; $j<count($group); $j++) { ?>
<?php if ($group[$i]['bg_no']==$group[$j]['bg_no']) continue; ?>
<option value="<?php echo $group[$j]['bg_no']?>"> <?php echo $group[$j]['bg_name']?> </option>
<?php } ?>
</select>
</td>
<td class="td_mng">
<a href="./num_book.php?bg_no=<?php echo $group[$i]['bg_no']?>">보기</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list">
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택비우기" onclick="document.pressed=this.value">
</div>
</form>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,14 @@
<?php
// 휴대폰 그룹 이동
$sub_menu = "900700";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
$res = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no='$bg_no'");
sql_query("update {$g5['sms5_book_group_table']} set bg_count = bg_count + {$res['bg_count']}, bg_member = bg_member + {$res['bg_member']}, bg_nomember = bg_nomember + {$res['bg_nomember']}, bg_receipt = bg_receipt + {$res['bg_receipt']}, bg_reject = bg_reject + {$res['bg_reject']} where bg_no='$move_no'");
sql_query("update {$g5['sms5_book_group_table']} set bg_count = 0, bg_member = 0, bg_nomember = 0, bg_receipt = 0, bg_reject = 0 where bg_no='$bg_no'");
sql_query("update {$g5['sms5_book_table']} set bg_no='$move_no' where bg_no='$bg_no'");
goto_url('./num_group.php');
?>

View File

@ -0,0 +1,77 @@
<?php
$sub_menu = "900700";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
if ($w == 'u') // 업데이트
{
for ($i=0; $i<count($_POST['chk']); $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$bg_no = $_POST['bg_no'][$k];
$bg_name = $_POST['bg_name'][$k];
if (!is_numeric($bg_no))
alert('그룹 고유번호가 없습니다.');
$res = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no='$bg_no'");
if (!$res)
alert('존재하지 않는 그룹입니다.');
if (!strlen(trim($bg_name)))
alert('그룹명을 입력해주세요');
$res = sql_fetch("select bg_name from {$g5['sms5_book_group_table']} where bg_no<>'$bg_no' and bg_name='$bg_name'");
if ($res)
alert('같은 그룹명이 존재합니다.');
sql_query("update {$g5['sms5_book_group_table']} set bg_name='".addslashes($bg_name)."' where bg_no='$bg_no'");
}
}
else if ($w == 'de') // 그룹삭제
{
for ($i=0; $i<count($_POST['chk']); $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$bg_no = $_POST['bg_no'][$k];
if (!is_numeric($bg_no))
alert('그룹 고유번호가 없습니다.');
$res = sql_fetch("select * from {$g5['sms5_book_group_table']} where bg_no='$bg_no'");
if (!$res)
alert('존재하지 않는 그룹입니다.');
sql_query("delete from {$g5['sms5_book_group_table']} where bg_no='$bg_no'");
sql_query("update {$g5['sms5_book_table']} set bg_no=1 where bg_no='$bg_no'");
}
}
else if ($w == 'em') // 비우기
{
for ($i=0; $i<count($_POST['chk']); $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$bg_no = $_POST['bg_no'][$k];
sql_query("update {$g5['sms5_book_group_table']} set bg_count = 0, bg_member = 0, bg_nomember = 0, bg_receipt = 0, bg_reject = 0 where bg_no='$bg_no'");
sql_query("delete from {$g5['sms5_book_table']} where bg_no='$bg_no'");
}
}
else // 등록
{
if (!strlen(trim($bg_name)))
alert('그룹명을 입력해주세요');
$res = sql_fetch("select bg_name from {$g5['sms5_book_group_table']} where bg_name='$bg_name'");
if ($res)
alert('같은 그룹명이 존재합니다.');
sql_query("insert into {$g5['sms5_book_group_table']} set bg_name='".addslashes($bg_name)."'");
}
goto_url('./num_group.php');
?>

View File

@ -0,0 +1,84 @@
<?php
include_once('./_common.php');
auth_check($auth[$sub_menu], "r");
if(!count($_POST['chk_bg_no']))
alert('번호를 '.$act.'할 그룹을 한개 이상 선택해 주십시오.', $url);
$sql = "select * from {$g5['sms5_book_table']} where bk_no in ($bk_no_list) order by bk_no desc ";
$result = sql_query($sql);
$save = array();
$save_group = array();
for ($kk=0;$row = sql_fetch_array($result);$kk++)
{
$bk_no = $row['bk_no'];
for ($i=0; $i<count($_POST['chk_bg_no']); $i++)
{
$bg_no = $_POST['chk_bg_no'][$i];
if( !$bg_no ) continue;
$sql = " insert into {$g5['sms5_book_table']}
set bg_no='$bg_no',
mb_id='{$row['mb_id']}',
bk_name='".addslashes($row['bk_name'])."',
bk_hp='{$row['bk_hp']}',
bk_receipt='{$row['bk_receipt']}',
bk_datetime='".G5_TIME_YMDHIS."' ";
sql_query($sql);
if( !in_array($bg_no, $save_group) ){
array_push( $save_group, $bg_no );
}
}
$save[$kk]['bg_no'] = $row['bg_no'];
$save[$kk]['bk_no'] = $row['bk_no'];
$save[$kk]['mb_id'] = $row['mb_id'];
$save[$kk]['bk_receipt'] = $row['bk_receipt'];
}
if ($sw == 'move')
{
foreach ($save as $v)
{
if( empty($v['bk_no']) ) continue;
sql_query(" delete from {$g5['sms5_book_table']} where bk_no = '{$v['bk_no']}' ");
if( !in_array($v['bg_no'], $save_group) ){
array_push( $save_group, $v['bg_no'] );
}
}
}
if( count($save_group) ){ //그룹테이블 업데이트
$save_group = array_unique( $save_group );
foreach( $save_group as $v )
{
if( empty($v) ) continue;
$bg_count = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where bg_no='$v' ");
$bg_receipt = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where bg_no='$v' and bk_receipt >= 1 ");
$bg_reject = (int)$bg_count['cnt'] - (int)$bg_receipt['cnt'];
$bg_member = sql_fetch("select count(*) as cnt from {$g5['sms5_book_table']} where bg_no='$v' and mb_id <> '' ");
$bg_nomember = (int)$bg_count['cnt'] - (int)$bg_member['cnt'];
$sql = "update {$g5['sms5_book_group_table']} set bg_count = {$bg_count['cnt']}, bg_receipt = {$bg_receipt['cnt']}, bg_reject = {$bg_reject}, bg_member = {$bg_member['cnt']}, bg_nomember = {$bg_nomember} where bg_no='$v' ";
sql_query($sql);
}
}
$msg = '해당 번호를 선택한 그룹으로 '.$act.' 하였습니다.';
$opener_href = './num_book.php?page='.$page;
echo <<<HEREDOC
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script>
alert("$msg");
opener.document.location.href = "$opener_href";
window.close();
</script>
<noscript>
<p>
"$msg"
</p>
<a href="$opener_href">돌아가기</a>
</noscript>
HEREDOC;
?>

188
adm/sms_admin/sms5.sql Normal file
View File

@ -0,0 +1,188 @@
## 마이에스큐엘 dump 10.11
##
##
## ######################################################
## Server version 5.0.92-log
##
## Table structure for table `{$g5['sms5_book_table']}`
##
DROP TABLE IF EXISTS `{$g5['sms5_book_table']}`;
CREATE TABLE `{$g5['sms5_book_table']}` (
`bk_no` int(11) NOT NULL auto_increment,
`bg_no` int(11) NOT NULL default '0',
`mb_no` int(11) NOT NULL default '0',
`mb_id` varchar(20) NOT NULL default '',
`bk_name` varchar(255) NOT NULL default '',
`bk_hp` varchar(255) NOT NULL default '',
`bk_receipt` tinyint(4) NOT NULL default '0',
`bk_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`bk_memo` text NOT NULL,
PRIMARY KEY (`bk_no`),
KEY `bk_name` (`bk_name`),
KEY `bk_hp` (`bk_hp`),
KEY `mb_no` (`mb_no`),
KEY `bg_no` (`bg_no`,`bk_no`),
KEY `mb_id` (`mb_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_book_table']}_group`
##
DROP TABLE IF EXISTS `{$g5['sms5_book_table']}_group`;
CREATE TABLE `{$g5['sms5_book_table']}_group` (
`bg_no` int(11) NOT NULL auto_increment,
`bg_name` varchar(255) NOT NULL default '',
`bg_count` int(11) NOT NULL default '0',
`bg_member` int(11) NOT NULL default '0',
`bg_nomember` int(11) NOT NULL default '0',
`bg_receipt` int(11) NOT NULL default '0',
`bg_reject` int(11) NOT NULL default '0',
PRIMARY KEY (`bg_no`),
KEY `bg_name` (`bg_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_config_table']}`
##
DROP TABLE IF EXISTS `{$g5['sms5_config_table']}`;
CREATE TABLE `{$g5['sms5_config_table']}` (
`cf_phone` varchar(255) NOT NULL default '',
`cf_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`cf_member` tinyint(4) NOT NULL default '1',
`cf_level` tinyint(4) NOT NULL default '2',
`cf_point` int(11) NOT NULL default '0',
`cf_day_count` int(11) NOT NULL default '0',
`cf_skin` varchar(100) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_form_table']}`
##
DROP TABLE IF EXISTS `{$g5['sms5_form_table']}`;
CREATE TABLE `{$g5['sms5_form_table']}` (
`fo_no` int(11) NOT NULL auto_increment,
`fg_no` tinyint(4) NOT NULL default '0',
`fg_member` char(1) NOT NULL default '0',
`fo_name` varchar(255) NOT NULL default '',
`fo_content` text NOT NULL,
`fo_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`fo_no`),
KEY `fg_no` (`fg_no`,`fo_no`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_form_table']}_group`
##
DROP TABLE IF EXISTS `{$g5['sms5_form_table']}_group`;
CREATE TABLE `{$g5['sms5_form_table']}_group` (
`fg_no` int(11) NOT NULL auto_increment,
`fg_name` varchar(255) NOT NULL default '',
`fg_count` int(11) NOT NULL default '0',
`fg_member` tinyint(4) NOT NULL,
PRIMARY KEY (`fg_no`),
KEY `fg_name` (`fg_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_history_table']}`
##
DROP TABLE IF EXISTS `{$g5['sms5_history_table']}`;
CREATE TABLE `{$g5['sms5_history_table']}` (
`hs_no` int(11) NOT NULL auto_increment,
`wr_no` int(11) NOT NULL default '0',
`wr_renum` int(11) NOT NULL default '0',
`bg_no` int(11) NOT NULL default '0',
`mb_no` int(11) NOT NULL default '0',
`mb_id` varchar(20) NOT NULL default '',
`bk_no` int(11) NOT NULL default '0',
`hs_name` varchar(30) NOT NULL default '',
`hs_hp` varchar(255) NOT NULL default '',
`hs_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`hs_flag` tinyint(4) NOT NULL default '0',
`hs_code` varchar(255) NOT NULL default '',
`hs_memo` varchar(255) NOT NULL default '',
`hs_log` varchar(255) NOT NULL default '',
PRIMARY KEY (`hs_no`),
KEY `wr_no` (`wr_no`),
KEY `mb_no` (`mb_no`),
KEY `bk_no` (`bk_no`),
KEY `hs_hp` (`hs_hp`),
KEY `hs_code` (`hs_code`),
KEY `bg_no` (`bg_no`),
KEY `mb_id` (`mb_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_write_table']}`
##
DROP TABLE IF EXISTS `{$g5['sms5_write_table']}`;
CREATE TABLE `{$g5['sms5_write_table']}` (
`wr_no` int(11) NOT NULL default '1',
`wr_renum` int(11) NOT NULL default '0',
`wr_reply` varchar(255) NOT NULL default '',
`wr_message` varchar(255) NOT NULL default '',
`wr_booking` datetime NOT NULL default '0000-00-00 00:00:00',
`wr_total` int(11) NOT NULL default '0',
`wr_re_total` int(11) NOT NULL default '0',
`wr_success` int(11) NOT NULL default '0',
`wr_failure` int(11) NOT NULL default '0',
`wr_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`wr_memo` text NOT NULL,
KEY `wr_no` (`wr_no`,`wr_renum`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_member_history_table']}`
##
DROP TABLE IF EXISTS `{$g5['sms5_member_history_table']}`;
CREATE TABLE `{$g5['sms5_member_history_table']}` (
`mh_no` int(11) NOT NULL auto_increment,
`mb_id` varchar(30) NOT NULL,
`mh_reply` varchar(30) NOT NULL,
`mh_hp` varchar(30) NOT NULL,
`mh_datetime` datetime NOT NULL,
`mh_booking` datetime NOT NULL,
`mh_log` varchar(255) NOT NULL,
`mh_ip` varchar(15) NOT NULL,
PRIMARY KEY (`mh_no`),
KEY `mb_id` (`mb_id`,`mh_datetime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

22
adm/sms_admin/sms_ing.php Normal file
View File

@ -0,0 +1,22 @@
<?php
include_once("./_common.php");
$g5['title'] = "SMS 전송 중";
?>
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>SMS 전송 중</title>
<style>
body {margin:0;padding:0;background:#000;color:#fff;font-size:0.75em;line-height:2em}
div {padding:50px 0;text-align:center}
</style>
</head>
<body>
<div><img src="img/ajax-loader2.gif"><br>SMS를 전송 중입니다.<br>잠시만 기다려주십시오.</div>
</body>
</html>

791
adm/sms_admin/sms_write.php Normal file
View File

@ -0,0 +1,791 @@
<?php
$sub_menu = "900300";
include_once("./_common.php");
auth_check($auth[$sub_menu], "r");
$g5['title'] = "문자 보내기";
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<div class="local_ov01 local_ov">
회원정보 최근 업데이트 : <?php echo $sms5['cf_datetime']?>
</div>
<?php
if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
?>
<div id="sms5_send">
<div id="send_emo">
<h2>이모티콘 목록</h2>
<?php include_once('./sms_write_form.php'); ?>
</div>
<div id="send_write">
<form name="form_sms" id="form_sms" method="post" action="sms_write_send.php" onsubmit="return sms5_chk_send(this);" >
<input type="hidden" name="send_list" value="">
<h2>보낼내용</h2>
<div class="sms5_box write_wrap">
<span class="box_ico"></span>
<label for="wr_message" id="wr_message_lbl">내용</label>
<textarea name="wr_message" id="wr_message" class="box_txt box_square" onkeyup="byte_check('wr_message', 'sms_bytes');" accesskey="m"></textarea>
<div id="sms_byte"><span id="sms_bytes">0</span> / 80 byte</div>
<button type="button" id="write_sc_btn" class="write_scemo_btn">특수<br>기호</button>
<div id="write_sc" class="write_scemo">
<span class="scemo_ico"></span>
<div class="scemo_list">
<button type="button" class="scemo_add" onclick="javascript:add('■')">■</button>
<button type="button" class="scemo_add" onclick="javascript:add('□')">□</button>
<button type="button" class="scemo_add" onclick="javascript:add('▣')">▣</button>
<button type="button" class="scemo_add" onclick="javascript:add('◈')">◈</button>
<button type="button" class="scemo_add" onclick="javascript:add('◆')">◆</button>
<button type="button" class="scemo_add" onclick="javascript:add('◇')">◇</button>
<button type="button" class="scemo_add" onclick="javascript:add('♥')">♥</button>
<button type="button" class="scemo_add" onclick="javascript:add('♡')">♡</button>
<button type="button" class="scemo_add" onclick="javascript:add('●')">●</button>
<button type="button" class="scemo_add" onclick="javascript:add('○')">○</button>
<button type="button" class="scemo_add" onclick="javascript:add('▲')">▲</button>
<button type="button" class="scemo_add" onclick="javascript:add('▼')">▼</button>
<button type="button" class="scemo_add" onclick="javascript:add('▶')">▶</button>
<button type="button" class="scemo_add" onclick="javascript:add('▷')">▷</button>
<button type="button" class="scemo_add" onclick="javascript:add('◀')">◀</button>
<button type="button" class="scemo_add" onclick="javascript:add('◁')">◁</button>
<button type="button" class="scemo_add" onclick="javascript:add('☎')">☎</button>
<button type="button" class="scemo_add" onclick="javascript:add('☏')">☏</button>
<button type="button" class="scemo_add" onclick="javascript:add('♠')">♠</button>
<button type="button" class="scemo_add" onclick="javascript:add('♤')">♤</button>
<button type="button" class="scemo_add" onclick="javascript:add('♣')">♣</button>
<button type="button" class="scemo_add" onclick="javascript:add('♧')">♧</button>
<button type="button" class="scemo_add" onclick="javascript:add('★')">★</button>
<button type="button" class="scemo_add" onclick="javascript:add('☆')">☆</button>
<button type="button" class="scemo_add" onclick="javascript:add('☞')">☞</button>
<button type="button" class="scemo_add" onclick="javascript:add('☜')">☜</button>
<button type="button" class="scemo_add" onclick="javascript:add('▒')">▒</button>
<button type="button" class="scemo_add" onclick="javascript:add('⊙')">⊙</button>
<button type="button" class="scemo_add" onclick="javascript:add('㈜')">㈜</button>
<button type="button" class="scemo_add" onclick="javascript:add('№')">№</button>
<button type="button" class="scemo_add" onclick="javascript:add('㉿')">㉿</button>
<button type="button" class="scemo_add" onclick="javascript:add('♨')">♨</button>
<button type="button" class="scemo_add" onclick="javascript:add('™')">™</button>
<button type="button" class="scemo_add" onclick="javascript:add('℡')">℡</button>
<button type="button" class="scemo_add" onclick="javascript:add('∑')">∑</button>
<button type="button" class="scemo_add" onclick="javascript:add('∏')">∏</button>
<button type="button" class="scemo_add" onclick="javascript:add('♬')">♬</button>
<button type="button" class="scemo_add" onclick="javascript:add('♪')">♪</button>
<button type="button" class="scemo_add" onclick="javascript:add('♩')">♩</button>
<button type="button" class="scemo_add" onclick="javascript:add('♭')">♭</button>
</div>
<div class="scemo_cls"><button type="button" class="scemo_cls_btn">닫기</button></div>
</div>
<button type="button" id="write_emo_btn" class="write_scemo_btn">이모<br>티콘</button>
<div id="write_emo" class="write_scemo">
<span class="scemo_ico"></span>
<div class="scemo_list">
<button type="button" class="scemo_add" onclick="javascript:add('*^^*')">*^^*</button>
<button type="button" class="scemo_add" onclick="javascript:add('♡.♡')">♡.♡</button>
<button type="button" class="scemo_add" onclick="javascript:add('@_@')">@_@</button>
<button type="button" class="scemo_add" onclick="javascript:add('☞_☜')">☞_☜</button>
<button type="button" class="scemo_add" onclick="javascript:add('ㅠ ㅠ')">ㅠ ㅠ</button>
<button type="button" class="scemo_add" onclick="javascript:add('Θ.Θ')">Θ.Θ</button>
<button type="button" class="scemo_add" onclick="javascript:add('^_~♥')">^_~♥</button>
<button type="button" class="scemo_add" onclick="javascript:add('~o~')">~o~</button>
<button type="button" class="scemo_add" onclick="javascript:add('★.★')">★.★</button>
<button type="button" class="scemo_add" onclick="javascript:add('(!.!)')">(!.!)</button>
<button type="button" class="scemo_add" onclick="javascript:add('⊙.⊙')">⊙.⊙</button>
<button type="button" class="scemo_add" onclick="javascript:add('q.p')">q.p</button>
<button type="button" class="scemo_add emo_long" onclick="javascript:add('┏( \'\')┛')">┏( \'\')┛</button>
<button type="button" class="scemo_add emo_long" onclick="javascript:add('@)-)--')">@)-)--')</button>
<button type="button" class="scemo_add emo_long" onclick="javascript:add('↖(^-^)↗')">↖(^-^)↗</button>
<button type="button" class="scemo_add emo_long" onclick="javascript:add('(*^-^*)')">(*^-^*)</button>
</div>
<div class="scemo_cls"><button type="button" class="scemo_cls_btn">닫기</button></div>
</div>
</div>
<div id="write_preset">
{이름} : 받는사람 이름
</div>
<div id="write_reply">
<label for="wr_reply">회신<strong class="sound_only"> 필수</strong></label>
<input type="text" name="wr_reply" value="<?php echo $sms5['cf_phone']?>" id="wr_reply" required class="frm_input required" size="17" maxlength="20">
</div>
<div id="write_recv" class="write_inner">
<h2>받는사람</h2>
<button type="button" class="write_floater write_floater_btn" onclick="hp_list_del()">선택삭제</button>
<label for="hp_list" class="sound_only">받는사람들</label>
<select name="hp_list" id="hp_list" size="5"></select>
<div id="recv_add">
<label for="hp_name">이름</label>
<input type="text" name="hp_name" id="hp_name" class="frm_input" size="11" maxlength="20" onkeypress="if(event.keyCode==13) document.getElementById('hp_number').focus();"><br>
<label for="hp_number">번호</label>
<input type="text" name="hp_number" id="hp_number" class="frm_input" size="11" maxlength="20" onkeypress="if(event.keyCode==13) hp_add()">
<button type="button" onclick="hp_add()">추가</button><br>
</div>
</div>
<div id="write_rsv" class="write_inner">
<h2>예약전송</h2>
<div class="write_floater">
<label for="wr_booking"><span class="sound_only">예약전송 </span>사용</label>
<input type="checkbox" name="wr_booking" id="wr_booking" onclick="booking(this.checked)">
</div>
<select name="wr_by" id="wr_by" disabled>
<option value="<?php echo date('Y')?>"><?php echo date('Y')?></option>
<option value="<?php echo date('Y')+1?>"><?php echo date('Y')+1?></option>
</select>
<label for="wr_by">년</label><br>
<select name="wr_bm" id="wr_bm" disabled>
<?php for ($i=1; $i<=12; $i++) { ?>
<option value="<?php echo sprintf("%02d",$i)?>"<?php echo get_selected(date('m'), $i); ?>><?php echo sprintf("%02d",$i)?></option>
<?php } ?>
</select>
<label for="wr_bm">월</label>
<select name="wr_bd" id="wr_bd" disabled>
<?php for ($i=1; $i<=31; $i++) { ?>
<option value="<?php echo sprintf("%02d",$i)?>"<?php echo get_selected(date('d'), $i); ?>><?php echo sprintf("%02d",$i)?></option>
<?php } ?>
</select>
<label for="wr_bd">일</label><br>
<select name="wr_bh" id="wr_bh" disabled>
<?php for ($i=0; $i<24; $i++) { ?>
<option value="<?php echo sprintf("%02d",$i)?>"<?php echo get_selected(date('H')+1, $i); ?>><?php echo sprintf("%02d",$i)?></option>
<?php } ?>
</select>
<label for="wr_bh">시</label>
<select name="wr_bi" id="wr_bi" disabled>
<?php for ($i=0; $i<=59; $i+=5) { ?>
<option value="<?php echo sprintf("%02d",$i)?>"><?php echo sprintf("%02d",$i)?></option>
<?php } ?>
</select>
<label for="wr_bi">분</label>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="전송" class="btn_submit">
<!-- <input type="submit" value="전송" onclick="send()"> -->
</div>
</form>
</div>
<div id="send_book">
<h2>휴대폰번호 목록</h2>
<div id="book_tab">
<a href="#book_group" id="book_group">그룹</a>
<a href="#book_person" id="book_person">개인</a>
<a href="#book_level" id="book_level">권한</a>
</div>
<div id="num_book"></div>
<div id="book_desc">SMS 수신을 허용한 회원님만 출력됩니다.</div>
</div>
</div>
<script>
function overlap_check()
{
var hp_list = document.getElementById('hp_list');
var hp_number = document.getElementById('hp_number');
var list = '';
if (hp_list.length < 1) {
alert('받는 사람을 입력해주세요.');
hp_number.focus();
return;
}
for (i=0; i<hp_list.length; i++)
list += hp_list.options[i].value + '/';
(function($){
var $form = $("#form_sms");
$form.find("input[name='send_list']").val( list );
var params = $form.serialize();
$.ajax({
url: './sms_write_overlap_check.php',
cache:false,
timeout : 30000,
dataType:"html",
data:params,
success: function(data) {
alert(data);
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
})(jQuery);
}
var is_sms5_submitted = false; //중복 submit방지
function sms5_chk_send(f)
{
if( is_sms5_submitted == false ){
is_sms5_submitted = true;
var hp_list = document.getElementById('hp_list');
var wr_message = document.getElementById('wr_message');
var hp_number = document.getElementById('hp_number');
var list = '';
if (!wr_message.value) {
alert('메세지를 입력해주세요.');
wr_message.focus();
is_sms5_submitted = false;
return false;
}
if (hp_list.length < 1) {
alert('받는 사람을 입력해주세요.');
hp_number.focus();
is_sms5_submitted = false;
return false;
}
for (i=0; i<hp_list.length; i++)
list += hp_list.options[i].value + '/';
w = document.body.clientWidth/2 - 200;
h = document.body.clientHeight/2 - 100;
act = window.open('sms_ing.php', 'act', 'width=300, height=200, left=' + w + ', top=' + h);
act.focus();
f.send_list.value = list;
return true;
} else {
alert("데이터 전송중입니다.");
}
}
function hp_add()
{
var hp_number = document.getElementById('hp_number'),
hp_name = document.getElementById('hp_name'),
hp_list = document.getElementById('hp_list'),
pattern = /^01[016789][0-9]{3,4}[0-9]{4}$/,
pattern2 = /^01[016789]-[0-9]{3,4}-[0-9]{4}$/;
if( !hp_number.value ){
alert("휴대폰번호를 입력해 주세요.");
hp_number.select();
return;
}
if(!pattern.test(hp_number.value) && !pattern2.test(hp_number.value)) {
alert("휴대폰번호 형식이 올바르지 않습니다.");
hp_number.select();
return;
}
if (!pattern2.test(hp_number.value)) {
hp_number.value = hp_number.value.replace(new RegExp("(01[016789])([0-9]{3,4})([0-9]{4})"), "$1-$2-$3");
}
var item = '';
if (trim(hp_name.value))
item = hp_name.value + ' (' + hp_number.value + ')';
else
item = hp_number.value;
var value = 'h,' + hp_name.value + ':' + hp_number.value;
for (i=0; i<hp_list.length; i++) {
if (hp_list[i].value == value) {
alert('이미 같은 목록이 있습니다.');
return;
}
}
if( jQuery.inArray( hp_number.value , sms_obj.phone_number ) > -1 ){
alert('목록에 이미 같은 휴대폰 번호가 있습니다.');
return;
} else {
sms_obj.phone_number.push( hp_number.value );
}
hp_list.options[hp_list.length] = new Option(item, value);
hp_number.value = '';
hp_name.value = '';
hp_name.select();
}
function hp_list_del()
{
var hp_list = document.getElementById('hp_list');
if (hp_list.selectedIndex < 0) {
alert('삭제할 목록을 선택해주세요.');
return;
}
var regExp = /(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}/,
hp_number_option = hp_list.options[hp_list.selectedIndex],
result = (hp_number_option.outerHTML.match(regExp));
if( result !== null ){
sms_obj.phone_number = sms_obj.array_remove( sms_obj.phone_number, result[0] );
}
hp_list.options[hp_list.selectedIndex] = null;
}
function book_change(id)
{
var book_group = document.getElementById('book_group');
var book_person = document.getElementById('book_person');
var num_book = document.getElementById('num_book');
var menu_group = document.getElementById('menu_group');
if (id == 'book_group')
{
book_group.style.fontWeight = 'bold';
book_person.style.fontWeight = 'normal';
book_level.style.fontWeight = 'normal';
}
else if (id == 'book_person')
{
book_group.style.fontWeight = 'normal';
book_person.style.fontWeight = 'bold';
book_level.style.fontWeight = 'normal';
}
else if (id == 'book_level')
{
book_group.style.fontWeight = 'normal';
book_person.style.fontWeight = 'normal';
book_level.style.fontWeight = 'bold';
}
}
function booking(val)
{
if (val)
{
document.getElementById('wr_by').disabled = false;
document.getElementById('wr_bm').disabled = false;
document.getElementById('wr_bd').disabled = false;
document.getElementById('wr_bh').disabled = false;
document.getElementById('wr_bi').disabled = false;
}
else
{
document.getElementById('wr_by').disabled = true;
document.getElementById('wr_bm').disabled = true;
document.getElementById('wr_bd').disabled = true;
document.getElementById('wr_bh').disabled = true;
document.getElementById('wr_bi').disabled = true;
}
}
function add(str) {
var conts = document.getElementById('wr_message');
var bytes = document.getElementById('sms_bytes');
conts.focus();
conts.value+=str;
byte_check('wr_message', 'sms_bytes');
return;
}
function byte_check(wr_message, sms_bytes)
{
var conts = document.getElementById(wr_message);
var bytes = document.getElementById(sms_bytes);
var i = 0;
var cnt = 0;
var exceed = 0;
var ch = '';
for (i=0; i<conts.value.length; i++)
{
ch = conts.value.charAt(i);
if (escape(ch).length > 4) {
cnt += 2;
} else {
cnt += 1;
}
}
bytes.innerHTML = cnt;
if (cnt > 80)
{
exceed = cnt - 80;
alert('메시지 내용은 80바이트를 넘을수 없습니다.\n\n작성하신 메세지 내용은 '+ exceed +'byte가 초과되었습니다.\n\n초과된 부분은 자동으로 삭제됩니다.');
var tcnt = 0;
var xcnt = 0;
var tmp = conts.value;
for (i=0; i<tmp.length; i++)
{
ch = tmp.charAt(i);
if (escape(ch).length > 4) {
tcnt += 2;
} else {
tcnt += 1;
}
if (tcnt > 80) {
tmp = tmp.substring(0,i);
break;
} else {
xcnt = tcnt;
}
}
conts.value = tmp;
bytes.innerHTML = xcnt;
return;
}
}
<?php
if ($bk_no) {
$row = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$bk_no'");
?>
var hp_list = document.getElementById('hp_list');
var item = "<?php echo $row['bk_name']?> (<?php echo $row['bk_hp']?>)";
var value = "p,<?php echo $row['bk_no']?>";
hp_list.options[hp_list.length] = new Option(item, value);
<?php } ?>
<?php
if ($fo_no) {
$row = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no='$fo_no'");
$fo_content = str_replace(array("\r\n","\n"), "\\n", $row['fo_content']);
echo "add(\"$fo_content\");";
}
?>
byte_check('wr_message', 'sms_bytes');
document.getElementById('wr_message').focus();
</script>
<?php
if ($wr_no)
{
// 메세지와 회신번호
$row = sql_fetch(" select * from {$g5['sms5_write_table']} where wr_no = '$wr_no' ");
echo "<script>\n";
echo "var hp_list = document.getElementById('hp_list');\n";
//echo "add(\"$row[wr_message]\");\n";
$wr_message = str_replace('"', '\"', $row['wr_message']);
$wr_message = str_replace(array("\r\n","\n"), "\\n", $wr_message);
echo "add(\"$wr_message\");\n";
echo "document.getElementById('wr_reply').value = '{$row['wr_reply']}';\n";
// 회원목록
$sql = " select * from {$g5['sms5_history_table']} where wr_no = '$wr_no' and bk_no > 0 ";
$qry = sql_query($sql);
$tot = mysql_num_rows($qry);
if ($tot > 0) {
$str = '재전송그룹 ('.number_format($tot).'명)';
$val = 'p,';
while ($row = sql_fetch_array($qry))
{
$val .= $row['bk_no'].',';
}
echo "hp_list.options[hp_list.length] = new Option('$str', '$val');\n";
}
// 비회원 목록
$sql = " select * from {$g5['sms5_history_table']} where wr_no = '$wr_no' and bk_no = 0 ";
$qry = sql_query($sql);
$tot = mysql_num_rows($qry);
if ($tot > 0)
{
while ($row = sql_fetch_array($qry))
{
$str = "{$row['hs_name']} ({$row['hs_hp']})";
$val = "h,{$row['hs_name']}:{$row['hs_hp']}";
echo "hp_list.options[hp_list.length] = new Option('$str', '$val');\n";
}
}
echo "</script>\n";
}
?>
<script>
$(function(){
$(".box_txt").bind("focus keydown", function(){
$("#wr_message_lbl").hide();
});
$(".write_scemo_btn").click(function(){
$(".write_scemo").hide();
$(this).next(".write_scemo").show();
});
$(".scemo_cls_btn").click(function(){
$(".write_scemo").hide();
});
});
var sms_obj={
phone_number : [],
el_box : "#num_book",
person_is_search : false,
level_add : function(lev, cnt){
if (cnt == '0') {
alert(lev + ' 레벨은 아무도 없습니다.');
return;
}
var hp_list = document.getElementById('hp_list');
var item = "회원 권한 " + lev + " 레벨 (" + cnt + " 명)";
var value = 'l,' + lev;
for (i=0; i<hp_list.length; i++) {
if (hp_list[i].value == value) {
alert('이미 같은 목록이 있습니다.');
return;
}
}
hp_list.options[hp_list.length] = new Option(item, value);
},
array_remove : function(arr, item){
for(var i = arr.length; i--;) {
if(arr[i] === item) {
arr.splice(i, 1);
}
}
return arr;
},
book_all_checked : function(chk){
var bk_no = document.getElementsByName('bk_no');
if (chk) {
for (var i=0; i<bk_no.length; i++) {
bk_no[i].checked = true;
}
} else {
for (var i=0; i<bk_no.length; i++) {
bk_no[i].checked = false;
}
}
},
person_add : function(bk_no, bk_name, bk_hp){
var hp_list = document.getElementById('hp_list');
var item = bk_name + " (" + bk_hp + ")";
var value = 'p,' + bk_no;
for (i=0; i<hp_list.length; i++) {
if (hp_list[i].value == value) {
alert('이미 같은 목록이 있습니다.');
return;
}
}
if( jQuery.inArray( bk_hp , this.phone_number ) > -1 ){
alert('목록에 이미 같은 휴대폰 번호가 있습니다.');
return;
} else {
this.phone_number.push( bk_hp );
}
hp_list.options[hp_list.length] = new Option(item, value);
},
person_multi_add : function(){
var bk_no = document.getElementsByName('bk_no');
var ck_no = '';
var count = 0;
for (i=0; i<bk_no.length; i++) {
if (bk_no[i].checked==true) {
count++;
ck_no += bk_no[i].value + ',';
}
}
if (!count) {
alert('하나이상 선택해주세요.');
return;
}
var hp_list = document.getElementById('hp_list');
var item = "개인 (" + count + " 명)";
var value = 'p,' + ck_no;
for (i=0; i<hp_list.length; i++) {
if (hp_list[i].value == value) {
alert('이미 같은 목록이 있습니다.');
return;
}
}
hp_list.options[hp_list.length] = new Option(item, value);
},
person : function(bg_no){
var params = { bg_no : bg_no };
this.person_is_search = false;
this.person_select( params, "html" );
book_change('book_person');
},
group_add : function(bg_no, bg_name, bg_count){
if (bg_count == '0') {
alert('그룹이 비어있습니다.');
return;
}
var hp_list = document.getElementById('hp_list');
var item = bg_name + " 그룹 (" + bg_count + " 명)";
var value = 'g,' + bg_no;
for (i=0; i<hp_list.length; i++) {
if (hp_list[i].value == value) {
alert('이미 같은 목록이 있습니다.');
return;
}
}
hp_list.options[hp_list.length] = new Option(item, value);
}
};
(function($){
$("#form_sms input[type=text], #form_sms select").keypress(function(e){
return e.keyCode != 13;
});
sms_obj.fn_paging = function( hash_val,total_page,$el,$search_form ){
$el.paging({
current:hash_val ? hash_val : 1,
max:total_page == 0 || total_page ? total_page : 45,
length : 5,
liitem : 'span',
format:'{0}',
next:'다음',
prev:'이전',
sideClass:'pg_page pg_next',
prevClass:'pg_page pg_prev',
first:'&lt;&lt;',last:'&gt;&gt;',
href:'#',
itemCurrent:'pg_current',
itemClass:'pg_page',
appendhtml:'<span class="sound_only">페이지</span>',
onclick:function(e,page){
e.preventDefault();
$search_form.find("input[name='page']").val( page );
var params = '';
if( sms_obj.person_is_search ){
params = $search_form.serialize();
} else {
params = { page: page };
}
sms_obj.person_select( params, "html" );
}
});
}
sms_obj.person_select = function( params, type ){
emoticon_list.loading(sms_obj.el_box, "./img/ajax-loader.gif" ); //로딩 이미지 보여줌
$.ajax({
url: "./ajax.sms_write_person.php",
cache:false,
timeout : 30000,
dataType:type,
data:params,
success: function(data) {
$(sms_obj.el_box).html(data);
var $sms_person_form = $("#sms_person_form", sms_obj.el_box),
total_page = $sms_person_form.find("input[name='total_pg']").val(),
current_page = $sms_person_form.find("input[name='page']").val()
sms_obj.fn_paging( current_page, total_page, $("#person_pg", sms_obj.el_box), $sms_person_form );
$sms_person_form.bind("submit", function(e){
e.preventDefault();
sms_obj.person_is_search = true;
$(this).find("input[name='total_pg']").val('');
$(this).find("input[name='page']").val('');
var params = $(this).serialize();
sms_obj.person_select( params, "html" );
emoticon_list.loadingEnd(sms_obj.el_box); //로딩 이미지 지움
});
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
}
sms_obj.triggerclick = function( sel ){
$(sel).trigger("click");
}
$("#book_level").bind("click", function(e){
e.preventDefault();
book_change( $(this).attr("id") );
emoticon_list.loading(sms_obj.el_box, "./img/ajax-loader.gif" ); //로딩 이미지 보여줌
$.ajax({
url: "./ajax.sms_write_level.php",
cache:false,
timeout : 30000,
dataType:'json',
success: function(HttpRequest) {
if (HttpRequest.error) {
alert(HttpRequest.error);
return false;
} else {
$(sms_obj.el_box).html(HttpRequest.html);
}
emoticon_list.loadingEnd(sms_obj.el_box); //로딩 이미지 지움
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
})
});
$("#book_person").bind("click", function(e){
e.preventDefault();
book_change( $(this).attr("id") );
sms_obj.person_is_search = false;
sms_obj.person_select( '','html' );
});
$("#book_group").bind("click", function(e){
e.preventDefault();
book_change( $(this).attr("id") );
emoticon_list.loading(sms_obj.el_box, "./img/ajax-loader.gif" ); //로딩 이미지 보여줌
$.ajax({
url: "./ajax.sms_write_group.php",
cache:false,
timeout : 30000,
dataType:'html',
success: function(data) {
$(sms_obj.el_box).html(data);
emoticon_list.loadingEnd(sms_obj.el_box); //로딩 이미지 지움
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
})
}).trigger("click");
})(jQuery);
</script>
<?php } else { //아이코드 사용설정이 안되어 있다면... ?>
<section>
<h2 class="h2_frm">SMS 문자전송 서비스를 사용할 수 없습니다.</h2>
<div class="local_desc01 local_desc">
<p>
SMS 를 사용하지 않고 있기 때문에, 문자 전송을 할 수 없습니다.<br>
SMS 사용 설정은 <a href="../config_form.php#anc_cf_sms" class="btn_frmline">환경설정 &gt; 기본환경설정 &gt; SMS설정</a> 에서 SMS 사용을 아이코드로 변경해 주셔야 사용하실수 있습니다.
</p>
</div>
</section>
<?php } ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,132 @@
<?php
if (!defined('_GNUBOARD_')) exit;
$group = array();
$qry = sql_query("select * from {$g5['sms5_form_group_table']} order by fg_name");
while ($res = sql_fetch_array($qry)) array_push($group, $res);
$res = sql_fetch("select count(*) as cnt from `{$g5['sms5_form_table']}` where fg_no=0");
$no_count = $res['cnt'];
?>
<form name="emo_frm">
<label for="emo_sel" class="sound_only">이모티콘 그룹</label>
<select name="fg_no" id="emo_sel">
<option value=""<?php echo get_selected('', $fg_no); ?>> 전체 </option>
<option value="0"<?php echo get_selected('0', $fg_no); ?>> 미분류 (<?php echo number_format($no_count)?>) </option>
<?php for($i=0; $i<count($group); $i++) {?>
<option value="<?php echo $group[$i]['fg_no']?>"<?php echo get_selected($fg_no, $group[$i]['fg_no']);?>> <?php echo $group[$i]['fg_name']?> (<?php echo number_format($group[$i]['fg_count'])?>) </option>
<?php } ?>
</select>
</form>
<ul class="emo_list">
</ul>
<form name="emo_sch" id="emo_sch" method="get" action="<?php echo $_SERVER['PHP_SELF']?>">
<input type="hidden" name="fg_no" value="<?php echo $fg_no?>">
<input type="hidden" name="page" id="hidden_page" >
<input type="hidden" name="fg_no" id="hidden_fg_no" >
<label for="st" class="sound_only">검색대상</label>
<select name="st" id="st">
<option value="all"<?php echo get_selected('all', $st); ?>>제목 + 이모티콘</option>
<option value="name"<?php echo get_selected('name', $st); ?>>제목</option>
<option value="content"<?php echo get_selected('content', $st); ?>>이모티콘</option>
</select>
<label for="sv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="sv" value="<?php echo $sv?>" id="sv" required class="frm_input required" size="15">
<input type="submit" value="검색" class="btn_submit">
</form>
<nav class="pg_wrap">
<span class="pg" id="emo_pg"></span>
</nav>
<script src="<?php echo G5_JS_URL?>/jquery.sms_paging.js"></script>
<script>
var emoticon_list = {
go : function(fo_no){
var wr_message = document.getElementById('wr_message');
//wr_message.focus();
wr_message.value = document.getElementById('fo_contents_' + fo_no).value;
byte_check('wr_message', 'sms_bytes');
}
};
(function($){
var $search_form = $("form#emo_sch");
emoticon_list.fn_paging = function( hash_val,total_page ){
$('#emo_pg').paging({
current:hash_val ? hash_val : 1,
max:total_page == 0 || total_page ? total_page : 45,
length : 5,
liitem : 'span',
format:'{0}',
next:'다음',
prev:'이전',
sideClass:'pg_page pg_next',
prevClass:'pg_page pg_prev',
first:'&lt;&lt;',last:'&gt;&gt;',
href:'#',
itemCurrent:'pg_current',
itemClass:'pg_page',
appendhtml:'<span class="sound_only">페이지</span>',
onclick:function(e,page){
e.preventDefault();
$("#hidden_page").val( page );
var params = $($search_form).serialize();
emoticon_list.select_page( params, "json" );
}
});
}
emoticon_list.loading = function( el, src ){
if( !el || !src) return;
$(el).append("<span class='tmp_loading'><img src='"+src+"' title='loading...' ></span>");
}
emoticon_list.loadingEnd = function( el ){
$(".tmp_loading", $(el)).remove();
}
emoticon_list.select_page = function( params, type ){
if( !type ){
type = "json";
}
emoticon_list.loading(".emo_list", "./img/ajax-loader.gif" ); //로딩 이미지 보여줌
$.ajax({
url: "./ajax.sms_write_form.php",
cache:false,
timeout : 30000,
dataType:type,
data:params,
success: function(HttpRequest) {
if( type == "json" ){
if (HttpRequest.error) {
alert(HttpRequest.error);
return false;
} else {
var $emoticon_box = $(".emo_list");
$emoticon_box.html( HttpRequest.list_text );
emoticon_list.fn_paging( HttpRequest.page, HttpRequest.total_page );
$("#hidden_page").val( HttpRequest.page );
}
}
emoticon_list.loadingEnd(".emo_list"); //로딩 이미지 지움
}
});
}
$("#emo_sel").bind("change", function(e){
var params = { fg_no : $(this).val() };
$search_form[0].reset();
$("#hidden_fg_no").val( $(this).val() );
emoticon_list.select_page( params, "json" );
});
$search_form.submit(function(e){
e.preventDefault();
var $form = $(this),
params = $(this).serialize();
emoticon_list.select_page( params, "json" );
});
$("#emo_sel").trigger("change");
})(jQuery);
</script>

View File

@ -0,0 +1,69 @@
<?php
$sub_menu = "900300";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
$list = $hps = array();
$overlap = 0;
if( !$send_list ){
die("넘어온 데이터 값이 없습니다.");
}
$send_list = explode('/', $send_list);
while ($row = array_shift($send_list))
{
$item = explode(',', $row);
for ($i=1, $max = count($item); $i<$max; $i++)
{
if (!trim($item[$i])) continue;
switch ($item[0])
{
case 'g': // 그룹전송
$qry = sql_query("select * from {$g5['sms5_book_table']} where bg_no='$item[1]' and bk_receipt=1");
while ($res = sql_fetch_array($qry)) {
$res['bk_hp'] = get_hp($res['bk_hp'], 0);
if (array_overlap($hps, $res['bk_hp'])) {
$overlap ++;
continue;
}
array_push($list, $res);
array_push($hps, $res['bk_hp']);
}
break;
case 'h': // 개별 휴대폰 번호 입력
$item[$i] = explode(':', $item[$i]);
$hp = get_hp($item[$i][0], 0);
$name = $item[$i][0];
if (array_overlap($hps, $hp)) {
$overlap ++;
continue;
}
array_push($list, array('bk_hp' => $hp, 'bk_name' => $name));
array_push($hps, $hp);
break;
case 'p': // 개인 선택
$res = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$item[$i]'");
$res['bk_hp'] = get_hp($res['bk_hp'], 0);
if (array_overlap($hps, $res['bk_hp'])) {
$overlap ++;
continue;
}
array_push($list, $res);
array_push($hps, $res['bk_hp']);
break;
}
}
}
if ($overlap)
die("중복되는 휴대폰번호가 $overlap 건 있습니다. ");
else
die("중복되는 휴대폰번호가 없습니다. ");
?>

View File

@ -0,0 +1,233 @@
<?php
$sub_menu = "900300";
include_once("./_common.php");
auth_check($auth[$sub_menu], "w");
$g5['title'] = "문자전송중";
if (!trim($wr_reply))
win_close_alert('회신 번호를 입력해주세요.');
if (!trim($wr_message))
win_close_alert('메세지를 입력해주세요.');
if (!trim($send_list))
win_close_alert('문자 메세지를 받을 휴대폰번호를 입력해주세요.');
$list = array();
$hps = array();
$send_list = explode('/', $send_list);
$wr_overlap = 1; // 중복번호를 체크함
$overlap = 0;
$duplicate_data = array();
$duplicate_data['hp'] = array();
$str_serialize = "";
while ($row = array_shift($send_list))
{
$item = explode(',', $row);
for ($i=1, $max = count($item); $i<$max; $i++)
{
if (!trim($item[$i])) continue;
switch ($item[0])
{
case 'g': // 그룹전송
$qry = sql_query("select * from {$g5['sms5_book_table']} where bg_no='$item[1]' and bk_receipt=1");
while ($row = sql_fetch_array($qry))
{
$row['bk_hp'] = get_hp($row['bk_hp'], 0);
if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
continue;
}
array_push($list, $row);
array_push($hps, $row['bk_hp']);
}
break;
case 'l':
$mb_level = $item[$i];
$qry = sql_query("select mb_id, mb_name, mb_nick, mb_hp from {$g5['member_table']} where mb_level='$mb_level' and mb_sms=1 and not (mb_hp='')");
while ($row = sql_fetch_array($qry))
{
$name = $row['mb_nick'];
$hp = get_hp($row['mb_hp'], 0);
$mb_id = $row['mb_id'];
if ($wr_overlap && array_overlap($hps, $hp)) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
continue;
}
$row = sql_fetch("select bg_no, bk_no from {$g5['sms5_book_table']} where mb_id='{$row['mb_id']}'");
$bg_no = $row['bg_no'];
$bk_no = $row['bk_no'];
array_push($list, array('bk_hp' => $hp, 'bk_name' => $name, 'mb_id' => $mb_id, 'bg_no' => $bg_no, 'bk_no' => $bk_no));
array_push($hps, $hp);
}
break;
case 'h': // 권한(mb_leve) 선택
$item[$i] = explode(':', $item[$i]);
$hp = get_hp($item[$i][1], 0);
$name = $item[$i][0];
if ($wr_overlap && array_overlap($hps, $hp)) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
continue;
}
array_push($list, array('bk_hp' => $hp, 'bk_name' => $name));
array_push($hps, $hp);
break;
case 'p': // 개인 선택
$row = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$item[$i]'");
$row['bk_hp'] = get_hp($row['bk_hp'], 0);
if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
continue;
}
array_push($list, $row);
array_push($hps, $row['bk_hp']);
break;
}
}
}
if( count($duplicate_data['hp']) ){ //중복된 번호가 있다면
$duplicate_data['total'] = $overlap;
$str_serialize = serialize($duplicate_data);
}
$wr_total = count($list);
// 예약전송
if ($wr_by && $wr_bm && $wr_bd && $wr_bh && $wr_bi) {
$wr_booking = "$wr_by-$wr_bm-$wr_bd $wr_bh:$wr_bi";
$booking = $wr_by.$wr_bm.$wr_bd.$wr_bh.$wr_bi;
} else {
$wr_booking = '';
$booking = '';
}
if ($config['cf_sms_use'] != 'icode') {
alert('기본환경설정에서 icode sms 사용이 비활성화 되어 있습니다.');
}
include_once(G5_ADMIN_PATH.'/admin.head.php');
$SMS = new SMS5;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$reply = str_replace('-', '', trim($wr_reply));
$wr_message = conv_unescape_nl($wr_message);
$result = $SMS->Add($list, $reply, '', '', $wr_message, $booking, $wr_total);
if ($result)
{
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
$row = sql_fetch("select max(wr_no) as wr_no from {$g5['sms5_write_table']}");
if ($row)
$wr_no = $row['wr_no'] + 1;
else
$wr_no = 1;
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum=0, wr_reply='$wr_reply', wr_message='$wr_message', wr_booking='$wr_booking', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
$wr_success = 0;
$wr_failure = 0;
$count = 0;
foreach ($SMS->Result as $result)
{
list($phone, $code) = explode(":", $result);
if (substr($code,0,5) == "Error")
{
$hs_code = substr($code,6,2);
switch ($hs_code) {
case '02': // "02:형식오류"
$hs_memo = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$hs_memo = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$hs_memo = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$hs_memo = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$hs_memo = "알 수 없는 오류로 전송이 실패하었습니다.";
break;
}
$wr_failure++;
$hs_flag = 0;
}
else
{
$hs_code = $code;
$hs_memo = get_hp($phone, 1)."로 전송했습니다.";
$wr_success++;
$hs_flag = 1;
}
$row = array_shift($list);
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
$log = array_shift($SMS->Log);
sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum=0, bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='".addslashes($row['bk_name'])."', hs_hp='{$row['bk_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'");
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
sql_query("update {$g5['sms5_write_table']} set wr_success='$wr_success', wr_failure='$wr_failure', wr_memo='$str_serialize' where wr_no='$wr_no' and wr_renum=0");
}
else win_close_alert("에러: SMS 서버와 통신이 불안정합니다.");
}
else win_close_alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
function win_close_alert($msg) {
$html = "<script>
act = window.open('sms_ing.php', 'act', 'width=300, height=200');
act.close();
alert('$msg');
history.back();</script>";
echo $html;
exit;
}
?>
<script>
act = window.open('sms_ing.php', 'act', 'width=300, height=200');
act.close();
location.href = 'history_view.php?wr_no=<?php echo $wr_no?>';
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>