Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- {% load static %}
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <!-- Bootstrap CSS -->
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
- integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
- <title>Employees</title>
- </head>
- <body>
- <nav class="navbar justify-content-center navbar-dark bg-dark">
- <a class="navbar-brand" href="all_employees">Show All Employee</a>
- <a class="navbar-brand" href="sale_status">Sales Status</a>
- <a class="navbar-brand" href="">My Profile</a>
- <a class="navbar-brand" href="logout">Log Out</a>
- </nav>
- <!--ADD Modal -->
- <div class="modal fade" id="add" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title text-center" id="exampleModalLabel">Add Employee</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <form method="POST" action="" autocomplete="off">
- <div class="modal-body">
- {% csrf_token %}
- <input type="text" class="form-control" placeholder="Enter Name" name="name">
- <br>
- <select class="form-control" id="exampleFormControlSelect1" name="designation">
- <option disabled="True"> Designation</option>
- {% for data in desigs %}
- <option> {{ data.desig }}</option>
- {% endfor %}
- </select>
- <br>
- <input type="number" class="form-control" placeholder="Salary" name="salary">
- <br>
- <input type="date" class="form-control" placeholder="Date" name="date">
- <br>
- <select class="form-control" id="exampleFormControlSelect1" name="branch">
- <option disabled="True"> Branch</option>
- {% for data in branches %}
- <option> {{ data.branch }}</option>
- {% endfor %}
- </select>
- <br>
- <input type="text" class="form-control" placeholder="Username" name="username">
- <br>
- <input type="text" class="form-control" placeholder="Password" name="password">
- <br>
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
- <button type="submit" class="btn btn-primary" name="Click">Submit</button>
- </div>
- <div class="modal-footer">
- </div>
- </form>
- </div>
- </div>
- </div>
- <!--EDIT Modal -->
- <div class="modal fade" id="edit" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title text-center" id="exampleModalLabel">Add Employee</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <form method="POST" action="" autocomplete="off">
- <div class="modal-body">
- {% csrf_token %}
- <input type="text" class="form-control" name="name" value={{ name_edit }}>
- <br>
- </div>
- <div class="modal-footer">
- </div>
- </form>
- </div>
- </div>
- </div>
- <div class="container">
- {% csrf_token %}
- <div class="jumbotron">
- <div class="card">
- <div class="card-header text-center">
- Employees
- </div>
- <div class="card-body">
- <div class="row">
- <div class="col text-right">
- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add">Add
- </button>
- </div>
- </div>
- <p class="card-text">Employees can be added here</p>
- <table class="table table-hover">
- <thead>
- <tr>
- <th scope="col">ID</th>
- <th scope="col">Name</th>
- <th scope="col">Designation</th>
- <th scope="col">Salary</th>
- <th scope="col">Date of Joining</th>
- <th scope="col">Username</th>
- <th scope="col">Branch</th>
- <th scope="col"></th>
- </tr>
- </thead>
- <tbody>
- {% for data in table %}
- <tr>
- <td>{{ data.id }}</td>
- <td>{{ data.name }}</td>
- <td>{{ data.designation }}</td>
- <td>{{ data.salary }}</td>
- <td>{{ data.doj }}</td>
- <td>{{ data.username }}</td>
- <td>{{ data.branch_id }}</td>
- <td>
- <a class="btn btn-primary" href="{% url 'employee_update' data.id %}" role="button">
- <i class="far fa-edit"></i>
- </a>
- {% with name_edit=data.id %}
- <button type="button" class="btn btn-primary" data-toggle="modal"
- data-target="#edit">Edit
- </button>
- {% endwith %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
- integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
- crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
- integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
- crossorigin="anonymous"></script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
- integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
- crossorigin="anonymous"></script>
- <script>
- if (window.history.replaceState) {
- window.history.replaceState(null, null, window.location.href);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment