<?php $__env->startSection('body2'); ?>

<h3>Personal Update</h3>
<hr>

<div class="row">
  <div class="col-md-2 visible-md visible-lg">
    <img src="/img-system/profile.jpg">
  </div>
  <div class="col-md-6"> 
    <form class="form-horizontal" method="post">
      <?php if(Auth::user()->username==''): ?>
      <h5 class="center" style="color:#f0ad4e">Create New User ID &amp; Password for basic login. Leave blank if not necessary.</h5>
      <div class="form-group">
        <label class="col-md-4">User ID</label>
        <div class="col-md-8">
          <div class="input-group">
            <input type="text" class="form-control" id="username" name="username">
            <span class="input-group-addon"><span class="fa fa-question" id="availableIcon"></span></span>
          </div><!-- /input-group -->
        </div>
        <div class="col-lg-4"></div>
        <div class="col-lg-8">
          <span class="alert-success" id="availableMsg0" style="display:none"><h5>User ID is valid.</h5></span>
          <span class="alert-danger" id="availableMsg1" style="display:none"><h5>User ID is not valid.</h5></span>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Password</label>
        <div class="col-md-8">
          <input type="password" class="form-control" name="password">
        </div>
      </div>
      <hr>
      <?php endif; ?>
      <div class="form-group">
        <label class="col-md-4">Name</label>
        <div class="col-md-8">
          <input type="text" class="form-control" name="name" value="<?php echo Auth::user()->name; ?>">
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">No IC / Passport</label>
        <div class="col-md-8">
          <input type="text" class="form-control" name="no_ic" value="<?php echo Auth::user()->profile->no_ic; ?>" required>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Gender</label>
        <div class="col-md-8">
          <input type="radio" name="gender" value="Male" <?php echo (Auth::user()->profile->gender=='Male')?'checked':''; ?>  required> Male
          <input type="radio" name="gender" value="Female" <?php echo (Auth::user()->profile->gender=='Female')?'checked':''; ?>  required> Female
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Birthdate</label>
        <div class="col-md-8">
          <input type="date" class="form-control" name="birthdate" value="<?php echo Auth::user()->profile->birthdate; ?>" required>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Address</label>
        <div class="col-md-8">
          <textarea class="form-control" name="address" required><?php echo Auth::user()->profile->address; ?></textarea>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Home Phone No</label>
        <div class="col-md-8">
          <input type="text" class="form-control" name="homephone" value="<?php echo Auth::user()->profile->homephone; ?>">
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Office Phone No</label>
        <div class="col-md-8">
          <input type="text" class="form-control" name="officephone" value="<?php echo Auth::user()->profile->officephone; ?>">
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Handphone No</label>
        <div class="col-md-8">
          <input type="text" class="form-control" name="handphone" value="<?php echo Auth::user()->profile->handphone; ?>" required>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-4">Email</label>
        <div class="col-md-8">
          <input type="email" class="form-control" name="email" value="<?php echo Auth::user()->profile->email; ?>">
        </div>
      </div>
      <div class="form-group">
        <div class="col-md-offset-4 col-md-8"><button type="submit" class="btn btn-warning">Save Changes</button></div>
      </div>
    </form>
  </div>
  <div class="col-md-4">
   <!--div class="alert alert-warning">
    <center><b>Important Notice</b></center>
  </div-->
</div>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
<script src="/js/check-availability.js"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('status-message'); ?>

<?php if(Session::has('status') && Session::get('status') === true): ?>
<div class="alert msg">
  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  <strong>Personal Details Successful Update</strong>
</div>
<?php endif; ?>
<?php if(Session::has('status') && !Session::get('status') ): ?>
<div class="alert msg">
  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  <strong>ERROR! Try again</strong>
</div>
<?php endif; ?>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('/member/template', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>