muhammad_nasif

all_employees.html

Dec 11th, 2020
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 7.31 KB | None | 0 0
  1. <!DOCTYPE html>
  2. {% load static %}
  3.  
  4. <html lang="en">
  5. <head>
  6.     <meta charset="UTF-8">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  8.  
  9.     <!-- Bootstrap CSS -->
  10.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
  11.          integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
  12.  
  13.     <title>Employees</title>
  14. </head>
  15. <body>
  16. <nav class="navbar justify-content-center navbar-dark bg-dark">
  17.     <a class="navbar-brand" href="all_employees">Show All Employee</a>
  18.     <a class="navbar-brand" href="sale_status">Sales Status</a>
  19.     <a class="navbar-brand" href="">My Profile</a>
  20.     <a class="navbar-brand" href="logout">Log Out</a>
  21.  
  22. </nav>
  23.  
  24.  
  25. <!--ADD Modal -->
  26. <div class="modal fade" id="add" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  27.     <div class="modal-dialog">
  28.         <div class="modal-content">
  29.             <div class="modal-header">
  30.                 <h5 class="modal-title text-center" id="exampleModalLabel">Add Employee</h5>
  31.                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  32.                     <span aria-hidden="true">&times;</span>
  33.                 </button>
  34.             </div>
  35.             <form method="POST" action="" autocomplete="off">
  36.                 <div class="modal-body">
  37.  
  38.                     {% csrf_token %}
  39.  
  40.  
  41.                     <input type="text" class="form-control" placeholder="Enter Name" name="name">
  42.                     <br>
  43.                     <select class="form-control" id="exampleFormControlSelect1" name="designation">
  44.                         <option disabled="True"> Designation</option>
  45.                         {% for data in desigs %}
  46.                             <option> {{ data.desig }}</option>
  47.                         {% endfor %}
  48.                     </select>
  49.                     <br>
  50.                     <input type="number" class="form-control" placeholder="Salary" name="salary">
  51.                     <br>
  52.                     <input type="date" class="form-control" placeholder="Date" name="date">
  53.                     <br>
  54.                     <select class="form-control" id="exampleFormControlSelect1" name="branch">
  55.                         <option disabled="True"> Branch</option>
  56.                         {% for data in branches %}
  57.                             <option> {{ data.branch }}</option>
  58.                         {% endfor %}
  59.                     </select>
  60.  
  61.                     <br>
  62.                     <input type="text" class="form-control" placeholder="Username" name="username">
  63.                     <br>
  64.                     <input type="text" class="form-control" placeholder="Password" name="password">
  65.                     <br>
  66.                     <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  67.                     <button type="submit" class="btn btn-primary" name="Click">Submit</button>
  68.                 </div>
  69.                 <div class="modal-footer">
  70.  
  71.                 </div>
  72.             </form>
  73.         </div>
  74.     </div>
  75. </div>
  76.  
  77.  
  78. <!--EDIT Modal -->
  79. <div class="modal fade" id="edit" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  80.     <div class="modal-dialog">
  81.         <div class="modal-content">
  82.             <div class="modal-header">
  83.                 <h5 class="modal-title text-center" id="exampleModalLabel">Add Employee</h5>
  84.                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  85.                     <span aria-hidden="true">&times;</span>
  86.                 </button>
  87.             </div>
  88.             <form method="POST" action="" autocomplete="off">
  89.                 <div class="modal-body">
  90.  
  91.                     {% csrf_token %}
  92.  
  93.                     <input type="text" class="form-control"  name="name" value={{ name_edit }}>
  94.                     <br>
  95.  
  96.                 </div>
  97.                 <div class="modal-footer">
  98.  
  99.                 </div>
  100.             </form>
  101.         </div>
  102.     </div>
  103. </div>
  104.  
  105. <div class="container">
  106.     {% csrf_token %}
  107.     <div class="jumbotron">
  108.         <div class="card">
  109.             <div class="card-header text-center">
  110.                 Employees
  111.             </div>
  112.             <div class="card-body">
  113.                 <div class="row">
  114.                     <div class="col text-right">
  115.                         <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add">Add
  116.                         </button>
  117.                     </div>
  118.                 </div>
  119.                 <p class="card-text">Employees can be added here</p>
  120.                 <table class="table table-hover">
  121.                     <thead>
  122.                     <tr>
  123.                         <th scope="col">ID</th>
  124.                         <th scope="col">Name</th>
  125.                         <th scope="col">Designation</th>
  126.                         <th scope="col">Salary</th>
  127.                         <th scope="col">Date of Joining</th>
  128.                         <th scope="col">Username</th>
  129.                         <th scope="col">Branch</th>
  130.                         <th scope="col"></th>
  131.  
  132.                     </tr>
  133.                     </thead>
  134.                     <tbody>
  135.                     {% for data in table %}
  136.                         <tr>
  137.                             <td>{{ data.id }}</td>
  138.                             <td>{{ data.name }}</td>
  139.                             <td>{{ data.designation }}</td>
  140.                             <td>{{ data.salary }}</td>
  141.                             <td>{{ data.doj }}</td>
  142.                             <td>{{ data.username }}</td>
  143.                             <td>{{ data.branch_id }}</td>
  144.                             <td>
  145.                                 <a class="btn btn-primary" href="{% url 'employee_update' data.id %}" role="button">
  146.                                     <i class="far fa-edit"></i>
  147.  
  148.                                 </a>
  149.                                 {% with name_edit=data.id %}
  150.                                     <button type="button" class="btn btn-primary" data-toggle="modal"
  151.                                            data-target="#edit">Edit
  152.  
  153.                                     </button>
  154.  
  155.                                 {% endwith %}
  156.  
  157.                             </td>
  158.                         </tr>
  159.                     {% endfor %}
  160.  
  161.                     </tbody>
  162.                 </table>
  163.             </div>
  164.         </div>
  165.     </div>
  166. </div>
  167.  
  168.  
  169. <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
  170.        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
  171.        crossorigin="anonymous"></script>
  172. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
  173.        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
  174.        crossorigin="anonymous"></script>
  175. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
  176.        integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
  177.        crossorigin="anonymous"></script>
  178.  
  179. <script>
  180.     if (window.history.replaceState) {
  181.         window.history.replaceState(null, null, window.location.href);
  182.     }
  183. </script>
  184.  
  185. </body>
  186. </html>
Advertisement
Add Comment
Please, Sign In to add comment