dlinaddcoupon.inc.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. global $_GPC, $_W;
  3. //$GLOBALS['frames'] = $this->getMainMenu2();
  4. $seller_id=$_COOKIE["storeid"];
  5. $uid=$_COOKIE["uid"];
  6. $GLOBALS['frames'] = $this->getNaveMenu($seller_id, $action='start',$uid);
  7. $cur_store = $this->getStoreById($seller_id);
  8. $list = pdo_get('zh_jdgjb_coupons',array('id'=>$_GPC['id']));
  9. if(checksubmit('submit')){
  10. $data['name']=$_GPC['name'];
  11. $data['number']=$_GPC['number'];
  12. $data['cost']=$_GPC['cost'];
  13. $data['seller_id']=$seller_id;
  14. $data['introduce']=$_GPC['introduce'];
  15. $data['start_time']=$_GPC['time']['start'];
  16. $data['conditions']=$_GPC['conditions'];
  17. $data['end_time']=$_GPC['time']['end'];
  18. $data['uniacid']=$_W['uniacid'];
  19. if($_GPC['id']==''){
  20. $data['type']=2;
  21. $data['time']=time();
  22. $res=pdo_insert('zh_jdgjb_coupons',$data);
  23. if($res){
  24. message('添加成功',$this->createWebUrl2('dlincoupon',array()),'success');
  25. }else{
  26. message('添加失败','','error');
  27. }
  28. }else{
  29. $res = pdo_update('zh_jdgjb_coupons', $data, array('id' => $_GPC['id']));
  30. if($res){
  31. message('编辑成功',$this->createWebUrl2('dlincoupon',array()),'success');
  32. }else{
  33. message('编辑失败','','error');
  34. }
  35. }
  36. }
  37. include $this->template('web/dlinaddcoupon');