Exemplo n.º 1
0
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
require_once "../../tools/PageTool.class.php";
$sqltool = new SQLTool();
$sql = "select * from t_kno where 1=1 ";
//输入搜索
$searchcontent = "";
if (isset($_GET['searchcontent']) and $_GET['searchcontent'] != "") {
    $searchcontent = $_GET['searchcontent'];
    $sql .= " and (kno_title like '%{$searchcontent}%' or kno_num like '%{$searchcontent}%' or kno_sort like '%{$searchcontent}%' or kno_keyword like '%{$searchcontent}%' or kno_content like '%{$searchcontent}%')";
}
//分类搜索
if (isset($_GET['kno_sort'])) {
    $sort = $_GET['kno_sort'];
    $sql .= " and kno_sort like '%{$sort}%' ";
}
$sql .= " and kno_state=3 order by kno_read desc";
$res = $sqltool->dbQuery($sql);
$pagetool = new PageTool(count($res));
$pagetool->url = "know_list.php";
$pagetool->sql = $sql;
$pagetool->url_arg = "searchcontent={$searchcontent}&kno_sort={$sort}";
$pageNow = 1;
if ($_GET['pageNow']) {
    $pageNow = $_GET['pageNow'];
}
$pagetool->pageNow = $pageNow;
$smarty->assign("res", $pagetool->getPageResource());
$smarty->assign("nav", $pagetool->getNavigate());
$smarty->assign("searchcontent", $searchcontent);
$smarty->display("share/know_list.html");
Exemplo n.º 2
0
$page2->url = "task_list.php";
$page2->sql = "select t_req.*,(select count(req_num) from t_feedback where t_feedback.req_num=t_req.req_num) fd from t_req where req_finish_engineer='{$user_name}' and req_state=4 order by req_finish_time desc";
$page2->pageNow = 1;
$page2->url_arg = "flag=2";
if ($_GET['flag'] == 2 and $_GET['pageNow']) {
    $page2->pageNow = $_GET['pageNow'];
}
$smarty->assign("done", $page2->getPageResource());
$smarty->assign("nav2", $page2->getNavigate());
$smarty->assign("totalCount2", $res2[0][0]);
//变更列表
$sql3 = " from t_req,t_req_change where t_req.req_num=t_req_change.req_num and req_engineer='{$user_name}' order by change_time desc";
$res3 = $sqltool->dbQuery("select count(*)" . $sql3);
$page3 = new PageTool($res3[0][0]);
$page3->sql = "select t_req.req_num,req_title,req_author,req_time,change_time,flag " . $sql3;
$page3->url = "task_list.php";
$page3->url_arg = "flag=3";
$page3->pageNow = 1;
if ($_GET['flag'] == 3 and $_GET['pageNow']) {
    $page3->pageNow = $_GET['pageNow'];
}
$smarty->assign("changelist", $page3->getPageResource());
$smarty->assign("nav3", $page3->getNavigate());
$smarty->assign("totalCount3", $res3[0][0]);
$flag = 1;
if ($_GET['flag']) {
    $flag = $_GET['flag'];
}
$smarty->assign("res", $res);
$smarty->assign("flag", $flag);
$smarty->display("engineer/task_list.html");
Exemplo n.º 3
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/7/1
 * Time: 17:16
 */
require_once "SQLTool.class.php";
require_once "PageTool.class.php";
$sqlTool = new SQLTool();
$res = $sqlTool->dbQuery("select count(*)from emp");
$pageTool = new PageTool($res[0][0], 2);
$pageTool->url = "./pagetest.php";
echo "用户列表:<br><br><br>";
$sql = "select *from emp ";
$pageTool->sql = $sql;
$pageNow = 1;
if ($_GET['pageNow']) {
    $pageNow = $_GET['pageNow'];
}
$res = $pageTool->getPageResource($pageNow);
for ($i = 0; $i < count($res); $i++) {
    echo $res[$i][emp_id] . "--" . $res[$i][emp_name] . "--" . $res[$i][emp_pwd] . "<br>";
}
echo "<br>";
echo $pageTool->getNavigate();