<? // Include the file for the specific functions on Users require_once '../../../Models/Users.php'; // New Helper to use the functions $id=$_GET["id"]; $User= new UsersModel(); // Performing a select with all "*" and specifiying the RoleId=2 for selecting only users $results = $User->SelectSpecific("*",array( "UserId" => $id )); $results=$results[0]; //If an edit is performed if(! empty($_POST)) { $data=$_POST; $answer=$User->Update($data,array( "UserId" => $id )); header("Location: ./index.php"); } function quotes($string) { return "'".$string."'"; } ?> <? include "header.php";?> <h2>Editer un utilisateur</h2> <form class="form-horizontal" data-toggle="validator" role="form" method="post" >
<?php // Login Code include_once '/Models/Users.php'; if (!empty($_POST)) { $UserMail = $_POST['UserMail']; $Userpassword = $_POST['Userpassword']; $User = new UsersModel(); $Result = $User->SelectSpecific("*", array("AND" => array("UserMail" => $UserMail, "Userpassword" => $Userpassword))); if (!empty($Result)) { session_start(); if (!isset($_SESSION['user'])) { $_SESSION['User'] = $Result[0]; if ($_SESSION["User"]['RoleId'] == 1) { header("Location: ./Views/Staff/index.php"); } if ($_SESSION["User"]['RoleId'] == 0) { header("Location: ./Views/Admin/index.php"); } if ($_SESSION["User"]['RoleId'] == 2) { header("Location: ./Views/User/index.php"); } } } else { } } ?> <div class="modal fade" id="LoginModal" role="dialog"> <div class="modal-dialog"> <!-- Modal of Login --> <div class="modal-content">
if(!empty($_POST)) { //die(var_dump($_POST)); $data=$_POST; unset($data['UserWordPass2']); //Juste pour l'instant //Il reste à faire le hash du mot de pass $data['Salt']=2; $data['RoleId']=2; $User= new UsersModel(); $results = $User->SelectSpecific("*",array( "UserMail" => $data["UserMail"] )); } ?> <?include 'header.php'; ?> <div class="welcome"> <div class="container"> <h2>Inscription au site</h2> <form class="form-horizontal" data-toggle="validator" role="form" method="post" > <fieldset> <!-- Multiple Radios --> <div class="form-group">
<? // Include the file for the specific functions on Users require_once '../../../Models/Users.php'; // New Helper to use the functions $User= new UsersModel(); // Performing a select with all "*" and specifiying the RoleId=2 for selecting only users $results = $User->SelectSpecific("*",array( "RoleId" => 2 )); $labels = array("Nom complet", "Date de naissance" , " Adresse" , "Numéro de téléphone", "Email", "Actions") ?> <? include 'header.php';?> <div id="page-content-wrapper"> <div class="container-fluid"> <div class="row"> <div class="col-lg-12"> <h1>Gestion des utilisateurs</h1> <br> <br> <a href="create.php">Créer un nouvel utilisateur</a> <table class="table table-hover table-condensed table-striped"> <tr> <?php foreach ($labels as $label) { ?> <th><?php