<?php
$u = $user->listuser();
?>
<div class="page-content">
	<div class="row">
		<div class="col-xs-12">
			<div class="row">
				<div class="col-xs-12">
					<h3 class="header smaller lighter blue">Data User</h3>
					<div class="clearfix">
						<a href="#modal-form" role="button" class="blue" data-toggle="modal">
							<button class="btn btn-white btn-info btn-bold">
								<i class="ace-icon fa fa-plus bigger-120 blue"></i>
								Tambah
							</button>
						</a>
						<div class="pull-right tableTools-container"></div>
					</div>
					<div>
						<table id="dynamic-table" class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>username</th>
									<th>Nama</th>
									<th>nip</th>
									<th>Status</th>
									<th></th>
								</tr>
							</thead>
							<tbody>
								<?php
									while($i<count($u)){
								?>
										<tr>
											<td><?php echo"".$u[$i][username].""; ?></td>
											<td><?php echo"".$u[$i][nama].""; ?></td>
											<td><?php echo"".$u[$i][nip].""; ?></td>
											<td>
												<?php if($u[$i][blokir]=='Y'){ ?>
													<span class="label label-sm label-danger">Tidak Aktif</span>
												<?php }else{ ?>
													<span class="label label-sm label-success">Aktif</span>
												<?php } ?>
											</td>
											<td>
												<div class="hidden-sm hidden-xs action-buttons">
													<a class="green" href="index.php?module=petugas&act=edit&id=<?php echo"".$u[$i][id_user].""; ?>">
														<i class="ace-icon fa fa-pencil bigger-130"></i>
													</a>
													<a class="red" href="#">
														<i class="ace-icon fa fa-trash-o bigger-130"></i>
													</a>
												</div>
											</td>
										</tr>
								<?php
	                                   	$i++;
	                             	}
                                   	unset($i);
                             	?>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div><!-- /.col -->
	</div><!-- /.row -->
	<div id="modal-form" class="modal" tabindex="-1">
		<div class="modal-dialog">
			<form class="form-horizontal" role="form" action="view/view/modul/mod_petugas/aksi_petugas.php?aksi=tambah" method="post" >
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">&times;</button>
						<h4 class="blue bigger">Tambah User</h4>
					</div>
					<div class="modal-body">
						<div class="row">
							<div class="col-xs-12 col-sm-12">
									<div class="form-group">
										<label> Username </label>
										<div>
											<input type="text" id="form-field-1" class="form-control" placeholder="Username" name="username" />
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label> Password </label>
										<div>
											<input type="text" id="form-field-1" placeholder="Password" class="form-control" name="password" />
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label> Ulangi Password </label>
										<div>
											<input type="text" id="form-field-1" placeholder="Ulangi Password" class="form-control" name="rpassword" />
										</div>
									</div>

									<div class="space-4"></div>	

									<div class="form-group">
										<label> Nama </label>
										<div>
											<input type="text" id="form-field-1" placeholder="Nama" class="form-control" name="nama" />
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label> NIP </label>
										<div>
											<input type="text" id="form-field-1" placeholder="NIP" class="form-control" name="nip" />
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label> Email </label>
										<div>
											<input type="text" id="form-field-1" placeholder="Email" class="form-control" name="email" />
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label> Alamat </label>
										<div>
											<input type="text" id="form-field-1" placeholder="Alamat" class="form-control" name="alamat" />
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label> Telepon </label>
										<div>
											<input type="text" id="form-field-1" placeholder="Telepon" class="form-control" name="tlp" />
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label> Level </label>
										<div>
											<select id="form-field-1" class="form-control" name="level">
												<?php
													$l = $level->listlevel();
													while($i<count($l)){
														?>
															<option value="<?php echo $l[$i][id_level]; ?>"><?php echo $l[$i][level]; ?></option>
														<?php
														$i++;
													}
													unset($i);	
												?>
					                        </select>
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label> Blokir </label>
										<div>
											<select id="form-field-1" class="form-control" name="blokir">
					                            <option value=""></option>
					                            <option value="N">Aktif</option>
					                            <option value="Y">Blokir</option>
					                        </select>
										</div>
									</div>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button class="btn btn-sm" data-dismiss="modal">
						<i class="ace-icon fa fa-times"></i>
						Cancel
					</button>
					<button type="submit" class="btn btn-sm btn-primary">
						<i class="ace-icon fa fa-check"></i>
						Save
					</button>
				</div>
			</form>	
		</div>
	</div>
</div><!-- PAGE CONTENT ENDS -->
</div><!-- /.page-content -->