123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <?php
- require_once('config.php');
- if(!@$_SESSION['session']){
- session_start();
- }
-
- if(@$_SESSION['session']){
- require_once('verifications.php');
- }
-
-
-
-
-
- include("".$MainDir."files/navheader.php");
-
- ?>
- <!DOCTYPE html>
- <html>
- <head>
-
- </head>
- <body>
- <center>
- <section>
- <?php
- if(!@$_SESSION['session'])
- {
-
- $page_name='Connexion';
- include_once('top.php');
-
-
- if(isset($_GET['error']))
- {
- echo'<span class="error">';
- $error=$_GET['error'];
- if($error=="username")
- {
- echo'Error : Your username is invalid';
- }
- if($error=="pass")
- {
- echo'error : Your password is invalid';
- }
- if($error=="connection")
- {
- echo"error : Your password don't match with your username";
- }
- echo'</span>';
- }
-
- ?>
- <form method="post" action="login.php">
- <table width="300" border="0" align="center">
- <tr>
- <td colspan="2" >Login</td>
- </tr>
- <tr>
- <td><label for="username">Username : </label></td>
- <td><input type="text" name="username" id="username" /></td>
- </tr>
- <tr>
- <td><label for="passwd">Password : </label></td>
- <td><input type="password" name="passwd" id="passwd" />
- </td>
- </tr>
- <tr>
- <td>
- <input type="submit" value="Login" class="addbutton" />
- </td>
- </tr>
- </table>
- </form>
- <div align="center"><a href="register.php"> → Register !</a>
- <?php
- if($localite != 'local')
- echo'<br /><a href="lost.php">Lost Password ?</a>';
- echo'</div>';
- }
- else
- {
- require_once('config.php');
-
- $page_name='Panneau Utilisateur';
- include_once('top.php');
-
-
- ?>
- <div align="center"><strong>Welcome in your user panel <?php echo htmlspecialchars($username) ?> !</strong></br ></br>
- Your e-mail : <?php echo htmlspecialchars($email) ?><br />
- Your id : <?php echo htmlspecialchars($id_user) ?> <br />
- <a href="profile.php">Profile Modification</a><br />
- <a href="logout.php">Logout</a></div>
-
-
- <?php
-
-
- $dbh = new PDO("mysql:host=$server;dbname=$base", $user, $passwd);
-
- $sql = "SELECT user_rank FROM user WHERE id_user=$id_user";
-
- $stmt = $dbh->query($sql);
-
- $user_ranking = $stmt->fetch(PDO::FETCH_ASSOC);
-
-
- echo "<br>";
- echo("Votre rang est : ".$user_ranking['user_rank'].". ");
-
- $user_rank="$user_ranking[user_rank]";
-
- if($user_rank==1){
- echo("Vous êtes administrateur.");
- }
- ?>
-
- <?php
- }
- include_once('bottom.php');
- ?>
- </div>
-
- </section>
-
-
-
- </center>
-
- </body>
-
- </html>
|