dlinaddnews.inc.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. global $_GPC, $_W;
  3. $action = 'start';
  4. $GLOBALS['frames'] = $this->getNaveMenu($_COOKIE['cityname'], $action);
  5. $info=pdo_get('zhtc_news',array('id'=>$_GPC['id']));
  6. $city=pdo_getall('zhtc_hotcity',array('uniacid'=>$_W['uniacid']),array(),'','time ASC');
  7. //var_dump($info);die;
  8. if(checksubmit('submit')){
  9. $data['title']=$_GPC['title'];
  10. $data['num']=$_GPC['num'];
  11. //$data['img']=$_GPC['img'];
  12. $data['state']=$_GPC['state'];
  13. $data['type']=$_GPC['type'];
  14. $data['cityname']=$_COOKIE["cityname"];
  15. $data['details']=html_entity_decode($_GPC['details']);
  16. $data['time']=time();
  17. $data['uniacid']=$_W['uniacid'];
  18. if($_GPC['id']==''){
  19. $res=pdo_insert('zhtc_news',$data);
  20. if($res){
  21. message('添加成功!', $this->createWebUrl2('dlinnews'), 'success');
  22. }else{
  23. message('添加失败!','','error');
  24. }
  25. }else{
  26. $res=pdo_update('zhtc_news',$data,array('id'=>$_GPC['id']));
  27. if($res){
  28. message('编辑成功!', $this->createWebUrl2('dlinnews'), 'success');
  29. }else{
  30. message('编辑失败!','','error');
  31. }
  32. }
  33. }
  34. include $this->template('web/dlinaddnews');