Advertisement
Guest User

Untitled

a guest
Nov 9th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.18 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5. <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
  6. <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
  7. <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  8.  
  9.   <meta charset="utf-8">
  10.   <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11.   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  12.   <meta name="description" content="">
  13.   <meta name="author" content="">
  14.  
  15.   <title>SB Admin - Tables</title>
  16.  
  17.   <!-- Custom fonts for this template-->
  18.   <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  19.  
  20.   <!-- Page level plugin CSS-->
  21.   <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
  22.  
  23.   <!-- Custom styles for this template-->
  24.   <link href="css/sb-admin.css" rel="stylesheet">
  25.  
  26. </head>
  27.  
  28. <body id="page-top">
  29.  
  30.   <nav class="navbar navbar-expand navbar-dark bg-dark static-top">
  31.  
  32.     <a class="navbar-brand mr-1" href="index.php">Panel Administracji zgłoszeniami</a>
  33.  
  34.     <button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
  35.       <i class="fas fa-bars"></i>
  36.     </button>
  37.  
  38.    
  39.    
  40.      
  41.   </nav>
  42.  
  43.   <div id="wrapper">
  44.  
  45.     <!-- Sidebar -->
  46.     <ul class="sidebar navbar-nav">
  47.       <li class="nav-item">
  48.         <a class="nav-link" href="index.php">
  49.           <i class="fas fa-fw fa-tachometer-alt"></i>
  50.           <span>Strona główna</span>
  51.         </a>
  52.       </li>
  53.      <li class="nav-item active">
  54.         <a class="nav-link" href="tables.php">
  55.           <i class="fas fa-fw fa-table"></i>
  56.           <span>Zgłoszenia</span></a>
  57.       </li>
  58.       <li class="nav-item active">
  59.         <a class="nav-link" href="zatrudnieni.php">
  60.           <i class="fas fa-fw fa-table"></i>
  61.           <span>Lista zatrudnionych</span></a>
  62.       </li>
  63.     </ul>
  64.  
  65.     <div id="content-wrapper">
  66.  
  67.       <div class="container-fluid">
  68.  
  69.         <!-- Breadcrumbs-->
  70.         <ol class="breadcrumb">
  71.           <li class="breadcrumb-item">
  72.             <a href="#">Zgłoszenia</a>
  73.           </li>
  74.            
  75.           <li class="breadcrumb-item active">Tabela</li>
  76.         </ol>
  77.  
  78.         <!-- DataTables Example -->
  79.         <div class="card mb-3">
  80.           <div class="card-header">
  81.             <i class="fas fa-table"></i>
  82.             Zgłoszenia</div>
  83.           <div class="card-body">
  84.             <div class="table-responsive">
  85.               <div class="container">
  86.     <div class="row clearfix">
  87.         <div class="col-md-12 table-responsive">
  88.             <table class="table table-bordered table-hover table-sortable" id="tab_logic">
  89.                 <thead>
  90.                    
  91.                 </thead>
  92.                
  93.                 <tbody>
  94.                
  95.                 <?php
  96.                 require_once "connect.php";
  97.                 //  $wynik = mysqli_query($connect,"SELECT imie FROM zgloszenia");
  98.                 //  $takoooo = mysqli_fetch_assoc($wynik);
  99.             //  foreach ($takoooo as $row)
  100.             //{
  101.                 //echo "<tr><td>".$row['imie']."</td></tr>";
  102.             //  print_r($takoooo);
  103.  
  104.         //  }
  105.         $wynik = mysqli_query($connect,"SELECT * FROM zgloszenia") or die('Błąd zapytania');
  106.         if(mysqli_num_rows($wynik) > 0) {
  107.             echo "<table class='table table-bordered table-hover table-sortable' id='tab_logic' >
  108.             <th class='text-center'> ID </th><th class='text-center'> Imie </th>  <th class='text-center'>Nazwisko</th>  <th class='text-center'>Wiadomosc</th> <th class='text-center'>Numer Telefonu</th><th class='text-center'>Stanowisko</th><th class='text-center'>Status</th>  
  109.                         </td>  ";
  110.                        
  111.             while($r = mysqli_fetch_assoc($wynik)) {
  112.          
  113.         echo "<tr>";
  114.          echo "<td>".$r['id']."</td>" ;
  115.         echo "<td>".$r['imie']."</td>" ;
  116.         echo "<td>".$r['nazwisko']."</td>";
  117.         echo "<td>".$r['text']."</td>";
  118.         echo "<td>".$r['tel']."</td>";
  119.         echo "<td>".$r['stanowisko']."</td>";
  120.        
  121.        
  122.         echo "<td data-name='sel'>
  123.         <form method='POST'>
  124.                             <select name='status1'>
  125.                                 <option value=''>Czeka</option>
  126.                                 <option value='1'>Przyjęty</option>
  127.                                 <option value='2'>Odrzucone</option>
  128.                                 <option value='3'>W rezerwie</option>
  129.                             </select></form>
  130.                             <button type='submit'  name='wykonaj' class='btn btn-primary pull-right'>Wykonaj!</button>
  131.                             </form>";
  132.                            
  133.        
  134.         echo "</tr>";
  135.             }}
  136.     echo "</table>";
  137.                             $id = ['id'];
  138.                             if (isset($_POST['wykonaj'])){
  139.                                 $status = $_POST['status1'];
  140.                                  
  141.  
  142.                                         if (isset($_POST['wykonaj'])){
  143.                                         if ($status == 2)
  144.                                         {
  145.                                         //$usun = mysqli_query($connect, "DELETE FROM `zgloszenia` WHERE `id` = '".$id."'");
  146.                                         echo "odrzucony";
  147.                                         }elseif ($status == 1) {
  148.                                             echo "przyjety";
  149.                                         } elseif ($status == 3) {
  150.                                             echo "w rezerwie";
  151.                                         }
  152.                                        
  153.                                        
  154.                                        
  155.                                        
  156.                                     }
  157.                             }
  158.  
  159.        
  160.        
  161.        
  162.         ?>
  163.                    
  164.                    
  165.                        
  166.                        
  167.                        
  168.                    
  169.                 </tbody>
  170.             </table>
  171.         </div>
  172.     </div>
  173.    
  174.  
  175. </div>
  176.             </div>
  177.           </div>
  178.          
  179.          </div>
  180.         </div>
  181.  
  182.        
  183.  
  184.       </div>
  185.       <!-- /.container-fluid -->
  186.  
  187.       <!-- Sticky Footer -->
  188.       <footer class="sticky-footer">
  189.         <div class="container my-auto">
  190.           <div class="copyright text-center my-auto">
  191.             <span>Copyright © Brajan Kowal 2019</span>
  192.           </div>
  193.         </div>
  194.       </footer>
  195.  
  196.     </div>
  197.     <!-- /.content-wrapper -->
  198.  
  199.   </div>
  200.   <!-- /#wrapper -->
  201.  
  202.   <!-- Scroll to Top Button-->
  203.   <a class="scroll-to-top rounded" href="#page-top">
  204.     <i class="fas fa-angle-up"></i>
  205.   </a>
  206.  
  207.   <!-- Logout Modal-->
  208.   <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  209.     <div class="modal-dialog" role="document">
  210.       <div class="modal-content">
  211.         <div class="modal-header">
  212.           <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
  213.           <button class="close" type="button" data-dismiss="modal" aria-label="Close">
  214.             <span aria-hidden="true">×</span>
  215.           </button>
  216.         </div>
  217.         <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
  218.         <div class="modal-footer">
  219.           <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
  220.           <a class="btn btn-primary" href="login.html">Logout</a>
  221.         </div>
  222.       </div>
  223.     </div>
  224.   </div>
  225.  
  226.   <!-- Bootstrap core JavaScript-->
  227.   <script src="vendor/jquery/jquery.min.js"></script>
  228.   <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  229.  
  230.   <!-- Core plugin JavaScript-->
  231.   <script src="vendor/jquery-easing/jquery.easing.min.js"></script>
  232.  
  233.   <!-- Page level plugin JavaScript-->
  234.   <script src="vendor/datatables/jquery.dataTables.js"></script>
  235.   <script src="vendor/datatables/dataTables.bootstrap4.js"></script>
  236.  
  237.   <!-- Custom scripts for all pages-->
  238.   <script src="js/sb-admin.min.js"></script>
  239.  
  240.   <!-- Demo scripts for this page-->
  241.   <script src="js/demo/datatables-demo.js"></script>
  242.  
  243. </body>
  244.  
  245. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement