<?
@session_start();
include ($_SERVER[DOCUMENT_ROOT] . "/common/conf/config.inc.php");
include ($_SERVER[DOCUMENT_ROOT] . "/module/online/online.lib.php");
include_once ($_SERVER[DOCUMENT_ROOT] . "/backoffice/module/admin/admin.lib.php");

if($_POST[evnMode]=="join"){
	//DB연결
	$dblink = SetConn($_conf_db["main_db"]);

	$RS = insertOnline();

	//관리자 문자/이메일전송용
	//stripslashes($arrAdminInfo["list"][0][a_name])
	//stripslashes($arrAdminInfo["list"][0][a_phone])
	$arrAdminInfo = getArticleInfo($GLOBALS["_conf_tbl"]["admin"], "1");

	//DB해제
	SetDisConn($dblink);

	if($RS==true){
		if($_POST[o_type]=="1"){
			if($_SITE["POSTMAN_ID"] != "test_website"){
				/*
				ob_start();
				include $_SERVER['DOCUMENT_ROOT']."/module/online/mail_send.html";
				$mailContents = ob_get_contents();
				ob_end_clean();
				$mailContents = str_replace("::성함::",$_POST[user_name],$mailContents);
				//$mailContents = str_replace("::일반전화::",$phone,$mailContents);
				$mailContents = str_replace("::연락처::",$mobile,$mailContents);
				$mailContents = str_replace("::이메일::",$email,$mailContents);
				$mailContents = str_replace("::제목::",$_POST[p_name],$mailContents);
				$mailContents = str_replace("::내용::",nl2br($_POST[contents]),$mailContents);
				*/
			?>
			<!-- <form name="mailForm1" method="post" action="send_mail.php">
			<input type="hidden" name="mem_name" value="<?=$arrAdminInfo["list"][0][a_name]?>"/>
			<input type="hidden" name="mem_email" value="<?=$arrAdminInfo["list"][0][a_email]?>"/>
			<input type="hidden" name="contents" value="<?=$mailContents?>">
			<input type="hidden" name="returnURL" value="<?=$_POST[returnURL]?>">
			</form>
			<script type="text/javascript">
			document.mailForm1.submit();
			</script> -->
			<?
			}
			jsGo($_REQUEST[returnURL],"","문의가 접수 되었습니다.");
		}
	}else{
		jsMsg("글 등록에 실패 하였습니다.");
		jsHistory("-2") ;
	}

}
?>