Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.76 KB | None | 0 0
  1. <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
  2. <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
  3. <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  4.  
  5. <?php session_start();
  6. if (!isset ($_SESSION['uid'])){
  7.  header('location: login.php');
  8. }
  9. else {
  10.  ob_start();
  11. }
  12. ?>
  13.  
  14. <!DOCTYPE html>
  15. <html lang="en" dir="ltr">
  16.   <head>
  17.     <meta charset="utf-8">
  18.     <title>Area De Gestão</title>
  19.       <link href="../style/cover.css" rel="stylesheet">
  20.   </head>
  21.  
  22.   <style>
  23. .table-fixed thead {
  24.   width: 97%;
  25.   background-color: #444;
  26. }
  27. .table-fixed tbody {
  28.   height: 230px;
  29.   overflow-y: auto;
  30.   width: 100%;
  31.   color:black;
  32. }
  33. .table-fixed thead, .table-fixed tbody, .table-fixed tr, .table-fixed td, .table-fixed th {
  34.   display: block;
  35. }
  36. .table-fixed tbody td, .table-fixed thead > tr> th {
  37.   float: left;
  38.   border-bottom-width: 0;
  39.   color:#fff;
  40. }
  41.  
  42. </style>
  43.  
  44.   <body>
  45.  
  46.           <div class="masthead clearfix"style="width:60%; margin-left:20%;">
  47.               <h3 class="masthead-brand">AACV</h3>
  48.               <nav class="nav nav-masthead" style="margin-top:2%;">
  49.                 <a class="nav-link active" href="#">Home</a>
  50.                 <a class="nav-link" href="#">Features</a>
  51.                 <a class="nav-link" href="#">Contact</a>
  52.               </nav>
  53.             </div>
  54.           </div>
  55.  
  56.             <div class="col-sm">
  57.               <form id="contact-form" role="form" method="post"  enctype="multipart/form-data">
  58.                 <div class="container" style="max-width:400px;">
  59.                   <div class="row">
  60.                     <div class="panel panel-default">
  61.                       <div class="panel-heading" style="background-color:#333; color:white;max-width:400px;">
  62.                         <h4>
  63.                         Tabela de Gestores
  64.                         </h4>
  65.                       </div>
  66.                       <table class="table table-fixed table-striped table-hover "  style="background-color:#333; color:#fff; max-width:400px;" >
  67.                         <thead>
  68.                           <tr>
  69.                           <th class="col-xs-4">ID</th>
  70.                           <th class="col-xs-4">Login</th>
  71.                           <th class="col-xs-4">Permissões</th>
  72.                           </tr>
  73.                         </thead>
  74.                         <tbody>
  75.                           <?php
  76.                          include '../dataBase/allGestor.php';
  77.                          $sqlResult= allGestor();
  78.                          //var_dump($sqlResult);
  79.  
  80.                          for ($i=0; $i <count($sqlResult) ; $i++) {
  81.                            echo "<tr>";
  82.                             echo "<td class='col-xs-4'>".$sqlResult[$i]['GestorID']."</td>";
  83.                             echo "<td class='col-xs-4'>".$sqlResult[$i]['Login']."</td>";
  84.  
  85.                             if ($sqlResult[$i]['Permission']==1) {
  86.                               echo "<td class='col-xs-4'>Admin</td>";
  87.  
  88.                             }else {
  89.                               echo "<td class='col-xs-4'>Normal</td>";
  90.                             }echo "</tr>";
  91.                           }
  92.                           ?>
  93.                         </tbody>
  94.                       </table>
  95.                     </div>
  96.                   </div>
  97.                 </div>
  98.               </form>
  99.             </div>
  100.  
  101.           <div class="col-sm">
  102.             <form id="contact-form" actio"debug.php" role="form" method="post"  enctype="multipart/form-data">
  103.               <div class="row">
  104.                   <div class="form-group">
  105.                     <label for="gestorLoginA">Login do Gestor</label>
  106.                     <input id="gestorLoginA" type="text" pattern="[A-Za-z]{1,100}" name="gestorLoginA" class="form-control" placeholder="user@aacv.pt" required>
  107.                   </div>
  108.                   <div class="form-group">
  109.                     <label for="gestorPermissionA">Permissões</label>
  110.                     <select name="gestorPermissionA">
  111.                       <option value="0">Normal </option>
  112.                       <option value="1">Admin</option>
  113.                     </select>
  114.                   </div>
  115.               </div>
  116.               <div class="form-group" align="center" style="padding:20px">
  117.                 <input id="adicionarGestor" type="submit" class="btn btn-success btn-send" value="Adicionar">
  118.               </div>
  119.             </form>
  120.  
  121.             <?php
  122.            if (isset($_POST['gestorLoginA']) and isset($_POST['gestorPermissionA'])) {
  123.              if ($_POST['gestorPermissionA'] == 1 || $_POST['gestorPermissionA'] == 0) {
  124.                include '../dataBase/addGestor.php';
  125.                addGestor($_POST['gestorLoginA'],$_POST['gestorPermissionA']);
  126.                echo "<meta http-equiv='refresh' content='0'>";
  127.                 header('Location:areaDeGestao.php');
  128.               }
  129.             }
  130.  
  131.             ?>
  132.  
  133.               <form id="contact-form"  role="form" method="post"  enctype="multipart/form-data">
  134.                 <div class="row">
  135.                 <div class="col-sm" >
  136.                   <div class="form-group">
  137.                     <label for="gestorIdE">ID</label>
  138.                     <input id="gestorIdE" type="text" pattern="[0-9]{1,100}" name="gestorIdE" class="form-control" placeholder="user@aacv.pt" required >
  139.                   </div>
  140.                 </div>
  141.                 <div class="col-sm">
  142.                   <div class="form-group">
  143.                     <label for="gestorLoginE">Login</label>
  144.                     <input id="gestorLoginE" type="text" pattern="[A-Za-z]{1,100}" name="gestorLoginE" class="form-control" placeholder="user@aacv.pt" required>
  145.                   </div>
  146.                 </div>
  147.                 </div>
  148.                 <div class="form-group" align="center" style="padding:20px">
  149.                   <input id="eleminiarGestor" type="submit" class="btn btn-success btn-send" value="Eliminar">
  150.                 </div>
  151.               </form>
  152.             </div>
  153.  
  154.             <?php
  155.              if (isset($_POST['gestorIdE']) and isset($_POST['gestorLoginE'])) {
  156.                include '../dataBase/delGestor.php';
  157.                echo $_POST['gestorIdE'];
  158.                echo $_POST['gestorLoginE'];
  159.                delGestor($_POST['gestorIdE'],$_POST['gestorLoginE']);
  160.                echo "<meta http-equiv='refresh' content='0'>";
  161.                 header('Location:areaDeGestao.php');
  162.               }
  163.             ?>
  164.  
  165.     <!-- Scripts para o bootstrap -->
  166.   <script src="../bootstrap/js/jquery-3.3.1.min.js"></script>
  167.   <script src="../bootstrap/js/popper.min.js"></script>
  168.   <script src="../bootstrap/js/bootstrap.min.js"></script>
  169.   </body>
  170. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement