<div class="content-wrapper">
 <section class="content-header">
  <h1>
    <?= $page_title ?>
    <small><?= $page_desc ?></small>
  </h1>
  <ol class="breadcrumb">
   <li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
   <li><?= $menu ?></li>
   <li class="active"><?= $sub_menu ?></li>
 </ol>
</section>
<section class="content">
  <div class="row">
     <div class="col-md-12">
      <?php if($this->session->flashdata('message')) { 
        $flashdata = $this->session->flashdata('message'); ?>
        <div class="alert alert-<?= $flashdata['class'] ?>">
         <button class="close" data-dismiss="alert" type="button">×</button>
         <?= $flashdata['message'] ?>
       </div>
     <?php } ?>
   </div>
 </div>
   <div class="box box-warning">
     <div class="box-header with-border">
       <h3 class="box-title">Offer Details</h3>
     </div>
      <form role="form" action="<?=base_url('Company/addOffer')?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
        <div class="box-body">
          <div class="col-md-12">
            <div class="col-md-6">
              <div class="form-group has-feedback">
                <label for="exampleInputEmail1">Company</label>
                <select name="company_id" class="form-control required" data-parsley-trigger="change" required>
                  <option selected disabled>Select Company</option>
                  <?php 
                    if(!empty($company_data)){
                      foreach ($company_data as $company) {
                        echo '<option value="'.$company->company_id.'">'.$company->company_name.'</option>';
                      } 
                    }
                  ?>
                </select> 
              </div> 
            </div>
            <div class="col-md-6">
              <div class="form-group has-feedback">
                <label for="exampleInputEmail1">Offer Applicable For</label>
                <select name="applicable_on" class="form-control required" data-parsley-trigger="change" required>
                  <option selected value="0">All Transactions</option>
                  <option value="1">Booking Charges</option>
                  <option value="2">SMS Charges</option>
                  <option value="3">Report Generation Charges</option>
                  <option value="4">Push Notification Charges</option>
                </select> 
              </div> 
            </div>
          </div>
          <div class="col-md-12">
            <div class="col-md-6">
              <div class="form-group has-feedback">
                <label>Offer Activation Date</label>
                <div class="input-group date" data-provide="datepicker">
                  <input id="datepicker" type="text" class="form-control required" data-parsley-trigger="change" data-parsley-minlength="2" required="" name="activation_date" placeholder="Pick Appointment Date" autocomplete="off">
                  <div class="input-group-addon">
                    <i class="fa fa-calendar"></i>
                  </div>
                </div>
              </div>
            </div> 
            <div class="col-md-6">
              <div class="form-group has-feedback">
                <label>Offer Expiry Date</label>
                <div class="input-group date" data-provide="datepicker">
                  <input id="datepicker" type="text" class="form-control required" data-parsley-trigger="change" data-parsley-minlength="2" required="" name="expiry_date" placeholder="Pick Appointment Date" autocomplete="off">
                  <div class="input-group-addon">
                    <i class="fa fa-calendar"></i>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-md-12">
            <div class="col-md-6" style="margin-bottom:27px;">
              <div class="form-group has-feedback">
                <label for="exampleInputEmail1">Offer Type</label>
                  <div class="col-md-12">
                    <div class="col-md-4">
                      <input type="radio" name="offer_type" value="1" class="required" required checked>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free Trial
                    </div>
                    <div class="col-md-8">
                      <input type="radio" name="offer_type" value="2" class="required" required >
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Discount
                    </div>
                  </div>
                </div>
              </div>
            <div class="col-md-6" id="input_discount">
              <!-- Discount Text Box -->
            </div>
          </div>
          <div class="col-md-12">          
            <div class="box-footer" style="text-align:center;">
              <button type="submit" class="btn btn-primary">Submit</button>
            </div>        
          </div>
        </form>
      </div>
    </section>
  </div>

<div id="discount_input_html" class="hide">
  <div class="form-group has-feedback" >
    <label>Discount</label>
    <input type="text" class="form-control required" data-parsley-trigger="change"  
    data-parsley-minlength="1"  data-parsley-pattern="^[0-9]+$" required="" name="discount"  placeholder="Discount Per Booking">
    <span class="glyphicon  form-control-feedback"></span>
  </div>
</div>