dlinaddcoupons.inc.php
1.18 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
<?php
global $_GPC, $_W;
$action = 'start';
$uid=$_COOKIE["uid"];
$storeid=$_COOKIE["storeid"];
$cur_store = $this->getStoreById($storeid);
$GLOBALS['frames'] = $this->getNaveMenu($storeid, $action,$uid);
$list = pdo_get('cjdc_coupons',array('id'=>$_GPC['id']));
if(checksubmit('submit')){
$data['name']=$_GPC['name'];
$data['full']=$_GPC['full'];
$data['reduce']=$_GPC['reduce'];
$data['number']=$_GPC['number'];
$data['start_time']=$_GPC['time']['start'];
$data['end_time']=$_GPC['time']['end'];
$data['uniacid']=$_W['uniacid'];
$data['type']=$_GPC['type'];
$data['store_id']=$storeid;
$data['instruction']=$_GPC['instruction'];
if($_GPC['id']==''){
$data['stock']=$_GPC['number'];
$res=pdo_insert('cjdc_coupons',$data);
if($res){
message('添加成功',$this->createWebUrl2('dlincoupons',array()),'success');
}else{
message('添加失败','','error');
}
}else{
$data['stock']=$_GPC['stock'];
$res = pdo_update('cjdc_coupons', $data, array('id' => $_GPC['id']));
if($res){
message('编辑成功',$this->createWebUrl2('dlincoupons',array()),'success');
}else{
message('编辑失败','','error');
}
}
}
include $this->template('web/dlinaddcoupons');