dlinad.inc.php 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. global $_GPC, $_W;
  3. $action = 'start';
  4. $GLOBALS['frames'] = $this->getNaveMenu($_COOKIE['cityname'], $action);
  5. $pageindex = max(1, intval($_GPC['page']));
  6. $pagesize=10;
  7. $sql="select * from".tablename('zhtc_ad')." where uniacid={$_W['uniacid']} and cityname='{$_COOKIE["cityname"]}' ORDER BY orderby ASC";
  8. $total=pdo_fetchcolumn("select count(*) from".tablename('zhtc_ad')." where uniacid={$_W['uniacid']} and cityname='{$_COOKIE["cityname"]}' ");
  9. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  10. $list=pdo_fetchall($select_sql);
  11. $pager = pagination($total, $pageindex, $pagesize);
  12. //$list=pdo_getall('zhtc_ad',array('uniacid'=>$_W['uniacid']),array(),'','orderby ASC');
  13. if($_GPC['op']=='delete'){
  14. $res=pdo_delete('zhtc_ad',array('id'=>$_GPC['id']));
  15. if($res){
  16. message('删除成功!', $this->createWebUrl2('dlinad'), 'success');
  17. }else{
  18. message('删除失败!','','error');
  19. }
  20. }
  21. if($_GPC['status']){
  22. $data['status']=$_GPC['status'];
  23. $res=pdo_update('zhtc_ad',$data,array('id'=>$_GPC['id']));
  24. if($res){
  25. message('编辑成功!', $this->createWebUrl2('dlinad'), 'success');
  26. }else{
  27. message('编辑失败!','','error');
  28. }
  29. }
  30. include $this->template('web/dlinad');