Example #1
0
 function __construct($user, $type)
 {
     $sqltool = new SQLTool();
     $this->type = $type;
     $user_mail = $sqltool->dbQuery("select email from t_user where user_name='{$user}'");
     $this->user_email = $user_mail[0][0];
 }
Example #2
0
if ($options != 7) {
    $sql = " and req_time>'{$start_date}' and req_time< '{$end_date}'";
}
if ($user != "") {
    $sql .= " and req_author='{$user}'";
}
if ($engineer != '') {
    $sql .= " and req_finish_engineer='{$engineer}'";
}
if ($state != 0) {
    $sql .= " and req_state={$state}";
}
if ($keyword != '') {
    $sql .= " and req_keyword='{$keyword}'";
}
$res = $sqltool->dbQuery("select count(*) from t_req where 1=1 {$sql}");
$pagetool = new PageTool($res[0][0]);
$pagetool->url = "request_inquiry.php";
$pagetool->url_arg = "options={$options}&date1={$date1}&date2={$date2}&user={$user}&engineer={$engineer}&state={$state}&keyword={$keyword}";
$pageNow = 1;
$pagetool->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 1=1 {$sql} order by req_time desc";
if ($_GET['pageNow']) {
    $pageNow = $_GET['pageNow'];
}
$pagetool->pageNow = $pageNow;
$req = $pagetool->getPageResource();
$list = "(";
for ($i = 0; $i < count($req); $i++) {
    if ($i == count($req) - 1) {
        $list .= "'" . $req[$i]['req_num'] . "'";
    } else {
Example #3
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/16
 * Time: 15:08
 */
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$sqltool = new SQLTool();
$req_num = $_GET['req_num'];
$sql = "select *from t_req where req_num = '{$req_num}'";
$res = $sqltool->dbQuery($sql);
//附件信息
$attachment = $sqltool->dbQuery("select attach_name,attach_id from t_attachment,t_req where req_attach_id=attach_id and req_num='{$req_num}'");
//指派信息
$res2 = $sqltool->dbQuery("select * from t_req_assign where req_num='{$req_num}' and finish_flag=1");
//流程信息
$assign = $sqltool->dbQuery("select * from t_req_assign where req_num='{$req_num}' order by assign_time");
$change = $sqltool->dbQuery("select change_time,req_engineer,change_reason from t_req_change where req_num='{$req_num}' order by change_time");
$process = array();
//重组数组
for ($i = 0; $i < count($assign); $i++) {
    $process[$i]['title'] = $assign[$i]['assign_time'] . "  " . $assign[$i]['assign_admin'] . "  指派  " . $assign[$i]['req_engineer'] . "  解决该请求.";
    $process[$i]['req_priority'] = $assign[$i]['req_priority'];
    $process[$i]['req_effect'] = $assign[$i]['req_effect'];
    $process[$i]['req_time_limit'] = $assign[$i]['req_time_limit'];
    $process[$i]['add_description'] = $assign[$i]['req_add_description'];
    $process[$i]['req_complex'] = $assign[$i]['req_complex'];
    $process[$i]['time'] = $assign[$i]['assign_time'];
Example #4
0
/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/17
 * Time: 9:30
 */
header("Content-type: text/html; charset=utf-8");
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$req_num = $_GET['req_num'];
$flag = $_GET['flag'];
$sqltool = new SQLTool();
$sql = "select *from t_req where req_num = '{$req_num}'";
//请求信息
$res = $sqltool->dbQuery($sql);
//附件信息
$attachment = $sqltool->dbQuery("select attach_name,attach_id from t_attachment,t_req where req_attach_id=attach_id and req_num='{$req_num}'");
//工程师列表
$engineer = $sqltool->dbQuery("select user_name,name,(select count(finish_flag) from t_req_assign where req_engineer=t.user_name and finish_flag=1) task from t_user t where user_role=2 order by task");
//流程信息
$assign = $sqltool->dbQuery("select * from t_req_assign where req_num='{$req_num}' order by assign_time");
$change = $sqltool->dbQuery("select change_time,req_engineer,change_reason from t_req_change where req_num='{$req_num}' order by change_time");
$process = array();
//重组数组
$i = 0;
for ($i = 0; $i < count($assign); $i++) {
    $process[$i]['title'] = $assign[$i]['assign_time'] . "  " . $assign[$i]['assign_admin'] . "  指派  " . $assign[$i]['req_engineer'] . "  解决该请求.";
    $process[$i]['req_priority'] = $assign[$i]['req_priority'];
    $process[$i]['req_effect'] = $assign[$i]['req_effect'];
    $process[$i]['req_time_limit'] = $assign[$i]['req_time_limit'];
Example #5
0
/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/15
 * Time: 19:35
 */
session_start();
date_default_timezone_set('prc');
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
require_once "../../tools/PageTool.class.php";
$user_name = $_SESSION['user_name'];
$sqltool = new SQLTool();
$sql = "select t_req.req_num,req_title,req_author,req_time,assign_time,req_priority,req_effect,req_time_limit from t_req,t_req_assign where req_engineer='{$user_name}' and finish_flag=1 and t_req.req_num = t_req_assign.req_num order by req_priority,req_effect ";
//任务列表
$res = $sqltool->dbQuery($sql);
//计算任务剩余时间
for ($i = 0; $i < count($res); $i++) {
    $t1 = date('Y-m-d H:i:s', time());
    $t1 = strtotime($t1);
    $t2 = strtotime($res[$i]['assign_time']);
    $time = $res[$i]['req_time_limit'] * 3600 - ($t1 - $t2);
    if ($time < 0) {
        $res[$i]['flag'] = 1;
    }
    $time = abs($time);
    $res[$i]['hour'] = floor($time / 3600);
    $res[$i]['minute'] = floor($time % 3600 / 60);
}
//我的已处理列表
$sql2 = "select count(*) from t_req where req_finish_engineer='{$user_name}' and req_state=4";
Example #6
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/7/9
 * Time: 16:56
 */
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
require_once "../../model/DepartTree.class.php";
$sqltool = new SQLTool();
$tree = new Tree();
$sql = "select depart_id id,depart_name name,depart_parent_id parent_id from t_depart";
$depart = $sqltool->dbQuery($sql);
$html_tree = $tree->DepartprocHtml($tree->getTree($depart, ''));
$smarty->assign("tree", $html_tree);
$smarty->display("admin/config_depart.html");
Example #7
0
        $season = ceil(date('n') / 3) - 1;
        //上季度是第几季度
        $start_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $season * 3 - 3 + 1, 1, date('Y')));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, $season * 3, date('t', mktime(0, 0, 0, $season * 3, 1, date("Y"))), date('Y')));
        $title = date('Y/m/d', strtotime($start_date)) . "—" . date('Y/m/d', strtotime($end_date)) . "日 ";
        break;
    case 8:
        $start_date = date('Y-m-d H:i:s', strtotime($_GET['date1']));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, date('m', strtotime($_GET['date2'])), date('d', strtotime($_GET['date2'])), date('Y', strtotime($_GET['date2']))));
        $title = date('Y/m/d', strtotime($_GET['date1'])) . "—" . date('Y/m/d', strtotime($_GET['date2'])) . "日 ";
        break;
}
$title .= " 工程师工作量排行榜";
$sql = " and (req_finish_time >'{$start_date}' and req_finish_time<'{$end_date}')";
$sqltool = new SQLTool();
$res = $sqltool->dbQuery("select user_name,(select sum(req_complex*0.2+1) from t_req where req_finish_engineer=t_user.user_name {$sql}) num from t_user where user_role=2 order by num desc");
for ($i = 0; $i < count($res); $i++) {
    $datay[$i] = $res[$i][1];
    $datax[$i] = $res[$i][0];
}
// Size of graph
$width = 870;
$height = count($res) * 40 + 20;
// Set the basic parameters of the graph
$graph = new Graph($width, $height, 'auto');
$graph->SetScale('textlin');
$graph->setcolor('white');
// Rotate graph 90 degrees and set margin
$graph->Set90AndMargin(100, 20, 30, 10);
// Setup title
$graph->title->Set($title);
Example #8
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/13
 * Time: 14:17
 */
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$kno_num = $_GET['kno_num'];
$sqltool = new SQLTool();
$sql = "select *from t_kno where kno_num='{$kno_num}'";
$res = $sqltool->dbQuery($sql);
$sql = "select sort_id,sort_name from t_req_sort where sort_parent_id is NULL ";
$parent_sort = $sqltool->dbQuery($sql);
$sql = "select sort_id,sort_name,sort_parent_id from t_req_sort where sort_parent_id is not NULL";
$child_sort = $sqltool->dbQuery($sql);
$req = $sqltool->dbQuery("select req_num,req_title from t_req where req_state='4'");
$sqltool->dbCloseConnection();
$smarty->assign("parent_sort", $parent_sort);
$smarty->assign("child_sort", $child_sort);
$smarty->assign("reqlist", $req);
$smarty->assign("kno", $res[0]);
$smarty->configLoad("config.ini", "uploadfile");
$smarty->display("admin/know_edit.html");
Example #9
0
/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/7/9
 * Time: 20:57
 */
session_start();
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
date_default_timezone_set('prc');
date_default_timezone_set('prc');
$user_name = $_SESSION['user_name'];
$sqltool = new SQLTool();
$sql = "select *from t_req where req_state=1";
$undo_res = $sqltool->dbQuery($sql);
$sql = "select t_req.req_num,req_title,req_author,req_time,req_engineer,change_time from t_req,t_req_change where t_req.req_num=t_req_change.req_num and flag=1";
$change_req = $sqltool->dbQuery("{$sql}");
$sql = "select t_req.req_num,req_title,req_author,req_time,req_engineer,assign_time, (TIME_TO_SEC(TIMEDIFF(NOW(),assign_time))-req_time_limit*3600) as time_left,finish_flag  from t_req,t_req_assign where t_req.req_num=t_req_assign.req_num and finish_flag=1 and (TIME_TO_SEC(TIMEDIFF(NOW(),assign_time))-req_time_limit *3600)>0";
$over_time_req = $sqltool->dbQuery($sql);
//请求追踪
$sql = "select t_req.req_num,req_title,req_author,req_time,assign_time,req_priority,req_effect,req_time_limit from t_req,t_req_assign where assign_admin='{$user_name}' and finish_flag=1 and t_req.req_num = t_req_assign.req_num";
$res = $sqltool->dbQuery($sql);
//计算任务剩余时间
for ($i = 0; $i < count($res); $i++) {
    $t1 = date('Y-m-d H:i:s', time());
    $t1 = strtotime($t1);
    $t2 = strtotime($res[$i]['assign_time']);
    $time = $res[$i]['req_time_limit'] * 3600 - ($t1 - $t2);
    if ($time < 0) {
        $res[$i]['flag'] = 1;
Example #10
0
        $title = date('Y/m/d', strtotime($start_date)) . "—" . date('Y/m/d', strtotime($end_date)) . "日 ";
        break;
    case 8:
        $start_date = date('Y-m-d H:i:s', strtotime($_GET['date1']));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, date('m', strtotime($_GET['date2'])), date('d', strtotime($_GET['date2'])), date('Y', strtotime($_GET['date2']))));
        $title = date('Y/m/d', strtotime($_GET['date1'])) . "—" . date('Y/m/d', strtotime($_GET['date2'])) . "日 ";
        break;
}
$title .= " 请求量统计";
if ($id == 9) {
    $sql = "";
} else {
    $sql = " and (req_time >'{$start_date}' and req_time<'{$end_date}')";
}
$sqltool = new SQLTool();
$res = $sqltool->dbQuery("select user_name,(select count(req_num)from t_req where req_author=t_user.user_name {$sql}) num from t_user where depart_id='{$depart_id}';");
for ($i = 0; $i < count($res); $i++) {
    $datay[$i] = $res[$i][1];
    $datax[$i] = $res[$i][0];
}
if (!count($res)) {
    $datax[0] = "NULL";
    $datay[0] = 0;
    $title = "该单位还未添加人员";
}
// Size of graph
$width = 870;
$height = count($datax) * 40 + 20;
// Set the basic parameters of the graph
$graph = new Graph($width, $height, 'auto');
$graph->SetScale('textlin');
Example #11
0
        $start_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $season * 3 - 3 + 1, 1, date('Y')));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, $season * 3, date('t', mktime(0, 0, 0, $season * 3, 1, date("Y"))), date('Y')));
        $title = date('Y/m/d', strtotime($start_date)) . "—" . date('Y/m/d', strtotime($end_date)) . "日 ";
        break;
    case 8:
        $start_date = date('Y-m-d H:i:s', strtotime($_GET['date1']));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, date('m', strtotime($_GET['date2'])), date('d', strtotime($_GET['date2'])), date('Y', strtotime($_GET['date2']))));
        $title = date('Y/m/d', strtotime($_GET['date1'])) . "—" . date('Y/m/d', strtotime($_GET['date2'])) . "日 ";
        break;
}
$title .= " 请求方式统计";
$sql = "where req_time >'{$start_date}' and req_time<'{$end_date}'";
$sqltool = new SQLTool();
$datax = array("网页请求", "邮件请求", "电话请求");
$datay = array(0, 0, 0);
$res = $sqltool->dbQuery("select req_source,count(*) num from t_req {$sql} group by req_source;");
for ($i = 0; $i < count($res); $i++) {
    $datay[$res[$i]['req_source'] - 1] = $res[$i]['num'];
}
// Size of graph
$width = 870;
$height = 3 * 40 + 20;
// Set the basic parameters of the graph
$graph = new Graph($width, $height, 'auto');
$graph->SetScale('textlin');
$graph->setcolor('white');
// Rotate graph 90 degrees and set margin
$graph->Set90AndMargin(120, 20, 30, 10);
// Setup title
$graph->title->Set($title);
$graph->title->SetFont(FF_SIMSUN, FS_BOLD, 12);
Example #12
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/10/8
 * Time: 10:23
 */
session_start();
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$sqltool = new SQLTool();
$user_name = $_SESSION['user_name'];
$res = $sqltool->dbQuery("select t_user.*,depart_name from t_user,t_depart where t_user.depart_id=t_depart.depart_id and user_name='{$user_name}'");
$smarty->assign("user", $res[0]);
$smarty->display("share/info.html");
Example #13
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/29
 * Time: 11:18
 */
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$sqltool = new SQLTool();
$res = $sqltool->dbQuery("select depart_name,depart_id from t_depart");
$smarty->assign("res", $res);
$smarty->display("admin/graph_user_req.html");
Example #14
0
        $season = ceil(date('n') / 3) - 1;
        //上季度是第几季度
        $start_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $season * 3 - 3 + 1, 1, date('Y')));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, $season * 3, date('t', mktime(0, 0, 0, $season * 3, 1, date("Y"))), date('Y')));
        $title = date('Y/m/d', strtotime($start_date)) . "—" . date('Y/m/d', strtotime($end_date)) . "日 ";
        break;
    case 8:
        $start_date = date('Y-m-d H:i:s', strtotime($_GET['date1']));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, date('m', strtotime($_GET['date2'])), date('d', strtotime($_GET['date2'])), date('Y', strtotime($_GET['date2']))));
        $title = date('Y/m/d', strtotime($_GET['date1'])) . "—" . date('Y/m/d', strtotime($_GET['date2'])) . "日 ";
        break;
}
$title .= " 请求分类统计";
$sql = " and (req_time >'{$start_date}' and req_time<'{$end_date}')";
$sqltool = new SQLTool();
$res = $sqltool->dbQuery("select sort_name,(select count(*) from t_req where req_sort like  CONCAT('%',t_req_sort.sort_name,'%') {$sql} ) num from t_req_sort where sort_parent_id!='' order by num desc");
for ($i = 0; $i < count($res); $i++) {
    $datay[$i] = $res[$i][1];
    $datax[$i] = $res[$i][0];
}
// Size of graph
$width = 870;
$height = count($res) * 40 + 20;
// Set the basic parameters of the graph
$graph = new Graph($width, $height, 'auto');
$graph->SetScale('textlin');
$graph->setcolor('white');
// Rotate graph 90 degrees and set margin
$graph->Set90AndMargin(120, 20, 30, 10);
// Setup title
$graph->title->Set($title);
Example #15
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();
Example #16
0
        $season = ceil(date('n') / 3) - 1;
        //上季度是第几季度
        $start_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $season * 3 - 3 + 1, 1, date('Y')));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, $season * 3, date('t', mktime(0, 0, 0, $season * 3, 1, date("Y"))), date('Y')));
        $title = date('Y/m/d', strtotime($start_date)) . "—" . date('Y/m/d', strtotime($end_date)) . "日 ";
        break;
    case 8:
        $start_date = date('Y-m-d H:i:s', strtotime($_GET['date1']));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, date('m', strtotime($_GET['date2'])), date('d', strtotime($_GET['date2'])), date('Y', strtotime($_GET['date2']))));
        $title = date('Y/m/d', strtotime($_GET['date1'])) . "—" . date('Y/m/d', strtotime($_GET['date2'])) . "日 ";
        break;
}
$title .= " 工程师解决请求数量排行榜";
$sql = " and (req_finish_time >'{$start_date}' and req_finish_time<'{$end_date}')";
$sqltool = new SQLTool();
$res = $sqltool->dbQuery("select user_name,(select count(*) from t_req where req_finish_engineer=t_user.user_name {$sql}) num from t_user where user_role=2 order by num desc");
for ($i = 0; $i < count($res); $i++) {
    $datay[$i] = $res[$i][1];
    $datax[$i] = $res[$i][0];
}
// Size of graph
$width = 880;
$height = count($res) * 40 + 20;
// Set the basic parameters of the graph
$graph = new Graph($width, $height, 'auto');
$graph->SetScale('textlin');
$graph->setcolor('white');
// Rotate graph 90 degrees and set margin
$graph->Set90AndMargin(100, 20, 30, 10);
// Setup title
$graph->title->Set($title);
        $season = ceil(date('n') / 3) - 1;
        //上季度是第几季度
        $start_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $season * 3 - 3 + 1, 1, date('Y')));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, $season * 3, date('t', mktime(0, 0, 0, $season * 3, 1, date("Y"))), date('Y')));
        $title = date('Y/m/d', strtotime($start_date)) . "—" . date('Y/m/d', strtotime($end_date)) . "日 ";
        break;
    case 8:
        $start_date = date('Y-m-d H:i:s', strtotime($_GET['date1']));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, date('m', strtotime($_GET['date2'])), date('d', strtotime($_GET['date2'])), date('Y', strtotime($_GET['date2']))));
        $title = date('Y/m/d', strtotime($_GET['date1'])) . "—" . date('Y/m/d', strtotime($_GET['date2'])) . "日 ";
        break;
}
$title .= " 工程师逾期未解决请求量统计";
$sql = " and (assign_time >'{$start_date}' and assign_time<'{$end_date}')";
$sqltool = new SQLTool();
$res = $sqltool->dbQuery("select user_name,(select count(*) from t_req_assign where req_time_left < 0 and  req_engineer=t_user.user_name {$sql} ) num from t_user where user_role=2");
for ($i = 0; $i < count($res); $i++) {
    $datay[$i] = $res[$i][1];
    $datax[$i] = $res[$i][0];
}
// Size of graph
$width = 870;
$height = count($res) * 40 + 20;
// Set the basic parameters of the graph
$graph = new Graph($width, $height, 'auto');
$graph->SetScale('textlin');
$graph->setcolor('white');
// Rotate graph 90 degrees and set margin
$graph->Set90AndMargin(100, 20, 30, 10);
// Setup title
$graph->title->Set($title);
Example #18
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/23
 * Time: 10:45
 */
session_start();
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$news_id = $_GET['news_id'];
$sqltool = new SQLTool();
$sqltool->dbUpdate("update t_news set news_read=news_read+1 where news_id='{$news_id}'");
$sql = "select *from t_news where news_id = '{$news_id}'";
$res = $sqltool->dbQuery($sql);
$attachment = $sqltool->dbQuery("select attach_name,t_attachment.attach_id from t_attachment,t_news where t_news.attach_id=t_attachment.attach_id and news_id='{$news_id}'");
$smarty->assign("res", $res[0]);
$smarty->assign("attach", $attachment);
$smarty->display("share/news_detail.html");
Example #19
0
        $title = date('Y/m/d', strtotime($start_date)) . "—" . date('Y/m/d', strtotime($end_date)) . "日 ";
        break;
    case 8:
        $start_date = date('Y-m-d H:i:s', strtotime($_GET['date1']));
        $end_date = date('Y-m-d H:i:s', mktime(23, 59, 59, date('m', strtotime($_GET['date2'])), date('d', strtotime($_GET['date2'])), date('Y', strtotime($_GET['date2']))));
        $title = date('Y/m/d', strtotime($_GET['date1'])) . "—" . date('Y/m/d', strtotime($_GET['date2'])) . "日 ";
        break;
}
$title .= " 请求量统计";
if ($id == 9) {
    $sql = "";
} else {
    $sql = " and (req_time >'{$start_date}' and req_time<'{$end_date}')";
}
$sqltool = new SQLTool();
$res = $sqltool->dbQuery("select depart_name,depart_id,(select count(req_num) from t_req,t_user where t_req.req_author=t_user.user_name and t_user.depart_id=t_depart.depart_id {$sql}) num from t_depart order by num desc");
for ($i = 0; $i < count($res); $i++) {
    $datay[$i] = $res[$i][2];
    $datax[$i] = $res[$i][0];
}
// Size of graph
$width = 870;
$height = count($res) * 40 + 20;
// Set the basic parameters of the graph
$graph = new Graph($width, $height, 'auto');
$graph->SetScale('textlin');
$graph->setcolor('white');
// Rotate graph 90 degrees and set margin
$graph->Set90AndMargin(100, 20, 30, 10);
// Setup title
$graph->title->Set($title);
Example #20
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/10
 * Time: 16:00
 */
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$sqltool = new SQLTool();
$sql = "select sort_id,sort_name from t_req_sort where sort_parent_id is NULL ";
$parent_sort = $sqltool->dbQuery($sql);
$sql = "select sort_id,sort_name,sort_parent_id from t_req_sort where sort_parent_id is not NULL";
$child_sort = $sqltool->dbQuery($sql);
$req = $sqltool->dbQuery("select req_num,req_title,req_author,t_user.name from t_req,t_user where req_state='4' and req_author=user_name");
$sqltool->dbCloseConnection();
//生成唯一的附件id标识符
$attach_id = md5(uniqid(md5(microtime(true)), true));
$smarty->configLoad("config.ini", "uploadfile");
$smarty->assign("attach_id", $attach_id);
$smarty->assign("parent_sort", $parent_sort);
$smarty->assign("child_sort", $child_sort);
$smarty->assign("reqlist", $req);
$smarty->display("share/know_create.html");
Example #21
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/22
 * Time: 20:20
 */
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
require_once "../../tools/PageTool.class.php";
$sqltool = new SQLTool();
$sql = " from t_news";
if ($_GET['searchcontent']) {
    $searchcontent = $_GET['searchcontent'];
    $sql = " from t_news where news_title like '%{$searchcontent}%' or news_content like '%{$searchcontent}%'";
}
$res = $sqltool->dbQuery("select count(*) " . $sql);
$sql .= " order by news_time desc";
$pagetool = new PageTool($res[0][0]);
$pagetool->url = "news_list.php";
$pagetool->url_arg = "searchcontent={$searchcontent}";
$pagetool->sql = "select *" . $sql;
$pagetool->pageNow = 1;
if ($_GET['pageNow']) {
    $pagetool->pageNow = $_GET['pageNow'];
}
$smarty->assign("nav", $pagetool->getNavigate());
$smarty->assign("res", $pagetool->getPageResource());
$smarty->display("share/news_list.html");
$sqltool->dbCloseConnection();
Example #22
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/7/9
 * Time: 15:29
 */
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$sqltool = new SQLTool();
$sql = "select sort_id,sort_name from t_req_sort where sort_parent_id is NULL ";
$parent_sort = $sqltool->dbQuery($sql);
$sql = "select sort_id,sort_name,sort_parent_id from t_req_sort where sort_parent_id is not NULL";
$child_sort = $sqltool->dbQuery($sql);
$sqltool->dbCloseConnection();
$smarty->assign("parent_sort", $parent_sort);
$smarty->assign("child_sort", $child_sort);
$smarty->display("admin/config_sort.html");
Example #23
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");
Example #24
0
//删除附件
if (isset($_GET['flag']) and $_GET['flag'] == 'del') {
    $attach_id = $_GET['attach_id'];
    $attach_name = $_GET['file_name'];
    //echo $attach_md5_name;
    $res = $sqltool->dbUpdate("delete from t_attachment where attach_id='{$attach_id}' and attach_name='{$attach_name}'");
    //删除文件
    $res1 = 1;
    $file_name = iconv('UTF-8', 'GB2312', $attach_name);
    if (file_exists(PROJECT_DIR . "\\uploadfile\\files\\" . $attach_id . "\\" . $file_name)) {
        $res1 = unlink(PROJECT_DIR . "\\uploadfile\\files\\" . $attach_id . "\\" . $file_name);
    }
    if ($res and $res1) {
        echo "<script>alert('附件删除成功!')</script>";
    } else {
        echo "<script>alert('附件删除失败!')</script>";
    }
}
$sql = "select *from t_kno where kno_num = '{$kno_num}'";
$res = $sqltool->dbQuery($sql);
$attachment = $sqltool->dbQuery("select attach_name,attach_id from t_attachment,t_kno where kno_attach_id=attach_id and kno_num='{$kno_num}'");
$change = $sqltool->dbQuery("select *from t_kno_change where kno_num='{$kno_num}'");
//更新阅读次数
if ($_GET['readflag'] == 1) {
    $sqltool->dbUpdate("update t_kno set kno_read=kno_read+1 where kno_num='{$kno_num}'");
}
$smarty->assign("res", $res[0]);
$smarty->assign("attach", $attachment);
$smarty->assign("change", $change);
$sqltool->dbCloseConnection();
$smarty->display("share/know_detail.html");
Example #25
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/9/14
 * Time: 14:59
 */
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$sqltool = new SQLTool();
$sql = "SELECT sort_name,(select count(*) from t_kno where kno_sort  like CONCAT('%',t.sort_name,'%') and kno_state=3) times,sort_parent_id from t_req_sort t GROUP BY sort_name ORDER BY sort_parent_id";
$child_sort = $sqltool->dbQuery($sql);
$parent_sort = $sqltool->dbQuery("select sort_id,sort_name from t_req_sort where sort_parent_id is NULL ");
$kno = $sqltool->dbQuery("select kno_title,kno_num,kno_read from t_kno  where kno_state=3 order by kno_read desc limit 0,20");
$smarty->assign("child_sort", $child_sort);
$smarty->assign("parent_sort", $parent_sort);
$smarty->assign("kno", $kno);
$smarty->display("share/know_search.html");
Example #26
0
<?php

/**
 * Created by PhpStorm.
 * User: huzhiming
 * Date: 2015/7/10
 * Time: 9:56
 */
session_start();
require_once "../../smarty_include.php";
require_once "../../tools/SQLTool.class.php";
$sqltool = new SQLTool();
$sql = "select sort_id,sort_name from t_req_sort where sort_parent_id is NULL ";
$parent_sort = $sqltool->dbQuery($sql);
$sql = "select sort_id,sort_name,sort_parent_id from t_req_sort where sort_parent_id is not NULL";
$child_sort = $sqltool->dbQuery($sql);
$userlist = $sqltool->dbQuery("select user_name,name,depart_name from t_user,t_depart where t_user.depart_id=t_depart.depart_id and user_role='1' order by t_user.depart_id");
$attach_id = md5(uniqid(md5(microtime(true)), true));
$smarty->configLoad("config.ini", "uploadfile");
$smarty->assign("attach_id", $attach_id);
$smarty->assign("parent_sort", $parent_sort);
$smarty->assign("child_sort", $child_sort);
$smarty->assign("userlist", $userlist);
$smarty->display("admin/request_create.html");
$sqltool->dbCloseConnection();