ruzhu.inc.php
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$pageindex = max(1, intval($_GPC['page']));
$pagesize=10;
$where=' WHERE uniacid=:uniacid';
$data[':uniacid']=$_W['uniacid'];
if($_GPC['keywords']){
$op=$_GPC['keywords'];
$where.=" and (store_name LIKE concat('%', :name,'%') || user_name LIKE concat('%', :name,'%'))";
$data[':name']=$op;
}
$sql="SELECT * FROM ".tablename('wpdc_ruzhu') . " ". $where." ORDER BY id DESC";
$total=pdo_fetchcolumn("SELECT count(*) FROM ".tablename('wpdc_ruzhu') . "".$where." ORDER BY id DESC",$data);
$list=pdo_fetchall( $sql,$data);
$select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
$list=pdo_fetchall($select_sql,$data);
$pager = pagination($total, $pageindex, $pagesize);
$operation=$_GPC['op'];
if($operation=='adopt'){//审核通过
$id=$_GPC['id'];
$res=pdo_update('wpdc_ruzhu',array('state'=>2),array('id'=>$id));
if($res){
message('审核成功',$this->createWebUrl('ruzhu',array()),'success');
}else{
message('审核失败','','error');
}
}
if($operation=='reject'){
$id=$_GPC['id'];
$res=pdo_update('wpdc_ruzhu',array('state'=>3),array('id'=>$id));
if($res){
message('拒绝成功',$this->createWebUrl('ruzhu',array()),'success');
}else{
message('拒绝失败','','error');
}
}
if($operation=='delete'){
$id=$_GPC['id'];
$res=pdo_delete('wpdc_ruzhu',array('id'=>$id));
if($res){
message('删除成功',$this->createWebUrl('ruzhu',array()),'success');
}else{
message('删除失败','','error');
}
}
include $this->template('web/ruzhu');