/home/mjc1/public_html/manage/m_cusafter_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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
include("./_common.php");



$dir        =   "../save_dir/notice/";
function 
file_upload($file,$last_idx){
    Global 
$ADMINID$dir;
    if(
$file['name']!='' && $file['size']>0){
        
$v explode(".",$file['name']);
        
$ext $v[count($v)-1];
        
$body_file_name  ".".$ext;
        if(
$body_file_name == ".php" || $body_file_name == ".html" || $body_file_name == ".cgi" || $body_file_name == ".pl"  || $body_file_name == ".htm" || $body_file_name == ".php3" || $body_file_name == ".php4") {
            return 
"ext_error";
        }
        
//$filename  = $last_idx."-".$ADMINID."-.".$ext;
        
$filename  $last_idx."-".$file['name'];
     
        
copy($file['tmp_name'] ,$dir.$filename);
        
unlink($file['tmp_name']);  
        return 
$filename;
    }
}

$sql "set names euckr";
mysql_query($sql,$connect_web);

$table "mBoard_cus_after";

@
extract($_POST);
@
extract($_FILES);

if(
$mode=='ch_state'){ // 상담결과

    //_pr($_GET);

    
$sql "update {$table} set state = '$state' where uid = '{$uid}' ";
    
$res mysql_query($sql,$connect_web);

    echo 
"ok";

    exit;
}

if(
$mode=='ch_emp'){ // 담당자
    
$sql "update {$table} set emp = '$emp' where uid = '{$uid}' ";
    
$res mysql_query($sql,$connect_web);

    echo 
"ok";

    exit;
}

if(
$mode=='ch_mark'){ // 홈페이지 표시여부
    
$sql "update {$table} set mark_flg = '$mark_flg' where uid = '{$uid}' ";
    
$res mysql_query($sql,$connect_web);

    echo 
"ok";

    exit;
}

if(
$mode=='ch_show_top'){ // 홈페이지 상위표시 여부
    
$sql "update {$table} set show_top = '$show_top' where uid = '{$uid}' ";
    
$res mysql_query($sql,$connect_web);

    echo 
"ok";

    exit;
}

if(
$qatxt_reg=='Y'){ // 상담후기에서 메인 표시내용 저장시
    
$_maincontent     addslashes($maincontent);
    
$_industry_type     addslashes($industry_type);
    
$_improve addslashes($improve);
    
$sql "update {$table} set industry_type = '$_industry_type', markdetail = '$_maincontent', improve = '$_improve' where uid = '{$code}' ";
    
$res mysql_query($sql,$connect_web);

} else if(
$qatxt_reg=='ceo_confirm') {
    
    
// DB접속
    
$DB_HOST  =  "114.108.136.196";
    
$DB_USER  =  "mj_inhouse_web";
    
$DB_PWD   =  "m897461z";
    
$DB_NAME  =  "mj_inhouse";

    
$connect_web2 = @mysql_connect($DB_HOST,$DB_USER,$DB_PWD);
    @
mysql_select_db$DB_NAME,$connect_web2);

    
$_ceo_confirm addslashes($ceo_confirm);

    
$cnt_sql "SELECT COUNT(*) AS cnt
    FROM jangbu_tellist_confirm AS j
    WHERE seq = '
{$code}'";
    
$cnt_res  mysql_query($cnt_sql,$connect_web2);
    
$cnt_info mysql_fetch_array($cnt_res);

    if((int)
$cnt_info['cnt'] != 0) {
        
$sql "update jangbu_tellist_confirm set ceo_confirm = '{$_ceo_confirm}' where seq = '{$code}'";
    } else {
        
$sql "insert into jangbu_tellist_confirm set ceo_confirm = '{$_ceo_confirm}', seq = '{$code}'";
    }

    
$res mysql_query($sql,$connect_web2);
?>
<script>
    document.location.href='m_cusafter_complain.php?<?php echo $qstr;?>';
</script>
<?php
} else if($qatxt_reg=='ceo_confirm2') {
    
    
// DB접속
    
$DB_HOST  =  "114.108.136.196";
    
$DB_USER  =  "mj_inhouse_web";
    
$DB_PWD   =  "m897461z";
    
$DB_NAME  =  "mj_inhouse";

    
$connect_web2 = @mysql_connect($DB_HOST,$DB_USER,$DB_PWD);
    @
mysql_select_db$DB_NAME,$connect_web2);

    
$_leadermemo addslashes($leadermemo);
    
$_ceocomment addslashes($ceocomment);

    
$sql "update issues set leadermemo = '{$_leadermemo}', ceocomment = '{$_ceocomment}' where idx = '{$code}'";
    
$res mysql_query($sql,$connect_web2);
?>
<script>
    document.location.href='m_cusreq.php?<?php echo $qstr;?>';
</script>
<?php
}

if(
$sel_del=='Y'){ // 선택삭제
    
$uids "";
    foreach(
$code_idx as $key=>$val){
        
$uid $codes[$val];
        
$sql "select * from {$table} where uid = '{$uid}' ";
        
$res mysql_query($sql,$connect_web);
        
$info mysql_fetch_array($res);
        
$sql "delete from {$table} where uid = '{$uid}' ";
        
mysql_query($sql,$connect_web);
    }

/*} else if($code!=''){ // 업데이트
    if($add_file_del=='Y'){
        unlink($dir.$add_file_del_name);
    }
    $_content     = addslashes($content);  
    $sql = "update {$table} set
                name = '{$name}', company = '{$company}', subject = '{$subject}', content = '{$_content}', hit = '{$hit}', temp = '{$temp}'
            where uid = '$code'
    ";
    mysql_query($sql,$connect_web);

    $filename = file_upload($add_file,$code);

    if($filename=='ext_error'){
?>
        <script language="JavaScript">
            alert("이 형식의 파일은 업로드 할 수 없습니다."); 
            history.back(); 
        </script>
<?php
    } else if($filename!=''){
        $sql = "update {$table} set add_file = '{$filename}' where uid = '$code' ";
        mysql_query($sql,$connect_web);
    }

} else if($code==''){ // 신규
    $_content     = addslashes($content);  
    $reg_date     =  Time();

    $sql = "insert into {$table} set
                name = '{$name}', company = '{$company}', subject = '{$subject}', content = '{$_content}', hit = '{$hit}', reg_date = '{$reg_date}',temp = '{$temp}'
    ";
    mysql_query($sql,$connect_web);
    $last_idx = mysql_insert_id($connect_web);

    $filename = file_upload($add_file,$last_idx);

    if($filename=='ext_error'){
?>
        <script language="JavaScript">
            alert("이 형식의 파일은 업로드 할 수 없습니다."); 
            history.back(); 
        </script>
<?php
    } else if($filename!=''){
        $sql = "update {$table} set add_file = '{$filename}' where uid = '$last_idx' ";
        mysql_query($sql,$connect_web);
    }*/
}

?>
<script>
    document.location.href='m_cusafter.php?<?php echo $qstr;?>';
</script>