<div class="row">
  <div class="col-lg-12 mt-4">
    <div class="card">
      <div class="card-header form-card-header">
        <h4 class="m-b-0 text-light">UPDATE DESIGNATION</h4>
      </div>
      <?php if($designation !== "No Data"){ ?>
      <div class="card-body">
        <form id="update_designation" class="form-material">
          <div class="form-body">
            <div class="row">
              <div class="col-md-12">
                <div class="form-group">
                  <label class="control-label"><strong>DESIGNATION</strong></label>
                  <input type="text" id="name" name="name" class="form-control"  autocomplete="off" maxlength="100" required="" value="<?php echo $designation[0]->name; ?>">
                  <label for="name" class="error"></label> 
                </div>
              </div>

              <div class="col-md-4">
                <div class="form-group">
                  <label class="control-label"><strong>STATUS</strong></label>
                  <select class="form-control"  autocomplete="off" id="status" name="status">
                    <option value="1" <?php if($designation[0]->status == "1"){ echo 'selected'; } ?>>ACTIVE</option>
                    <option value="0" <?php if($designation[0]->status == "0"){ echo 'selected'; } ?>>DEACTIVE</option>
                  </select>  
                  <label for="status" class="error"></label> 
                </div>
              </div>
            </div>
          </div>

          <?php $_SESSION["token"] = md5(uniqid(mt_rand(), true)); ?>
          <input type="hidden" name="csrfToken" id="csrfreg" value="<?php echo $_SESSION["token"];?>">
          <input type="hidden" id="id" name="id" value="<?php echo $designation[0]->id; ?>">

          <div class="form-actions">
            <button type="submit" class="btn btn-rounded btn-outline-success col-md-3">SAVE</button>  
            <button type="button" class="btn btn-rounded btn-outline-danger col-md-3" onclick="window.location.href='<?php echo base_url(); ?>secretariat/designations'">CANCEL</button>  
          </div>
        </form>
      </div>
      <?php }else{ ?>
      <div class="card-body">
        <h3 class="card-title">RECORD NOT FOUND. </h3>
        <a href="<?php echo base_url(); ?>secretariat/designations" class="btn btn-danger">BACK TO LIST</a>
      </div>
      <?php } ?>
    </div>
  </div>
</div>