diff --git a/adm/sms_admin/_common.php b/adm/sms_admin/_common.php
index 289691141..c2c148c40 100644
--- a/adm/sms_admin/_common.php
+++ b/adm/sms_admin/_common.php
@@ -4,7 +4,7 @@ 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']}'")))
+ if(!mysql_num_rows(mysql_query(" show tables like '{$g5['sms5_config_table']}' ")))
goto_url('install.php');
// SMS 설정값 배열변수
diff --git a/adm/sms_admin/ajax.hp_chk.php b/adm/sms_admin/ajax.hp_chk.php
index 560257309..b1c303565 100644
--- a/adm/sms_admin/ajax.hp_chk.php
+++ b/adm/sms_admin/ajax.hp_chk.php
@@ -1,4 +1,5 @@
그룹
diff --git a/adm/sms_admin/config.php b/adm/sms_admin/config.php
index 1a9f1132b..f1fd649d4 100644
--- a/adm/sms_admin/config.php
+++ b/adm/sms_admin/config.php
@@ -109,7 +109,7 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
|
- > 허용
+ >
|
@@ -118,7 +118,7 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
레벨 이상
diff --git a/adm/sms_admin/config_update.php b/adm/sms_admin/config_update.php
index 22fc6ea05..e89787730 100644
--- a/adm/sms_admin/config_update.php
+++ b/adm/sms_admin/config_update.php
@@ -20,7 +20,7 @@ $userinfo = array(
if ($userinfo['code'] == '202')
alert('아이코드 아이디와 패스워드가 맞지 않습니다.');
-if ($cf_member == 'on')
+if ($cf_member == '1')
$cf_member = 1;
else
$cf_member = 0;
diff --git a/adm/sms_admin/form_list.php b/adm/sms_admin/form_list.php
index c62704d98..008405441 100644
--- a/adm/sms_admin/form_list.php
+++ b/adm/sms_admin/form_list.php
@@ -29,7 +29,7 @@ if ($st == 'all') {
}
$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_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
@@ -41,7 +41,7 @@ $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];
+$no_count = $res['cnt'];
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
@@ -122,9 +122,9 @@ function multi_update(sel)
diff --git a/adm/sms_admin/form_write.php b/adm/sms_admin/form_write.php
index 35c2382bb..603bd2c03 100644
--- a/adm/sms_admin/form_write.php
+++ b/adm/sms_admin/form_write.php
@@ -41,7 +41,7 @@ include_once(G5_ADMIN_PATH.'/admin.head.php');
$qry = sql_query("select * from {$g5['sms5_form_group_table']} order by fg_name");
while($res = sql_fetch_array($qry)) {
?>
-
+
diff --git a/adm/sms_admin/history_list.php b/adm/sms_admin/history_list.php
index bb2b10292..193937878 100644
--- a/adm/sms_admin/history_list.php
+++ b/adm/sms_admin/history_list.php
@@ -17,7 +17,7 @@ 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_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
@@ -30,9 +30,7 @@ include_once(G5_ADMIN_PATH.'/admin.head.php');
@@ -59,7 +59,7 @@ include_once(G5_ADMIN_PATH.'/admin.head.php');
- |
+ |
데이터가 없습니다.
|
@@ -77,23 +77,22 @@ include_once(G5_ADMIN_PATH.'/admin.head.php');
$bg_name = '없음';
if ($res['mb_id'])
- $mb_id = "{$res['mb_id']}";
+ $mb_id = ''.$res['mb_id'].'';
else
$mb_id = '비회원';
?>
- |
- |
- |
- |
- |
+ |
+ |
+ |
+ |
+ |
|
예약":'';?> |
|
|
- 수정
-
+ 수정
|
diff --git a/adm/sms_admin/history_send.php b/adm/sms_admin/history_send.php
index 5494c2e00..488e25db5 100644
--- a/adm/sms_admin/history_send.php
+++ b/adm/sms_admin/history_send.php
@@ -116,7 +116,7 @@ if ($result)
$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='$hs_memo', hs_log='$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(); // 보관하고 있던 결과값을 지웁니다.
diff --git a/adm/sms_admin/history_view.php b/adm/sms_admin/history_view.php
index edf8dbfe2..d65672290 100644
--- a/adm/sms_admin/history_view.php
+++ b/adm/sms_admin/history_view.php
@@ -52,7 +52,7 @@ function re_send()
act = window.open('sms_ing.php', 'act', 'width=300, height=200');
act.focus();
- location.href = './history_send.php?w=f&page=&st=&sv=&wr_no=&wr_renum=';
+ location.href = './history_send.php?w=f&page=&st=&sv=&wr_no=&wr_renum=';
}
function all_send()
@@ -71,8 +71,8 @@ function all_send()
@@ -239,7 +239,7 @@ function all_send()
-
+
''";
$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_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
@@ -111,9 +111,9 @@ function no_hp_click(val)
@@ -123,10 +123,10 @@ function no_hp_click(val)
@@ -29,9 +29,9 @@ $no_count = $res['cnt'];
diff --git a/adm/sms_admin/sms_write_send.php b/adm/sms_admin/sms_write_send.php
index 0276553a8..d11a5b0fd 100644
--- a/adm/sms_admin/sms_write_send.php
+++ b/adm/sms_admin/sms_write_send.php
@@ -134,6 +134,7 @@ $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);
@@ -198,7 +199,8 @@ if ($result)
$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(stripslashes($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(); // 보관하고 있던 결과값을 지웁니다.
diff --git a/plugin/sms5/sms5.lib.php b/plugin/sms5/sms5.lib.php
index 7ff5fc61d..ea587384a 100644
--- a/plugin/sms5/sms5.lib.php
+++ b/plugin/sms5/sms5.lib.php
@@ -20,6 +20,70 @@ function get_sms5_skin_select($skin_gubun, $id, $name, $selected='', $event='')
return $str;
}
+// 한페이지에 보여줄 행, 현재페이지, 총페이지수, URL
+function sms5_sub_paging($write_pages, $cur_page, $total_page, $url, $add="", $starget="")
+{
+ if( $starget ){
+ $url = preg_replace('#&'.$starget.'=[0-9]*#', '', $url) . '&'.$starget.'=';
+ }
+
+ $str = '';
+ if ($cur_page > 1) {
+ $str .= '처음'.PHP_EOL;
+ }
+
+ $start_page = ( ( (int)( ($cur_page - 1 ) / $write_pages ) ) * $write_pages ) + 1;
+ $end_page = $start_page + $write_pages - 1;
+
+ if ($end_page >= $total_page) $end_page = $total_page;
+
+ if ($start_page > 1) $str .= '이전'.PHP_EOL;
+
+ if ($total_page > 1) {
+ for ($k=$start_page;$k<=$end_page;$k++) {
+ if ($cur_page != $k)
+ $str .= ''.$k.'페이지'.PHP_EOL;
+ else
+ $str .= '열린'.$k.'페이지'.PHP_EOL;
+ }
+ }
+
+ if ($total_page > $end_page) $str .= '다음'.PHP_EOL;
+
+ if ($cur_page < $total_page) {
+ $str .= '맨끝'.PHP_EOL;
+ }
+
+ if ($str)
+ return "";
+ else
+ return "";
+}
+
+// 권한 검사
+function ajax_auth_check($auth, $attr)
+{
+ global $is_admin;
+
+ if ($is_admin == 'super') return;
+
+ if (!trim($auth))
+ die("{\"error\":\"이 메뉴에는 접근 권한이 없습니다.\\n\\n접근 권한은 최고관리자만 부여할 수 있습니다.\"}");
+
+ $attr = strtolower($attr);
+
+ if (!strstr($auth, $attr)) {
+ if ($attr == 'r')
+ die("{\"error\":\"읽을 권한이 없습니다.\"}");
+ else if ($attr == 'w')
+ die("{\"error\":\"입력, 추가, 생성, 수정 권한이 없습니다.\"}");
+ else if ($attr == 'd')
+ die("{\"error\":\"삭제 권한이 없습니다.\"}");
+ else
+ die("{\"error\":\"속성이 잘못 되었습니다.\"}");
+ }
+}
+
if ( ! function_exists('array_overlap')) {
function array_overlap($arr, $val) {
for ($i=0, $m=count($arr); $i<$m; $i++) {
diff --git a/plugin/sms5/write_update.php b/plugin/sms5/write_update.php
index 735004fc7..a25e50b7b 100644
--- a/plugin/sms5/write_update.php
+++ b/plugin/sms5/write_update.php
@@ -91,6 +91,8 @@ if ($mh_by && $mh_bm && $mh_bd && $mh_bh && $mh_bi) {
$SMS = new SMS5;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
+$mh_message = conv_unescape_nl($mh_message);
+
$result = $SMS->Add($mh_hp, $mh_reply, '', '', $mh_message, $booking, $total);
$is_success = null;