inactivity.inc.php 1.6 KB

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