/home/mjc1/public_html/adm/sms_admin/ajax.hp_chk.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
46
47
48
49
50
51
<?php
$sub_menu 
"900800";
include_once(
"./_common.php");
@include_once(
G5_PLUGIN_PATH."/sms5/JSON.php");

if( !
function_exists('json_encode') ) {
    function 
json_encode($data) {
        
$json = new Services_JSON();
        return( 
$json->encode($data) );
    }
}

ajax_auth_check($auth[$sub_menu], "r");

$err '';
$arr_ajax_msg = array();
$exist_hplist = array();

if( !
$bk_hp )
    
$err '휴대폰번호를 입력해 주십시오.';

$bk_hp get_hp($bk_hp);

$sql " select count(*) as cnt from {$g5['sms5_book_table']} where bk_hp = '$bk_hp' ";
if(
$w == 'u' && $bk_no)
    
$sql .= " and bk_no <> '$bk_no' ";
$row sql_fetch($sql);

if(
$row['cnt'])
    
$err '같은 번호가 존재합니다.';

// 수정일 때 회원정보에서 중복체크
if(!$row['cnt'] && $w == 'u') {
    
$sql " select mb_id from {$g5['member_table']} where mb_hp = '{$bk_hp}' and mb_hp <> '' ";

    if( 
$mb_id )
        
$sql .= " and mb_id <> '{$mb_id}' ";

    
$result sql_query($sql);

    while(
$row sql_fetch_array($result)){
        
$exist_hplist[] = $row['mb_id'];
    }
}

$arr_ajax_msg['error'] = $err;
$arr_ajax_msg['exist'] = $exist_hplist;

die( 
json_encode($arr_ajax_msg) );

?>