/home/mjc1/public_html/j3demo/adm/ajax.category_copy_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
<?php
$sub_menu 
"300100";
$dir ".";
include_once(
$dir."/_common.php");
include(
"./auth_check.php"); // 관리자 권한 체크


if($mode=='init'){
    
$sql "update product_s set prod_cate_code_s = 0 where 1=1";
    
mysql_query($sql,$connect_j3);

    
$sql "delete from product_category_s where 1=1";
    
mysql_query($sql,$connect_j3);

    
$msg "초기화가 완료 되었습니다.";

    
$mode_ok "Y";
} else {
    
$mode "update";

    
$sql "select * from product_category order by code2";
    
$res mysql_query($sql,$connect_j3);
    
$cnt 0;
    while(
$info mysql_fetch_array($res)){
        
$sql "insert into product_category_s set code = '{$info['code']}', parent_code = '{$info['parent_code']}', code2 = '{$info['code2']}', name = '{$info['name']}', 
                    lv = '
{$info['lv']}', cate1_name = '{$info['cate1_name']}', cate2_name = '{$info['cate2_name']}', pc_use = '1', 
                    pccode = '
{$info['code']}', remarks = '{$info['remarks']}', data_created = '{$info['data_created']}', data_creator = '{$info['data_creator']}', 
                    data_updated = '
{$info['data_updated']}', data_updater = '{$info['data_updater']}' ";
        
mysql_query($sql,$connect_j3);
        
$cnt++;
    }

    
$mode_ok "Y";
}

echo 
"<?php xml version='1.0' encoding='utf-8'?><output>";
echo 
"<mode>".$mode."</mode>";
echo 
"<mode_ok>".$mode_ok."</mode_ok>";
echo 
"<rtn_url>".$rtn_url."</rtn_url>";
echo 
"<msg>".$msg."</msg>";
echo 
"<cnt>".$cnt."</cnt>";
echo 
"</output>";

?>