<div class="form-group promo-type-wrapper-ntf show buyxgetfreeshipping freeshippingwhenoverx buyxgetx buyxgety buyxgetamountoffy amountoffy xoffitemsinybrands buyxgetysamebrands percentoffitemsincat buyxgetysamecategory buyxfromygetoffonz xoffitemsinycategoriestiered xamountoffwhenxormore ordersofatleastxgety ordersofatleastxgetyoffleastormostexpensiveproduct xoffforrepeatcustomers xpercentoffforrepeatcustomers">
  <label class="col-sm-3 control-label"><?php echo $text_ntf_congrats; ?></label>
  <div class="col-sm-9">

    <ul class="nav nav-tabs langTabsNtf">
      <?php foreach ($languages as $lang) { ?>
        <li><a href="#message_congrats_<?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="message_congrats_<?php echo $lang['language_id']; ?>" class="tab-pane fade">
          <textarea name="<?php echo $module_setting; ?>[message_congrats][<?php echo $lang['language_id']; ?>]" placeholder="" class="form-control" data-isl-summernote-ntf='100'>
<?php
$message = !empty($setting['item']['message_congrats'][$lang['language_id']]) ? $setting['item']['message_congrats'][$lang['language_id']] : '';
$message = trim(strip_tags(html_entity_decode($message)));
if (!empty($message) && !$promo_reset) {
echo $setting['item']['message_congrats'][$lang['language_id']];
} elseif (!empty($setting['ntf_template'][$promo_type . '_congrats'])) {
echo $setting['ntf_template'][$promo_type . '_congrats'];
} else {
echo $setting['ntf_template']['congrats'];
} ?>
          </textarea>
        </div>
      <?php } ?>
    </div>

  </div>
</div>

<div class="form-group promo-type-wrapper-ntf show buyxgetx buyxgety buyxgetamountoffy buyxgetysamebrands buyxgetysamecategory buyxfromygetoffonz ordersofatleastxgety">
  <label class="col-sm-3 control-label"><?php echo $text_ntf_eligible; ?></label>
  <div class="col-sm-9">

    <ul class="nav nav-tabs langTabsNtf">
      <?php foreach ($languages as $lang) { ?>
        <li><a href="#message_eligible_<?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="message_eligible_<?php echo $lang['language_id']; ?>" class="tab-pane fade">
          <textarea name="<?php echo $module_setting; ?>[message_eligible][<?php echo $lang['language_id']; ?>]" placeholder="" class="form-control" data-isl-summernote-ntf='100'>
<?php
$message = !empty($setting['item']['message_eligible'][$lang['language_id']]) ? $setting['item']['message_eligible'][$lang['language_id']] : '';
$message = trim(strip_tags(html_entity_decode($message)));
if (!empty($message) && !$promo_reset) {
echo $setting['item']['message_eligible'][$lang['language_id']];
} elseif (!empty($setting['ntf_template'][$promo_type . '_eligible'])) {
echo $setting['ntf_template'][$promo_type . '_eligible'];
} else {
echo $setting['ntf_template']['eligible'];
} ?>
          </textarea>
        </div>
      <?php } ?>
    </div>

  </div>
</div>

<div class="form-group promo-type-wrapper-ntf show freeshippingwhenoverx buyxgetx buyxgety buyxgetamountoffy amountoffy buyxgetysamebrands buyxgetysamecategory buyxfromygetoffonz xoffitemsinycategoriestiered xamountoffwhenxormore ordersofatleastxgety ordersofatleastxgetyoffleastormostexpensiveproduct xoffforrepeatcustomers xpercentoffforrepeatcustomers">
  <label class="col-sm-3 control-label"><?php echo $text_ntf_upsell; ?></label>
  <div class="col-sm-9">

    <ul class="nav nav-tabs langTabsNtf">
      <?php foreach ($languages as $lang) { ?>
        <li><a href="#message_upsell_<?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="message_upsell_<?php echo $lang['language_id']; ?>" class="tab-pane fade">
          <textarea name="<?php echo $module_setting; ?>[message_upsell][<?php echo $lang['language_id']; ?>]" placeholder="" class="form-control" data-isl-summernote-ntf='100'>
<?php
$message = !empty($setting['item']['message_upsell'][$lang['language_id']]) ? $setting['item']['message_upsell'][$lang['language_id']] : '';
$message = trim(strip_tags(html_entity_decode($message)));
if (!empty($message) && !$promo_reset) {
echo $setting['item']['message_upsell'][$lang['language_id']];
} elseif (!empty($setting['ntf_template'][$promo_type . '_upsell'])) {
echo $setting['ntf_template'][$promo_type . '_upsell'];
} else {
echo $setting['ntf_template']['upsell'];
} ?>
          </textarea>
        </div>
      <?php } ?>
    </div>

  </div>
</div>

<script>
$(document).trigger('isl.summernote');

$('.promo-type-wrapper-ntf').removeClass('show');
setTimeout(function() {
  $('.promo-type-wrapper-ntf.<?php echo $promo_type; ?>').addClass('show');
}, 200);

$('.langTabsNtf').each(function() {
  $(this).find('a:first').tab('show');
});
</script>
