header.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. require_once __DIR__.DIRECTORY_SEPARATOR.'common.php';
  3. ?>
  4. <!doctype html>
  5. <html class="no-js" lang="">
  6. <head>
  7. <meta charset="utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  9. <title><?php echo PROGRAM_NAME.' V'.SOURCE_VERSION.'.'.BASE_VERSION ?></title>
  10. <link rel="icon" type="image/png" href="img/favicon.png">
  11. <meta name="description" content="">
  12. <meta name="viewport" content="width=device-width, initial-scale=1">
  13. <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,800,700,400italic,600italic,700italic,800italic,300italic" rel="stylesheet" type="text/css">
  14. <link rel="stylesheet" href="css/bootflat.min.css">
  15. <link rel="stylesheet" href="css/font-awesome.min.css">
  16. <link rel="stylesheet" href="css/codemirror.css">
  17. <link rel="stylesheet" href="css/monokai.css">
  18. <link rel="stylesheet" href="css/main.css">
  19. </head>
  20. <body>
  21. <div id="wrap">
  22. <!-- menu -->
  23. <nav role="navigation" class="navbar navbar-inverse">
  24. <div class="container-fluid">
  25. <!-- Brand and toggle get grouped for better mobile display -->
  26. <div class="navbar-header">
  27. <button data-target="#bs-example-navbar-collapse-5" data-toggle="collapse" class="navbar-toggle" type="button">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a href="index.php" class="navbar-brand">Hackpoint</a>
  34. </div>
  35. <!-- Collect the nav links, forms, and other content for toggling -->
  36. <div id="bs-example-navbar-collapse-5" class="collapse navbar-collapse">
  37. <ul class="nav navbar-nav">
  38. <li <?php echo $page=='index.php'?'class="active"':''; ?>><a href="index.php">Sketch</a></li>
  39. <?php if ($myUser->connected()): ?>
  40. <li <?php echo $page=='component.php'?'class="active"':''; ?>><a href="component.php">Composants</a></li>
  41. <?php endif; ?>
  42. </ul>
  43. <ul class="nav navbar-nav navbar-right">
  44. <?php if (!$myUser->connected()): ?>
  45. <li>
  46. <form id="loginForm" method="post" action="action.php?action=login" class="navbar-form navbar-right">
  47. Identifiant :
  48. <input name="login" placeholder="Identifiant" class="form-control" type="text">
  49. Mot de passe :
  50. <input name="password" placeholder="Mot de passe" class="form-control" type="password">
  51. <input class="btn btn-success" value="Connexion" type="submit">
  52. </form>
  53. </li>
  54. <?php else: ?>
  55. <li class="dropdown <?php echo $page=='account.php'?'active':''; ?>" >
  56. <a data-toggle="dropdown" class="dropdown-toggle" href="#"> Connecté en tant que <?php echo $myUser->login; ?> <b class="caret"></b></a>
  57. <ul role="menu" class="dropdown-menu">
  58. <li class="dropdown-header">Profil</li>
  59. <li ><a href="account.php">Modifier</a></li>
  60. <li class="divider"></li>
  61. <li><a href="action.php?action=logout">Déconnexion</a></li>
  62. </ul>
  63. </li>
  64. <?php endif; ?>
  65. </ul>
  66. <!--<button class="btn btn-danger navbar-btn" onclick="window.location='action.php?action=logout';" type="button">MAJ</button>-->
  67. </div><!-- /.navbar-collapse -->
  68. </div><!-- /.container-fluid -->
  69. </nav>
  70. <!-- menu -->
  71. <!-- body -->
  72. <div class="container-fluid">
  73. <!-- messages -->
  74. <?php if (isset($_SESSION['error'])): ?>
  75. <div class="alert alert-danger">
  76. <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
  77. <strong>Oops!</strong> <?php echo $_SESSION['error']; unset($_SESSION['error']); ?>
  78. </div>
  79. <?php endif; ?>
  80. <?php if (isset($_SESSION['success'])): ?>
  81. <div class="alert alert-success alert-dismissable">
  82. <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
  83. <strong>Succès !</strong> <?php echo $_SESSION['success']; unset($_SESSION['success']); ?>
  84. </div>
  85. <?php endif; ?>
  86. <!-- messages -->