<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 EXHIBITION </h4>
      </div>
      <div class="card-body">
        <form id="update_exhibition" class="form-material">
          <div class="form-body">
            <div class="row">
              <div class="col-md-12">
                <div class="form-group">
                  <label class="control-label"><strong>SELECT YEAR <span>*</span></strong></label>
                  <select name="year" id="year" class="form-control"   autocomplete="off" required="" >
                    <option value="">SELECT YEAR</option>
                    <?php foreach($years_master as $val){ ?>
                      <option value="<?php echo $val->year; ?>" <?php if($exhibitions[0]->year == $val->year){ echo 'selected'; } ?>><?php echo $val->year; ?></option>
                    <?php } ?>
                  </select>
                  <label for="year" class="error"></label> 
                </div>
              </div>
              
              <!--
              <div class="col-md-12">
                <div class="form-group">
                  <label class="control-label"><strong>SELECT EXHIBITION TYPE <span>*</span></strong></label>
                  <select name="isEexhibition" id="isEexhibition" class="form-control">
                    <option value="">SELECT EXHIBITION TYPE</option>
                      <option value="0" >EXHIBITION</option>
                      <option value="1">VIRTUAL EXHIBITION</option>
                  </select>
                  <label for="year" class="error"></label> 
                </div>
              </div>
                -->
                
              <div class="col-md-12">
                <div class="form-group">
                  <label class="control-label"><strong>EXHIBITION NAME <span>*</span></strong></label>
                  <input type="text" id="name" name="name" value="<?php echo $exhibitions[0]->name; ?>" class="form-control"   autocomplete="off" maxlength="255" required="" >
                  <label for="name" class="error"></label> 
                </div>
              </div>

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

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

              <div class="col-md-12">
                <div class="form-group">
                  <label class="control-label"><strong>VENUE <span>*</span></strong></label>
                  <input type="text" id="venue" name="venue" class="form-control"   autocomplete="off" maxlength="100" required=""  value="<?php echo $exhibitions[0]->venue; ?>">
                  <label for="venue" class="error"></label> 
                </div>
              </div>

              <div class="col-md-12">
                <div class="form-group">
                  <label class="control-label"><strong>UPLOAD IMAGE</strong></label>
                  <input type="file" name="image" id="image" class="form-control"   autocomplete="off" />
                  <label> Note : image size ( 250 x 180 pixels )</label>
                  <label for="image" 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 : 10 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().$exhibitions[0]->filepath_forpdf; ?>"><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>ADD LINK</strong></label>
                  <input type="text" id="url" name="url" value="<?php echo $exhibitions[0]->url; ?>" class="form-control"   autocomplete="off" maxlength="100" >
                  <label for="url" class="error"></label> 
                </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($exhibitions[0]->status == '1'){echo 'selected'; }?>>ACTIVE</option>
                    <option value="0" <?php if($exhibitions[0]->status == '0'){echo 'selected'; }?>>DEACTIVE</option>
                  </select>
                  <label for="status" class="error"></label> 
                </div>
              </div>
            </div>
          </div>
          
          <input type="hidden" id="id" name="id" value="<?php echo $exhibitions[0]->id; ?>">
          <input type="hidden" id="imgpath" name="imgpath" value="<?php echo $exhibitions[0]->filepath; ?>">

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