/home/mjc1/public_html/mjmall/ajax.install_req.process.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
include_once("./_common.php");
include(
"./include/common.php");

$mode_ok "Y";

@
extract($_POST);
$smname iconv("utf-8","euckr",$smname);
$telname iconv("utf-8","euckr",$telname);
$smtel iconv("utf-8","euckr",$smtel);

$sql "select count(*) as cnt from mBoard_install_req where ipadd = '".$_SERVER['REMOTE_ADDR']."' and reg_date like '".date("Y-m-d H:i",time())."%' ";
$res mysql_query($sql);
$info mysql_fetch_array($res);
if(
$info['cnt']>0){
    
$mode_ok "N";
    
$msg "너무 빠른시간안에 중복으로 요청하셨습니다.";
}

if(
$mode_ok=='Y'){
    if(
$contact_time=='1'){
        
$ct_time "20분이내 연락";
    } else {
        
$ct_time "{$ct_date} {$ct_hour}시 {$ct_minute}분에 연락";
    }
    
$ct $ct_time;
    
$ct_time iconv("utf-8","euckr",$ct_time);
    if(
"{$ct_date} {$ct_hour}:{$ct_minute}:00"<=date("Y-m-d H:i:s",time()) && $contact_time=='0'){
        
$mode_ok "N";
        
$msg "금일시분 이후로 선택하시기 바랍니다.";
    } else {
        
$sql "insert into mBoard_install_req set smname = '{$smname}', smtel = '{$smtel}', smtitle = '{$smtitle}', telname = '{$telname}', 
                    contact_time = '
{$ct_time}', ipadd = '".$_SERVER['REMOTE_ADDR']."', reg_date = '".date("Y-m-d H:i:s",time())."', come_from = '{$come_from}'  ";
        
$res mysql_query($sql);
    }
}

echo 
"<?php xml version='1.0' encoding='utf-8'?><output>";
echo 
"<mode>".$mode."</mode>";
echo 
"<mode_ok>".$mode_ok."</mode_ok>";
echo 
"<rtn_url>".$rtn_url."</rtn_url>";
echo 
"<msg>".$msg."</msg>";
echo 
"<contact_time>".$ct."</contact_time>";
echo 
"</output>";
?>