<div class="row">
  <div class="col-md-9">

    <div class="form-group" style="margin-top:30px">
      <label class="col-sm-3 control-label" for="entry-status"><?php echo $entry_status; ?></label>
      <div class="col-sm-9">
        <select id="entry-status" name="<?php echo $module['setting_key']; ?>[status]" class="form-control isl-w-m">
          <option value="1" <?php echo $setting['status'] == '1' ? 'selected' : ''; ?>><?php echo $text_enabled; ?></option>
          <option value="0" <?php echo $setting['status'] != '1' ? 'selected' : ''; ?>><?php echo $text_disabled; ?></option>
        </select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label"><?php echo $entry_publish_date; ?></label>
      <div class="col-sm-9">

        <div class="isl-inline-block isl-w-m">
          <div class="input-group datepicker">
            <input type="text" name="<?php echo $module['setting_key']; ?>[date_start]" value="<?php echo date('Y-m-d', strtotime($setting['date_start'])); ?>" data-date-format="YYYY-MM-DD" class="form-control" data-toggle="tooltip" title="Start date">
            <span class="input-group-btn">
              <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
            </span>
          </div>
        </div>

        <div class=" isl-inline-block isl-w-m isl-ml-5">
          <div class="input-group datepicker">
            <input type="text" id="date-end" name="<?php echo $module['setting_key']; ?>[date_end]" value="<?php echo $setting['date_end'] ? date('Y-m-d', strtotime($setting['date_end'])) : ''; ?>" data-date-format="YYYY-MM-DD" class="form-control"  data-toggle="tooltip" title="End date">
            <a onclick="$('#date-end').val('')" class="pointer text-muted" data-toggle="tooltip" title="Clear date end" style="position:absolute;right:-15px;top:.5em;"><i class="fa fa-close"></i></a>
            <span class="input-group-btn">
              <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
            </span>
          </div>
        </div>

      </div>
    </div>

  </div>
  <div class="col-md-3">

    <div class="panel panel-default panel-info">
      <div class="panel-heading"><?php echo $text_information; ?></div>

      <div class="panel-body">
        <ul class="isl-list">
          <?php foreach ($text_info_setting as $info) { ?>
            <li><?php echo $info ?></li>
          <?php } ?>
        </ul>
      </div>

    </div>

  </div>
</div>

<h3 class="isl-legend"><?php echo $text_discount; ?></h3>
<hr class="isl-hr">

<div class="row">
  <div class="col-md-9">

    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-code-prefix"><?php echo $entry_code_prefix; ?></label>
      <div class="col-sm-9">
        <input type="text" id="entry-code-prefix" name="<?php echo $module['setting_key']; ?>[discount][code_prefix]" value="<?php echo $setting['discount']['code_prefix']; ?>" class="form-control isl-w-s">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-discount"><?php echo $entry_discount_off; ?></label>
      <div class="col-sm-9">
        <input type="number" min="1" id="entry-discount" name="<?php echo $module['setting_key']; ?>[discount][discount]" value="<?php echo $setting['discount']['discount']; ?>" class="form-control isl-inline-block isl-w-s">

        <select name="<?php echo $module['setting_key']; ?>[discount][type]" class="form-control isl-inline-block isl-w-m isl-mh-5">
          <option value="P" <?php echo $setting['discount']['type'] == 'P' ? 'selected' : ''; ?>><?php echo $text_percentage; ?></option>
          <option value="F" <?php echo $setting['discount']['type'] == 'F' ? 'selected' : ''; ?>><?php echo $text_fixed; ?></option>
        </select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-delay"><?php echo $entry_delay; ?></label>
      <div class="col-sm-9">
        <input type="number" min="0" id="entry-delay" name="<?php echo $module['setting_key']; ?>[discount][delay]" value="<?php echo $setting['discount']['delay']; ?>" class="form-control isl-inline-block isl-w-s isl-mr-5"> second
        <i class="fa fa-question-circle text-primary isl-ml-5" data-toggle="tooltip" title="Delay time before popup show and discount code activate."></i>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-duration"><?php echo $entry_duration; ?></label>
      <div class="col-sm-9">
        <input type="number" min="1" id="entry-duration" name="<?php echo $module['setting_key']; ?>[discount][duration]" value="<?php echo $setting['discount']['duration']; ?>" class="form-control isl-inline-block isl-w-s isl-mr-5"> minute
        <i class="fa fa-question-circle text-primary isl-ml-5" data-toggle="tooltip" title="Duration of the discount code remain active."></i>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-repeat"><?php echo $entry_repeat; ?></label>
      <div class="col-sm-9">
        <input type="number" min="0" id="entry-repeat" name="<?php echo $module['setting_key']; ?>[discount][repeat]" value="<?php echo $setting['discount']['repeat']; ?>" class="form-control isl-inline-block isl-w-s isl-mr-5"> minute
        <i class="fa fa-question-circle text-primary isl-ml-5" data-toggle="tooltip" title="Generate another discount code x minutes after last active duration end."></i>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-discount"><?php echo $entry_validation; ?></label>
      <div class="col-sm-9">

        <div class="checkbox">
          <label>
            <input type="checkbox" name="<?php echo $module['setting_key']; ?>[discount][total_check]" value="1" <?php echo $setting['discount']['total_check'] ? 'checked' : ''; ?>>
            <?php echo $entry_cart_value; ?> <input type="number" min="0" name="<?php echo $module['setting_key']; ?>[discount][total]" value="<?php echo $setting['discount']['total']; ?>" min="0" class="form-control input-sm isl-inline-block isl-w-s isl-mh-5">
            <i class="fa fa-question-circle text-primary isl-ml-5" data-toggle="tooltip" title="The cart total amount that must be reached before the discount is valid."></i>
          </label>
        </div>
        <div class="checkbox isl-pt-10">
          <label>
            <input type="checkbox" name="<?php echo $module['setting_key']; ?>[discount][logged]" value="1" <?php echo $setting['discount']['logged'] ? 'checked' : ''; ?>>
            <?php echo $entry_login_to_use; ?>
          </label>
        </div>
        <div class="checkbox isl-pt-10">
          <label>
            <input type="checkbox" name="<?php echo $module['setting_key']; ?>[discount][shipping]" value="1" <?php echo $setting['discount']['shipping'] ? 'checked' : ''; ?>>
            <?php echo $entry_free_shipping; ?>
          </label>
        </div>
        <div class="checkbox isl-pt-10">
          <label>
            <input type="checkbox" name="<?php echo $module['setting_key']; ?>[discount][product_check]" value="1" <?php echo $setting['discount']['product_check'] ? 'checked' : ''; ?> data-isl-toggle>
            <?php echo $entry_specific_product; ?>
          </label>

          <div class="isl-toggle isl-w-l">
            <input type="text" placeholder="<?php echo $text_name_product; ?>" data-isl-autocomplete='{"type":"product", "target":"isl-autocomplete-a", "name":"<?php echo $module['setting_key']; ?>[discount][coupon_product][]"}' class="form-control input-sm">
            <div class="well well-sm isl-well isl-autocomplete-a">
              <?php foreach ($coupon_product_data as $product) { ?>
                <div class="isl-autocomplete-a<?php echo $product['product_id']; ?>">
                  <i class="fa fa-minus-circle pointer"></i> <?php echo $product['name']; ?>
                  <input type="hidden" name="<?php echo $module['setting_key']; ?>[discount][coupon_product][]" value="<?php echo $product['product_id']; ?>">
                </div>
              <?php } ?>
            </div>
          </div>
        </div>
        <div class="checkbox isl-pt-10">
          <label>
            <input type="checkbox" name="<?php echo $module['setting_key']; ?>[discount][category_check]" value="1" <?php echo $setting['discount']['category_check'] ? 'checked' : ''; ?> data-isl-toggle>
            <?php echo $entry_category_product; ?>
          </label>

          <div class="isl-toggle isl-w-l">
            <input type="text" placeholder="<?php echo $text_name_category; ?>" data-isl-autocomplete='{"type":"category", "target":"isl-autocomplete-b", "name":"<?php echo $module['setting_key']; ?>[discount][coupon_category][]"}' class="form-control input-sm">
            <div class="well well-sm isl-well isl-autocomplete-b">
              <?php foreach ($coupon_category_data as $category) { ?>
                <div class="isl-autocomplete-b<?php echo $category['category_id']; ?>">
                  <i class="fa fa-minus-circle pointer"></i> <?php echo $category['name']; ?>
                  <input type="hidden" name="<?php echo $module['setting_key']; ?>[discount][coupon_category][]" value="<?php echo $category['category_id']; ?>">
                </div>
              <?php } ?>
            </div>
          </div>
        </div>
        <div class="checkbox isl-pt-10">
          <label>
            <input type="checkbox" name="<?php echo $module['setting_key']; ?>[discount][manufacturer_check]" value="1" <?php echo $setting['discount']['manufacturer_check'] ? 'checked' : ''; ?> data-isl-toggle>
            <?php echo $entry_manufacturer_product; ?>
          </label>

          <div class="isl-toggle isl-w-l">
            <input type="text" placeholder="<?php echo $text_name_manufacturer; ?>" data-isl-autocomplete='{"type":"manufacturer", "target":"isl-autocomplete-c", "name":"<?php echo $module['setting_key']; ?>[discount][coupon_manufacturer][]"}' class="form-control input-sm">
            <div class="well well-sm isl-well isl-autocomplete-c">
              <?php foreach ($coupon_manufacturer_data as $manufacturer) { ?>
                <div class="isl-autocomplete-c<?php echo $manufacturer['manufacturer_id']; ?>">
                  <i class="fa fa-minus-circle pointer"></i> <?php echo $manufacturer['name']; ?>
                  <input type="hidden" name="<?php echo $module['setting_key']; ?>[discount][coupon_manufacturer][]" value="<?php echo $manufacturer['manufacturer_id']; ?>">
                </div>
              <?php } ?>
            </div>
          </div>
        </div>

      </div>
    </div>

  </div>
  <div class="col-md-3">

    <div class="panel panel-default panel-info">
      <div class="panel-heading"><?php echo $text_information; ?></div>

      <div class="panel-body">
        <ul class="isl-list">
          <?php foreach ($text_info_setting_discount as $info) { ?>
            <li><?php echo $info ?></li>
          <?php } ?>
        </ul>
      </div>

    </div>

  </div>
</div>

<h3 class="isl-legend"><?php echo $text_modal_popup; ?></h3>
<hr class="isl-hr">

<div class="row">
  <div class="col-md-9">

    <div class="form-group">
      <div class="col-sm-3">
        <label class="control-label isl-block"><?php echo $entry_message; ?></label>
      </div>
      <div class="col-sm-9">
        <ul class="nav nav-tabs langTabs">
          <?php foreach ($languages as $lang) { ?>
            <li><a href="#design_modal_message_<?php echo $lang['language_id']; ?>" data-toggle="tab"><img src="<?php echo $lang['flag_url']; ?>"> <?php echo $lang['name']; ?></a></li>
          <?php } ?>
        </ul>

        <div class="tab-content">
          <?php foreach ($languages as $lang) { ?>
            <div id="design_modal_message_<?php echo $lang['language_id']; ?>" class="tab-pane fade">
              <textarea name="<?php echo $module['setting_key']; ?>[modal][message][<?php echo $lang['language_id']; ?>]" class="form-control" data-isl-summernote='350'>
<?php echo !empty($setting['modal']['message'][$lang['language_id']]) ? $setting['modal']['message'][$lang['language_id']] : $setting['modal']['message'][0]; ?>
              </textarea>
            </div>
          <?php } ?>
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-modal-design"><?php echo $entry_design; ?></label>
      <div class="col-sm-9">
        <div class="">
          <div class="isl-w-m isl-inline-block">
            <?php echo $entry_border_size; ?>
          </div>
          <input type="number" id="entry-modal-design" name="<?php echo $module['setting_key']; ?>[modal][border_size]" value="<?php echo $setting['modal']['border_size']; ?>" class="form-control isl-w-xs isl-inline-block">
        </div>
        <div class="isl-pt-10">
          <div class="isl-w-m isl-inline-block">
            <?php echo $entry_border_color; ?>
          </div>
          <input type="text" name="<?php echo $module['setting_key']; ?>[modal][border_color]" value="<?php echo $setting['modal']['border_color']; ?>" class="form-control isl-w-m isl-inline-block minicolors">
        </div>
        <div class="isl-pt-10">
          <div class="isl-w-m isl-inline-block">
            <?php echo $entry_background; ?>
          </div>
          <input type="text" name="<?php echo $module['setting_key']; ?>[modal][background]" value="<?php echo $setting['modal']['background']; ?>" class="form-control isl-w-m isl-inline-block minicolors">
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-css"><?php echo $entry_custom_css; ?></label>
      <div class="col-sm-9">
        <textarea class="form-control" name="<?php echo $module['setting_key']; ?>[modal][custom_css]" id="entry-css" rows="8"><?php echo $setting['modal']['custom_css']; ?></textarea>
      </div>
    </div>

  </div>
  <div class="col-md-3">

    <div class="panel panel-default panel-info">
      <div class="panel-heading"><?php echo $text_information; ?></div>

      <div class="panel-body">
        <ul class="isl-list">
          <?php foreach ($text_info_setting_modal as $info) { ?>
            <li><?php echo $info ?></li>
          <?php } ?>
        </ul>
      </div>

    </div>

  </div>
</div>

<h3 class="isl-legend"><?php echo $text_mini_popup; ?></h3>
<hr class="isl-hr">

<div class="row">
  <div class="col-md-9">

    <div class="form-group">
      <div class="col-sm-3">
        <label class="control-label isl-block"><?php echo $entry_message; ?></label>
      </div>
      <div class="col-sm-9">
        <ul class="nav nav-tabs langTabs">
          <?php foreach ($languages as $lang) { ?>
            <li><a href="#design_popup_message_<?php echo $lang['language_id']; ?>" data-toggle="tab"><img src="<?php echo $lang['flag_url']; ?>"> <?php echo $lang['name']; ?></a></li>
          <?php } ?>
        </ul>

        <div class="tab-content">
          <?php foreach ($languages as $lang) { ?>
            <div id="design_popup_message_<?php echo $lang['language_id']; ?>" class="tab-pane fade">
              <textarea name="<?php echo $module['setting_key']; ?>[popup][message][<?php echo $lang['language_id']; ?>]" class="form-control" data-isl-summernote='200'>
<?php echo !empty($setting['popup']['message'][$lang['language_id']]) ? $setting['popup']['message'][$lang['language_id']] : $setting['popup']['message'][0]; ?>
              </textarea>
            </div>
          <?php } ?>
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-popup-position"><?php echo $entry_position; ?></label>
      <div class="col-sm-9">
        <select id="entry-popup-position" name="<?php echo $module['setting_key']; ?>[popup][position]" class="form-control isl-w-m">
          <option value="topleft" <?php echo $setting['popup']['position'] == 'topleft' ? 'selected' : ''; ?>>Top left</option>
          <option value="topcenter" <?php echo $setting['popup']['position'] == 'topcenter' ? 'selected' : ''; ?>>Top Center</option>
          <option value="topright" <?php echo $setting['popup']['position'] == 'topright' ? 'selected' : ''; ?>>Top right</option>
          <option value="bottomleft" <?php echo $setting['popup']['position'] == 'bottomleft' ? 'selected' : ''; ?>>Bottom left</option>
          <option value="bottomcenter" <?php echo $setting['popup']['position'] == 'bottomcenter' ? 'selected' : ''; ?>>Bottom Center</option>
          <option value="bottomright" <?php echo $setting['popup']['position'] == 'bottomright' ? 'selected' : ''; ?>>Bottom right</option>
        </select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-popup-design"><?php echo $entry_design; ?></label>
      <div class="col-sm-9">
        <div class="">
          <div class="isl-w-m isl-inline-block">
            <?php echo $entry_border_size; ?>
          </div>
          <input type="number" id="entry-popup-design" name="<?php echo $module['setting_key']; ?>[popup][border_size]" value="<?php echo $setting['popup']['border_size']; ?>" class="form-control isl-w-xs isl-inline-block">
        </div>
        <div class="isl-pt-10">
          <div class="isl-w-m isl-inline-block">
            <?php echo $entry_border_color; ?>
          </div>
          <input type="text" name="<?php echo $module['setting_key']; ?>[popup][border_color]" value="<?php echo $setting['popup']['border_color']; ?>" class="form-control isl-w-m isl-inline-block minicolors">
        </div>
        <div class="isl-pt-10">
          <div class="isl-w-m isl-inline-block">
            <?php echo $entry_background; ?>
          </div>
          <input type="text" name="<?php echo $module['setting_key']; ?>[popup][background]" value="<?php echo $setting['popup']['background']; ?>" class="form-control isl-w-m isl-inline-block minicolors">
        </div>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-3 control-label" for="entry-css"><?php echo $entry_custom_css; ?></label>
      <div class="col-sm-9">
        <textarea class="form-control" name="<?php echo $module['setting_key']; ?>[popup][custom_css]" id="entry-css" rows="8"><?php echo $setting['popup']['custom_css']; ?></textarea>
      </div>
    </div>

  </div>
  <div class="col-md-3">

    <div class="panel panel-default panel-info">
      <div class="panel-heading"><?php echo $text_information; ?></div>

      <div class="panel-body">
        <ul class="isl-list">
          <?php foreach ($text_info_setting_popup as $info) { ?>
            <li><?php echo $info ?></li>
          <?php } ?>
        </ul>
      </div>

    </div>

  </div>
</div>
