addjfgoods.inc.php
1.4 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
<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$info = pdo_get('cjdc_jfgoods',array('uniacid' => $_W['uniacid'],'id'=>$_GPC['id']));
$type = pdo_getall('cjdc_jftype',array('uniacid' => $_W['uniacid']));
if(checksubmit('submit')){
$data['name']=$_GPC['name'];
if($info['img']!=$_GPC['img']){
$data['img']=$_W['attachurl'].$_GPC['img'];
}else{
$data['img']=$_GPC['img'];
}
$data['money']=$_GPC['money'];
$data['type_id']=$_GPC['type_id'];
$data['goods_details']=html_entity_decode($_GPC['goods_details']);
$data['process_details']=html_entity_decode($_GPC['process_details']);
$data['attention_details']=html_entity_decode($_GPC['attention_details']);
$data['number']=$_GPC['number'];
$data['is_open']=$_GPC['is_open'];
$data['type']=$_GPC['type'];
$data['num']=$_GPC['num'];
$data['hb_moeny']=$_GPC['hb_moeny'];
$data['uniacid']=$_W['uniacid'];
if($_GPC['id']==''){
$res=pdo_insert('cjdc_jfgoods',$data);
if($res){
message('添加成功',$this->createWebUrl('jfgoods',array()),'success');
}else{
message('添加失败','','error');
}
}else{
$res = pdo_update('cjdc_jfgoods', $data, array('id' => $_GPC['id']));
if($res){
message('编辑成功',$this->createWebUrl('jfgoods',array()),'success');
}else{
message('编辑失败','','error');
}
}
}
include $this->template('web/addjfgoods');