#328 상품문의 답변 sms 이메일 알림 추가

This commit is contained in:
chicpro
2013-11-21 16:35:19 +09:00
parent 8b216869f1
commit 2d02784941
4 changed files with 55 additions and 0 deletions

View File

@ -50,6 +50,18 @@ $qstr = 'page='.$page.'&sort1='.$sort1.'&sort2='.$sort2;
<th scope="row">이름</th>
<td><?php echo $name; ?></td>
</tr>
<?php if($iq['iq_email']) { ?>
<tr>
<th scope="row">이메일</th>
<td><?php echo get_text($iq['iq_email']); ?></td>
</tr>
<?php } ?>
<?php if($iq['iq_hp']) { ?>
<tr>
<th scope="row">휴대폰</th>
<td><?php echo get_text($iq['iq_hp']); ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="iq_subject">제목</label></th>
<td><input type="text" name="iq_subject" value="<?php echo conv_subject($iq['iq_subject'],120); ?>" id="iq_subject" required class="frm_input required" size="95"></td>

View File

@ -20,6 +20,39 @@ if ($w == "u")
where iq_id = '$iq_id' ";
sql_query($sql);
if(trim($iq_answer)) {
$sql = " select a.iq_email, a.iq_hp, b.it_name
from {$g5['g5_shop_item_qa_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
where a.iq_id = '$iq_id' ";
$row = sql_fetch($sql);
// SMS 알림
if($config['cf_sms_use'] == 'icode' && $row['iq_hp']) {
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
$sms_content = get_text($row['it_name']).' 상품문의에 답변이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $default['de_admin_company_tel']);
$recv_number = preg_replace('/[^0-9]/', '', $row['iq_hp']);
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
}
}
// 답변 이메일전송
if(trim($row['iq_email'])) {
include_once(G5_LIB_PATH.'/mailer.lib.php');
$subject = $config['cf_title'].' '.$row['it_name'].' 상품문의 답변 알림 메일';
$content = conv_content($iq_answer, 1);
mailer($config['cf_title'], $admin['mb_email'], $row['iq_email'], $subject, $content, 1);
}
}
goto_url("./itemqaform.php?w=$w&amp;iq_id=$iq_id&amp;$qstr");
}
else {

View File

@ -12,6 +12,11 @@ $iq_id = escape_trim($_REQUEST['iq_id']);
$chk_secret = '';
if($w == '') {
$qa['iq_email'] = $member['mb_email'];
$qa['iq_hp'] = $member['mb_hp'];
}
if ($w == "u")
{
$qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' ");

View File

@ -18,6 +18,11 @@ $iq_id = escape_trim($_REQUEST['iq_id']);
$chk_secret = '';
if($w == '') {
$qa['iq_email'] = $member['mb_email'];
$qa['iq_hp'] = $member['mb_hp'];
}
if ($w == "u")
{
$qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' ");