/home/mjc1/public_html/adm/sms_admin/sms_write_overlap_check.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
$sub_menu 
"900300";
include_once(
"./_common.php");

auth_check($auth[$sub_menu], "w");

$list $hps = array();

$overlap 0;

if( !
$send_list ){
    die(
"넘어온 데이터 값이 없습니다.");
}
$send_list explode('/'$send_list);

while (
$row array_shift($send_list)) 
{
    
$item explode(','$row);

    for (
$i=1$max count($item); $i<$max$i++) 
    {
        if (!
trim($item[$i])) continue;

        switch (
$item[0]) 
        {
            case 
'g'// 그룹전송
                
$qry sql_query("select * from {$g5['sms5_book_table']} where bg_no='$item[1]' and bk_receipt=1");
                while (
$res sql_fetch_array($qry)) {
                    
$res['bk_hp'] = get_hp($res['bk_hp'], 0);
                    if (
array_overlap($hps$res['bk_hp'])) {
                        
$overlap ++;
                        continue;
                    }
                    
array_push($list$res);
                    
array_push($hps$res['bk_hp']);
                }
                break;

            case 
'h'// 개별 휴대폰 번호 입력
                
$item[$i] = explode(':'$item[$i]);
                
$hp get_hp($item[$i][0], 0);
                
$name $item[$i][0];
                if (
array_overlap($hps$hp)) {
                    
$overlap ++;
                    continue;
                }
                
array_push($list, array('bk_hp' => $hp'bk_name' => $name));
                
array_push($hps$hp);
                break;

            case 
'p'// 개인 선택
                
$res sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$item[$i]'");
                
$res['bk_hp'] = get_hp($res['bk_hp'], 0);
                if (
array_overlap($hps$res['bk_hp'])) {
                    
$overlap ++;
                    continue;
                }
                
array_push($list$res);
                
array_push($hps$res['bk_hp']);
                break;
        }
    }
}

if (
$overlap)
    die(
"중복되는 휴대폰번호가 $overlap 건 있습니다. ");
else
    die(
"중복되는 휴대폰번호가 없습니다. ");
?>