/home/mjc1/public_html/adm/member_group_update.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
$sub_menu 
"200130";
include_once(
'./_common.php');

if (
$is_admin != 'super')
    
alert('최고관리자만 접근 가능합니다.');

check_token();

if(
$_POST['act_button']=='선택삭제'){

    
$count count($_POST['chk']);

    if(!
$count)
        
alert($_POST['act_button'].'할 게시판그룹을 1개이상 선택해 주세요.');

    for (
$i=0$i<$count$i++)
    {
        
$k     $_POST['chk'][$i];
        
$gr_id $_POST['mg_no'][$k];

        
$sql "select * from {$g5['member_group']} where mg_no = '$gr_id'";
        
$info sql_fetch($sql);

        
sql_query(" delete from {$g5['member_group']} where mg_no = '$gr_id' ");

        
/*$dest_path = G5_DATA_PATH.'/reseller/'.$gr_id.'/'.$info[mbr_file];
        @unlink($dest_path);*/

    
}

    
goto_url('./member_group_list.php?'.$qstr);
    exit;
}

$mg_no $_POST['mg_no'];
$last_id "";

if(
$mg_no==''){

    
$sql " insert into {$g5['member_group']}
                set mg_name   = '
{$_POST['mg_name']}',
                    mg_memo = '
{$_POST['mg_memo']}',
                    mg_payment = '
{$_POST['mg_payment']}',
                    mg_point = '
{$_POST['mg_point']}',
                    mg_point_price = '
{$_POST['mg_point_price']}',
                    mg_point_price_get = '
{$_POST['mg_point_price_get']}',
                    mg_save = '
{$_POST['mg_save']}',
                    mg_save_price = '
{$_POST['mg_save_price']}',
                    mg_save_price_get = '
{$_POST['mg_save_price_get']}',
                    mg_seq = '
{$_POST['mg_seq']}',
                    mg_danga_use = '
{$_POST['mg_danga_use']}',
                    mg_danga_per = '
{$_POST['mg_danga_per']}',
                    mg_img = '' "
;
    
$result sql_query($sqlFALSE);
    
$mg_no mysql_insert_id();
    
$mg_id "mg_".$mg_no;
} else {
    
$sql " update {$g5['member_group']}
                set mg_name   = '
{$_POST['mg_name']}',
                    mg_memo = '
{$_POST['mg_memo']}',
                    mg_payment = '
{$_POST['mg_payment']}',
                    mg_point = '
{$_POST['mg_point']}',
                    mg_point_price = '
{$_POST['mg_point_price']}',
                    mg_point_price_get = '
{$_POST['mg_point_price_get']}',
                    mg_save = '
{$_POST['mg_save']}',
                    mg_save_price = '
{$_POST['mg_save_price']}',
                    mg_save_price_get = '
{$_POST['mg_save_price_get']}',
                    mg_danga_use = '
{$_POST['mg_danga_use']}',
                    mg_danga_per = '
{$_POST['mg_danga_per']}',
                    mg_seq = '
{$_POST['mg_seq']}'
                where mg_no = '
{$mg_no}'
        "
;
    
sql_query($sql);
    
$mg_id "mg_".$mg_no;
}

// 아이콘 업로드
    
if (is_uploaded_file($_FILES['mg_img']['tmp_name'])) {
        if (!
preg_match("/(\.gif)$/i"$_FILES['mg_img']['name'])) {
            
alert($_FILES['mg_img']['name'] . '은(는) gif 파일이 아닙니다.');
        }

        if (
preg_match("/(\.gif)$/i"$_FILES['mg_img']['name'])) {
            @
mkdir(G5_DATA_PATH.'/member/'.$mg_idG5_DIR_PERMISSION);
            @
chmod(G5_DATA_PATH.'/member/'.$mg_idG5_DIR_PERMISSION);

            
$dest_path G5_DATA_PATH.'/member/'.$mg_id.'/'.$mg_id.'.gif';
            
move_uploaded_file($_FILES['mg_img']['tmp_name'], $dest_path);
            
chmod($dest_pathG5_FILE_PERMISSION);

            
/*if (file_exists($dest_path)) {
                $size = getimagesize($dest_path);
                // 아이콘의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 아이콘 삭제
                if ($size[0] > $config['cf_member_icon_width'] || $size[1] > $config['cf_member_icon_height']) {
                    @unlink($dest_path);
                }
            }*/
        
}
        
$sql "update {$g5['member_group']} set mg_img = '".$mg_id.".gif' where mg_no = '".$mg_no."' " ;
        
sql_query($sql);
    }


//sql_query(" OPTIMIZE TABLE `$g5['auth_table']` ");

goto_url('./member_group_list.php?'.$qstr);
?>