dlinvideo.inc.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. global $_GPC, $_W;
  3. $action = 'start';
  4. $GLOBALS['frames'] = $this->getNaveMenu($_COOKIE['cityname'], $action);
  5. //$list=pdo_getall('zhtc_video',array('uniacid'=>$_W['uniacid']),array(),'','time ASC');
  6. $where=" WHERE a.uniacid=:uniacid and cityname=:cityname ";
  7. $data[':uniacid']=$_W['uniacid'];
  8. $data[':cityname']=$_COOKIE['cityname'];
  9. if(!empty($_GPC['keywords'])){
  10. $where.=" and a.title LIKE concat('%', :name,'%') ";
  11. $data[':name']=$_GPC['keywords'];
  12. }
  13. if(!empty($_GPC['time'])){
  14. $start=strtotime($_GPC['time']['start']);
  15. $end=strtotime($_GPC['time']['end']);
  16. $where.=" and unix_timestamp(a.time) >={$start} and unix_timestamp(a.time)<={$end} ";
  17. }
  18. $pageindex = max(1, intval($_GPC['page']));
  19. $pagesize=10;
  20. $sql="select a.*,b.type_name from " . tablename("zhtc_video") . " a" . " left join " . tablename("zhtc_videotype") . " b on a.type_id=b.id ".$where."order by a.num asc,a.time DESC ";
  21. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  22. $list = pdo_fetchall($select_sql,$data);
  23. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_video") . " a" . " left join " . tablename("zhtc_videotype") . " b on a.type_id=b.id ".$where,$data);
  24. $pager = pagination($total, $pageindex, $pagesize);
  25. //$list=pdo_fetchall($sql,$data);
  26. if($_GPC['op']=='delete'){
  27. $res=pdo_delete('zhtc_video',array('id'=>$_GPC['id']));
  28. if($res){
  29. message('删除成功!', $this->createWebUrl2('dlinvideo'), 'success');
  30. }else{
  31. message('删除失败!','','error');
  32. }
  33. }
  34. // if($_GPC['state']){
  35. // $data['state']=$_GPC['state'];
  36. // $res=pdo_update('zhtc_video',$data,array('id'=>$_GPC['id']));
  37. // if($res){
  38. // message('编辑成功!', $this->createWebUrl('video'), 'success');
  39. // }else{
  40. // message('编辑失败!','','error');
  41. // }
  42. // }
  43. include $this->template('web/dlinvideo');