本文整理汇总了PHP中get_key函数的典型用法代码示例。如果您正苦于以下问题:PHP get_key函数的具体用法?PHP get_key怎么用?PHP get_key使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_key函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: Password
/**
* @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;
}
}
开发者ID:prosenjit-itobuz,项目名称:Unitee,代码行数:32,代码来源:User.php
示例2: getanswer
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 如有疑问请联系邮箱[email protected]";
change_gift_status($mysql, $usrname, 3);
}
} else {
$contentStr = $ckresult;
}
} else {
$contentStr = "你个辣鸡,居然向我发送了{$keyword} 【注意啦,大福利来啦,大年夜到初二三天,回复求红包试试?】QAQ!QAQ!!";
}
}
return $contentStr;
}
开发者ID:waymao,项目名称:weinanyuan,代码行数:32,代码来源:answer.php
示例3: value
/** @return array */
public function value()
{
$value = parent::value();
if (is_array($value)) {
$value = get_key($value, 0, '');
}
return [$value];
}
开发者ID:agelxnash,项目名称:owl-admin,代码行数:9,代码来源:oneSelect.php
示例4: check_key
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;
}
开发者ID:stonegithubs,项目名称:pub-sub-with-swoole,代码行数:12,代码来源:key.php
示例5: Auth
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;
}
开发者ID:prosenjit-itobuz,项目名称:Unitee,代码行数:37,代码来源:User_auth.php
示例6: exit
<?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');
}
开发者ID:haogm123,项目名称:ydoa,代码行数:25,代码来源:mod_add.php
示例7: exit
<?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}'");
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_tpl.php
示例8: sys_freebsd
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;
}
开发者ID:php360,项目名称:ltnmp,代码行数:45,代码来源:p.php
示例9: exit
<?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);
}
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_basis.php
示例10: DATE_SUB
}
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'));
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_registration.php
示例11: exit
<?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);
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_type.php
示例12: exit
<?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) . "%' ");
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_goods_purchase.php
示例13: exit
<?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) {
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_department.php
示例14: get_key
<span aria-hidden="true">×</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">×</span> Удалить
</a>
</div>
开发者ID:agelxnash,项目名称:owl-admin,代码行数:31,代码来源:jsonfield.blade.php
示例15: get_logadd
$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');
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_plan.php
示例16: getCut
public function getCut()
{
return \get_key($this->_cfg, 'cut', '<cut/>');
}
开发者ID:agelxnash,项目名称:seo-tools,代码行数:4,代码来源:Summary.php
示例17: get_key
<?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;
开发者ID:nddery,项目名称:BrainCyclopedia,代码行数:24,代码来源:nytarticles.php
示例18: exit
<?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');
}
开发者ID:haogm123,项目名称:ydoa,代码行数:16,代码来源:mod_channel_edit.php
示例19: exit
<?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)
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_user.php
示例20: insert_db
//写入主表信息
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 = '审批培训计划';
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_training.php
注:本文中的get_key函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论