<div id="page-wrapper">
	<div class="main-page">
		<div class="forms">
			<div class=" form-grids row form-grids-right">
				<div class="widget-shadow " data-example-id="basic-forms"> 
					<div class="form-title">
						<h4>Data Pegawai</h4>
					</div>
				</div>
			</div>
		</div>
		<div class="tables">
			<div class="table-responsive bs-example widget-shadow">
				<div class="col-md-9">
					<a href="<?php echo base_url();?>Admin/downloadExcel" class="btn btn-md btn-primary">
						<i class="fa fa-download"></i> Download Data Pegawai
					</a>
				</div>
				<div class="col-md-3">
					<div class="dropdown">
						<button class="btn btn-success dropdown-toggle" type="button" data-toggle="dropdown">Tambah Pegawai <span class="caret"></span></button>
						<ul class="dropdown-menu">
							<li><a href="<?php echo base_url();?>Admin/pegawaiAdd">
								<i class="fa fa-file"></i> Menggunakan Form
							</a></li>
							<li><a href="<?php echo base_url();?>Admin/pegawaiAddExcel"> <i class="fa fa-table"></i> Menggunakan Excel</a></li>
						</ul>
					</div>
					<?php /**<a href="<?php echo base_url();?>anggota_dewasa/export_excel" class="btn btn-primary" style="margin-left:5px;">
						<i class="fa fa-table"></i> Export Excel
					</a>**/ ?>
				</div>
				<div class="clearfix"> </div>
				<br>
				<table class="table table-bordered" style="font-size:12px !important;" id="dataku">
					<thead>
						<tr>
							<th>No</th>
							<th>NIP/NPP</th>
							<th>Nama</th>
							<th>Unit Kerja</th>
							<th>Email</th>
							<th>Nomor Telepon</th>
							<th>Aksi</th>
						</tr>
					</thead>
					<tbody>
						<?php
							if($pegawai == NULL)
							{
								?>
								<tr>
									<td colspan="7"><center>Tidak ada data pegawai.</center></td>
								</tr>
								<?php
							}
							else
							{
								$no = 0;
								foreach($pegawai as $a)
								{
									$no++;
									?>
									<tr>
										<td><?php echo $no;?></td>
										<td><?php echo $a['no_pegawai'];?></td>
										<td><?php echo ($a['gelar_depan'] != NULL ? $a['gelar_depan']." " : "").$a['nama'].($a['gelar_belakang'] != NULL ? " ".$a['gelar_belakang'] : "");?></td>
										<td><?php echo $a['unit_kerja'];?></td>
										<td><?php echo $a['email'];?></td>
										<td><?php echo $a['nohp'];?></td>
										<td style="font-size:10px !important;">
											<a href="<?php echo base_url();?>Admin/personal/<?php echo $a['id_pegawai'];?>" class="btn btn-xs btn-info" title="Detail">
												<i class="fa fa-info-circle"></i>
											</a>
											<a href="<?php echo base_url();?>Admin/download/<?php echo $a['id_pegawai'];?>" class="btn btn-xs btn-primary" title="Download CV">
												<i class="fa fa-download"></i>
											</a>
											<a href="<?php echo base_url();?>Admin/resetPassword/<?php echo $a['id_pegawai'];?>" class="btn btn-xs btn-warning" title="Reset Password" onclick="return confirm('Apakah Anda ingin mereset password <?php echo ($a['gelar_depan'] != NULL ? $a['gelar_depan']." " : "").$a['nama'].($a['gelar_belakang'] != NULL ? " ".$a['gelar_belakang'] : "");?> ?');">
												<i class="fa fa-key"></i>
											</a>
											<a href="<?php echo base_url();?>Admin/pegawaiDelete/<?php echo $a['id_pegawai'];?>" class="btn btn-xs btn-danger" onclick="return confirm('Anda yakin akan menghapus pegawai ini?');" title="Hapus">
												<i class="fa fa-trash"></i>
											</a>
										</td>
									</tr>
									<?php
								}
							}
						?>
					</tbody> 
				</table>
			</div>
		</div>
	</div>
</div>