addad.inc.php
1.32 KB
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
<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$info=pdo_get('cjdc_ad',array('id'=>$_GPC['id']));
if(checksubmit('submit')){
if($info['logo']!=$_GPC['logo']){
$data['logo']=$_W['attachurl'].$_GPC['logo'];
}
if($_GPC['item']==1){
$data['src']=$_GPC['src'];
}elseif($_GPC['item']==2){
$data['src2']=$_GPC['src2'];
}elseif($_GPC['item']==3){
$data['xcx_name']=$_GPC['xcx_name'];
$data['appid']=trim($_GPC['appid']);
}
$data['orderby']=$_GPC['orderby'];
$data['status']=$_GPC['status'];
$data['title']=$_GPC['title'];
$data['item']=$_GPC['item'];
$data['type']=$_GPC['type'];
$data['uniacid']=$_W['uniacid'];
$data['created_time']=date('Y-m-d H:i:s');
if($_GPC['id']==''){
$res=pdo_insert('cjdc_ad',$data);
if($res){
message('添加成功!', $this->createWebUrl('ad'), 'success');
}else{
message('添加失败!','','error');
}
}else{
$res=pdo_update('cjdc_ad',$data,array('id'=>$_GPC['id']));
if($res){
message('编辑成功!', $this->createWebUrl('ad'), 'success');
}else{
message('编辑失败!','','error');
}
}
}
include $this->template('web/addad');