当前位置: 首页>>代码示例>>PHP>>正文


PHP AllowUser函数代码示例

本文整理汇总了PHP中AllowUser函数的典型用法代码示例。如果您正苦于以下问题:PHP AllowUser函数的具体用法?PHP AllowUser怎么用?PHP AllowUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AllowUser函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: toLogin

<?php

require_once 'support/config.php';
if (!isLoggedIn()) {
    toLogin();
    die;
}
if (!AllowUser(array(1, 2))) {
    redirect("index.php");
}
if (empty($_GET['id']) || empty($_GET['t'])) {
    redirect('index.php');
    die;
} else {
    $table = "";
    switch ($_GET['t']) {
        case 'a':
            $table = "assets";
            $page = "assets.php";
            $activity_input['admin_id'] = $_SESSION[WEBAPP]['user']['id'];
            $activity_input['item_id'] = $_GET['id'];
            $con->myQuery("INSERT INTO activities(admin_id,action,action_date,category_type_id,item_id) VALUES(:admin_id,'Deleted Asset',NOW(),1,:item_id)", $activity_input);
            break;
        case 'am':
            $table = "asset_models";
            $page = "asset_models.php";
            break;
        case 'c':
            $table = "consumables";
            $page = "consumables.php";
            break;
开发者ID:jpbalderas17,项目名称:ams,代码行数:31,代码来源:delete.php

示例2: htmlspecialchars

        <h1>
            View Asset <?php 
echo htmlspecialchars($asset['asset_name']);
?>
 (<?php 
echo htmlspecialchars($asset['category']);
?>
)
        </h1>
    </section>
    <section class='content'>
        <div class="row">
                <div class="col-lg-12">
                    <h3 class="page-header"> 
                            <?php 
if (AllowUser(array(1, 2)) && $asset['is_deleted'] == 0) {
    ?>
  
                                <div class="dropdown" style='display:inline'>
                                  <button class="btn btn-flat btn-success dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                    Actions
                                    <span class="caret"></span>
                                  </button>
                                  <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                    <li><a href="frm_assets.php?id=<?php 
    echo $asset['id'];
    ?>
">Edit Asset</a></li>
                                    <li><a href="delete.php?id=<?php 
    echo $asset['id'];
    ?>
开发者ID:jpbalderas17,项目名称:ams,代码行数:31,代码来源:view_asset.php

示例3: toLogin

<?php

require_once 'support/config.php';
if (!isLoggedIn()) {
    toLogin();
    die;
}
if (!AllowUser(array(1, 2, 3))) {
    redirect("index.php");
}
if (!empty($_GET['date_start'])) {
    $date_start = date_create($_GET['date_start']);
} else {
    $date_start = "";
}
if (!empty($_GET['date_end'])) {
    $date_end = date_create($_GET['date_end']);
} else {
    $date_end = "";
}
makeHead("Asset Depreciation Report");
require_once "template/header.php";
require_once "template/sidebar.php";
?>
<div class='content-wrapper'>
    <div class='content-header'>
        <h1 class='page-header text-center text-green'>Asset Maintenance Report</h1>
    </div>
    <section class='content'>
        <div class="row">
                <div class='col-lg-12'>
开发者ID:jpbalderas17,项目名称:ams,代码行数:31,代码来源:report_asset_maintenance.php

示例4: toLogin

<?php

require_once 'support/config.php';
if (!isLoggedIn()) {
    toLogin();
    die;
}
if (!AllowUser(array(1))) {
    redirect("index.php");
}
if (!empty($_POST)) {
    //Validate form inputs
    $inputs = $_POST;
    $errors = "";
    if (empty($_POST['user_type_id'])) {
        $errors .= "Select user type. <br/>";
    }
    if (empty($_POST['first_name'])) {
        $errors .= "Enter first name. <br/>";
    }
    if (empty($_POST['middle_name'])) {
        $errors .= "Enter middle name. <br/>";
    }
    if (empty($_POST['last_name'])) {
        $errors .= "Enter last name. <br/>";
    }
    if (empty($_POST['username'])) {
        $errors .= "Enter username. <br/>";
    }
    if (empty($_POST['password'])) {
        $errors .= "Enter password. <br/>";
开发者ID:jpbalderas17,项目名称:crm,代码行数:31,代码来源:create_users.php


注:本文中的AllowUser函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。