receivelist.inc.php 1.1 KB

12345678910111213141516171819
  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,b.img as user_img from " . tablename("zhtc_jfrecord") . " a" . " left join " . tablename("zhtc_user") . " b on b.id=a.user_id WHERE a.good_id =".$_GPC['good_id']." order by id DESC";
  7. $select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
  8. $list = pdo_fetchall($select_sql);
  9. $total=pdo_fetchcolumn("select count(*) from " . tablename("zhtc_jfrecord") . " a" . " left join " . tablename("zhtc_user") . " b on b.id=a.user_id WHERE a.good_id =".$_GPC['good_id']."");
  10. $pager = pagination($total, $pageindex, $pagesize);
  11. if($_GPC['op']=='upd'){
  12. $res=pdo_update('zhtc_jfrecord',array('state'=>2),array('id'=>$_GPC['id']));
  13. if($res){
  14. message('修改成功',$this->createWebUrl('receivelist',array('good_id' => $_GPC['good_id'],'type'=>$_GPC['type'])),'success');
  15. }else{
  16. message('修改失败',$this->createWebUrl('receivelist',array('good_id' => $_GPC['good_id'],'type'=>$_GPC['type'])),'error');
  17. }
  18. }
  19. include $this->template('web/receivelist');