dltable2.inc.php
1.73 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
53
54
55
56
57
58
<?php
global $_GPC, $_W;
$action = 'start';
//$GLOBALS['frames'] = $this->getMainMenu2();
$uid=$_COOKIE["uid"];
$storeid=$_COOKIE["storeid"];
$cur_store = $this->getStoreById($storeid);
$GLOBALS['frames'] = $this->getNaveMenu($storeid, $action,$uid);
$type=pdo_getall('cjdc_table_type',array('uniacid'=>$_W['uniacid'],'store_id'=>$storeid));
$where="WHERE a.uniacid=:uniacid and a.store_id=:store_id";
$data[':uniacid']=$_W['uniacid'];
$data[':store_id']=$storeid;
if($_GPC['op']=='del'){
$result = pdo_delete('cjdc_table', array('id'=>$_GPC['id']));
if($result){
message('删除成功',$this->createWebUrl2('dltable2',array()),'success');
}else{
message('删除失败','','error');
}
}
if($_GPC['status']){
if($_GPC['status']=="4"){
$_GPC['status']=0;
}
$data2['status']=$_GPC['status'];
$res=pdo_update('cjdc_table',$data2,array('id'=>$_GPC['id']));
if($res){
message('编辑成功',$this->createWebUrl2('dltable2',array()),'success');
}else{
message('编辑失败','','error');
}
}
if(checksubmit('submit')){
//echo $_GPC['area'];die;
if($_GPC['keywords']){
$where .=" and a.name LIKE :name ";
$op=$_GPC['keywords'];
$data[':name']="%$op%";
}
if($_GPC['type']){
$where .=" and a.type_id=:type_id";
$data[':type_id']=$_GPC['type'];
}
}
if($_GPC['op']=='qt'){
$res=pdo_update('cjdc_table',array('status'=>0));
if($res){
message('清台成功',$this->createWebUrl2('dltable2',array()),'success');
}else{
message('清台失败','','error');
}
}
$sql="select a.*,b.name as type_name from " . tablename("cjdc_table") . " a" . " left join " . tablename("cjdc_table_type") . " b on b.id=a.type_id " .$where;
$list=pdo_fetchall($sql,$data);
include $this->template('web/dltable2');