<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 CIRCULARS</h4>
      </div>
      <div class="card-body">
        <form id="update_circulars" class="form-material">
          <div class="form-body">
            <div class="row">
              <div class="col-md-4">
                <div class="form-group">
                  <label class="control-label"><strong>CIRCULAR TYPE</strong></label>
                  <select name="type" id="type" class="form-control"   autocomplete="off"  >
                    <option value="">Select Type</option>
                    <option value="dgft" <?php if($circulars[0]->type == 'dgft'){ echo 'selected'; } ?> >DGFT</option>
                    <option value="rbi" <?php if($circulars[0]->type == 'rbi'){ echo 'selected'; } ?>>RBI</option>
                    <option value="fta" <?php if($circulars[0]->type == 'fta'){ echo 'selected'; } ?>>FTA</option>
                    <option value="customs" <?php if($circulars[0]->type == 'customs'){ echo 'selected'; } ?>>CUSTOMS</option>
                    <option value="gst" <?php if($circulars[0]->type == 'gst'){ echo 'selected'; } ?>>GST</option>
                  </select>
                  <label for="type" class="error"></label> 
                </div>
              </div>

              <div class="col-md-4">
                <div class="form-group">
                  <label class="control-label"><strong>POST DATE </strong></label>
                  <input type="text" id="post_date" name="post_date" class="form-control"   autocomplete="off" maxlength="100"  value="<?php if($circulars[0]->post_date !== ""){ echo date("d-m-Y",strtotime($circulars[0]->post_date));} ?>">
                  <label for="post_date" class="error"></label> 
                </div>
              </div>

              <div class="col-md-4">
                <div class="form-group">
                  <label class="control-label"><strong>LAST DATE </strong></label>
                  <input type="text" id="last_date" name="last_date" class="form-control"   autocomplete="off" maxlength="100"  value="<?php if($circulars[0]->last_date !== ""){ echo date("d-m-Y",strtotime($circulars[0]->last_date));} ?>">
                  <label for="last_date" class="error"></label> 
                </div>
              </div>

              <div class="col-md-12">
                <div class="form-group">
                  <label class="control-label"><strong>CIRCULAR NAME <span>*</span></strong></label>
                  <input type="text" id="title" name="title" class="form-control"   autocomplete="off" maxlength="255"  value="<?php echo $circulars[0]->name; ?>">
                  <label for="title" class="error"></label> 
                </div>
              </div>

              <div class="col-md-6">
                <div class="form-group">
                  <label class="control-label"><strong>UPLOAD FILE <span>*</span></strong></label>
                  <input type="file" id="pdf" name="pdf" class="form-control"   autocomplete="off"  >
                  <label> Max file size : 5 mb allowed. </label>
                  <label for="pdf" class="error"></label> 
                </div>
              </div>

              <div class="col-md-3 offset-3">
                <div class="form-group">
                  <a class="btn btn-block btn-info" target="_blank" href="<?php echo base_url().$circulars[0]->filepath; ?>"><i class="fa fa-file-pdf-o" aria-hidden="true">  VIEW FILE</i></a>
                </div>
              </div>

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

          <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(); ?>circulars/list'">CANCEL</button>  
          </div>
        </form>
      </div>
    </div>
  </div>
</div>