ingoodsinfo.inc.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu2();
  4. $info=pdo_get('zhtc_goods',array('id'=>$_GPC['id']));
  5. if($info['imgs']){
  6. if(strpos($info['imgs'],',')){
  7. $imgs= explode(',',$info['imgs']);
  8. }else{
  9. $imgs=array(
  10. 0=>$info['imgs']
  11. );
  12. }
  13. }
  14. if($info['lb_imgs']){
  15. if(strpos($info['lb_imgs'],',')){
  16. $lb_imgs= explode(',',$info['lb_imgs']);
  17. }else{
  18. $lb_imgs=array(
  19. 0=>$info['lb_imgs']
  20. );
  21. }
  22. }
  23. if(checksubmit('submit')){
  24. if($_GPC['imgs']){
  25. $data['imgs']=implode(",",$_GPC['imgs']);
  26. }else{
  27. $data['imgs']='';
  28. }
  29. if($_GPC['lb_imgs']){
  30. $data['lb_imgs']=implode(",",$_GPC['lb_imgs']);
  31. }else{
  32. $data['lb_imgs']='';
  33. }
  34. $data['goods_name']=$_GPC['goods_name'];
  35. $data['goods_cost']=$_GPC['goods_cost'];
  36. $data['freight']=$_GPC['freight'];
  37. $data['delivery']=$_GPC['delivery'];
  38. $data['quality']=$_GPC['quality'];
  39. $data['free']=$_GPC['free'];
  40. $data['all_day']=$_GPC['all_day'];
  41. $data['service']=$_GPC['service'];
  42. $data['refund']=$_GPC['refund'];
  43. $data['weeks']=$_GPC['weeks'];
  44. $res = pdo_update('zhtc_goods', $data, array('id' => $_GPC['id']));
  45. if($res){
  46. message('编辑成功',$this->createWebUrl('ingoods',array()),'success');
  47. }else{
  48. message('编辑失败','','error');
  49. }
  50. }
  51. include $this->template('web/ingoodsinfo');