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


PHP Utilisateur::getUtilisateur方法代码示例

本文整理汇总了PHP中Utilisateur::getUtilisateur方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilisateur::getUtilisateur方法的具体用法?PHP Utilisateur::getUtilisateur怎么用?PHP Utilisateur::getUtilisateur使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utilisateur的用法示例。


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

示例1:

<div class="container-fluid">
    <header>
        <?php 
require_once 'utilities/loginregis.php';
require_once 'utilities/messaging.php';
require_once 'utilities/pagesetup.php';
require_once "utilities/userfunctions.php";
if (isset($_GET['altuser'])) {
    $altuserlogin = $_GET['altuser'];
    //securize this
    $altuser = Utilisateur::getUtilisateur($altuserlogin);
} else {
    $altuserlogin = $_SESSION["loggedIn"];
}
$altuser = Utilisateur::getUtilisateur($altuserlogin);
?>
        <div class="row">
            <div class="jumbotron">
                <div class="container">
                    <h1 style="text-align:center">Rate <?php 
echo $altuser['name'];
?>
's Language Skills!</h1>
                    <?php 
$languageErr = $levelErr = "Required";
$language = $ratelevel = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST["language"])) {
        $languageErr = "Language is required";
    } else {
        $language = $_POST['language'];
开发者ID:yujia21,项目名称:INF472WFinalProject,代码行数:31,代码来源:content-rateuser.php

示例2:

                    <h1 style="text-align:center">Edit Profile</h1>
                    <style>
                         .error {color: #FF0000;}
                    </style>
                </div>
            </div>
        </div>
    </header>
    
    <body>
    <?php 
require_once 'utilities/loginregis.php';
require_once 'utilities/messaging.php';
require_once 'utilities/pagesetup.php';
require_once "utilities/userfunctions.php";
$user = Utilisateur::getUtilisateur($_SESSION["loggedIn"]);
$login = $user['login'];
$name = $user['name'];
$lname = $user['lastname'];
$email = $user['email'];
$bdate = $user['birthdate'];
// define variables and set to empty values
$loginErr = $nameErr = $lnameErr = $emailErr = $pwdErr = $cpwdErr = $opwdErr = $bdateErr = "";
$opwd = $pwd = $cpwd = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST["name"])) {
        $nameErr = "Name is required";
    } else {
        $name = test_input($_POST["name"]);
        // check if name only contains letters and whitespace
        if (!preg_match("/^[a-zA-Z ]*\$/", $name)) {
开发者ID:yujia21,项目名称:INF472WFinalProject,代码行数:31,代码来源:content-editprofile.php

示例3: routeRequest

function routeRequest()
{
    if (isset($_SESSION['LAST_ACTIVITY']) && time() - $_SESSION['LAST_ACTIVITY'] > 1800) {
        // last request was more than 30 minutes ago
        session_unset();
        // unset $_SESSION variable for the run-time
        session_destroy();
        // destroy session data in storage
    }
    $_SESSION['LAST_ACTIVITY'] = time();
    // update last activity time stamp
    $dbh = Database::connect();
    $u = Utilisateur::getUtilisateur($dbh, $_SESSION["id"]);
    $uri = substr($_SERVER['REQUEST_URI'], strrpos($_SERVER['REQUEST_URI'], '/'));
    switch ($uri) {
        case '/':
            echo file_get_contents('./public/index.html');
            echo '<script type="text/babel">' . file_get_contents('./public/scripts/Connexion-Inscription/Connexion.js') . file_get_contents('./public/scripts/Connexion-Inscription/Inscription.js') . file_get_contents('./public/scripts/Connexion-Inscription/EditProfile.js') . file_get_contents('./public/scripts/Affiche/Autobar/Autobar.js') . file_get_contents('./public/scripts/Affiche/Autobar/LieuAutobar.js') . file_get_contents('./public/scripts/Lieu/Lieu.js') . file_get_contents('./public/scripts/Utilisateur/Utilisateur.js') . file_get_contents('./public/scripts/Utilisateur/ListeUtilisateur.js') . file_get_contents('./public/scripts/Affiche/ObjetForm.js') . file_get_contents('./public/scripts/Affiche/Objet.js') . file_get_contents('./public/scripts/Affiche/NavbarObjet.js') . file_get_contents('./public/scripts/Filter/FilterBar.js') . file_get_contents('./public/scripts/Affiche/ListeAffiche.js') . file_get_contents('./public/scripts/Docs/Docs.js') . file_get_contents('./public/scripts/Lieu/Lieu.js') . file_get_contents('./public/scripts/Lieu/NavbarLieu.js') . file_get_contents('./public/scripts/Lieu/LieuForm.js') . file_get_contents('./public/scripts/Lieu/ListeLieu.js') . file_get_contents('./public/scripts/Lieu/LieuMap.js') . file_get_contents('./public/scripts/App/App.js') . '</script>';
            break;
        case '/Connexion':
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                $u = Utilisateur::seConnecter($dbh, $_POST['identifiant'], $_POST['motdepasse']);
                if (!is_null($_SESSION["id"])) {
                    echo json_encode(array("result" => json_decode(json_encode($u))));
                } else {
                    echo json_encode(array("error" => $u));
                }
            } else {
                if ($_SERVER['REQUEST_METHOD'] === 'PUT') {
                    if (!is_null($u)) {
                        echo json_encode(array("result" => json_decode(json_encode($u))));
                    }
                }
            }
            break;
        case '/Deconnexion':
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                Utilisateur::seDeconnecter();
            }
            break;
        case '/Inscription':
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                echo Helpers::testInscription($dbh);
            }
            break;
        case '/EditProfile':
            if (!is_null($u) && $_SERVER['REQUEST_METHOD'] === 'POST') {
                echo Helpers::testUpdate($dbh);
            }
            break;
        case '/ChargerLesObjets':
            if ($_SERVER['REQUEST_METHOD'] === 'GET') {
                header('Content-Type: application/json');
                $reponse = Objet::chargerLesObjets($dbh);
                echo json_encode($reponse);
            }
            break;
        case '/AjouterUnObjet':
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                if (!is_null($u)) {
                    $u = $u->ajouterUnObjet($dbh, $_POST["nom"], $_POST["description"], json_decode($_POST["lieux"]));
                    if (is_array($u) && isset($u["error"])) {
                        echo json_encode($u);
                    } else {
                        echo json_encode(array("result" => "success"));
                    }
                }
            }
            break;
        case '/SupprimerUnObjet':
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                if (!is_null($u)) {
                    $u->supprimerUnObjet($dbh, $_POST["ido"]);
                }
            }
            break;
        case '/DeclarerAvoirTrouveUnObjet':
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                if (!is_null($u)) {
                    $u->declarerAvoirTrouveUnObjet($dbh, $_POST["ido"]);
                }
            }
            break;
        case '/RetirerDeclaration':
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                if (!is_null($u)) {
                    $u->retirerDeclaration($dbh, $_POST["ido"]);
                }
            }
            break;
        case '/AjouterUnLieu':
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                if (!is_null($u)) {
                    $l = Lieu::ajouterUnLieu($dbh, $_POST["tag"], $_POST["lat"], $_POST["lng"]);
                    if (is_array($l) && isset($l["error"])) {
                        echo json_encode($l);
                    } else {
                        echo json_encode(array("e" => "v"));
                    }
                }
//.........这里部分代码省略.........
开发者ID:Edouard360,项目名称:web-project,代码行数:101,代码来源:server.php


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