아이코드 1도 접해보지않아서..질문드립니다 .ㅠ
본문
지금
메인에 빠른상담으로 만들고있습니다!
문의하기누르면 문자를 발송하게하고싶은데요! 지금 이소스를 사용하면되는지 질문입니다!!!
소스보여드리겠습니다!!
------------퀵메뉴 www/quickmenu.php
<div class="quick-menu">
<div class="quick-top">
<ul class="row">
<li class="cell">
<div class="img-box"><img src="<?php echo G5_THEME_IMG_URL?>/quick-logo.png" alt=""></div>
</li>
<li class="cell">
<h1>빠른 <b>문자상담</b></h1>
</li>
</ul>
</div>
<div class="quick-section">
<form name="fwrite" method="post" onSubmit="return submitChk(this)"; style="margin:0px;" id="sosong">
<input type=hidden name=sca value="<?=$sca?>">
<ul class="row">
<li class="cell"><span>이름</span></li>
<li class="cell"><input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input" size="10" maxlength="20" placeholder="이름을 입력해주세요."></li>
</ul>
<ul class="row">
<li class="cell"><span>연락처</span></li>
<li class="cell"><input type="text" name="wr_5" value="<?php echo $wr_5 ?>" id="wr_5" required class="frm_input" size="10" maxlength="20" placeholder="연락처를 입력해주세요."></li>
</ul>
<ul class="row">
<li class="cell"><span>희망차종</span></li>
<li class="cell"><input type="text" name="wr_subject" value="<?php echo $wr_subject ?>" id="wr_subject" required class="frm_input" size="10" maxlength="20" placeholder="희망차종을 입력하세요"></li>
</ul>
<button onclick="return true;"><span>문의하기</span></button>
</form>
</div>
<button class="call"><span>빠른상담하기</span><span>1600-0000</span></button>
<div class="kakao">
<span>카카오문의</span>
<div class="circle">
<div class="img-box"><img src="<?php echo G5_THEME_IMG_URL?>/kakao.png" alt=""></div>
</div>
</div>
<div class="quick-bottom">
<span>카카오플러스친구(고릴라오토)</span>
<span>카카오톡으로 문의하기 xxx</span>
</div>
</div>
<script language="javascript">
function submitChk(f)
{
f.action = "/form_ok.php";
return true;
}
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script type="text/javascript">
jQuery(function($){
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',
'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],
monthNamesShort: ['1월','2월','3월','4월','5월','6월',
'7월','8월','9월','10월','11월','12월'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
weekHeader: 'Wk',
dateFormat: 'yy-mm-dd',
firstDay: 0,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ko']);
$('.date').datepicker({
showOn: 'both',
changeMonth: true,
changeYear: true,
showButtonPanel: true
});
});
</script>
------------------------------www/form_ok.php
<?
include_once("./common.php");
include_once("./lib/mailer.lib.php");
include_once('./lib/icode.sms.lib.php');
ob_start();
include_once ("./bbs/write_update_mail.php");
$content = ob_get_contents();
ob_end_clean();
$wr_homepage = "$hp1-$hp2-$hp3";
$bo_table = "business";
$write_table = $g5['write_prefix'] . $bo_table;
$wr_num = get_next_num($write_table);
$wr_reply = "";
$wr_subject = "{$_POST[wr_name]}님의 상담문의입니다.";
//$secret = "secret";
$sql = " insert into $write_table
set wr_num = '$wr_num',
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '{$member['mb_id']}',
wr_password = '$wr_password',
wr_name = '$wr_name',
wr_email = '$wr_email',
wr_homepage = '$wr_homepage',
wr_datetime = '".G5_TIME_YMDHIS."',
wr_last = '".G5_TIME_YMDHIS."',
wr_ip = '{$_SERVER['REMOTE_ADDR']}',
wr_1 = '$wr_1',
wr_2 = '$wr_2',
wr_3 = '$wr_3',
wr_4 = '$wr_4',
wr_5 = '$wr_5',
wr_6 = '$wr_6',
wr_7 = '$wr_7',
wr_8 = '$wr_8',
wr_9 = '$wr_9',
wr_10 = '$wr_10' ";
sql_query($sql);
$wr_id = sql_insert_id();
// 부모 아이디에 UPDATE
sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' ");
// 새글 INSERT
sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$wr_id}', '{$wr_id}', '".G5_TIME_YMDHIS."', '{$member['mb_id']}' ) ");
// 게시글 1 증가
sql_query("update {$g5['board_table']} set bo_count_write = bo_count_write + 1 where bo_table = '{$bo_table}'");
$super_admin = get_admin("super");
$wr_email = $super_admin[mb_email];
mailer($wr_name, $wr_email, $super_admin[mb_email], $wr_subject, $content, 1);
alert("상담문의 신청이 완료되었습니다.","/index.php");
?>
이소스대로하면될까요?
답변 1
선행되어야 할 것은 아이코드 가입 및 그누보드에 아이디/패스워드 연동,
아이코드 발신번호 사전등록입니다.
그 후 아래 코드를 form_ok.php 소스 하단에 집어 넣어주세요.
문자 내용은 알아서 편집하시면 됩니다.
//----------------------------------------------------------
// SMS 문자전송 시작
//----------------------------------------------------------
$sms_contents = "새 문의 글이 등록되었습니다."; // 문자 내용
// 핸드폰번호에서 숫자만 취한다
$receive_number = preg_replace("/[^0-9]/", "", $wr_homepage); // 수신자번호
$send_number = preg_replace("/[^0-9]/", "", $sms5['cf_phone']); // 발신자번호
if ($w == "" && $receive_number)
{
if ($config['cf_sms_use'] == 'icode')
{
if($config['cf_sms_type'] == 'LMS') {
include_once('./lib/icode.lms.lib.php');
$port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']);
// SMS 모듈 클래스 생성
if($port_setting !== false) {
$SMS = new LMS;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
$strDest = array();
$strDest[] = $receive_number;
$strCallBack = $send_number;
$strCaller = iconv_euckr(trim($config['cf_title']));
$strSubject = '';
$strURL = '';
$strData = iconv_euckr($sms_contents);
$strDate = '';
$nCount = count($strDest);
$res = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
$SMS->Send();
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
}
} else {
include_once('./lib/icode.sms.lib.php');
$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($receive_number, $send_number, $config['cf_icode_id'], iconv_euckr(stripslashes($sms_contents)), "");
$SMS->Send();
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
}
}
}
//----------------------------------------------------------
// SMS 문자전송 끝
//----------------------------------------------------------