/home/mjc1/public_html/onlinecs/mobile/ajax_id1process.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
<?php
include_once("./_common.php");
// 나중에 사용할때 처리할려고 일단 가져왔음
//login.php 작업이 안되어 있어서 동작 안함
include("../../manage/category/mscommon.php");

$sa_name_array[3] = "천년CS";
$sa_name_array[4] = "제조CS";
$sa_name_array[9] = "제조Pro";
$sa_name_array[12] = "천년CS";
$sa_name_array[15] = "천년3";

$u_cid strtoupper($cid);

if (
$cid == "mjtest") {
    
//e수발주웹 판매중단
    
$ms2Qry       =  " SELECT user_id, app_id, app_dbip, app_dbname, eorderlimit From app_priv WHERE upper(user_id) = '{$u_cid}' and app_id = '12' ";
    
$ms2Result    =    mysql_query($ms2Qry);
    
$app_cnt 0;
    if( 
MYSQL_NUM_ROWS($ms2Result) > 0){
        
$ms2Row  =  MYSQL_FETCH_ARRAY($ms2Result);
        
$sa_type 12;    //12: e수발주웹
        
$sa_uid $ms2Row['user_id'];
        
$u_sa_uid strtoupper($ms2Row['user_id']);
        
$sa_dbip $ms2Row['app_dbip'];
        
$sa_dbname $ms2Row['app_dbname'];
        
$limituser $ms2Row['eorderlimit'];
        
$app_cnt++;
        
$sa_name $sa_name_array[12];
    }
} else {
    if(
$sa_type!=''){
        
$msQry       =  " SELECT user_id, app_id, app_dbip, app_dbname, eorderlimit From app_priv WHERE upper(user_id) = '{$u_cid}' and (app_id = '$sa_type') AND app_active = 1 order by app_id  ";
    } else {
        if(
$cid=='weblink'){ // 대성활어일 경우 천년3만 나오게 처리
            
$msQry       =  " SELECT user_id, app_id, app_dbip, app_dbname, eorderlimit From app_priv WHERE upper(user_id) = '{$u_cid}' and app_id= '15' AND app_active = 1 order by app_id  ";
        } else {
            
$msQry       =  " SELECT user_id, app_id, app_dbip, app_dbname, eorderlimit From app_priv WHERE upper(user_id) = '{$u_cid}' and (app_id = '3' or app_id= '4' or app_id= '9'  or app_id= '15') AND app_active = 1 order by app_id  ";
        }
    }
    
$msResult    =    mysql_query($msQry);
    
$app_cnt 0;
    
$sa_type ""$sa_name='';
    while(
$msRow  =  MYSQL_FETCH_ARRAY($msResult)){
        
$sa_type .= $msRow['app_id'].",";    //9:제조Pro, 4:제조CS, 3:천년
        
$sa_name .= $sa_name_array[$msRow['app_id']].",";
        
$app_cnt++;
    }
    
$sa_type substr($sa_type,0,strlen($sa_type)-1);
    
$sa_name substr($sa_name,0,strlen($sa_name)-1);
}

echo 
"<?php xml version='1.0' encoding='utf-8'?><output>";
echo 
"<app_cnt>".$app_cnt."</app_cnt>";
echo 
"<sa_type>".$sa_type."</sa_type>";
echo 
"<sa_name>".$sa_name."</sa_name>";
echo 
"<msg>".$msg."</msg>";
echo 
"</output>";

?>