<?php
$edit = $_SESSION['id_user'];
$q=mysqli_query($connect, "select * from users where ID ='$edit'") or die(mysqli_error($connect));
$b=mysqli_fetch_array($q);
?>
<div class="row clearfix">
  <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
    <div class="card">
      <div class="header">
        <h2>PROFILE</h2>
      </div>
      <div class="body">
        <form class="form_ajax">
        <input type="hidden" name="p" value="admin-login">
        <input type="hidden" name="t" value="update">
        <input type="hidden" name="token" value="<?php echo getToken();?>">
        <input type="hidden" name="id" value="<?php echo $b['ID'];?>">
          <div class="input-group">
            <label>Name</label>
            <div class="form-line">
              <input type="text" name="user_nama" class="form-control" required value="<?php echo $b['user_nama'];?>" readonly>
            </div>
          </div>
          <div class="input-group">
            <label>Email</label>
            <div class="form-line">
              <input type="email" disabled class="form-control" value="<?php echo $b['user_email'];?>" readonly>
            </div>
          </div>
		   <div class="form-group">
          	<label>No. HP</label>
            <div class="form-line">
            	<input type="tel" name="user_hp" class="form-control" required value="<?php echo $b['user_hp'];?>" readonly>
            </div>
          </div>
          <div class="input-group">
            <label>Password</label>
            <div class="form-line">
              <input type="password" id="password" name="password" minlength="6" placeholder="(Empty if don't change)" class="form-control" readonly>
            </div>
          </div>
		  <div class="input-group">
            <label>Confirm Password</label>
            <div class="form-line">
              <input type="password" name="password" equalTo="#password" placeholder="(Empty if don't change)" class="form-control" readonly>
            </div>
          </div>
          <div class="form-group">
            <label>Foto</label>
            <div class="form-line">
                <!--<input name="foto" id="inputFile99" accept="image/*" onChange="validateImage(this);" type="file"/ readonly>-->
                <?php if($b['user_foto']){?>
                <p align="center" id="img-view99" class="img-view" style="text-align:center;"><img src="<?php echo getConfig($connect, 'base_url');?>image.php?t=user&id=<?php echo $edit;?>" style="max-height:100px;" class="center">
                  <button type="button" class="btn bg-red waves-effect no-padding btn-xs" onClick="$('#img-view99').remove();$('#inputFile99').val('');"><i class="material-icons">delete</i></button>
                  <input type="hidden" name="old_img" value="1">
                </p>
                <?php } ?>
              </div>
          </div>
        <div class="form-group">
          <button type="submit" class="btn btn-sm bg-blue-grey waves-effect">Submit</button>
          <button type="reset" class="btn btn-sm bg-red waves-effect back">Cancel</button>
        <div class="preloader pl-size-xs pull-right" style="display:none;" id="loading">
            <div class="spinner-layer pl-deep-purple">
              <div class="circle-clipper left">
                <div class="circle"></div>
              </div>
              <div class="circle-clipper right">
                <div class="circle"></div>
              </div>
            </div>
          </div>
        </div>
      </form>
      </div>
    </div>
  </div>
</div>