ListInfo.php
2.38 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
require("../class/connect.php");
require("../class/db_sql.php");
require("../data/dbcache/class.php");
require("../member/class/user.php");
require("../class/q_functions.php");
require LoadLang("pub/fun.php");
$link=db_connect();
$empire=new mysqlquery();
//驗證是否登陸
$user=islogin();
//取得模型id
$mid=(int)$_GET['mid'];
if(!$mid)
{
printerror("ErrorUrl","history.go(-1)",1);
}
$mr=$empire->fetch1("select tbname,qmname,listfile,sonclass from {$dbtbpre}enewsmod where mid='$mid'");
if(!$mr['tbname']||InfoIsInTable($mr['tbname']))
{
printerror("ErrorUrl","history.go(-1)",1);
}
esetcookie("qdelinfo","dgcms");
$totalnum=(int)$_GET['totalnum'];
$start=0;
$page=(int)$_GET['page'];
$page=RepPIntvar($page);
$line=25;//每行顯示
$page_line=10;
$offset=$page*$line;
$add='';
$search="&mid=$mid";
//審核表
$ecmscheck=(int)$_GET['ecmscheck'];
$addecmscheck='';
$indexchecked=1;
if($ecmscheck)
{
$search.='&ecmscheck='.$ecmscheck;
$addecmscheck='&ecmscheck='.$ecmscheck;
$indexchecked=0;
}
$infotb=ReturnInfoMainTbname($mr['tbname'],$indexchecked);
//顯示方式
if($public_r['qlistinfomod'])
{
$modnum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsmod where tbname='$mr[tbname]'");
if($modnum>1)
{
$add.=' and ('.ReturnClass($mr['sonclass']).')';
}
}
//搜索
$sear=RepPostStr($_GET['sear'],1);
$keyboard='';
$show='';
if($sear)
{
$keyboard=RepPostVar2($_GET['keyboard']);
$show=RepPostStr($_GET['show'],1);
//關鍵字
if($keyboard)
{
$add.=" and (title like '%$keyboard%')";
}
$search.="&sear=1&keyboard=$keyboard&show=$show";
}
//優化
$yhid=$etable_r[$mr[tbname]][yhid];
$yhvar='qmlist';
$yhadd='';
if($yhid)
{
$yhadd=ReturnYhSql($yhid,$yhvar,1);
}
//信息表
$totalquery="select count(*) as total from ".$infotb." where ".$yhadd."userid='$user[userid]' and ismember=1".$add;
if($totalnum<1)
{
$num=$empire->gettotal($totalquery);//取得總條數
}
else
{
$num=$totalnum;
}
$search.="&totalnum=$num";
$returnpage=page1($num,$line,$page_line,$start,$page,$search);
//導入頁面
$deftempfile=ECMS_PATH.'e/data/html/list/qlistinfo.php';
if($mr[listfile])
{
$tempfile=ECMS_PATH.'e/data/html/list/q'.$mr[listfile].'.php';
if(!file_exists($tempfile))
{
$tempfile=$deftempfile;
}
}
else
{
$tempfile=$deftempfile;
}
require($tempfile);
db_close();
$empire=null;
?>