Advertisement
Guest User

Untitled

a guest
Nov 9th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.16 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.                            
  132.        
  133.         echo "</tr>";
  134.             }}
  135.     echo "</table>";
  136.                             $id = ['id'];
  137.                             if (isset($_POST['wykonaj'])){
  138.                                 $status = $_POST['status1'];
  139.                                  
  140.  
  141.                                         if (isset($_POST['wykonaj'])){
  142.                                         if ($status == 2)
  143.                                         {
  144.                                         //$usun = mysqli_query($connect, "DELETE FROM `zgloszenia` WHERE `id` = '".$id."'");
  145.                                         echo "odrzucony";
  146.                                         }elseif ($status == 1) {
  147.                                             echo "przyjety";
  148.                                         } elseif ($status == 3) {
  149.                                             echo "w rezerwie";
  150.                                         }
  151.                                        
  152.                                        
  153.                                        
  154.                                        
  155.                                     }
  156.                             }
  157.  
  158.        
  159.        
  160.        
  161.         ?>
  162.                    
  163.                    
  164.                        
  165.                        
  166.                        
  167.                    
  168.                 </tbody>
  169.             </table>
  170.         </div>
  171.     </div>
  172.    
  173.  
  174. </div>
  175.             </div>
  176.           </div>
  177.          
  178.          </div>
  179.         </div>
  180.  
  181.        
  182.  
  183.       </div>
  184.       <!-- /.container-fluid -->
  185.  
  186.       <!-- Sticky Footer -->
  187.       <footer class="sticky-footer">
  188.         <div class="container my-auto">
  189.           <div class="copyright text-center my-auto">
  190.             <span>Copyright © Brajan Kowal 2019</span>
  191.           </div>
  192.         </div>
  193.       </footer>
  194.  
  195.     </div>
  196.     <!-- /.content-wrapper -->
  197.  
  198.   </div>
  199.   <!-- /#wrapper -->
  200.  
  201.   <!-- Scroll to Top Button-->
  202.   <a class="scroll-to-top rounded" href="#page-top">
  203.     <i class="fas fa-angle-up"></i>
  204.   </a>
  205.  
  206.   <!-- Logout Modal-->
  207.   <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  208.     <div class="modal-dialog" role="document">
  209.       <div class="modal-content">
  210.         <div class="modal-header">
  211.           <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
  212.           <button class="close" type="button" data-dismiss="modal" aria-label="Close">
  213.             <span aria-hidden="true">×</span>
  214.           </button>
  215.         </div>
  216.         <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
  217.         <div class="modal-footer">
  218.           <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
  219.           <a class="btn btn-primary" href="login.html">Logout</a>
  220.         </div>
  221.       </div>
  222.     </div>
  223.   </div>
  224.  
  225.   <!-- Bootstrap core JavaScript-->
  226.   <script src="vendor/jquery/jquery.min.js"></script>
  227.   <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  228.  
  229.   <!-- Core plugin JavaScript-->
  230.   <script src="vendor/jquery-easing/jquery.easing.min.js"></script>
  231.  
  232.   <!-- Page level plugin JavaScript-->
  233.   <script src="vendor/datatables/jquery.dataTables.js"></script>
  234.   <script src="vendor/datatables/dataTables.bootstrap4.js"></script>
  235.  
  236.   <!-- Custom scripts for all pages-->
  237.   <script src="js/sb-admin.min.js"></script>
  238.  
  239.   <!-- Demo scripts for this page-->
  240.   <script src="js/demo/datatables-demo.js"></script>
  241.  
  242. </body>
  243.  
  244. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement