<?php echo $header; ?><?php echo $column_left; ?>

<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-module" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <button type="submit" form="form-module" data-toggle="tooltip" onclick="$('#svsty').val(1);" title="Save & Stay" class="btn btn-primary">Save & Stay</button>
        <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a> <?php echo $text_extension_doc; ?> </div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
        <?php } ?>
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    <?php if ($error_warning) { ?>
    <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>
      </div>
      <div class="panel-body">
        <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-fbecommevnt" class="form-horizontal">
          <input type="hidden"  name="svsty" id="svsty" />
          <ul class="nav nav-tabs">
            <li class="active"><a href="#tab-general" data-toggle="tab"><?php echo $tab_general; ?></a></li>
            <li><a href="#tab-store" data-toggle="tab"><?php echo $tab_store; ?></a></li>
          </ul>
          <div class="tab-content">
            <div class="tab-pane active" id="tab-general">
              <div class="form-group">
                <label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
                <div class="col-sm-10">
                  <select name="fbecommevnt_status" id="input-mainstatus" class="form-control">
                    <?php if ($fbecommevnt_status) { ?>
                    <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                    <option value="0"><?php echo $text_disabled; ?></option>
                    <?php } else { ?>
                    <option value="1"><?php echo $text_enabled; ?></option>
                    <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                    <?php } ?>
                  </select>
                </div>
              </div>
            </div>
            <div class="tab-pane" id="tab-store">
              <ul class="nav nav-tabs" id="storetab">
                <?php $i=0; foreach ($stores as $store) { $i++; ?>
                <li class="<?php if($i==1) { ?> active <?php } ?>"><a href="#tab-<?php echo $store['store_id'];?>" data-toggle="tab"><?php echo $store['name']; ?></a></li>
                <?php } ?>
              </ul>
              <div class="tab-content">
                <?php $i=0; foreach ($stores as $store) { $i++; ?>
                <div class="tab-pane <?php if($i==1) { ?> active <?php } ?>" id="tab-<?php echo $store['store_id'];?>">
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-status"><?php echo $store['name']; ?> <?php echo $tab_store;?> <?php echo $entry_status; ?></label>
                    <div class="col-sm-10">
                      <input type="radio" value="1" name="fbecommevnt_sts<?php echo $store['store_id'];?>" <?php if ($fbecommevnt_sts[$store['store_id']] == 1) { ?>checked<?php } ?>><?php echo $text_enabled; ?>&nbsp;&nbsp;
					  <input type="radio" value="0" name="fbecommevnt_sts<?php echo $store['store_id'];?>" <?php if ($fbecommevnt_sts[$store['store_id']] == 0) { ?>checked<?php } ?>><?php echo $text_disabled; ?>
                    </div>
                  </div><div class="form-group">
                    <label class="col-sm-2 control-label" for="input-fb_pixel_code"><?php echo $entry_fb_pixel_code; ?></label>
                    <div class="col-sm-10">
                      <textarea name="fbecommevnt_fb_pixel_code<?php echo $store['store_id'];?>" id="input-fb_pixel_code" rows="15" class="form-control"><?php echo $fbecommevnt_fb_pixel_code[$store['store_id']]; ?></textarea>
                    </div>
                  </div>
                </div>
                <?php } ?>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
<?php echo $footer; ?>