Ejemplo n.º 1
0
 /**
  * @param string $type  (change , verify , )
  */
 public function Password($type, $redirect = NULL)
 {
     $this->load->library("encryption");
     $this->load->helper("setup");
     $this->encryption->initialize(array('cipher' => 'aes-256', 'mode' => 'cbc', 'key' => get_key()));
     switch ($type) {
         case "change":
             $actual = $_REQUEST['txt_actual_pass'];
             $nueva = $_REQUEST['txt_new_pass'];
             $actual_decrypt = $this->encryption->decrypt($this->session->user['password']);
             if (strcmp($actual_decrypt, $actual) != 0) {
                 redirect("Dashboard/index/" . $redirect . "?opps=1");
             }
             $pass_encrypt = $this->encryption->encrypt($nueva);
             $this->load->model("user/user_profile");
             $success = $this->user_profile->change_password($pass_encrypt);
             if (!$success) {
                 redirect("Dashboard/index/" . $redirect . "?opps=2");
             } else {
                 redirect("Dashboard/index/" . $redirect . "?opps=0");
             }
             break;
         case "verify":
             $this->load->model("user/user_auth");
             $state = $this->user_auth->PasswordState();
             echo $state;
             break;
     }
 }
Ejemplo n.º 2
0
function getanswer($mysql, $usrname, $keyword)
{
    switch ($keyword) {
        case "求红包":
            require "redpocket.php";
            $contentStr = redpocket($mysql, $usrname);
            break;
        case "我爱你":
            $contentStr = "我也爱你么么哒";
            break;
        default:
            $exploded = explode(":", $keyword, 2);
            if ($exploded[0] == "红包问题答案") {
                require "redpocket.php";
                $ckresult = checkanswer($mysql, $usrname, $exploded[1]);
                if ($ckresult === 0) {
                    $key = get_key($mysql, $usrname);
                    if ($key == 1) {
                        $contentStr = "恭喜答对,很抱歉,红包已经发完……";
                    } else {
                        $contentStr = "恭喜答对!您的提取密钥是:" . $key . "。相关指引请看http://waymao.com/img/wny 如有疑问请联系邮箱hb@waymao.com";
                        change_gift_status($mysql, $usrname, 3);
                    }
                } else {
                    $contentStr = $ckresult;
                }
            } else {
                $contentStr = "你个辣鸡,居然向我发送了{$keyword} 【注意啦,大福利来啦,大年夜到初二三天,回复求红包试试?】QAQ!QAQ!!";
            }
    }
    return $contentStr;
}
Ejemplo n.º 3
0
 /** @return array */
 public function value()
 {
     $value = parent::value();
     if (is_array($value)) {
         $value = get_key($value, 0, '');
     }
     return [$value];
 }
Ejemplo n.º 4
0
function check_key($str)
{
    $err = false;
    $ar = parse_str($str);
    $key = $ar['key'];
    $uid = $ar['uid'];
    $k = get_key($uid);
    if ($k == $key) {
        $err = true;
    }
    return $err;
}
Ejemplo n.º 5
0
 public function Auth($usr, $pwd, $type = "user")
 {
     $this->load->library('encryption');
     //iniciando tipo de encriptacion aes-256
     // se tiene la llave por medio de helper setup
     $this->encryption->initialize(array('cipher' => 'aes-256', 'mode' => 'cbc', 'key' => get_key()));
     // comenzaremos analizar el campo de user en la tabla login
     $t = "login.user";
     //verifica si el tipo es email
     if ($type === "email") {
         $t = "user.email";
     }
     $this->query = NULL;
     //sentencia sql en el cual verifica el estado de un usuario
     $this->query = "SELECT concat(user.nombres, ' ' , user.apellidos ) " . " as 'name' , login.user as 'user' " . ", login.password as 'password' " . ", login.status as 'status' " . ", login.last_date as 'last_date' " . ", login.password_state as 'p_state'" . ", roles.nombre as 'rol_name' " . ", roles.nivel as 'rol_nivel'  " . ", roles.parent as 'parent'" . ", user.avatar as 'avatar' " . ", roles.sub_nivel as 'sub_nivel'  " . ", user.email as 'email' " . ", login.id_login as 'id_login'" . ", user.id_user as 'id_user' " . " FROM user " . " LEFT JOIN login ON login.id_login=user.id_login " . " LEFT JOIN roles ON roles.id_rol=user.id_rol " . " WHERE {$t} LIKE ? ";
     $request = $this->db->query($this->query, array($usr))->result_array()[0];
     if (empty($request)) {
         return FALSE;
     } else {
         $pass = $this->encryption->decrypt($request['password']);
         if (strcmp($pwd, $pass) !== 0) {
             return FALSE;
         }
     }
     if ($request['status'] == 0) {
         return array("status" => 0, "user" => $request['user'], "avatar" => $request['avatar'], "name" => $request['name']);
     }
     if (isset($this->session->user)) {
         $this->session->unset_userdata('user');
     }
     $this->session->user = $request;
     date_default_timezone_set("America/El_Salvador");
     $date = new DateTime("now");
     $current_d = $date->format("Y-m-d H:m:s");
     $this->db->update("login", array("last_date" => $current_d), "id_login = " . $request['id_login']);
     return TRUE;
 }
Ejemplo n.º 6
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("file_Increase");
empty($do) && ($do = 'list');
if ($do == 'list') {
    include_once 'template/add.php';
} elseif ($do == 'save') {
    $savetype = getGP('savetype', 'P');
    $filetype = getGP('filetype', 'P');
    $filenumber = getGP('filenumber', 'P');
    $filename = getGP('filename', 'P');
    $enddate = getGP('enddate', 'P');
    $position = getGP('position', 'P');
    $page = getGP('page', 'P');
    $appendix = getGP('file1', 'P') . "," . getGP('file2', 'P') . "," . getGP('file3', 'P');
    $content = getGP('content', 'P');
    $file = array('filetype' => $filetype, 'filenumber' => $filenumber, 'filename' => $filename, 'enddate' => $enddate, 'position' => $position, 'page' => $page, 'appendix' => $appendix, 'content' => $content, 'type' => '0', 'date' => get_date('Y-m-d H:i:s', PHP_TIME), 'uid' => $_USER->id);
    insert_db('file', $file);
    $id = $db->insert_id();
    $content = serialize($file);
    $title = '新增档案信息';
    get_logadd($id, $content, $title, 20, $_USER->id);
    show_msg('新增档案信息成功!', 'admin.php?ac=index&fileurl=file');
}
Ejemplo n.º 7
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("workclass_admin");
empty($do) && ($do = 'list');
if ($do == 'list') {
    //列表信息
    $wheresql = '';
    $page = max(1, getGP('page', 'G', 'int'));
    $pagesize = $_CONFIG->config_data('pagenum');
    $offset = ($page - 1) * $pagesize;
    $url = 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '';
    if ($typeid = getGP('typeid', 'G')) {
        $wheresql .= " AND typeid='" . $typeid . "'";
        $url .= '&typeid=' . rawurlencode($typeid);
    }
    if ($title = getGP('title', 'G')) {
        $wheresql .= " AND title LIKE '%{$title}%' ";
        $url .= '&title=' . rawurlencode($title);
    }
    $num = $db->result("SELECT COUNT(*) AS num FROM " . DB_TABLEPRE . "workclass_template WHERE 1 {$wheresql}");
    $sql = "SELECT * FROM " . DB_TABLEPRE . "workclass_template WHERE 1 {$wheresql} ORDER BY tplid desc LIMIT {$offset}, {$pagesize}";
    $result = $db->fetch_all($sql);
    include_once 'mana/template.php';
} elseif ($do == 'update') {
    $idarr = getGP('id', 'P', 'array');
    foreach ($idarr as $id) {
        $db->query("DELETE FROM " . DB_TABLEPRE . "workclass_template WHERE tplid = '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "workclass_flow WHERE tplid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "workclass_from WHERE tplid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "workclass WHERE tplid= '{$id}'");
Ejemplo n.º 8
0
Archivo: p.php Proyecto: php360/ltnmp
function sys_freebsd()
{
    //CPU
    if (false === ($res['cpu']['num'] = get_key("hw.ncpu"))) {
        return false;
    }
    $res['cpu']['model'] = get_key("hw.model");
    //LOAD AVG
    if (false === ($res['loadAvg'] = get_key("vm.loadavg"))) {
        return false;
    }
    //UPTIME
    if (false === ($buf = get_key("kern.boottime"))) {
        return false;
    }
    $buf = explode(' ', $buf);
    $sys_ticks = time() - intval($buf[3]);
    $min = $sys_ticks / 60;
    $hours = $min / 60;
    $days = floor($hours / 24);
    $hours = floor($hours - $days * 24);
    $min = floor($min - $days * 60 * 24 - $hours * 60);
    if ($days !== 0) {
        $res['uptime'] = $days . "天";
    }
    if ($hours !== 0) {
        $res['uptime'] .= $hours . "小时";
    }
    $res['uptime'] .= $min . "分钟";
    //MEMORY
    if (false === ($buf = get_key("hw.physmem"))) {
        return false;
    }
    $res['memTotal'] = round($buf / 1024 / 1024, 2);
    $str = get_key("vm.vmtotal");
    preg_match_all("/\nVirtual Memory[\\:\\s]*\\(Total[\\:\\s]*([\\d]+)K[\\,\\s]*Active[\\:\\s]*([\\d]+)K\\)\n/i", $str, $buff, PREG_SET_ORDER);
    preg_match_all("/\nReal Memory[\\:\\s]*\\(Total[\\:\\s]*([\\d]+)K[\\,\\s]*Active[\\:\\s]*([\\d]+)K\\)\n/i", $str, $buf, PREG_SET_ORDER);
    $res['memRealUsed'] = round($buf[0][2] / 1024, 2);
    $res['memCached'] = round($buff[0][2] / 1024, 2);
    $res['memUsed'] = round($buf[0][1] / 1024, 2) + $res['memCached'];
    $res['memFree'] = $res['memTotal'] - $res['memUsed'];
    $res['memPercent'] = floatval($res['memTotal']) != 0 ? round($res['memUsed'] / $res['memTotal'] * 100, 2) : 0;
    $res['memRealPercent'] = floatval($res['memTotal']) != 0 ? round($res['memRealUsed'] / $res['memTotal'] * 100, 2) : 0;
    return $res;
}
Ejemplo n.º 9
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("wage_basis");
global $_CACHE;
get_cache('wage_type');
empty($do) && ($do = 'list');
if ($do == 'list') {
    if (getGP('view', 'P') == 'save') {
        $newuid = getGP('newuid', 'P', 'array');
        $newusername = getGP('newusername', 'P', 'array');
        $newname = getGP('newname', 'P', 'array');
        $newcontent = getGP('newcontent', 'P', 'array');
        foreach ($newuid as $id) {
            if ($newname[$id] != '') {
                $wage_basis = array('uid' => $id, 'username' => $newusername[$id], 'name' => $newname[$id], 'content' => $newcontent[$id]);
                insert_db('wage_basis', $wage_basis);
                $vid = $db->insert_id();
                //写数数据
                //$sqlu = "SELECT tid,name FROM ".DB_TABLEPRE."wage_type order by tnumber asc";
                //$results = $db->query($sqlu);
                //while ($type = $db->fetch_array($results)) {
                foreach ($_CACHE['wage_type'] as $type) {
                    $contentdb = getGP('newtype_' . $type['tid'], 'P', 'array');
                    $wage_data = array('viewid' => $vid, 'tid' => $type['tid'], 'name' => $type['name'], 'content' => $contentdb[$id], 'type' => 1);
                    insert_db('wage_data', $wage_data);
                }
                $content = serialize($wage_type);
                $title = '添加薪资基础信息';
                get_logadd($id, $content, $title, 36, $_USER->id);
            }
Ejemplo n.º 10
0
    }
    if ($ischeck == '3') {
        $wheresql .= " AND DATE_SUB(CURDATE(), INTERVAL 7 DAY)<=date(date) ";
    }
    if ($ischeck == '4') {
        $wheresql .= " AND DATE_SUB(CURDATE(),INTERVAL 1 MONTH)<=date(date) ";
    }
    if ($ischeck == '5') {
        $wheresql .= " AND DATE_SUB(CURDATE(),INTERVAL 6 MONTH)<=date(date) ";
    }
    $num = $db->result("SELECT COUNT(*) AS num FROM " . DB_TABLEPRE . "registration WHERE 1 {$wheresql} ORDER BY id desc");
    $sql = "SELECT * FROM " . DB_TABLEPRE . "registration WHERE 1 {$wheresql} ORDER BY id desc LIMIT {$offset}, {$pagesize}";
    $result = $db->fetch_all($sql);
    include_once 'template/registrationlist.php';
} elseif ($do == 'update') {
    get_key("registration_");
    $idarr = getGP('id', 'P', 'array');
    foreach ($idarr as $id) {
        $db->query("DELETE FROM " . DB_TABLEPRE . "registration WHERE id = '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "registration_log WHERE rid = '{$id}'");
    }
    $content = serialize($idarr);
    $title = '清理考勤信息';
    get_logadd($id, $content, $title, 7, $_USER->id);
    show_msg('考勤信息清理成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
} elseif ($do == 'add') {
    if ($_POST['view'] != '') {
        $id = getGP('id', 'P', 'int');
        if ($id != '') {
            $name = check_str(getGP('user', 'P'));
            $uid = check_str(getGP('userid', 'P'));
Ejemplo n.º 11
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("project_config");
empty($do) && ($do = 'list');
if ($do == 'list') {
    //列表信息
    $wheresql = '';
    $page = max(1, getGP('page', 'G', 'int'));
    $pagesize = $_CONFIG->config_data('pagenum');
    $offset = ($page - 1) * $pagesize;
    $url = 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '';
    $num = $db->result("SELECT COUNT(*) AS num FROM " . DB_TABLEPRE . "project_type order by tid asc");
    $sql = "SELECT * FROM " . DB_TABLEPRE . "project_type order by tid asc LIMIT {$offset}, {$pagesize}";
    $result = $db->fetch_all($sql);
    include_once 'mana/type.php';
} elseif ($do == 'update') {
    $idarr = getGP('id', 'P', 'array');
    foreach ($idarr as $id) {
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_type WHERE tid = '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_model WHERE typeid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_flow WHERE typeid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_template WHERE typeid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_from WHERE typeid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project WHERE typeid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_log WHERE typeid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_db WHERE typeid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_personnel WHERE typeid= '{$id}'");
        $db->query("DELETE FROM " . DB_TABLEPRE . "project_personnel_log WHERE typeid= '{$id}'");
    }
    $content = serialize($idarr);
Ejemplo n.º 12
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
$ischeck = $_GET['ischeck'];
if ($_GET['ischeck'] == ' ') {
    $_check['ischeck'] = '  ui-tab-trigger-item-current';
} else {
    $_check['ischeck' . $_GET['ischeck']] = '  ui-tab-trigger-item-current';
}
get_key("goods_purchase");
empty($do) && ($do = 'list');
if ($do == 'list') {
    //列表信息
    $wheresql = '';
    $page = max(1, getGP('page', 'G', 'int'));
    $pagesize = $_CONFIG->config_data('pagenum');
    $offset = ($page - 1) * $pagesize;
    $url = 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '';
    if ($number = getGP('number', 'G')) {
        $wheresql .= " AND number ='" . $number . "'";
    }
    //时间
    $vstartdate = getGP('vstartdate', 'G');
    $venddate = getGP('venddate', 'G');
    if ($vstartdate != '' && $venddate != '') {
        $wheresql .= " AND (startdate>='" . $vstartdate . "' and startdate<='" . $venddate . "')";
        $url .= '&vstartdate=' . $vstartdate . '&venddate=' . $venddate;
    }
    $vuidtype = getGP('vuidtype', 'G');
    if (!is_superadmin() && $vuidtype == '') {
        $key1 = $db->result("SELECT * FROM " . DB_TABLEPRE . "office_goods_key where examination like '%" . get_realname($_USER->id) . "%' ");
Ejemplo n.º 13
0
<?php

/*
*/
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("department_");
empty($do) && ($do = 'list');
if ($do == 'list') {
    include_once 'template/department.php';
} elseif ($do == 'save') {
    $idarr = getGP('id', 'P', 'array');
    $persno = getGP('persno', 'P', 'array');
    $name = getGP('name', 'P', 'array');
    $date = get_date('Y-m-d H:i:s', PHP_TIME);
    foreach ($idarr as $id) {
        if ($name[$id] == '') {
            $name[$id] = '新部门名称';
        }
        if ($persno[$id] == '') {
            $persno[$id] = '负责人为空?';
        }
        $department = array('name' => $name[$id], 'persno' => $persno[$id]);
        update_db('department', $department, array('id' => $id));
    }
    if (getGP('newid', 'P', 'array') != '' || getGP('newids', 'P', 'array') != '') {
        $newname = '';
        foreach (getGP('newname', 'P', 'array') as $name) {
            $newname .= $name . ',';
        }
        $newpersno = '';
        foreach (getGP('newpersno', 'P', 'array') as $name) {
Ejemplo n.º 14
0
                            <span aria-hidden="true">&times;</span> Удалить
                        </a>
                    </div>
                </fieldset>
            </div>
        </div>
    </script>
	<div class="json-field-list form-horizontal">
	    @foreach ($value as $num => $data)
		    <div class="panel panel-default json-field-item">
                <div class="panel-body">
                    <fieldset>
                        @foreach($fields as $field)
                            <?php 
$field_name = get_key($field, 'name', '', 'is_scalar');
$field_label = get_key($field, 'label', '', 'is_scalar');
?>
                            <div class="form-group">
                                <label for="dynamic-field-{{ $name }}-{{$num}}-{{ $field_name }}" class="col-sm-1 control-label"><small>{{ $field_label }}</small></label>
                                <div class="col-sm-11">
                                    @if(get_key($field, 'type', 'input', 'is_scalar') == 'input')
                                        <input class="form-control dataUrl" id="dynamic-field-{{ $name }}-{{$num}}-{{ $field_name }}" placeholder="{{ $field_label }}" data-name="{{ $field_name }}" value="{{ $data->$field_name or '' }}"/>
                                    @endif
                                </div>
                            </div>
                        @endforeach
                        <div class="form-group text-right">
                            <a href="#" class="btn-sm btn-danger json-field-remove">
                                <span aria-hidden="true">&times;</span> Удалить
                            </a>
                        </div>
Ejemplo n.º 15
0
            $title = '新增工作计划';
            get_logadd($id, $content, $title, 12, $_USER->id);
        }
        show_msg('计划信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
    } else {
        $id = getGP('id', 'G', 'int');
        if ($id != '') {
            $user = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "plan  WHERE id = '{$id}'  ");
            get_key('date_plan_edit');
            $startdate = explode(' ', $user['startdate']);
            $starttime = explode(':', $startdate[1]);
            $enddate = explode(' ', $user['enddate']);
            $endtime = explode(':', $enddate[1]);
            $_title['name'] = '编辑';
        } else {
            get_key('date_plan_Increase');
            $startdate = explode(' ', get_date('Y-m-d H:i:s', PHP_TIME));
            $starttime = explode(':', $startdate[1]);
            $enddate = explode(' ', get_date('Y-m-d H:i:s', PHP_TIME));
            $endtime = explode(':', $enddate[1]);
            $user['type'] = '个人';
            $_title['name'] = '发布';
        }
        include_once 'template/planadd.php';
    }
} elseif ($do == 'views') {
    $id = getGP('id', 'G', 'int');
    if ($_POST['view'] != '') {
        $bbsid = getGP('bbsid', 'P');
        $title = check_str(getGP('title', 'P'));
        $author = getGP('author', 'P');
Ejemplo n.º 16
0
 public function getCut()
 {
     return \get_key($this->_cfg, 'cut', '<cut/>');
 }
Ejemplo n.º 17
0
<?php

require_once 'keys.php';
$key = get_key();
define('API_KEY', $key);
// array of possible offset
$offset = array(0, 1, 2, 3, 4, 5, 6, 7);
// $url  = 'http://api.nytimes.com/svc/search/v1/article';
$url = 'http://api.nytimes.com/svc/search/v2/articlesearch.json';
// $url .= '?query= des_facet:[POLITICS AND GOVERNMENT]&fields=title,date,body,publication_year';
// $url .= '?query=facet_terms:politics';
$url .= '?fq=politics';
// $url .= '&fl=headline,pub_year,pub_date,body';
$url .= '&begin_date=' . $_GET['year'] . '0101';
$url .= '&end_date=' . $_GET['year'] . '1231';
$url .= '&offset=' . $offset[array_rand($offset)];
$url .= '&api-key=' . API_KEY;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$response = curl_exec($ch);
echo $response;
exit;
Ejemplo n.º 18
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("office_sms_channel");
empty($do) && ($do = 'list');
if ($do == 'list') {
    $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "phone_channel  order by id desc");
    include_once 'template/channel_edit.php';
} elseif ($do == 'save') {
    $savetype = getGP('savetype', 'P');
    //发送消息表
    $phone_channel = array('username' => getGP('username', 'P'), 'password' => getGP('password', 'P'));
    update_db('phone_channel', $phone_channel, array('id' => 1));
    //insert_db('channel_edit',$channel_edit);
    show_msg('信息更新成功!', 'admin.php?ac=channel_edit&fileurl=sms');
}
Ejemplo n.º 19
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("office_communication");
empty($do) && ($do = 'list');
if ($do == 'list') {
    //列表信息
    $wheresql = '';
    $page = max(1, getGP('page', 'G', 'int'));
    $pagesize = $_CONFIG->config_data('pagenum');
    $offset = ($page - 1) * $pagesize;
    $url = 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '';
    if ($keyword = getGP('keyword', 'G')) {
        $wheresql .= " AND (b.name LIKE '%{$keyword}%' OR a.username LIKE '%{$keyword}%')";
        $url .= '&keyword=' . rawurlencode($keyword);
    }
    if ($department = getGP('department', 'G', 'int')) {
        $wheresql .= " AND a.departmentid = {$department}";
        $url .= '&department=' . $department;
    }
    if ($usergroup = getGP('usergroup', 'G', 'int')) {
        $wheresql .= " AND a.groupid = {$usergroup}";
        $url .= '&usergroup=' . $usergroup;
    }
    $num = $db->result("SELECT COUNT(*) AS num FROM " . DB_TABLEPRE . "user a," . DB_TABLEPRE . "user_view b WHERE a.id=b.uid {$wheresql}");
    $sql = "SELECT * FROM " . DB_TABLEPRE . "user a," . DB_TABLEPRE . "user_view b WHERE a.id=b.uid {$wheresql} ORDER BY a.numbers  ASC LIMIT {$offset}, {$pagesize}";
    $result = $db->fetch_all($sql);
    include_once 'template/user.php';
}
//读取上级部门
function get_father($fid)
Ejemplo n.º 20
0
            //写入主表信息
            insert_db('training', $training);
            $id = $db->insert_id();
            $content = serialize($training);
            $title = '添加培训计划';
            get_logadd($id, $content, $title, 28, $_USER->id);
        }
        show_msg('培训计划信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
    } else {
        $id = getGP('id', 'G', 'int');
        if ($id != '') {
            $user = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "training  WHERE id = '{$id}'  ");
            get_key("training_");
            $_title['name'] = '编辑';
        } else {
            get_key("training_");
            $user['number'] = get_date('YmdHis', PHP_TIME);
            $_title['name'] = '发布';
        }
        include_once 'template/trainingadd.php';
    }
} elseif ($do == 'views') {
    $id = getGP('id', 'G', 'int');
    if ($_POST['view'] != '') {
        $id = getGP('id', 'P');
        $type = getGP('type', 'P');
        //主表信息
        $training = array('type' => $type, 'examinationdate' => get_date('Y-m-d H:i:s', PHP_TIME));
        update_db('training', $training, array('id' => $id));
        $content = serialize($training);
        $title = '审批培训计划';
Ejemplo n.º 21
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("job_demand");
empty($do) && ($do = 'list');
if ($do == 'list') {
    $id = getGP('id', 'G', 'int');
    $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "job_demand  WHERE id = '{$id}'");
    include_once 'template/job_demand_views.php';
}
Ejemplo n.º 22
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("office_communication_Increase");
empty($do) && ($do = 'list');
if ($do == 'list') {
    include_once 'template/add.php';
} elseif ($do == 'save') {
    $savetype = getGP('savetype', 'P');
    $company = getGP('company', 'P');
    $person = getGP('person', 'P');
    $tel = getGP('tel', 'P');
    $phone = getGP('phone', 'P');
    $fax = getGP('fax', 'P');
    $mail = getGP('mail', 'P');
    $zipcode = getGP('zipcode', 'P');
    $address = getGP('address', 'P');
    $position = getGP('position', 'P');
    $sex = getGP('sex', 'P');
    $msn = getGP('msn', 'P');
    $date = get_date('Y-m-d h:i:s', PHP_TIME);
    $type = getGP('type', 'P');
    $uid = $_USER->id;
    //主表信息
    $communication = array('company' => $company, 'person' => $person, 'tel' => $tel, 'phone' => $phone, 'fax' => $fax, 'mail' => $mail, 'zipcode' => $zipcode, 'address' => $address, 'position' => $position, 'sex' => $sex, 'msn' => $msn, 'type' => $type, 'date' => $date, 'uid' => $uid);
    //写入主表信息
    insert_db('communication', $communication);
    $id = $db->insert_id();
    $content = serialize($communication);
    $title = '添加通迅录';
    get_logadd($id, $content, $title, 9, $_USER->id);
Ejemplo n.º 23
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("property_depreciation");
empty($do) && ($do = 'list');
if ($do == 'edit') {
    //列表信息
    $id = getGP('id', 'G', 'int');
    $sql = "SELECT * FROM " . DB_TABLEPRE . "property_depreciation WHERE propertyid='" . $id . "'  ORDER BY id desc";
    $result = $db->fetch_all($sql);
    include_once 'template/depreciation_view.php';
}
Ejemplo n.º 24
0
        //主表信息
        $bbs_log = array('bbsid' => $bbsid, 'title' => $title, 'author' => $author, 'content' => $content, 'enddate' => $enddate, 'type' => 4, 'uid' => $uid);
        insert_db('bbs_log', $bbs_log);
        $content = serialize($bbs_log);
        $title = '回复信息';
        get_logadd($id, $content, $title, 34, $_USER->id);
        show_msg('评论发布成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&type=' . $_GET['type'] . '&id=' . $bbsid);
    } else {
        if ($id != '') {
            $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "document  WHERE id = '{$id}'");
            $_title['name'] = $_title['title'] . '信息浏览';
        }
    }
    include_once 'template/documentviews.php';
} elseif ($do == 'documenttype') {
    get_key("office_document_type_" . getGP('type', 'G') . "");
    $type = getGP('type', 'G', 'int');
    if ($_POST['view'] == 'save') {
        $idarr = getGP('id', 'P', 'array');
        $name = getGP('name', 'P', 'array');
        $date = get_date('Y-m-d H:i:s', PHP_TIME);
        foreach ($idarr as $id) {
            if ($name[$id] == '') {
                $name[$id] = '新文件夹名称';
            }
            $document_type = array('title' => $name[$id]);
            update_db('document_type', $document_type, array('id' => $id));
        }
        if (getGP('newid', 'P', 'array') != '' || getGP('newids', 'P', 'array') != '') {
            $newname = '';
            foreach (getGP('newname', 'P', 'array') as $name) {
Ejemplo n.º 25
0
 public static function sys_freebsd()
 {
     //CPU
     if (false === ($res['cpu']['num'] = get_key("hw.ncpu"))) {
         return false;
     }
     $res['cpu']['detail'] = get_key("hw.model");
     //LOAD AVG
     if (false === ($res['loadAvg'] = get_key("vm.loadavg"))) {
         return false;
     }
     $res['loadAvg'] = str_replace("{", "", $res['loadAvg']);
     $res['loadAvg'] = str_replace("}", "", $res['loadAvg']);
     //UPTIME
     if (false === ($buf = get_key("kern.boottime"))) {
         return false;
     }
     $buf = explode(' ', $buf);
     $sys_ticks = time() - intval($buf[3]);
     $min = $sys_ticks / 60;
     $hours = $min / 60;
     $days = floor($hours / 24);
     $hours = floor($hours - $days * 24);
     $min = floor($min - $days * 60 * 24 - $hours * 60);
     if ($days !== 0) {
         $res['uptime'] = $days . "天";
     }
     if ($hours !== 0) {
         $res['uptime'] .= $hours . "小时";
     }
     $res['uptime'] .= $min . "分钟";
     //MEMORY
     if (false === ($buf = get_key("hw.physmem"))) {
         return false;
     }
     $res['memTotal'] = round($buf / 1024 / 1024, 2);
     $buf = explode("\n", do_command("vmstat", ""));
     $buf = explode(" ", trim($buf[2]));
     $res['memFree'] = round($buf[5] / 1024, 2);
     $res['memUsed'] = $res['memTotal'] - $res['memFree'];
     $res['memPercent'] = floatval($res['memTotal']) != 0 ? round($res['memUsed'] / $res['memTotal'] * 100, 2) : 0;
     $buf = explode("\n", do_command("swapinfo", "-k"));
     $buf = $buf[1];
     preg_match_all("/([0-9]+)\\s+([0-9]+)\\s+([0-9]+)/", $buf, $bufArr);
     $res['swapTotal'] = round($bufArr[1][0] / 1024, 2);
     $res['swapUsed'] = round($bufArr[2][0] / 1024, 2);
     $res['swapFree'] = round($bufArr[3][0] / 1024, 2);
     $res['swapPercent'] = floatval($res['swapTotal']) != 0 ? round($res['swapUsed'] / $res['swapTotal'] * 100, 2) : 0;
     return $res;
 }
Ejemplo n.º 26
0
function macro_TitleIndex($formatter, $value, $options = array())
{
    global $DBInfo;
    $pc = !empty($DBInfo->titleindex_pagecount) ? intval($DBInfo->titleindex_pagecount) : 100;
    if ($pc < 1) {
        $pc = 100;
    }
    $pg = empty($options['p']) ? 1 : intval($options['p']);
    if ($pg < 1) {
        $pg = 1;
    }
    $group = $formatter->group;
    $key = -1;
    $keys = array();
    if ($value == '' or $value == 'all') {
        $sel = '';
    } else {
        $sel = ucfirst($value);
    }
    // get all keys
    $all_keys = get_keys();
    if (isset($sel[0])) {
        if (!isset($all_keys[$sel])) {
            $sel = key($all_keys);
        }
        // default
    }
    if (@preg_match('/' . $sel . '/i', '') === false) {
        $sel = '';
    }
    $titleindex = array();
    // cache titleindex
    $kc = new Cache_text('titleindex');
    $delay = !empty($DBInfo->default_delaytime) ? $DBInfo->default_delaytime : 0;
    $uid = '';
    if (function_exists('posix_getuid')) {
        $uid = '.' . posix_getuid();
    }
    $lock_file = _fake_lock_file($DBInfo->vartmp_dir, 'titleindex' . $uid);
    $locked = _fake_locked($lock_file, $DBInfo->mtime());
    if ($locked or $kc->exists('key') and $DBInfo->checkUpdated($kc->mtime('key'), $delay)) {
        if (!empty($formatter->use_group) and $formatter->group) {
            $keys = $kc->fetch('key.' . $formatter->group);
            $titleindex = $kc->fetch('titleindex.' . $formatter->group);
        } else {
            $keys = $kc->fetch('key');
            $titleindex = $kc->fetch('titleindex' . $sel);
        }
        if (isset($sel[0]) and isset($titleindex[$sel])) {
            $all_pages = $titleindex[$sel];
        }
        if (empty($titleindex) and $locked) {
            // no cache found
            return _("Please wait...");
        }
    }
    if (empty($all_pages)) {
        $all_pages = array();
        $indexer = $DBInfo->lazyLoad('titleindexer');
        if (!empty($formatter->use_group) and $formatter->group) {
            $group_pages = $indexer->getLikePages('^' . $formatter->group);
            foreach ($group_pages as $page) {
                $all_pages[] = str_replace($formatter->group, '', $page);
            }
        } else {
            $all_pages = $indexer->getLikePages('^' . $all_keys[$sel], 0);
        }
        #natcasesort($all_pages);
        #sort($all_pages,SORT_STRING);
        //usort($all_pages, 'strcasecmp');
        $pages = array_flip($all_pages);
        if (!empty($formatter->use_group)) {
            array_walk($pages, '_setpagekey');
        } else {
            array_walk($pages, create_function('&$p, $k', '$p = $k;'));
        }
        $all_pages = array_flip($pages);
        uksort($all_pages, 'strcasecmp');
    }
    if (empty($keys) or empty($titleindex)) {
        _fake_lock($lock_file);
        foreach ($all_pages as $page => $rpage) {
            $p = ltrim($page);
            $pkey = get_key("{$p}");
            if ($key != $pkey) {
                $key = $pkey;
                //$keys[] = $pkey;
                if (!isset($titleindex[$pkey])) {
                    $titleindex[$pkey] = array();
                }
            }
            $titleindex[$pkey][$page] = $rpage;
        }
        $keys = array_keys($all_keys);
        if (!empty($tlink)) {
            $keys[] = 'all';
        }
        if (!empty($formatter->use_group) and $formatter->group) {
            $kc->update('key.' . $formatter->group, $keys);
            $kc->update('titleindex.' . $formatter->group, $titleindex);
        } else {
            $kc->update('key', $keys);
            $kc->update('titleindex' . $sel, $titleindex);
        }
        if (isset($sel[0]) and isset($titleindex[$sel])) {
            $all_pages = $titleindex[$sel];
        }
        _fake_lock($lock_file, LOCK_UN);
    }
    $pnut = null;
    if (isset($sel[0]) and count($all_pages) > $pc) {
        $pages_number = intval(count($all_pages) / $pc);
        if (count($all_pages) % $pc) {
            $pages_number++;
        }
        $pages = array_keys($all_pages);
        $pages = array_splice($pages, ($pg - 1) * $pc, $pc);
        $selected = array();
        foreach ($pages as $p) {
            $selected[$p] = $all_pages[$p];
        }
        $pages = $selected;
        $pnut = get_pagelist($formatter, $pages_number, '?action=titleindex&amp;sec=' . $sel . '&amp;p=', !empty($pg) ? $pg : 1);
    } else {
        $pages =& $all_pages;
    }
    //print count($all_pages);
    //exit;
    $out = '';
    #  if ($DBInfo->use_titlecache)
    #    $cache=new Cache_text('title');
    $key = '';
    foreach ($pages as $page => $rpage) {
        $p = ltrim($page);
        $pkey = get_key("{$p}");
        if ($key != $pkey) {
            $key = $pkey;
            if (isset($sel[0]) and !preg_match('/^' . $sel . '/i', $pkey)) {
                continue;
            }
            if (!empty($out)) {
                $out .= "</ul>";
            }
            $out .= "<a name='{$key}'></a><h3><a href='#top'>{$key}</a></h3>\n";
            $out .= "<ul>";
        }
        if (isset($sel[0]) and !preg_match('/^' . $sel . '/i', $pkey)) {
            continue;
        }
        #
        #    if ($DBInfo->use_titlecache and $cache->exists($page))
        #      $title=$cache->fetch($page);
        #    else
        $title = get_title($rpage, $page);
        #$out.= '<li>' . $formatter->word_repl('"'.$page.'"',$title,'',0,0);
        $urlname = _urlencode($group . $rpage);
        $out .= '<li>' . $formatter->link_tag($urlname, '', _html_escape($title));
        $keyname = $DBInfo->pageToKeyname(urldecode($rpage));
        if (is_dir($DBInfo->upload_dir . "/{$keyname}") or !empty($DBInfo->use_hashed_upload_dir) and is_dir($DBInfo->upload_dir . '/' . get_hashed_prefix($keyname) . $keyname)) {
            $out .= ' ' . $formatter->link_tag($urlname, "?action=uploadedfiles", $formatter->icon['attach']);
        }
        $out .= "</li>\n";
    }
    if (!empty($pnut)) {
        $out .= '<li style="list-style:none">' . $pnut . '</li>' . "\n";
    }
    $out .= "</ul>\n";
    $index = '';
    $tlink = '';
    if (isset($sel[0])) {
        $tlink = $formatter->link_url($formatter->page->urlname, '?action=titleindex&amp;sec=');
    }
    $index = array();
    foreach ($keys as $key) {
        $name = strval($key);
        $tag = '#' . $key;
        $link = !empty($tlink) ? preg_replace('/sec=/', 'sec=' . _urlencode($key), $tlink) : '';
        if ($name == 'Others') {
            $name = _("Others");
        } else {
            if ($name == 'all') {
                $name = _("Show all");
            }
        }
        $index[] = "<a href='{$link}{$tag}'>{$name}</a>";
    }
    $str = implode(' | ', $index);
    return "<center><a name='top'></a>{$str}</center>\n{$out}";
}
Ejemplo n.º 27
0
    }
    //时间
    $vstartdate = getGP('vstartdate', 'G');
    $venddate = getGP('venddate', 'G');
    if ($vstartdate != '' && $venddate != '') {
        $wheresql .= " AND (logindate>'" . $vstartdate . "' and logindate<'" . $venddate . "')";
        $url .= '&vstartdate=' . $vstartdate . '&venddate=' . $venddate;
    }
    $num = $db->result("SELECT COUNT(*) AS num FROM " . DB_TABLEPRE . "loginlog WHERE 1 {$wheresql} and uid='" . $_USER->id . "'");
    $sql = "SELECT * FROM " . DB_TABLEPRE . "loginlog WHERE 1 {$wheresql} and uid='" . $_USER->id . "' ORDER BY id desc LIMIT {$offset}, {$pagesize}";
    $result = $db->fetch_all($sql);
    include_once 'template/log.php';
} elseif ($do == 'update') {
    show_msg('你没有权限使用此功能,请联系系统管理员作删除操作!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
} elseif ($do == 'userupdate') {
    get_key("config_log_delete");
    $idarr = getGP('id', 'P', 'array');
    foreach ($idarr as $id) {
        $db->query("DELETE FROM " . DB_TABLEPRE . "oalog WHERE id = '{$id}' ");
    }
    show_msg('你没有权限使用此功能,请联系系统管理员作删除操作!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=loglist');
} elseif ($do == 'excel') {
    $datename = "log_" . get_date('YmdHis', PHP_TIME);
    $outputFileName = 'data/excel/' . $datename . '.xls';
    //生成数据
    $content = array();
    $archive = array("姓名", "IP", "登录时间", "退出时间");
    $content[] = $archive;
    $wheresql = '';
    //根据条件导出
    if ($name = getGP('name', 'P')) {
<?php

include_once 'parametri.php';
include_once 'variabili.php';
require 'funzioni.php';
mkdir($destination_path);
//connessione
$con = mysqli_connect($host, $user, $password, $dbName);
if (!$con) {
    trigger_error('Could not connect to MySQL: ' . mysqli_connect_error());
}
$sql0 = 'SELECT `Path` FROM `maintable` WHERE `Object` ="' . get_key() . '";';
$result = mysqli_query($con, $sql0);
$var = array();
while ($obj = mysqli_fetch_object($result)) {
    $var[] = $obj;
}
$temp = json_decode(json_encode($var[0]), true);
$path = $temp['Path'] . "\\";
$class = get_maxClass() - 1;
$save = 0;
$sql = "SELECT * FROM `clusttable` WHERE";
while ($class >= 0) {
    if ($_POST['c' . $class] == "1") {
        //echo 'classe selezionata: '.$class. '<br>' ;
        $save += 1;
        if ($save > 1) {
            $sql = $sql . " or";
        }
        $sql = $sql . " `Class`=\"" . $class . "\"";
    }
Ejemplo n.º 29
0
    if (!is_superadmin() && $vuidtype == '') {
        $wheresql .= " AND uid ='" . $_USER->id . "'";
    }
    if ($vuidtype != '') {
        if ($vuidtype == '-1') {
            $wheresql .= get_subordinate($_USER->id, 'uid');
        } else {
            $wheresql .= " and uid='" . $vuidtype . "'";
        }
    }
    $num = $db->result("SELECT COUNT(*) AS num FROM " . DB_TABLEPRE . "sms_send WHERE 1 {$wheresql} ");
    $sql = "SELECT * FROM " . DB_TABLEPRE . "sms_send WHERE 1 {$wheresql} ORDER BY id desc LIMIT {$offset}, {$pagesize}";
    $result = $db->fetch_all($sql);
    include_once 'template/index.php';
} elseif ($do == 'update') {
    get_key("office_info_delete");
    $idarr = getGP('id', 'P', 'array');
    foreach ($idarr as $id) {
        $db->query("DELETE FROM " . DB_TABLEPRE . "sms_send WHERE id = '{$id}' ");
        //db->query("DELETE FROM ".DB_TABLEPRE."user_view WHERE uid = '$id'");
        if ($id != '') {
            $oalog = array('uid' => $_USER->id, 'content' => '删除内部短信', 'title' => '删除内部短信', 'startdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'contentid' => $id, 'type' => '4');
            insert_db('oalog', $oalog);
        }
    }
    show_msg('短消息删除成功!', 'admin.php?ac=index&fileurl=sms&userkeytype=' . getGP('userkeytype', 'P') . '');
} elseif ($do == 'excel') {
    $datename = "sms_" . get_date('YmdHis', PHP_TIME);
    $outputFileName = 'data/excel/' . $datename . '.xls';
    $content = array();
    $archive = array("接收人", "发送人", "发送时间", "内容");
Ejemplo n.º 30
0
<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("office_goods");
empty($do) && ($do = 'list');
if ($do == 'list') {
    include_once 'template/add.php';
} elseif ($do == 'save') {
    $savetype = getGP('savetype', 'P');
    $goods_type = getGP('goods_type', 'P');
    $title = getGP('title', 'P');
    $specification = getGP('specification', 'P');
    $unit = getGP('unit', 'P');
    $price = getGP('price', 'P');
    $number = getGP('number', 'P');
    $content = getGP('content', 'P');
    //$purchase=getGP('purchase','P');
    //$examination=getGP('examination','P');
    //$warehousing=getGP('warehousing','P');
    $office_goods = array('goods_type' => $goods_type, 'title' => $title, 'specification' => $specification, 'unit' => $unit, 'price' => $price, 'number' => $number, 'content' => $content, 'date' => get_date('Y-m-d H:i:s', PHP_TIME), 'uid' => $_USER->id);
    insert_db('office_goods', $office_goods);
    $id = $db->insert_id();
    $content = serialize($office_goods);
    $title = '新增办公用品信息';
    get_logadd($id, $content, $title, 23, $_USER->id);
    show_msg('您要处理的信息操作成功!', 'admin.php?ac=index&fileurl=' . $fileurl . '');
}
//读取部门
function GET_FILE_PUBLIC_LIST($fatherid = 0, $selid = 0, $layer = 0)
{
    $str = "";