
<div class="row">
	<div class="col-md-12">
        <?php
            
            if (isset($key)) {
        ?>
		
		<div class="card card-rounded card-abu">
		    <div class="card-header">
		    	<h4 class="card-title" id="heading-labels">		    		
				    <i class="fa fa-user-o"></i> Data Akun <?= $key->nama ?>
		    		<div class="row form-detail-karyawan">		
						<div class="col-md-8">&nbsp;</div>
						<?php
				            if (in_array($this->session->userdata('level_user'), array("1"))) {
				         ?>
						<div class="col-md-2">
		    				<a href="#" class="btn btn_edit_akun btn-outline-secondary round" id="<?= md5($key->id_user) ?>"> <i id="<?= md5($key->id_user) ?>" class="fa fa-pencil"></i> Edit Data</a>
				    		</a>
				    	</div>
				    	<div class="col-md-2">
				    		<a href="#" class="btn btn_delete_akun btn-outline-secondary round" id="<?= md5($key->id_user) ?>"> <i id="<?= md5($key->id_user) ?>" class="fa fa-trash"></i> Hapus Data</a>
						</div>
						<?php }?>
					</div>
		      	</h4>
		    </div>
		    <div class="card-body">
		    	<div class="row form-detail-karyawan">		
					<div class="col-md-12">
						<fieldset class="form-group">
							<label>
							     Username
							</label>
							<p class="form-control-static" >
								<?= isset($key->username) ? $key->username : "-" ?>
							</p>
						</fieldset>
					</div>		
					<div class="col-md-6">
						<fieldset class="form-group">
							<label>
								Lock IMEI
							</label>
							<p class="form-control-static" >
								<?= isset($key->devide_id) ? $key->devide_id : "-" ?>
							</p>
						</fieldset>
					</div>				
					<div class="col-md-6">
						<fieldset class="form-group">
							<label>
								Token
							</label>
							<p class="form-control-static" >
								<?= isset($key->token) ? $key->token : "-" ?>
							</p>
						</fieldset>
					</div>	
                    <div class="col-md-6">
                        <fieldset class="form-group">
                            <label>
                                Lock Area
                            </label>
                            <p class="form-control-static" >
                                <?php
                                    if ($key->lock_area != 0) {
                                        foreach ($area as $key => $value) {
                                            echo $value->nama_kantor.'<br>';
                                        }
                                    }else{
                                        echo "Semua Kantor";
                                    }
                                ?>
                            </p>
                        </fieldset>
                    </div>  					
				</div>
		    </div>
		</div>
		<?php } else{ ?>
           <!--  <div class="text-right">
                <button type="button" class="btn btn_tambah_akun btn-biru btn-min-width mb-1" id="tambah_akun">
                    <i class="fa fa-plus"></i> Tambah Akun
                </button>
            </div> -->
        <?php
            }
        ?>
	</div>

</div>              


