merge 충돌 수정
This commit is contained in:
@ -924,4 +924,10 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
|||||||
#grp_color li span{width:10px;height:10px; display:inline-block;background:rgb(75, 178, 197);margin-right:5px;}
|
#grp_color li span{width:10px;height:10px; display:inline-block;background:rgb(75, 178, 197);margin-right:5px;}
|
||||||
#grp_color li.color2 span{background:rgb(234, 162, 40);}
|
#grp_color li.color2 span{background:rgb(234, 162, 40);}
|
||||||
#chart_wr h5{text-align:center;border:1px solid #eee;padding:30px 0}
|
#chart_wr h5{text-align:center;border:1px solid #eee;padding:30px 0}
|
||||||
|
|
||||||
#chart_wr{margin:20px }
|
#chart_wr{margin:20px }
|
||||||
|
|
||||||
|
/*전송실패 문자 재전송 내역*/
|
||||||
|
.sms_table{padding:0 20px 40px;}
|
||||||
|
.sms_table table th{border:1px solid #ddd;padding:9px 0}
|
||||||
|
.sms_table table td{border:1px solid #ddd;text-align:center;width:16%;padding:9px 0}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
define('G5_IS_ADMIN', true);
|
define('G5_IS_ADMIN', true);
|
||||||
include_once ('../../common.php');
|
include_once ('../../common.php');
|
||||||
include_once(G5_ADMIN_PATH.'/admin.lib.php');
|
include_once(G5_ADMIN_PATH.'/admin.lib.php');
|
||||||
|
include_once(G5_SMS5_PATH.'/sms5.lib.php');
|
||||||
|
|
||||||
if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) {
|
if (!strstr($_SERVER['SCRIPT_NAME'], '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']}' ")))
|
||||||
|
|||||||
@ -86,10 +86,6 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
|
|||||||
<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')">
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th scope="row">건별 금액</th>
|
|
||||||
<td><?php echo number_format($userinfo['gpay'])?> 원</td>
|
|
||||||
</tr>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><label for="cf_phone">회신번호<strong class="sound_only"> 필수</strong></label></th>
|
<th scope="row"><label for="cf_phone">회신번호<strong class="sound_only"> 필수</strong></label></th>
|
||||||
|
|||||||
@ -39,7 +39,8 @@ if (!$res['cnt']) {
|
|||||||
$sql = sql_query("select * from {$g5['sms5_history_table']} where wr_no='$wr_no' $sql_renum $sql_flag");
|
$sql = sql_query("select * from {$g5['sms5_history_table']} where wr_no='$wr_no' $sql_renum $sql_flag");
|
||||||
while ($res = sql_fetch_array($sql))
|
while ($res = sql_fetch_array($sql))
|
||||||
{
|
{
|
||||||
$res['bk_hp'] = get_hp($res['bk_hp'], 0);
|
$res['bk_hp'] = get_hp($res['hs_hp'], 0);
|
||||||
|
$res['bk_name'] = $res['hs_name'];
|
||||||
|
|
||||||
if ($g5['sms5_demo'])
|
if ($g5['sms5_demo'])
|
||||||
$res['bk_hp'] = '0100000000';
|
$res['bk_hp'] = '0100000000';
|
||||||
@ -48,6 +49,7 @@ while ($res = sql_fetch_array($sql))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$wr_total = count($list);
|
$wr_total = count($list);
|
||||||
|
$reply = str_replace('-', '', trim($write['wr_reply']));
|
||||||
|
|
||||||
if ($config['cf_sms_use'] != 'icode') {
|
if ($config['cf_sms_use'] != 'icode') {
|
||||||
alert('기본환경설정에서 icode sms 사용이 비활성화 되어 있습니다.');
|
alert('기본환경설정에서 icode sms 사용이 비활성화 되어 있습니다.');
|
||||||
@ -55,14 +57,104 @@ if ($config['cf_sms_use'] != 'icode') {
|
|||||||
include_once(G5_ADMIN_PATH.'/admin.head.php');
|
include_once(G5_ADMIN_PATH.'/admin.head.php');
|
||||||
|
|
||||||
$SMS = new SMS5;
|
$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']));
|
if($config['cf_sms_type'] == 'LMS') {
|
||||||
|
$port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']);
|
||||||
|
|
||||||
$result = $SMS->Add($list, $reply, '', '', $write['wr_message'], '', $wr_total);
|
if($port_setting !== false) {
|
||||||
|
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
|
||||||
|
|
||||||
if ($result)
|
$wr_success = 0;
|
||||||
{
|
$wr_failure = 0;
|
||||||
|
$count = 0;
|
||||||
|
|
||||||
|
for($i=0; $i<$wr_total; $i++) {
|
||||||
|
$strDest = array();
|
||||||
|
$strDest[] = $list[$i]['bk_hp'];
|
||||||
|
$strCallBack = $reply;
|
||||||
|
$strCaller = $config['cf_title'];
|
||||||
|
$strSubject = '';
|
||||||
|
$strURL = '';
|
||||||
|
$strData = $write['wr_message'];
|
||||||
|
if( !empty($list[$i]['bk_name']) ){
|
||||||
|
$strData = str_replace("{이름}", $list[$i]['bk_name'], $strData);
|
||||||
|
}
|
||||||
|
$strDate = $booking;
|
||||||
|
$nCount = 1;
|
||||||
|
|
||||||
|
$result = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
|
||||||
|
|
||||||
|
if($result) {
|
||||||
|
$result = $SMS->Send();
|
||||||
|
|
||||||
|
if ($result) //SMS 서버에 접속했습니다.
|
||||||
|
{
|
||||||
|
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 = $list[$i];
|
||||||
|
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
|
||||||
|
|
||||||
|
$log = array_shift($SMS->Log);
|
||||||
|
$log = @iconv('euc-kr', 'utf-8', $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='".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)."'", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', wr_reply='".addslashes($write['wr_reply'])."', wr_message='".addslashes($write['wr_message'])."', wr_success='$wr_success', wr_failure='$wr_failure', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
|
||||||
|
|
||||||
|
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 {
|
||||||
|
$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();
|
$result = $SMS->Send();
|
||||||
|
|
||||||
if ($result) //SMS 서버에 접속했습니다.
|
if ($result) //SMS 서버에 접속했습니다.
|
||||||
@ -126,8 +218,9 @@ if ($result)
|
|||||||
sql_query("update {$g5['sms5_write_table']} set wr_re_total=wr_re_total+1 where wr_no='$wr_no' and wr_renum=0");
|
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 서버와 통신이 불안정합니다.");
|
||||||
|
}
|
||||||
|
else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
|
||||||
}
|
}
|
||||||
else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -98,6 +98,7 @@ function all_send()
|
|||||||
|
|
||||||
<?php if ($write['wr_re_total'] && !$wr_renum) { ?>
|
<?php if ($write['wr_re_total'] && !$wr_renum) { ?>
|
||||||
<h2>전송실패 문자 재전송 내역</h2>
|
<h2>전송실패 문자 재전송 내역</h2>
|
||||||
|
<div class="sms_table">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -138,6 +139,7 @@ function all_send()
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if( $write['wr_memo'] ){
|
if( $write['wr_memo'] ){
|
||||||
|
|||||||
@ -33,7 +33,7 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
|
|||||||
<label for="wr_message" id="wr_message_lbl">내용</label>
|
<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>
|
<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>
|
<div id="sms_byte"><span id="sms_bytes">0</span> / <span id="sms_max_bytes"><?php echo ($config['cf_sms_type'] == 'LMS' ? 90 : 80); ?></span> byte</div>
|
||||||
|
|
||||||
<button type="button" id="write_sc_btn" class="write_scemo_btn">특수<br>기호</button>
|
<button type="button" id="write_sc_btn" class="write_scemo_btn">특수<br>기호</button>
|
||||||
<div id="write_sc" class="write_scemo">
|
<div id="write_sc" class="write_scemo">
|
||||||
@ -406,6 +406,7 @@ function byte_check(wr_message, sms_bytes)
|
|||||||
{
|
{
|
||||||
var conts = document.getElementById(wr_message);
|
var conts = document.getElementById(wr_message);
|
||||||
var bytes = document.getElementById(sms_bytes);
|
var bytes = document.getElementById(sms_bytes);
|
||||||
|
var max_bytes = document.getElementById("sms_max_bytes");
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var cnt = 0;
|
var cnt = 0;
|
||||||
@ -424,6 +425,40 @@ function byte_check(wr_message, sms_bytes)
|
|||||||
|
|
||||||
bytes.innerHTML = cnt;
|
bytes.innerHTML = cnt;
|
||||||
|
|
||||||
|
<?php if($config['cf_sms_type'] == 'LMS') { ?>
|
||||||
|
if(cnt > 90)
|
||||||
|
max_bytes.innerHTML = 1500;
|
||||||
|
else
|
||||||
|
max_bytes.innerHTML = 90;
|
||||||
|
|
||||||
|
if (cnt > 1500)
|
||||||
|
{
|
||||||
|
exceed = cnt - 1500;
|
||||||
|
alert('메시지 내용은 1500바이트를 넘을수 없습니다.\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 > 1500) {
|
||||||
|
tmp = tmp.substring(0,i);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
xcnt = tcnt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
conts.value = tmp;
|
||||||
|
bytes.innerHTML = xcnt;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
<?php } else { ?>
|
||||||
if (cnt > 80)
|
if (cnt > 80)
|
||||||
{
|
{
|
||||||
exceed = cnt - 80;
|
exceed = cnt - 80;
|
||||||
@ -451,6 +486,7 @@ function byte_check(wr_message, sms_bytes)
|
|||||||
bytes.innerHTML = xcnt;
|
bytes.innerHTML = xcnt;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
<?php } ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -133,16 +133,109 @@ if ($config['cf_sms_use'] != 'icode') {
|
|||||||
|
|
||||||
include_once(G5_ADMIN_PATH.'/admin.head.php');
|
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));
|
$reply = str_replace('-', '', trim($wr_reply));
|
||||||
$wr_message = conv_unescape_nl($wr_message);
|
$wr_message = conv_unescape_nl($wr_message);
|
||||||
|
|
||||||
$result = $SMS->Add($list, $reply, '', '', $wr_message, $booking, $wr_total);
|
$SMS = new SMS5;
|
||||||
|
|
||||||
if ($result)
|
if($config['cf_sms_type'] == 'LMS') {
|
||||||
{
|
$port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']);
|
||||||
|
|
||||||
|
if($port_setting !== false) {
|
||||||
|
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
|
||||||
|
|
||||||
|
$wr_success = 0;
|
||||||
|
$wr_failure = 0;
|
||||||
|
$count = 0;
|
||||||
|
|
||||||
|
$row2 = sql_fetch("select max(wr_no) as wr_no from {$g5['sms5_write_table']}");
|
||||||
|
if ($row2)
|
||||||
|
$wr_no = $row2['wr_no'] + 1;
|
||||||
|
else
|
||||||
|
$wr_no = 1;
|
||||||
|
|
||||||
|
for($i=0; $i<$wr_total; $i++) {
|
||||||
|
$strDest = array();
|
||||||
|
$strDest[] = $list[$i]['bk_hp'];
|
||||||
|
$strCallBack = $reply;
|
||||||
|
$strCaller = $config['cf_title'];
|
||||||
|
$strSubject = '';
|
||||||
|
$strURL = '';
|
||||||
|
$strData = $wr_message;
|
||||||
|
if( !empty($list[$i]['bk_name']) ){
|
||||||
|
$strData = str_replace("{이름}", $list[$i]['bk_name'], $strData);
|
||||||
|
}
|
||||||
|
$strDate = $booking;
|
||||||
|
$nCount = 1;
|
||||||
|
|
||||||
|
$result = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
|
||||||
|
|
||||||
|
if($result) {
|
||||||
|
$result = $SMS->Send();
|
||||||
|
|
||||||
|
if ($result) //SMS 서버에 접속했습니다.
|
||||||
|
{
|
||||||
|
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 = $list[$i];
|
||||||
|
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
|
||||||
|
|
||||||
|
$log = array_shift($SMS->Log);
|
||||||
|
$log = @iconv('euc-kr', 'utf-8', $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)."'", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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_success='$wr_success', wr_failure='$wr_failure', wr_memo='$str_serialize', wr_booking='$wr_booking', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
|
||||||
|
$result = $SMS->Add($list, $reply, '', '', $wr_message, $booking, $wr_total);
|
||||||
|
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
$result = $SMS->Send();
|
$result = $SMS->Send();
|
||||||
|
|
||||||
if ($result) //SMS 서버에 접속했습니다.
|
if ($result) //SMS 서버에 접속했습니다.
|
||||||
@ -211,8 +304,9 @@ if ($result)
|
|||||||
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");
|
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 서버와 통신이 불안정합니다.");
|
||||||
|
}
|
||||||
|
else win_close_alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
|
||||||
}
|
}
|
||||||
else win_close_alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
|
|
||||||
|
|
||||||
function win_close_alert($msg) {
|
function win_close_alert($msg) {
|
||||||
|
|
||||||
|
|||||||
@ -49,9 +49,5 @@ if (!empty($config['cf_sms_use'])) {
|
|||||||
// 아이코드에 실제로 보내지 않고 가상(Random)으로 전송결과를 저장합니다.
|
// 아이코드에 실제로 보내지 않고 가상(Random)으로 전송결과를 저장합니다.
|
||||||
$g5['sms5_demo_send'] = true;
|
$g5['sms5_demo_send'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
|
||||||
include_once(G5_SMS5_PATH.'/sms5.lib.php');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -82,10 +82,10 @@ class LMS {
|
|||||||
2.설정에서 제목필드보기 설정 Enable -> 제목을 넣지 않을 경우 제목없음으로 자동표시
|
2.설정에서 제목필드보기 설정 Enable -> 제목을 넣지 않을 경우 제목없음으로 자동표시
|
||||||
|
|
||||||
제목의 첫글자에 "<",">", 개행문자가 있을경우 단말기종류 및 통신사에 따라 메세지 전송실패 -> 글자를 체크하거나 취환처리요망
|
제목의 첫글자에 "<",">", 개행문자가 있을경우 단말기종류 및 통신사에 따라 메세지 전송실패 -> 글자를 체크하거나 취환처리요망
|
||||||
|
*/
|
||||||
$strSubject = str_replace("\r\n", " ", $strSubject);
|
$strSubject = str_replace("\r\n", " ", $strSubject);
|
||||||
$strSubject = str_replace("<", "[", $strSubject);
|
$strSubject = str_replace("<", "[", $strSubject);
|
||||||
$strSubject = str_replace(">", "]", $strSubject);
|
$strSubject = str_replace(">", "]", $strSubject);
|
||||||
*/
|
|
||||||
|
|
||||||
$strSubject = FillSpace($strSubject,30);
|
$strSubject = FillSpace($strSubject,30);
|
||||||
$strData = FillSpace(CutChar($strData,1500),1500);
|
$strData = FillSpace(CutChar($strData,1500),1500);
|
||||||
|
|||||||
@ -154,7 +154,157 @@ if ( ! function_exists('is_ie')) {
|
|||||||
* 접속, 발송, URL발송, 결과등의 실질적으로 쓰이는 모든 부분이 포함되어 있다.
|
* 접속, 발송, URL발송, 결과등의 실질적으로 쓰이는 모든 부분이 포함되어 있다.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SMS5 extends SMS {
|
if($config['cf_sms_type'] == 'LMS') {
|
||||||
|
include_once(G5_LIB_PATH.'/icode.lms.lib.php');
|
||||||
|
|
||||||
|
class SMS5 extends LMS {
|
||||||
|
var $icode_id;
|
||||||
|
var $icode_pw;
|
||||||
|
var $socket_host;
|
||||||
|
var $socket_port;
|
||||||
|
var $socket_portcode;
|
||||||
|
var $send_type;
|
||||||
|
var $Data = array();
|
||||||
|
var $Result = array();
|
||||||
|
var $Log = array();
|
||||||
|
|
||||||
|
// SMS 서버 접속
|
||||||
|
function SMS_con($host, $id, $pw, $portcode) {
|
||||||
|
$this->socket_host = $host;
|
||||||
|
$this->socket_portcode = $portcode;
|
||||||
|
$this->icode_id = FillSpace($id, 10);
|
||||||
|
$this->icode_pw = FillSpace($pw, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Init() {
|
||||||
|
$this->Data = ""; // 발송하기 위한 패킷내용이 배열로 들어간다.
|
||||||
|
$this->Result = ""; // 발송결과값이 배열로 들어간다.
|
||||||
|
}
|
||||||
|
|
||||||
|
function Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate="", $nCount) {
|
||||||
|
// EUC-KR로 변환
|
||||||
|
$strCaller = iconv_euckr($strCaller);
|
||||||
|
$strSubject = iconv_euckr($strSubject);
|
||||||
|
$strData = iconv_euckr($strData);
|
||||||
|
|
||||||
|
// 문자 타입별 Port 설정.
|
||||||
|
$sendType = strlen($strData) > 90 ? 1 : 0; // 0: SMS / 1: LMS
|
||||||
|
|
||||||
|
/* 개발 완료 후 아래 포트를 rand 함수를 이용하는 라인으로 변경 바랍니다.*/
|
||||||
|
|
||||||
|
// 충전식
|
||||||
|
if ($this->socket_portcode == 1) {
|
||||||
|
if($sendType && $sendType == 1) {
|
||||||
|
//$this->socket_port = 8200; // LMS
|
||||||
|
$this->socket_port=(int)rand(8200,8201); // LMS
|
||||||
|
} else {
|
||||||
|
//$this->socket_port = 6295; // SMS
|
||||||
|
$this->socket_port=(int)rand(6295,6297); // SMS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 정액제
|
||||||
|
else {
|
||||||
|
if($sendType && $sendType == 1) {
|
||||||
|
//$this->socket_port = 8300; // LMS
|
||||||
|
$this->socket_port=(int)rand(8300,8301); // LMS
|
||||||
|
} else {
|
||||||
|
//$this->socket_port = 6291; // SMS
|
||||||
|
$this->socket_port=(int)rand(6291,6293); // SMS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$strCallBack = FillSpace($strCallBack, 11); // 회신번호
|
||||||
|
$strDate = FillSpace($strDate, 12); // 즉시(12byte 공백), 예약전송(YmdHi)
|
||||||
|
|
||||||
|
if ($sendType && $sendType == 1) {
|
||||||
|
|
||||||
|
/** LMS 제목 **/
|
||||||
|
/*
|
||||||
|
제목필드의 값이 없을 경우 단말기 기종및 설정에 따라 표기 방법이 다름
|
||||||
|
1.설정에서 제목필드보기 설정 Disable -> 제목필드값을 넣어도 미표기
|
||||||
|
2.설정에서 제목필드보기 설정 Enable -> 제목을 넣지 않을 경우 제목없음으로 자동표시
|
||||||
|
|
||||||
|
제목의 첫글자에 "<",">", 개행문자가 있을경우 단말기종류 및 통신사에 따라 메세지 전송실패 -> 글자를 체크하거나 취환처리요망
|
||||||
|
*/
|
||||||
|
$strSubject = str_replace("\r\n", " ", $strSubject);
|
||||||
|
$strSubject = str_replace("<", "[", $strSubject);
|
||||||
|
$strSubject = str_replace(">", "]", $strSubject);
|
||||||
|
|
||||||
|
$strSubject = FillSpace($strSubject,30);
|
||||||
|
$strData = FillSpace(CutChar($strData,1500),1500);
|
||||||
|
} else if (!$strURL) {
|
||||||
|
$strData = FillSpace(CutChar($strData,90),90);
|
||||||
|
$strCaller = FillSpace($strCaller,10);
|
||||||
|
} else {
|
||||||
|
$strURL = FillSpace($strURL,50);
|
||||||
|
}
|
||||||
|
|
||||||
|
$Error = CheckCommonTypeDest($strDest, $nCount);
|
||||||
|
$Error = is_vaild_callback($strCallBack);
|
||||||
|
$Error = CheckCommonTypeDate($strDate);
|
||||||
|
|
||||||
|
for ($i=0; $i<$nCount; $i++) {
|
||||||
|
$strDest[$i] = FillSpace($strDest[$i],11);
|
||||||
|
if ($sendType && $sendType == 1) {
|
||||||
|
$this->Data[$i] = '01144 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strSubject.$strDate.$strData;
|
||||||
|
} else if (!$strURL) {
|
||||||
|
$this->Data[$i] = '01144 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strCaller.$strDate.$strData;
|
||||||
|
} else {
|
||||||
|
$strData = FillSpace(CheckCallCenter($strURL, $strDest[$i], $strData),80);
|
||||||
|
$this->Data[$i] = '05173 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strURL.$strDate.$strData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Send() {
|
||||||
|
global $g5;
|
||||||
|
|
||||||
|
if ($g5['sms5_demo_send']) {
|
||||||
|
foreach($this->Data as $puts) {
|
||||||
|
if (rand(0,10)) {
|
||||||
|
$phone = substr($puts,26,11);
|
||||||
|
$code = '47022497 ';
|
||||||
|
} else {
|
||||||
|
$phone = substr($puts,26,11);
|
||||||
|
$code = 'Error(02)';
|
||||||
|
}
|
||||||
|
$this->Result[] = "$phone:$code";
|
||||||
|
$this->Log[] = $puts;
|
||||||
|
}
|
||||||
|
$this->Data = "";
|
||||||
|
return true;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fsocket = fsockopen($this->socket_host,$this->socket_port, $errno, $errstr, 2);
|
||||||
|
if (!$fsocket) return false;
|
||||||
|
set_time_limit(300);
|
||||||
|
|
||||||
|
foreach($this->Data as $puts) {
|
||||||
|
fputs($fsocket, $puts);
|
||||||
|
while(!$gets) { $gets = fgets($fsocket,30); }
|
||||||
|
$dest = substr($puts,26,11);
|
||||||
|
if (substr($gets,0,19) == "0223 00".$dest) {
|
||||||
|
$this->Result[] = $dest.":".substr($gets,19,10);
|
||||||
|
$this->Log[] = $puts;
|
||||||
|
} else {
|
||||||
|
$this->Result[$dest] = $dest.":Error(".substr($gets,6,2).")";
|
||||||
|
$this->Log[] = $puts;
|
||||||
|
}
|
||||||
|
$gets = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($fsocket);
|
||||||
|
$this->Data = "";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
||||||
|
|
||||||
|
class SMS5 extends SMS {
|
||||||
var $Log = array();
|
var $Log = array();
|
||||||
|
|
||||||
function SMS_con($sms_server,$sms_id,$sms_pw,$port) {
|
function SMS_con($sms_server,$sms_id,$sms_pw,$port) {
|
||||||
@ -329,5 +479,6 @@ class SMS5 extends SMS {
|
|||||||
$this->Data = "";
|
$this->Data = "";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('_GNUBOARD_')) exit;
|
if (!defined('_GNUBOARD_')) exit;
|
||||||
|
|
||||||
|
if(!$config['cf_sms_use'])
|
||||||
|
alert_close('문자보내기를 이용하실 수 없습니다.');
|
||||||
|
|
||||||
if( !$sms5['bo_skin'] ){
|
if( !$sms5['bo_skin'] ){
|
||||||
$sms5['bo_skin'] = "basic";
|
$sms5['bo_skin'] = "basic";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once("./_common.php");
|
include_once("./_common.php");
|
||||||
|
|
||||||
|
if(!$config['cf_sms_use'])
|
||||||
|
alert_close('문자보내기를 이용하실 수 없습니다.');
|
||||||
|
|
||||||
|
// SMS 라이브러리
|
||||||
|
$config['cf_sms_type'] = '';
|
||||||
|
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
||||||
|
include_once(G5_SMS5_PATH.'/sms5.lib.php');
|
||||||
|
|
||||||
$g5['title'] = "문자전송중";
|
$g5['title'] = "문자전송중";
|
||||||
|
|
||||||
if (!($token && get_session("ss_token") == $token))
|
if (!($token && get_session("ss_token") == $token))
|
||||||
|
|||||||
Reference in New Issue
Block a user