{% extends "layouts/base.html" %}

{% block title %} {{ judul }} {% endblock %} 

<!-- Specific Page CSS goes HERE  -->
{% block stylesheets %}{% endblock stylesheets %}


{% block content %}
<div class="content">
    <div class="page-inner">
			<div class="row">

				<div class="col-md-12">
					<div class="card">
						<div class="card-header">
							<h4 class="card-title">Daftar Pegawai</h4>
						</div>
						<div class="card-body">
							<div class="table-responsive">
								<table id="basic-datatables" class="display table table-striped table-hover" >
									<thead>
										<tr>
											<th scope="col">Nama Pegawai</th>
											<th scope="col">NIP</th>
											<th scope="col">Pangkat/Gol.</th>
											<th scope="col">Jabatan</th>
											<th scope="col">Unit</th>

											{% if user.is_staff %}
											<th scope="col">Lantai</th>
											<th scope="col">Telpon</th>
											{% endif%}
										</tr>
									</thead>
									<tfoot>
										<tr>
											<th scope="col">Nama Pegawai</th>
											<th scope="col">NIP</th>
											<th scope="col">Pangkat/Gol.</th>
											<th scope="col">Jabatan</th>
											<th scope="col">Unit</th>

											{% if user.is_staff %}
											<th scope="col">Lantai</th>
											<th scope="col">Telpon</th>
											{% endif%}
										</tr>
									</tfoot>
									<tbody>
                                        {% for p in pegawai %}
                                            <p></p>
                                            <tr>
                                                <td><small>{{ p.nama | title }}</small></td>
                                                <td><small>{{ p.nip }}</small></td>
                                                <td><small>{{ p.pangkatgolongan}}</small></td>
                                                <td><small>{{ p.namajabatan | title }}</small></td>
                                                <td><small>{{ p.esl4 | title }}, {{ p.esl3 | title }}</small></td>

												{% if user.is_staff %}
													<td><a href="/createnewuser/{{ p.nip }}">Create</a></td>
													<td>
													</td>
												{% endif %}
                                            </tr>
                                        {% endfor %} 
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>

			</div>            
    </div>
</div>
{% endblock content %}

<!-- Specific Page JS goes HERE  -->
{% block javascripts %}

	<script >
		$(document).ready(function() {
			$('#basic-datatables').DataTable({});
		});
	</script>



{% endblock javascripts %}


