dlinactivity.inc.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. global $_GPC, $_W;
  3. $action = 'start';
  4. $GLOBALS['frames'] = $this->getNaveMenu($_COOKIE['cityname'], $action);
  5. $where=" where uniacid=:uniacid and cityname=:cityname";
  6. $data[':uniacid']=$_W['uniacid'];
  7. $data[':cityname']= $_COOKIE['cityname'];
  8. $type=pdo_getall('zhtc_acttype',array('uniacid'=>$_W['uniacid']));
  9. if(isset($_GPC['keywords'])){
  10. $where.=" and title LIKE concat('%', :name,'%') ";
  11. $data[':name']=$_GPC['keywords'];
  12. $type='all';
  13. }
  14. if(!empty($_GPC['time'])){
  15. $start=strtotime($_GPC['time']['start']);
  16. $end=strtotime($_GPC['time']['end']);
  17. $where.=" and UNIX_TIMESTAMP(time) >={$start} and UNIX_TIMESTAMP(time)<={$end}";
  18. }
  19. if($_GPC['type_id']>0){
  20. $where.=" and type_id=".$_GPC['type_id'];
  21. }
  22. $pageindex = max(1, intval($_GPC['page']));
  23. $pagesize=10;
  24. $sql="select * from".tablename('zhtc_activity') ."".$where." ORDER BY id DESC";
  25. $total=pdo_fetchcolumn("select count(*) from".tablename('zhtc_activity')."".$where,$data);
  26. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  27. $list=pdo_fetchall($select_sql,$data);
  28. $pager = pagination($total, $pageindex, $pagesize);
  29. if($_GPC['op']=='delete'){
  30. $res=pdo_delete('zhtc_activity',array('id'=>$_GPC['id']));
  31. if($res){
  32. message('删除成功!', $this->createWebUrl2('dlinactivity'), 'success');
  33. }else{
  34. message('删除失败!','','error');
  35. }
  36. }
  37. if($_GPC['op']=='change'){
  38. $res=pdo_update('zhtc_activity',array('is_bm'=>$_GPC['is_bm']),array('id'=>$_GPC['id']));
  39. if($res){
  40. message('修改成功!', $this->createWebUrl2('dlinactivity'), 'success');
  41. }else{
  42. message('修改失败!','','error');
  43. }
  44. }
  45. include $this->template('web/dlinactivity');