jfgoods.inc.php 1.2 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $pageindex = max(1, intval($_GPC['page']));
  5. $pagesize=10;
  6. $sql="select a.* ,b.name as type_name from " . tablename("zhtc_jfgoods") . " a" . " left join " . tablename("zhtc_jftype") . " b on b.id=a.type_id where a.uniacid=".$_W['uniacid']." order by num asc";
  7. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  8. $list = pdo_fetchall($select_sql);
  9. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_jfgoods") . " a" . " left join " . tablename("zhtc_jftype") . " b on b.id=a.type_id where a.uniacid=".$_W['uniacid']."");
  10. $pager = pagination($total, $pageindex, $pagesize);
  11. if($_GPC['op']=='delete'){
  12. $res=pdo_delete('zhtc_jfgoods',array('id'=>$_GPC['id']));
  13. if($res){
  14. message('删除成功',$this->createWebUrl('jfgoods',array()),'success');
  15. }else{
  16. message('删除失败','','error');
  17. }
  18. }
  19. if($_GPC['op']=='change'){
  20. $res=pdo_update('zhtc_jfgoods',array('is_open'=>$_GPC['is_open']),array('id'=>$_GPC['id']));
  21. if($res){
  22. message('修改成功!', $this->createWebUrl('jfgoods'), 'success');
  23. }else{
  24. message('修改失败!','','error');
  25. }
  26. }
  27. include $this->template('web/jfgoods');