Example #1
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("project_");
$typeid = $_GET['typeid'];
$projectid = $_GET['projectid'];
$modid = $_GET['modid'];
pro_mana_view($typeid, $_USER->id);
$sql = "SELECT * FROM " . DB_TABLEPRE . "project_model  WHERE mid = '" . $modid . "'";
$mod = $db->fetch_one_array($sql);
//创建权限
global $db;
$manat = $db->fetch_one_array("SELECT tid FROM " . DB_TABLEPRE . "project_type where (keyuser like '%" . get_realname($_USER->id) . "%' or keyuser='' or manauser like '%" . get_realname($_USER->id) . "%') and tid=" . $typeid);
if (!is_superadmin() && $manat['tid'] == '') {
    $sql = "SELECT mid FROM " . DB_TABLEPRE . "project_model  WHERE mid = '" . $modid . "' and (keyuser like '%" . get_realname($_USER->id) . "%' or keyuser='' or manauser like '%" . get_realname($_USER->id) . "%')";
    $mana = $db->fetch_one_array($sql);
    if ($mana['mid'] == '') {
        show_msg('对不起,您没有使用的权限,不可用!', 'home.php?mid=8');
    }
}
empty($do) && ($do = 'list');
if ($do == 'list') {
    //列表信息
    $wheresqltype = '';
    $wheresql = '';
    $page = max(1, getGP('page', 'G', 'int'));
    $pagesize = $_CONFIG->config_data('pagenum');
    $offset = ($page - 1) * $pagesize;
    $url = 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&type=' . $_GET['type'];
    if ($title = getGP('title', 'G')) {
        $wheresqltype .= " AND a.title LIKE '%{$title}%' ";
Example #2
0
        include_once 'template/personnel.php';
    }
} elseif ($do == 'flow') {
    $sql = "SELECT * FROM " . DB_TABLEPRE . "project_personnel where projectid='" . $_GET['projectid'] . "' and appkey2=1 order by perid asc";
    $result = $db->fetch_all($sql);
    include_once 'template/flow.php';
} elseif ($do == 'workkey') {
    $db->query("update " . DB_TABLEPRE . "project set type=1 where id = '" . getGP('projectid', 'G') . "'");
    $content = getGP('projectid', 'G');
    $title = '撤消项目';
    get_logadd($id, $content, $title, 32, $_USER->id);
    show_msg('项目己成功撤消!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
} elseif ($do == 'view') {
    $sql = "SELECT * FROM " . DB_TABLEPRE . "project  WHERE id = '" . $_GET['projectid'] . "'";
    $row = $db->fetch_one_array($sql);
    pro_mana_view($row['typeid'], $_USER->id);
    if ($_GET['down'] != '') {
        if (file_exists("project/tpl/type_" . $row['typeid'] . ".php") != '') {
            include_once "project/tpl/type_" . $row['typeid'] . ".php";
        } else {
            include_once 'template/view_excel.php';
        }
        header('Location: down.php?urls=data/excel/project/p_' . $row['id'] . '.xls');
    }
    include_once 'template/view.php';
} elseif ($do == 'update') {
    $idarr = getGP('id', 'P', 'array');
    foreach ($idarr as $id) {
        $db->query("DELETE FROM " . DB_TABLEPRE . "project WHERE id = '{$id}' ");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_log WHERE projectid = '{$id}' ");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_personnel where projectid = '{$id}' ");