MySQLi 지원 추가 및 SMS5 수정

This commit is contained in:
chicpro
2015-10-16 10:12:06 +09:00
parent 0803de998b
commit 1fe4684537
44 changed files with 236 additions and 1415 deletions

View File

@ -5,7 +5,7 @@ include_once(G5_ADMIN_PATH.'/admin.lib.php');
include_once(G5_SMS5_PATH.'/sms5.lib.php');
if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) {
if(!mysql_num_rows(mysql_query(" show tables like '{$g5['sms5_config_table']}' ")))
if(!sql_num_rows(sql_query(" show tables like '{$g5['sms5_config_table']}' ")))
goto_url('install.php');
// SMS 설정값 배열변수

View File

@ -90,49 +90,10 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
<tr>
<th scope="row"><label for="cf_phone">회신번호<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회신받을 휴대폰 번호를 입력하세요. '-' 를 꼭 입력하세요.<br>예) 010-123-4567"); ?>
<?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>

View File

@ -8,16 +8,15 @@ check_demo();
$g5['title'] = "SMS 기본설정";
// 회신번호 체크
if(!check_vaild_callback($cf_phone))
alert('회신번호가 올바르지 않습니다.');
$userinfo = get_icode_userinfo($cf_icode_id, $cf_icode_pw);
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)
@ -25,7 +24,7 @@ if (!$res)
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 .= $g5['sms5_config_table']." set cf_phone='$cf_phone' ";
sql_query($sql);

View File

@ -1,90 +0,0 @@
<?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['SCRIPT_NAME']?>" 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['SCRIPT_NAME']."?st=$st&amp;sv=$sv&amp;page="); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -53,7 +53,7 @@ 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());
sql_query($f[$i]) or die(mysqli_error());
}
// 테이블 생성 ------------------------------------
@ -68,7 +68,7 @@ $download_point = -20;
//-------------------------------------------------------------------------------------------------
// config 테이블 설정
$sql = " insert into {$g5['sms5_book_group_table']} set bg_name='미분류'";
mysql_query($sql) or die(mysql_error() . "<p>" . $sql);
sql_query($sql) or die(mysqli_error() . "<p>" . $sql);
echo "<script>document.getElementById('sms5_job_02').innerHTML='DB설정 완료';</script>";
flush(); usleep(50000);

View File

@ -65,12 +65,7 @@ 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 ''
`cf_datetime` datetime NOT NULL default '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@ -164,25 +159,3 @@ CREATE TABLE `{$g5['sms5_write_table']}` (
`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;

View File

@ -114,7 +114,7 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
<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">
<input type="text" name="wr_reply" value="<?php echo $sms5['cf_phone']?>" id="wr_reply" required class="frm_input required" size="17" maxlength="20" readonly="readonly">
</div>
<div id="write_recv" class="write_inner">
@ -532,7 +532,7 @@ if ($wr_no)
// 회원목록
$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);
$tot = sql_num_rows($qry);
if ($tot > 0) {
@ -550,7 +550,7 @@ if ($wr_no)
// 비회원 목록
$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);
$tot = sql_num_rows($qry);
if ($tot > 0)
{

View File

@ -12,6 +12,9 @@ $wr_message = clean_xss_tags(trim($wr_message));
if (!$wr_reply)
win_close_alert('회신 번호를 숫자, - 로 입력해주세요.');
if(!check_vaild_callback($wr_reply))
win_close_alert('회신 번호를 올바르게 입력해 주십시오.');
if (!$wr_message)
win_close_alert('메세지를 입력해주세요.');
@ -42,6 +45,9 @@ while ($row = array_shift($send_list))
while ($row = sql_fetch_array($qry))
{
$row['bk_hp'] = get_hp($row['bk_hp'], 0);
if(!$row['bk_hp']) continue;
if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
@ -63,6 +69,8 @@ while ($row = array_shift($send_list))
$hp = get_hp($row['mb_hp'], 0);
$mb_id = $row['mb_id'];
if(!$hp) continue;
if ($wr_overlap && array_overlap($hps, $hp)) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
@ -84,6 +92,8 @@ while ($row = array_shift($send_list))
$hp = get_hp($item[$i][1], 0);
$name = $item[$i][0];
if(!$hp) continue;
if ($wr_overlap && array_overlap($hps, $hp)) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
@ -99,6 +109,8 @@ while ($row = array_shift($send_list))
$row = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$item[$i]'");
$row['bk_hp'] = get_hp($row['bk_hp'], 0);
if(!$row['bk_hp']) continue;
if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );