コード例 #1
0
ファイル: promote.php プロジェクト: aurelienshz/g1a
<?php

if (connected() && $_SESSION['niveau'] == 3) {
    require MODELES . 'membres/getUserDetails.php';
    require MODELES . 'membres/promoteUser.php';
    $title = "Changer le statut d'un membre";
    $style = ['form.css'];
    if (!DEBUG) {
        $style[] = 'minipage.css';
    }
    if (!empty($_POST)) {
        if (promoteUser($_GET['id'], $_POST['niveau'])) {
            $contents['ok'] = "Modifié !";
        }
    }
    $user = getUserDetails($_GET['id']);
    // var_dump($user);
    $contents['value'] = $user['niveau'];
    vue(['promote'], $style, $title, $contents);
} else {
    header('Location: ' . getLink(['accueil']));
}
コード例 #2
0
include_once 'function_add_db.php';
if (empty($_SESSION['nom'])) {
    session_write_close();
    // to be sure
    header('Location: ./login.php');
    exit;
}
if (isset($_REQUEST['deconnect']) && $_REQUEST['deconnect'] == "yes") {
    session_destroy();
    session_write_close();
    // to be sure
    header('Location: ./index.php');
    exit;
}
if (isset($_REQUEST['boutonAdmin']) && is_numeric($_REQUEST['idUserPromote'])) {
    promoteUser($_REQUEST['idUserPromote']);
}
function getArrayUser()
{
    $isAdmin = $_SESSION['isAdmin'];
    $html = "";
    $html .= '<table style="border-collapse: collapse;border:1px solid black;">';
    $html .= "<th>Nom</th>";
    $html .= "<th>Prenom</th>";
    $html .= "<th>Détail</th>";
    $html .= "<th>Modification</th>";
    $html .= "<th>Suppresion</th>";
    if ($isAdmin == 1) {
        $html .= "<th>Promotion Administrateur</th>";
    }
    foreach (getListUsers() as $row) {