/home/mjc1/public_html/adm/shop_admin/bannerformupdate.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
<?php
$sub_menu 
'100720';
include_once(
'./_common.php');

check_demo();

if (
$W == 'd')
    
auth_check($auth[$sub_menu], "d");
else
    
auth_check($auth[$sub_menu], "w");

@
mkdir(G5_DATA_PATH."/banner"G5_DIR_PERMISSION);
@
chmod(G5_DATA_PATH."/banner"G5_DIR_PERMISSION);

$bn_bimg      $_FILES['bn_bimg']['tmp_name'];
$bn_bimg_name $_FILES['bn_bimg']['name'];

if (
$bn_bimg_del)  @unlink(G5_DATA_PATH."/banner/$bn_id");

if (
$w=="")
{
    if (!
$bn_bimg_namealert('배너 이미지를 업로드 하세요.');

    
sql_query(" alter table {$g5['g5_shop_banner_table']} auto_increment=1 ");

    
$sql " insert into {$g5['g5_shop_banner_table']}
                set bn_alt        = '
$bn_alt',
                    bn_url        = '
$bn_url',
                    bn_position   = '
$bn_position',
                    bn_border     = '
$bn_border',
                    bn_new_win    = '
$bn_new_win',
                    bn_begin_time = '
$bn_begin_time',
                    bn_end_time   = '
$bn_end_time',
                    bn_time       = '
$now',
                    bn_hit        = '0',
                    bn_order      = '
$bn_order' ";
    
sql_query($sql);

    
$bn_id mysql_insert_id();
}
else if (
$w=="u")
{
    
$sql " update {$g5['g5_shop_banner_table']}
                set bn_alt        = '
$bn_alt',
                    bn_url        = '
$bn_url',
                    bn_position   = '
$bn_position',
                    bn_border     = '
$bn_border',
                    bn_new_win    = '
$bn_new_win',
                    bn_begin_time = '
$bn_begin_time',
                    bn_end_time   = '
$bn_end_time',
                    bn_order      = '
$bn_order'
              where bn_id = '
$bn_id' ";
    
sql_query($sql);
}
else if (
$w=="d")
{
    @
unlink(G5_DATA_PATH."/banner/$bn_id");

    
$sql " delete from {$g5['g5_shop_banner_table']} where bn_id = $bn_id ";
    
$result sql_query($sql);
}


if (
$w == "" || $w == "u")
{
    if (
$_FILES['bn_bimg']['name']) upload_file($_FILES['bn_bimg']['tmp_name'], $bn_idG5_DATA_PATH."/banner");

    
goto_url("./bannerform.php?w=u&amp;bn_id=$bn_id");
} else {
    
goto_url("./bannerlist.php");
}
?>