Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
- <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
- <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
- <?php session_start();
- if (!isset ($_SESSION['uid'])){
- header('location: login.php');
- }
- else {
- ob_start();
- }
- ?>
- <!DOCTYPE html>
- <html lang="en" dir="ltr">
- <head>
- <meta charset="utf-8">
- <title>Area De Gestão</title>
- <link href="../style/cover.css" rel="stylesheet">
- </head>
- <style>
- .table-fixed thead {
- width: 97%;
- background-color: #444;
- }
- .table-fixed tbody {
- height: 230px;
- overflow-y: auto;
- width: 100%;
- color:black;
- }
- .table-fixed thead, .table-fixed tbody, .table-fixed tr, .table-fixed td, .table-fixed th {
- display: block;
- }
- .table-fixed tbody td, .table-fixed thead > tr> th {
- float: left;
- border-bottom-width: 0;
- color:#fff;
- }
- </style>
- <body>
- <div class="masthead clearfix"style="width:60%; margin-left:20%;">
- <h3 class="masthead-brand">AACV</h3>
- <nav class="nav nav-masthead" style="margin-top:2%;">
- <a class="nav-link active" href="#">Home</a>
- <a class="nav-link" href="#">Features</a>
- <a class="nav-link" href="#">Contact</a>
- </nav>
- </div>
- </div>
- <div class="col-sm">
- <form id="contact-form" role="form" method="post" enctype="multipart/form-data">
- <div class="container" style="max-width:400px;">
- <div class="row">
- <div class="panel panel-default">
- <div class="panel-heading" style="background-color:#333; color:white;max-width:400px;">
- <h4>
- Tabela de Gestores
- </h4>
- </div>
- <table class="table table-fixed table-striped table-hover " style="background-color:#333; color:#fff; max-width:400px;" >
- <thead>
- <tr>
- <th class="col-xs-4">ID</th>
- <th class="col-xs-4">Login</th>
- <th class="col-xs-4">Permissões</th>
- </tr>
- </thead>
- <tbody>
- <?php
- include '../dataBase/allGestor.php';
- $sqlResult= allGestor();
- //var_dump($sqlResult);
- for ($i=0; $i <count($sqlResult) ; $i++) {
- echo "<tr>";
- echo "<td class='col-xs-4'>".$sqlResult[$i]['GestorID']."</td>";
- echo "<td class='col-xs-4'>".$sqlResult[$i]['Login']."</td>";
- if ($sqlResult[$i]['Permission']==1) {
- echo "<td class='col-xs-4'>Admin</td>";
- }else {
- echo "<td class='col-xs-4'>Normal</td>";
- }echo "</tr>";
- }
- ?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </form>
- </div>
- <div class="col-sm">
- <form id="contact-form" actio"debug.php" role="form" method="post" enctype="multipart/form-data">
- <div class="row">
- <div class="form-group">
- <label for="gestorLoginA">Login do Gestor</label>
- <input id="gestorLoginA" type="text" pattern="[A-Za-z]{1,100}" name="gestorLoginA" class="form-control" placeholder="user@aacv.pt" required>
- </div>
- <div class="form-group">
- <label for="gestorPermissionA">Permissões</label>
- <select name="gestorPermissionA">
- <option value="0">Normal </option>
- <option value="1">Admin</option>
- </select>
- </div>
- </div>
- <div class="form-group" align="center" style="padding:20px">
- <input id="adicionarGestor" type="submit" class="btn btn-success btn-send" value="Adicionar">
- </div>
- </form>
- <?php
- if (isset($_POST['gestorLoginA']) and isset($_POST['gestorPermissionA'])) {
- if ($_POST['gestorPermissionA'] == 1 || $_POST['gestorPermissionA'] == 0) {
- include '../dataBase/addGestor.php';
- addGestor($_POST['gestorLoginA'],$_POST['gestorPermissionA']);
- echo "<meta http-equiv='refresh' content='0'>";
- header('Location:areaDeGestao.php');
- }
- }
- ?>
- <form id="contact-form" role="form" method="post" enctype="multipart/form-data">
- <div class="row">
- <div class="col-sm" >
- <div class="form-group">
- <label for="gestorIdE">ID</label>
- <input id="gestorIdE" type="text" pattern="[0-9]{1,100}" name="gestorIdE" class="form-control" placeholder="user@aacv.pt" required >
- </div>
- </div>
- <div class="col-sm">
- <div class="form-group">
- <label for="gestorLoginE">Login</label>
- <input id="gestorLoginE" type="text" pattern="[A-Za-z]{1,100}" name="gestorLoginE" class="form-control" placeholder="user@aacv.pt" required>
- </div>
- </div>
- </div>
- <div class="form-group" align="center" style="padding:20px">
- <input id="eleminiarGestor" type="submit" class="btn btn-success btn-send" value="Eliminar">
- </div>
- </form>
- </div>
- <?php
- if (isset($_POST['gestorIdE']) and isset($_POST['gestorLoginE'])) {
- include '../dataBase/delGestor.php';
- echo $_POST['gestorIdE'];
- echo $_POST['gestorLoginE'];
- delGestor($_POST['gestorIdE'],$_POST['gestorLoginE']);
- echo "<meta http-equiv='refresh' content='0'>";
- header('Location:areaDeGestao.php');
- }
- ?>
- <!-- Scripts para o bootstrap -->
- <script src="../bootstrap/js/jquery-3.3.1.min.js"></script>
- <script src="../bootstrap/js/popper.min.js"></script>
- <script src="../bootstrap/js/bootstrap.min.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement