public function display()
    {
        $rows_data = $this->model->get_rows_data();
        $page_nav = $this->model->page_nav();
        $search_value = isset($_POST['search_value']) ? esc_html(stripslashes($_POST['search_value'])) : '';
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc';
        $order_by = isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        $ids_string = '';
        ?>
    <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
    <div style="clear: both; float: left; width: 99%;">
      <div style="float:left; font-size: 14px; font-weight: bold;">
        This section allows you to block IPs.
        <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
      </div>
      <div style="float: right; text-align: right;">
        <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
          <img width="215" border="0" alt="web-dorado.com" src="<?php 
        echo WD_FMC_URL . '/images/wd_logo.png';
        ?>
" />
        </a>
      </div>
    </div>
    <form onkeypress="spider_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fmc" style="float: left; width: 99%;">
      <?php 
        wp_nonce_field('nonce_fmc', 'nonce_fmc');
        ?>
      <span class="block_icon"></span>
      <h2>Blocked IPs</h2>
      <div class="buttons_div">
        <input class="button-primary" type="submit" value="Save" onclick="spider_set_input_value('task', 'save_all');" />
        <input class="button-secondary" type="submit" value="Delete" onclick="if (confirm('Do you want to unblock selected IPs?')) {
                                                                      spider_set_input_value('task', 'delete_all');
                                                                    } else {
                                                                      return false;
                                                                    }" />
      </div>
      <div class="tablenav top">
        <?php 
        WDW_FMC_Library::search('IP', $search_value, 'blocked_ips');
        WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
        ?>
      </div>
      <table class="wp-list-table widefat fixed pages">
        <thead>
          <tr>
            <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
            <th class="table_small_col <?php 
        if ($order_by == 'id') {
            echo $order_class;
        }
        ?>
">
              <a onclick="spider_set_input_value('task', '');
                          spider_set_input_value('order_by', 'id');
                          spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'id' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                          spider_form_submit(event, 'blocked_ips')" href="">
                <span>ID</span><span class="sorting-indicator"></span></th>
              </a>
            <th class="<?php 
        if ($order_by == 'ip') {
            echo $order_class;
        }
        ?>
">
              <a onclick="spider_set_input_value('task', '');
                          spider_set_input_value('order_by', 'ip');
                          spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'ip' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                          spider_form_submit(event, 'blocked_ips')" href="">
                <span>IP</span><span class="sorting-indicator"></span>
              </a>
            </th>
            <th class="table_big_col">Edit</th>
            <th class="table_big_col">Delete</th>
          </tr>		  
          <tr id="tr">
            <th></th>
            <th></th>
            <th class="edit_input"><input type="text" class="input_th" id="ip" name="ip" onkeypress="return spider_check_isnum(event)"></th>
            <th class="table_big_col">
              <a class="add_tag_th button-primary button button-small" onclick="if (spider_check_required('ip', 'IP')) {return false;}
                                                                                spider_set_input_value('task', 'save');
                                                                                spider_set_input_value('current_id', '');
                                                                                spider_form_submit(event, 'blocked_ips')" href="">Add IP</a>
            </th>
            <th></th>
          </tr>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                ?>
              <tr id="tr_<?php 
                echo $row_data->id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="table_small_col check-column" id="td_check_<?php 
                echo $row_data->id;
                ?>
" >
                  <input id="check_<?php 
                echo $row_data->id;
                ?>
" name="check_<?php 
                echo $row_data->id;
                ?>
" type="checkbox" />
                </td>
                <td class="table_small_col" id="td_id_<?php 
                echo $row_data->id;
                ?>
" ><?php 
                echo $row_data->id;
                ?>
</td>
                <td id="td_ip_<?php 
                echo $row_data->id;
                ?>
" >
                  <a class="pointer" id="ip<?php 
                echo $row_data->id;
                ?>
"
                     onclick="spider_edit_ip(<?php 
                echo $row_data->id;
                ?>
)" 
                     title="Edit"><?php 
                echo $row_data->ip;
                ?>
</a>
                </td>
                <td class="table_big_col" id="td_edit_<?php 
                echo $row_data->id;
                ?>
">
                  <a onclick="spider_edit_ip(<?php 
                echo $row_data->id;
                ?>
)">Edit</a>
                </td>
                <td class="table_big_col" id="td_delete_<?php 
                echo $row_data->id;
                ?>
">
                  <a onclick="spider_set_input_value('task', 'delete');
                              spider_set_input_value('current_id', <?php 
                echo $row_data->id;
                ?>
);
                              spider_form_submit(event, 'blocked_ips')" href="">Delete</a>
                </td>
              </tr>
              <?php 
                $ids_string .= $row_data->id . ',';
            }
        }
        ?>
        </tbody>
      </table>
      <input id="task" name="task" type="hidden" value="" />
      <input id="current_id" name="current_id" type="hidden" value="" />
      <input id="ids_string" name="ids_string" type="hidden" value="<?php 
        echo $ids_string;
        ?>
" />
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php 
        echo $asc_or_desc;
        ?>
" />
      <input id="order_by" name="order_by" type="hidden" value="<?php 
        echo $order_by;
        ?>
" />
    </form>
    <?php 
    }
Exemplo n.º 2
0
    public function display()
    {
        $rows_data = $this->model->get_rows_data();
        $page_nav = $this->model->page_nav();
        $search_value = isset($_POST['search_value']) ? esc_html($_POST['search_value']) : '';
        $search_select_value = isset($_POST['search_select_value']) ? (int) $_POST['search_select_value'] : 0;
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html($_POST['asc_or_desc']) : 'asc';
        $order_by = isset($_POST['order_by']) ? esc_html($_POST['order_by']) : 'id';
        $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
        $ids_string = '';
        ?>
    <div style="clear: both; float: left; width: 99%;">
      <div style="float:left; font-size: 14px; font-weight: bold;">
        This section allows you to edit form themes.
        <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
      </div>
      <div style="float: right; text-align: right;">
        <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
          <img width="215" border="0" alt="web-dorado.com" src="<?php 
        echo WD_FMC_URL . '/images/wd_logo.png';
        ?>
" />
        </a>
      </div>
    </div>
    <form class="wrap" id="themes_form" method="post" action="admin.php?page=themes_fmc" style="float: left; width: 99%;">
      <?php 
        wp_nonce_field('nonce_fmc', 'nonce_fmc');
        ?>
      <span class="theme_icon"></span>
      <h2>
        Themes
        <a href="" class="add-new-h2" onclick="spider_set_input_value('task', 'add');
                                               spider_form_submit(event, 'themes_form')">Add new</a>
      </h2>
      <div class="buttons_div">
        <input class="button-secondary" type="submit" onclick="if (confirm('Do you want to delete selected items?')) {
                                                       spider_set_input_value('task', 'delete_all');
                                                     } else {
                                                       return false;
                                                     }" value="Delete" />
      </div>
      <div class="tablenav top">
        <?php 
        WDW_FMC_Library::search('Title', $search_value, 'themes_form');
        WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'themes_form');
        ?>
      </div>
      <table class="wp-list-table widefat fixed pages">
        <thead>
          <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
          <th class="table_small_col <?php 
        if ($order_by == 'id') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
              spider_set_input_value('order_by', 'id');
              spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html($_POST['order_by']) == 'id' && esc_html($_POST['asc_or_desc']) == 'asc' ? 'desc' : 'asc';
        ?>
');
              spider_form_submit(event, 'themes_form')" href="">
              <span>ID</span><span class="sorting-indicator"></span></a>
          </th>
          <th class="<?php 
        if ($order_by == 'title') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
              spider_set_input_value('order_by', 'title');
              spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html($_POST['order_by']) == 'title' && esc_html($_POST['asc_or_desc']) == 'asc' ? 'desc' : 'asc';
        ?>
');
              spider_form_submit(event, 'themes_form')" href="">
              <span>Title</span><span class="sorting-indicator"></span></a>
          </th>
          <th class="table_big_col <?php 
        if ($order_by == 'default') {
            echo $order_class;
        }
        ?>
">
            <a onclick="spider_set_input_value('task', '');
              spider_set_input_value('order_by', 'default');
              spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html($_POST['order_by']) == 'default' && esc_html($_POST['asc_or_desc']) == 'asc' ? 'desc' : 'asc';
        ?>
');
              spider_form_submit(event, 'themes_form')" href="">
              <span>Default</span><span class="sorting-indicator"></span></a>
          </th>
          <th class="table_big_col">Edit</th>
          <th class="table_big_col">Delete</th>
        </thead>
        <tbody id="tbody_arr">
          <?php 
        if ($rows_data) {
            foreach ($rows_data as $row_data) {
                $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
                $default_image = $row_data->default ? 'default' : 'notdefault';
                $default = $row_data->default ? '' : 'setdefault';
                ?>
              <tr id="tr_<?php 
                echo $row_data->id;
                ?>
" <?php 
                echo $alternate;
                ?>
>
                <td class="table_small_col check-column">
                  <input id="check_<?php 
                echo $row_data->id;
                ?>
" name="check_<?php 
                echo $row_data->id;
                ?>
" type="checkbox"/>
                </td>
                <td class="table_small_col"><?php 
                echo $row_data->id;
                ?>
</td>
                <td>
                  <a onclick="spider_set_input_value('task', 'edit');
                              spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                              spider_form_submit(event, 'themes_form')" href="" title="Edit"><?php 
                echo $row_data->title;
                ?>
</a>
                </td>
                <td class="table_big_col">
                  <?php 
                if ($default != '') {
                    ?>
                    <a onclick="spider_set_input_value('task', '<?php 
                    echo $default;
                    ?>
');
                                spider_set_input_value('current_id', '<?php 
                    echo $row_data->id;
                    ?>
');
                                spider_form_submit(event, 'themes_form')" href="">
                    <?php 
                }
                ?>
                  <img src="<?php 
                echo WD_FMC_URL . '/images/' . $default_image . '.png';
                ?>
" />
                  <?php 
                if ($default != '') {
                    ?>
                    </a>
                    <?php 
                }
                ?>
                </td>
                <td class="table_big_col">
                  <a onclick="spider_set_input_value('task', 'edit');
                              spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                              spider_form_submit(event, 'themes_form')" href="">Edit</a>
                </td>
                <td class="table_big_col">
                  <a onclick="spider_set_input_value('task', 'delete');
                              spider_set_input_value('current_id', '<?php 
                echo $row_data->id;
                ?>
');
                              spider_form_submit(event, 'themes_form')" href="">Delete</a>
                </td>
              </tr>
              <?php 
                $ids_string .= $row_data->id . ',';
            }
        }
        ?>
        </tbody>
      </table>
      <input id="task" name="task" type="hidden" value=""/>
      <input id="current_id" name="current_id" type="hidden" value=""/>
      <input id="ids_string" name="ids_string" type="hidden" value="<?php 
        echo $ids_string;
        ?>
"/>
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
      <input id="order_by" name="order_by" type="hidden" value="<?php 
        echo $order_by;
        ?>
"/>
    </form>
    <?php 
    }
    public function display($form_id)
    {
        global $wpdb;
        $forms = $this->model->get_form_titles();
        $statistics = $this->model->get_statistics($form_id);
        $labels_parameters = $this->model->get_labels_parameters($form_id);
        $sorted_labels_id = $labels_parameters[0];
        $sorted_label_types = $labels_parameters[1];
        $lists = $labels_parameters[2];
        $sorted_label_names = $labels_parameters[3];
        $sorted_label_names_original = $labels_parameters[4];
        $rows = isset($labels_parameters[5]) ? $labels_parameters[5] : NULL;
        $group_ids = isset($labels_parameters[6]) ? $labels_parameters[6] : NULL;
        $where_choices = $labels_parameters[7];
        $order_by = isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id';
        $asc_or_desc = isset($_POST['asc_or_desc']) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc';
        $style_id = $this->model->hide_or_not($lists['hide_label_list'], '@submitid@');
        $style_date = $this->model->hide_or_not($lists['hide_label_list'], '@submitdate@');
        $style_ip = $this->model->hide_or_not($lists['hide_label_list'], '@submitterip@');
        $style_username = $this->model->hide_or_not($lists['hide_label_list'], '@submitterusername@');
        $style_useremail = $this->model->hide_or_not($lists['hide_label_list'], '@submitteremail@');
        $oder_class_default = "manage-column column-autor sortable desc";
        $oder_class = "manage-column column-title sorted " . $asc_or_desc;
        $ispaypal = FALSE;
        $temp = array();
        $m = count($sorted_label_names);
        $n = count($rows);
        $group_id_s = array();
        $group_id_s = $this->model->sort_group_ids(count($sorted_label_names), $group_ids);
        $ka_fielderov_search = $lists['ip_search'] || $lists['startdate'] || $lists['enddate'] || $lists['username_search'] || $lists['useremail_search'] ? TRUE : FALSE;
        $is_stats = false;
        $blocked_ips = $this->model->blocked_ips();
        ?>
    <script type="text/javascript">
      function clickLabChBAll(ChBAll) {
        <?php 
        if (isset($sorted_label_names)) {
            $templabels = array_merge(array('submitid', 'submitdate', 'submitterip', 'submitterusername', 'submitteremail'), $sorted_labels_id);
            $sorted_label_names_for_check = array_merge(array('ID', 'Submit date', "Submitter's IP", "Submitter's Username", "Submitter's Email Address"), $sorted_label_names_original);
        } else {
            $templabels = array('submitid', 'submitdate', 'submitterip', 'submitterusername', 'submitteremail');
            $sorted_label_names_for_check = array('ID', 'Submit date', "Submitter's IP", 'Submitter\'s Username', 'Submitter\'s Email Address');
        }
        ?>
        if (ChBAll.checked) {
          document.forms.admin_form.hide_label_list.value = '';
          for (i = 0; i <= ChBAll.form.length; i++) {
            if (typeof(ChBAll.form[i]) != "undefined") {
              if (ChBAll.form[i].type == "checkbox") {
                ChBAll.form[i].checked = true;
              }
            }
          }
        }
        else {
          document.forms.admin_form.hide_label_list.value = '@<?php 
        echo implode($templabels, '@@');
        ?>
@' + '@payment_info@';
          for (i = 0; i <= ChBAll.form.length; i++) {
            if (typeof(ChBAll.form[i]) != "undefined") {
              if (ChBAll.form[i].type == "checkbox") {
                ChBAll.form[i].checked = false;
              }
            }
          }
        }
        renderColumns();
      }
      function remove_all() {
        document.getElementById('startdate').value = '';
        document.getElementById('enddate').value = '';
        document.getElementById('ip_search').value = '';
		document.getElementById('username_search').value='';
		document.getElementById('useremail_search').value='';
        <?php 
        $n = count($rows);
        for ($i = 0; $i < count($sorted_label_names); $i++) {
            if ($sorted_label_types[$i] != "type_mark_map") {
                ?>
            document.getElementById('<?php 
                echo $form_id . '_' . $sorted_labels_id[$i] . '_search';
                ?>
').value='';
            <?php 
            }
        }
        ?>
      }
      function show_hide_filter() {
        if (document.getElementById('fields_filter').style.display == "none") {
          document.getElementById('fields_filter').style.display = '';
          document.getElementById('filter_img').src = '<?php 
        echo WD_FMC_URL . '/images/filter_hide.png';
        ?>
';
        }
        else {
          document.getElementById('fields_filter').style.display = "none";
          document.getElementById('filter_img').src = '<?php 
        echo WD_FMC_URL . '/images/filter_show.png';
        ?>
';
        }
      }
      jQuery(document).ready(function () { 
        jQuery('.theme-detail').click(function () {
          jQuery(this).siblings('.themedetaildiv').toggle();
          return false;
        });
      });
    </script>
    <div id="sbox-overlay" onclick="toggleChBDiv(false)"
       style="z-index: 65555; position: fixed; top: 0px; left: 0px; visibility: visible; zoom: 1; background-color: #000000; opacity: 0.7; filter: alpha(opacity=70); display: none;">
    </div>
    <div style="background-color: #FFFFFF; width: 350px; max-height: 350px; overflow-y: auto; padding: 20px; position: fixed; top: 100px; display: none; border: 2px solid #AAAAAA;  z-index: 65556;" id="ChBDiv">
      <form action="#">
        <?php 
        wp_nonce_field('nonce_fmc', 'nonce_fmc');
        ?>
        <p style="font-weight: bold; font-size: 18px; margin-top: 0px;">Select Columns</p>
        <div class="fm_check_labels"><input type="checkbox" <?php 
        echo $lists['hide_label_list'] === '' ? 'checked="checked"' : '';
        ?>
 onclick="clickLabChBAll(this)" id="ChBAll"/><label for="ChBAll"> All</label></div>
        <?php 
        foreach ($templabels as $key => $curlabel) {
            if (strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE) {
                ?>
        <div class="fm_check_labels"><input type="checkbox" checked="checked" onclick="clickLabChB('<?php 
                echo $curlabel;
                ?>
', this)" id="fm_check_id_<?php 
                echo $curlabel;
                ?>
" /><label for="fm_check_id_<?php 
                echo $curlabel;
                ?>
"> <?php 
                echo stripslashes($sorted_label_names_for_check[$key]);
                ?>
</label></div>
            <?php 
            } else {
                ?>
        <div class="fm_check_labels"><input type="checkbox" onclick="clickLabChB('<?php 
                echo $curlabel;
                ?>
', this)" id="fm_check_id_<?php 
                echo $curlabel;
                ?>
"/><label for="fm_check_id_<?php 
                echo $curlabel;
                ?>
"> <?php 
                echo stripslashes($sorted_label_names_for_check[$key]);
                ?>
</label></div>
            <?php 
            }
        }
        $ispaypal = FALSE;
        for ($i = 0; $i < count($sorted_label_names); $i++) {
            if ($sorted_label_types[$i] == 'type_paypal_payment_status') {
                $ispaypal = TRUE;
            }
        }
        if ($ispaypal) {
            ?>
        <div class="fm_check_labels">
          <input type="checkbox" onclick="clickLabChB('payment_info', this)" id="fm_check_payment_info" <?php 
            echo strpos($lists['hide_label_list'], '@payment_info@') === FALSE ? 'checked="checked"' : '';
            ?>
 />
          <label for="fm_check_payment_info"> Payment Info</label>
        </div>
	        <?php 
        }
        ?>
        <div style="text-align: center; padding: 20px;">
          <input type="button" class="button-secondary" onclick="toggleChBDiv(false);" value="Done" />
        </div>
      </form>
    </div>
    <div style="clear: both; float: left; width: 99%;">
      <div style="float:left; font-size: 14px; font-weight: bold;">
        This section allows you to view and manage form submissions.
        <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-6.html">Read More in User Manual</a>
      </div>
      <div style="float: right; text-align: right;">
        <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
          <img width="215" border="0" alt="web-dorado.com" src="<?php 
        echo WD_FMC_URL . '/images/wd_logo.png';
        ?>
" />
        </a>
      </div>
    </div>
    <form action="admin.php?page=submissions_fmc" method="post" id="admin_form" name="admin_form">
      <?php 
        wp_nonce_field('nonce_fmc', 'nonce_fmc');
        ?>
      <input type="hidden" name="option" value="com_formmaker" />
      <input type="hidden" id="task" name="task" value="" />
      <input type="hidden" id="current_id" name="current_id" value="" />
      <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php 
        echo $asc_or_desc;
        ?>
" />
      <input type="hidden" name="order_by" id="order_by" value="<?php 
        echo $order_by;
        ?>
" />
      <br />
      <table width="99%">
        <tr style="line-height: inherit !important;">
          <td align="left" width="300">
            <select name="form_id" id="form_id" style="width:99%" onchange="document.admin_form.submit();">
              <option value="0" selected="selected"> - Select a Form - </option>
              <?php 
        if ($forms) {
            foreach ($forms as $form) {
                ?>
              <option value="<?php 
                echo $form->id;
                ?>
" <?php 
                if ($form_id == $form->id) {
                    $chosen_form_title = $form->title;
                    echo 'selected="selected"';
                }
                ?>
> <?php 
                echo $form->title;
                ?>
 </option>
                  <?php 
            }
        }
        ?>
            </select>
          </td>
          <?php 
        if ($form_id > 0) {
            ?>
          <td class="reports"><strong>Entries</strong><br /><?php 
            echo $statistics["total_entries"];
            ?>
</td>
          <td class="reports"><strong>Views</strong><br /><?php 
            echo $statistics["total_views"];
            ?>
</td>
          <td class="reports"><strong>Conversion Rate</strong><br/><?php 
            echo $statistics["conversion_rate"];
            ?>
</td>
          <td class="form_title">
            <span class="form_title_cont" title="<?php 
            echo $chosen_form_title;
            ?>
"><?php 
            echo $chosen_form_title;
            ?>
</span>
          </td>
          <td style="text-align: right;" width="300">
            <span class="exp_but_span">Export to</span>
            <input type="button" class="button-secondary" value="CSV" onclick="window.location='<?php 
            echo add_query_arg(array('action' => 'generete_csv_fmc', 'form_id' => $form_id), admin_url('admin-ajax.php'));
            ?>
'" />&nbsp;
            <input type="button" class="button-secondary" value="XML" onclick="window.location='<?php 
            echo add_query_arg(array('action' => 'generete_xml_fmc', 'form_id' => $form_id), admin_url('admin-ajax.php'));
            ?>
'" />
          </td>			
        </tr>       
        <tr>
          <td align="left" colspan="4">
            <input type="hidden" name="hide_label_list" value="<?php 
            echo $lists['hide_label_list'];
            ?>
" />
            <img src="<?php 
            echo WD_FMC_URL . '/images/filter_show.png';
            ?>
" width="40" style="vertical-align: bottom; cursor: pointer;" onclick="show_hide_filter()" title="Search by fields" id="filter_img" />
            <input type="button" class="button-secondary" onclick="spider_form_submit(event, 'admin_form')" value="Go" />
            <input type="button" class="button-secondary" onclick="remove_all(); spider_form_submit(event, 'admin_form')" value="Reset" />
          </td>
          <td align="right" colspan="2">
            <br />
            <?php 
            if (isset($sorted_label_names)) {
                ?>
            <input type="button" class="button-secondary" onclick="toggleChBDiv(true)" value="Add/Remove Columns" />
              <?php 
            }
            ?>
            <input class="button-secondary" type="button" onclick="spider_set_input_value('task', 'block_ip'); spider_form_submit(event, 'admin_form')" value="Block IP" />
            <input class="button-secondary" type="button" onclick="spider_set_input_value('task', 'unblock_ip'); spider_form_submit(event, 'admin_form')" value="Unblock IP" />
            <input class="button-secondary" type="button" onclick="if (confirm('Do you want to delete selected items?')) {
                                                                     spider_set_input_value('task', 'delete_all');
                                                                     spider_form_submit(event, 'admin_form')
                                                                   } else {
                                                                     return false;
                                                                   }" value="Delete"/>
          </td>
        </tr>
          <?php 
        } else {
            ?>
          <td></td>
        </tr>
            <?php 
        }
        ?>
      </table>
      <div class="tablenav top" style="width: 99%;">
        <?php 
        WDW_FMC_Library::html_page_nav($lists['total'], $lists['limit'], 'admin_form');
        ?>
      </div>    
      <div class="submit_content" style="width: 99%;">
        <table class="wp-list-table widefat fixed posts table_content">
          <thead>
            <tr>
              <th class="table_small_col count_col sub-align">#</th>
              <th scope="col" id="cb" class="manage-column column-cb check-column table_small_col sub-align form_check"><input id="check_all" type="checkbox"></th>
              <th scope="col" id="submitid_fc" class="table_small_col sub-align submitid_fc <?php 
        if ($order_by == "group_id") {
            echo $oder_class;
        } else {
            echo $oder_class_default;
        }
        ?>
" <?php 
        echo $style_id;
        ?>
>
                <a href="" class="sub_id" onclick="spider_set_input_value('order_by', 'group_id');
                                                   spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'group_id' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                                                   spider_form_submit(event, 'admin_form')">
                  <span>ID</span>
                  <span class="sorting-indicator" style="margin-top: 8px;"></span>
                </a>
              </th>
              <th class="table_small_col sub-align">Edit</th>
              <th class="table_small_col sub-align">Delete</th>
              <th scope="col" id="submitdate_fc" class="table_large_col submitdate_fc <?php 
        if ($order_by == "date") {
            echo $oder_class;
        } else {
            echo $oder_class_default;
        }
        ?>
" <?php 
        echo $style_date;
        ?>
>
                <a href="" onclick="spider_set_input_value('order_by', 'date');
                                    spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'date' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                                    spider_form_submit(event, 'admin_form')">
                  <span>Submit date</span>
                  <span class="sorting-indicator"></span>
                </a>
              </th>
              <th scope="col" id="submitterip_fc" class="table_medium_col_uncenter submitterip_fc <?php 
        if ($order_by == "ip") {
            echo $oder_class;
        } else {
            echo $oder_class_default;
        }
        ?>
" <?php 
        echo $style_ip;
        ?>
>
                <a href="" onclick="spider_set_input_value('order_by', 'ip');
                                    spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'ip' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                                    spider_form_submit(event, 'admin_form')">
                  <span>Submitter's IP</span>
                  <span class="sorting-indicator"></span>
                </a>
              </th>	
			  
			   <th scope="col" id="submitterusername_fc" class="table_medium_col_uncenter submitterusername_fc <?php 
        if ($order_by == "display_name") {
            echo $oder_class;
        } else {
            echo $oder_class_default;
        }
        ?>
" <?php 
        echo $style_username;
        ?>
>
                <a href="" onclick="spider_set_input_value('order_by', 'display_name');
                                    spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'display_name' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                                    spider_form_submit(event, 'admin_form')">
                  <span>Submitter's Username</span>
                  <span class="sorting-indicator"></span>
                </a>
              </th>	
			  
			  <th scope="col" id="submitteremail_fc" class="table_medium_col_uncenter submitteremail_fc <?php 
        if ($order_by == "user_email") {
            echo $oder_class;
        } else {
            echo $oder_class_default;
        }
        ?>
" <?php 
        echo $style_useremail;
        ?>
>
                <a href="" onclick="spider_set_input_value('order_by', 'user_email');
                                    spider_set_input_value('asc_or_desc', '<?php 
        echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == 'user_email' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
        ?>
');
                                    spider_form_submit(event, 'admin_form')">
                  <span>Submitter's Email Address</span>
                  <span class="sorting-indicator"></span>
                </a>
              </th>	
			  
			
              <?php 
        for ($i = 0; $i < count($sorted_label_names); $i++) {
            $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
            $styleStr2 = $this->model->hide_or_not($lists['hide_label_list'], '@payment_info@');
            $field_title = $this->model->get_type_address($sorted_label_types[$i], $sorted_label_names_original[$i]);
            if ($sorted_label_types[$i] == 'type_paypal_payment_status') {
                $ispaypal = TRUE;
                ?>
              <th <?php 
                echo $styleStr;
                ?>
 id="<?php 
                echo $sorted_labels_id[$i] . '_fc';
                ?>
" class="table_large_col <?php 
                echo $sorted_labels_id[$i] . '_fc';
                if ($order_by == $sorted_labels_id[$i] . "_field") {
                    echo $oder_class . '"';
                } else {
                    echo $oder_class_default . '"';
                }
                ?>
">
                <a href="" onclick="spider_set_input_value('order_by', '<?php 
                echo $sorted_labels_id[$i] . '_field';
                ?>
');
                                    spider_set_input_value('asc_or_desc', '<?php 
                echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == $sorted_labels_id[$i] . '_field' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
                ?>
');
                                    spider_form_submit(event, 'admin_form')">	
                  <span><?php 
                echo $field_title;
                ?>
</span>
                  <span class="sorting-indicator"></span>
                </a>
              </th>
              <th class="table_large_col payment_info_fc" <?php 
                echo $styleStr2;
                ?>
>Payment Info</th>
                  <?php 
            } else {
                ?>
              <th <?php 
                echo $styleStr;
                ?>
 id="<?php 
                echo $sorted_labels_id[$i] . '_fc';
                ?>
" class="<?php 
                echo $sorted_label_types[$i] == 'type_mark_map' || $sorted_label_types[$i] == 'type_matrix' ? 'table_large_col ' : '';
                echo $sorted_labels_id[$i] . '_fc';
                if ($order_by == $sorted_labels_id[$i] . "_field") {
                    echo $oder_class . '"';
                } else {
                    echo $oder_class_default . '"';
                }
                ?>
">
                <a href="" onclick="spider_set_input_value('order_by', '<?php 
                echo $sorted_labels_id[$i] . '_field';
                ?>
');
                                    spider_set_input_value('asc_or_desc', '<?php 
                echo isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) == $sorted_labels_id[$i] . '_field' && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc' ? 'desc' : 'asc';
                ?>
');
                                    spider_form_submit(event, 'admin_form')">
                  <span><?php 
                echo $field_title;
                ?>
</span>
                  <span class="sorting-indicator"></span>
                </a>
              </th>
                  <?php 
            }
        }
        ?>
		           
            </tr>
            <tr id="fields_filter" style="display: none;">
              <th></th>
              <th></th>
              <th></th>
              <th></th>
              <th class="submitid_fc" <?php 
        echo $style_id;
        ?>
 ></th>
              <th width="150" class="submitdate_fc" <?php 
        echo $style_date;
        ?>
>
                <table align="center" style="margin:auto" class="simple_table">
                  <tr class="simple_table">
                    <td class="simple_table" style="text-align: left;">From:</td>
                    <td style="text-align: center;" class="simple_table">
                      <input class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="<?php 
        echo $lists['startdate'];
        ?>
" />
                    </td>
                    <td style="text-align: center;" class="simple_table">
                      <input type="reset" style="width: 22px; border-radius: 3px !important;" class="button" value="..." onclick="return showCalendar('startdate','%Y-%m-%d');" />
                    </td>
                  </tr>
                  <tr class="simple_table">
                    <td style="text-align: left;" class="simple_table">To:</td>
                    <td style="text-align: center;" class="simple_table">
                      <input class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="<?php 
        echo $lists['enddate'];
        ?>
" />
                    </td>
                    <td style="text-align: center;" class="simple_table">
                      <input type="reset" style="width: 22px; border-radius: 3px !important;" class="button" value="..." onclick="return showCalendar('enddate','%Y-%m-%d');" />
                    </td>
                  </tr>
                </table>
              </th>
              <th class="table_medium_col_uncenter submitterip_fc" <?php 
        echo $style_ip;
        ?>
>
                <input type="text" name="ip_search" id="ip_search" value="<?php 
        echo $lists['ip_search'];
        ?>
" onChange="this.form.submit();" />
              </th>
			
			   </th>
              <th class="table_medium_col_uncenter submitterusername_fc" <?php 
        echo $style_username;
        ?>
>
                <input type="text" name="username_search" id="username_search" value="<?php 
        echo $lists['username_search'];
        ?>
" onChange="this.form.submit();" />
              </th>
			  
			  </th>
              <th class="table_medium_col_uncenter submitteremail_fc" <?php 
        echo $style_useremail;
        ?>
>
                <input type="text" name="useremail_search" id="useremail_search" value="<?php 
        echo $lists['useremail_search'];
        ?>
" onChange="this.form.submit();" />
              </th>
			  
              <?php 
        for ($i = 0; $i < count($sorted_label_names); $i++) {
            $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
            if (!$ka_fielderov_search) {
                if ($lists[$form_id . '_' . $sorted_labels_id[$i] . '_search']) {
                    $ka_fielderov_search = TRUE;
                }
            }
            switch ($sorted_label_types[$i]) {
                case 'type_mark_map':
                    ?>
                      <th class="table_large_col <?php 
                    echo $sorted_labels_id[$i];
                    ?>
_fc" <?php 
                    echo $styleStr;
                    ?>
></th>
                      <?php 
                    break;
                case 'type_paypal_payment_status':
                    ?>
                      <th class="table_large_col <?php 
                    echo $sorted_labels_id[$i];
                    ?>
_fc" <?php 
                    echo $styleStr;
                    ?>
>
                        <select style="font-size: 11px; margin: 0; padding: 0; height: inherit;" name="<?php 
                    echo $form_id . '_' . $sorted_labels_id[$i];
                    ?>
_search" id="<?php 
                    echo $form_id . '_' . $sorted_labels_id[$i];
                    ?>
_search" onChange="this.form.submit();" value="<?php 
                    echo $lists[$form_id . '_' . $sorted_labels_id[$i] . '_search'];
                    ?>
" >
                          <option value="" ></option>
                          <option value="canceled" >Canceled</option>
                          <option value="cleared" >Cleared</option>
                          <option value="cleared by payment review" >Cleared by payment review</option>
                          <option value="completed" >Completed</option>
                          <option value="denied" >Denied</option>
                          <option value="failed" >Failed</option>
                          <option value="held" >Held</option>
                          <option value="in progress" >In progress</option>
                          <option value="on hold" >On hold</option>
                          <option value="paid" >Paid</option>
                          <option value="partially refunded" >Partially refunded</option>
                          <option value="pending verification" >Pending verification</option>
                          <option value="placed" >Placed</option>
                          <option value="processing" >Processing</option>
                          <option value="refunded" >Refunded</option>
                          <option value="refused" >Refused</option>
                          <option value="removed" >Removed</option>
                          <option value="returned" >Returned</option>
                          <option value="reversed" >Reversed</option>
                          <option value="temporary hold" >Temporary hold</option>
                          <option value="unclaimed" >Unclaimed</option>
                        </select>	
                        <script> 
                          var element = document.getElementById('<?php 
                    echo $form_id . '_' . $sorted_labels_id[$i];
                    ?>
_search');
                          element.value = '<?php 
                    echo $lists[$form_id . '_' . $sorted_labels_id[$i] . '_search'];
                    ?>
';
                        </script>
                      </th>
                      <th class="table_large_col  payment_info_fc" <?php 
                    echo $styleStr2;
                    ?>
></th>
                      <?php 
                    break;
                default:
                    ?>
                      <th class="<?php 
                    echo $sorted_labels_id[$i];
                    ?>
_fc" <?php 
                    echo $styleStr;
                    ?>
>
                        <input name="<?php 
                    echo $form_id . '_' . $sorted_labels_id[$i] . '_search';
                    ?>
" id="<?php 
                    echo $form_id . '_' . $sorted_labels_id[$i] . '_search';
                    ?>
" type="text" value="<?php 
                    echo $lists[$form_id . '_' . $sorted_labels_id[$i] . '_search'];
                    ?>
"  onChange="this.form.submit();" >
                      </th>
                      <?php 
                    break;
            }
        }
        ?>
            </tr>
          </thead>
          <?php 
        $k = 0;
        for ($www = 0, $qqq = count($group_id_s); $www < $qqq; $www++) {
            $i = $group_id_s[$www];
            $alternate = !isset($alternate) || $alternate == 'class="alternate"' ? '' : 'class="alternate"';
            $temp = $this->model->array_for_group_id($group_id_s[$www], $rows);
            $data = $temp[0];
            $userinfo = get_userdata($data->user_id_wd);
            $useremail = $userinfo ? $userinfo->user_email : "";
            $username = $userinfo ? $userinfo->display_name : "";
            ?>
            <tr <?php 
            echo $alternate;
            ?>
>
              <td class="table_small_col count_col sub-align"><?php 
            echo $www + 1;
            ?>
</td>
              <th class="check-column table_small_col sub-align" style="padding: 0;">
                <input type="checkbox" name="post[]" value="<?php 
            echo $data->group_id;
            ?>
">
              </th>   
              <td class="table_small_col sub-align submitid_fc" id="submitid_fc" <?php 
            echo $style_id;
            ?>
>
                <a href="" onclick="spider_set_input_value('task', 'edit');						  
                                    spider_set_input_value('current_id',<?php 
            echo $data->group_id;
            ?>
);
                                    spider_form_submit(event, 'admin_form');" ><?php 
            echo $data->group_id;
            ?>
                </a>
              </td> 
              <td class="table_small_col sub-align">
                <a href="" onclick="spider_set_input_value('task', 'edit');						  
                                    spider_set_input_value('current_id',<?php 
            echo $data->group_id;
            ?>
);
                                    spider_form_submit(event, 'admin_form');">Edit
                </a>
              </td>
              <td class="table_small_col sub-align">
                <a href="" onclick="spider_set_input_value('task', 'delete');						  
                                    spider_set_input_value('current_id',<?php 
            echo $data->group_id;
            ?>
);
                                    spider_form_submit(event, 'admin_form');">Delete
                </a>
              </td>		 
              <td  class="table_large_col submitdate_fc sub-align" id="submitdate_fc" <?php 
            echo $style_date;
            ?>
>
                <a href="" onclick="spider_set_input_value('task', 'edit');						  
                                    spider_set_input_value('current_id',<?php 
            echo $data->group_id;
            ?>
);
                                    spider_form_submit(event, 'admin_form');" ><?php 
            echo $data->date;
            ?>
                </a>
              </td>
              <td class="table_medium_col_uncenter submitterip_fc sub-align" id="submitterip_fc" <?php 
            echo $style_ip;
            ?>
>
                <a class="thickbox-preview" href="<?php 
            echo add_query_arg(array('action' => 'fromipinfoinpopup_fmc', 'data_ip' => $data->ip, 'width' => '400', 'height' => '300', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
            ?>
" title="Show submitter information" <?php 
            echo !in_array($data->ip, $blocked_ips) ? '' : 'style="color: #FF0000;"';
            ?>
><?php 
            echo $data->ip;
            ?>
</a>
              </td>
			  
			  
			  
			  <td  class="table_large_col submitterusername_fc sub-align" id="submitterusername_fc" <?php 
            echo $style_username;
            ?>
>
               <?php 
            echo $username;
            ?>
              </td>
			  
			  <td  class="table_large_col submitteremail_fc sub-align" id="submitteremail_fc" <?php 
            echo $style_useremail;
            ?>
>
                <?php 
            echo $useremail;
            ?>
              </td>
			  
			  
			  
              <?php 
            for ($h = 0; $h < $m; $h++) {
                $not_label = TRUE;
                for ($g = 0; $g < count($temp); $g++) {
                    $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$h]);
                    if ($temp[$g]->element_label == $sorted_labels_id[$h]) {
                        if (strpos($temp[$g]->element_value, "***map***")) {
                            $map_params = explode('***map***', $temp[$g]->element_value);
                            ?>
              <td class="table_large_col <?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc sub-align" id="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc" <?php 
                            echo $styleStr;
                            ?>
>
                <a class="thickbox-preview" href="<?php 
                            echo add_query_arg(array('action' => 'frommapeditinpopup_fmc', 'long' => $map_params[0], 'lat' => $map_params[1], 'width' => '620', 'height' => '550', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
                            ?>
" title="Show on Map">Show on Map</a>
              </td>
                    <?php 
                        } elseif (strpos($temp[$g]->element_value, "*@@url@@*")) {
                            ?>
              <td class="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc sub-align" id="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc" <?php 
                            echo $styleStr;
                            ?>
>
                      <?php 
                            $new_files = explode("*@@url@@*", $temp[$g]->element_value);
                            foreach ($new_files as $new_file) {
                                if ($new_file) {
                                    $new_filename = explode('/', $new_file);
                                    $new_filename = $new_filename[count($new_filename) - 1];
                                    ?>
                <a target="_blank" class="fm_fancybox" rel="group_<?php 
                                    echo $www;
                                    ?>
" href="<?php 
                                    echo $new_file;
                                    ?>
"><?php 
                                    echo $new_filename;
                                    ?>
</a><br />
                          <?php 
                                }
                            }
                            ?>
              </td>
                      <?php 
                        } elseif (strpos($temp[$g]->element_value, "***star_rating***")) {
                            $view_star_rating_array = $this->model->view_for_star_rating($temp[$g]->element_value, $temp[$g]->element_label);
                            $stars = $view_star_rating_array[0];
                            ?>
              <td align="center" class="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc sub-align" id="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc" <?php 
                            echo $styleStr;
                            ?>
><?php 
                            echo $stars;
                            ?>
</td>
                      <?php 
                        } elseif (strpos($temp[$g]->element_value, "***matrix***")) {
                            ?>
   
              <td class="table_large_col <?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc sub-align" id="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc" <?php 
                            echo $styleStr;
                            ?>
>
                <a class="thickbox-preview" href="<?php 
                            echo add_query_arg(array('action' => 'show_matrix_fmc', 'matrix_params' => $temp[$g]->element_value, 'width' => '620', 'height' => '550', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
                            ?>
" title="Show Matrix">Show Matrix</a>
              </td>
                      <?php 
                        } elseif (strpos($temp[$g]->element_value, "@@@") !== FALSE || $temp[$g]->element_value == "@@@" || $temp[$g]->element_value == "@@@@@@@@@") {
                            ?>
              <td class="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc" <?php 
                            echo $styleStr;
                            ?>
>
                <p><?php 
                            echo str_replace("@@@", " ", $temp[$g]->element_value);
                            ?>
</p>
              </td>
                      <?php 
                        } elseif (strpos($temp[$g]->element_value, "***grading***")) {
                            $view_grading_array = $this->model->view_for_grading($temp[$g]->element_value);
                            $items = $view_grading_array[0];
                            ?>
              <td class="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc sub-align" id="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc" <?php 
                            echo $styleStr;
                            ?>
>
                <p><?php 
                            echo $items;
                            ?>
</p>
              </td>
                      <?php 
                        } else {
                            if (strpos($temp[$g]->element_value, "***quantity***")) {
                                $temp[$g]->element_value = str_replace("***quantity***", " ", $temp[$g]->element_value);
                            }
                            if (strpos($temp[$g]->element_value, "***property***")) {
                                $temp[$g]->element_value = str_replace("***property***", " ", $temp[$g]->element_value);
                            }
                            ?>
              <td class="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc sub-align" id="<?php 
                            echo $sorted_labels_id[$h];
                            ?>
_fc" <?php 
                            echo $styleStr;
                            ?>
>
                <p><?php 
                            echo str_replace("***br***", '<br>', stripslashes($temp[$g]->element_value));
                            ?>
</p>
              </td>
                      <?php 
                        }
                        $not_label = FALSE;
                    }
                }
                if ($not_label) {
                    ?>
              <td class="<?php 
                    echo $sorted_labels_id[$h];
                    ?>
_fc sub-align" id="<?php 
                    echo $sorted_labels_id[$h];
                    ?>
_fc" <?php 
                    echo $styleStr;
                    ?>
><p>&nbsp;</p></td>
                  <?php 
                }
            }
            if ($ispaypal) {
                $styleStr = $this->model->hide_or_not($lists['hide_label_list'], '@payment_info@');
                ?>
              <td class="table_large_col payment_info_fc sub-align" id="payment_info_fc" <?php 
                echo $styleStr;
                ?>
>
                <a class="thickbox-preview" href="<?php 
                echo add_query_arg(array('action' => 'paypal_info', 'id' => $i, 'width' => '600', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
                ?>
">
                  <img src="<?php 
                echo WD_FMC_URL . '/images/info.png';
                ?>
" />
                </a>
              </td>
                <?php 
            }
            ?>
            </tr>
            <?php 
            $k = 1 - $k;
        }
        ?>
        </table>
      </div>	 
      <?php 
        if ($sorted_label_types) {
            foreach ($sorted_label_types as $key => $sorted_label_type) {
                if ($this->model->check_radio_type($sorted_label_type)) {
                    $is_stats = true;
                    break;
                }
            }
            if ($is_stats) {
                ?>
		  <br /><br />
		  <h1 style="border-bottom: 1px solid; padding-bottom:7px; width:99%; color: hsl(197, 100%, 32%);">Statistics</h1>		
		  <table class="wp-list-table widefat fixed posts table_content" style="width: 99%;">
		    <tr>
          <td class="key" style="vertical-align: middle;width: 9%">
            <label for="sorted_label_key">Select a Field:</label>
          </td>
          <td width="330">
            <select id="sorted_label_key">
              <option value="">Select a Field</option>
                <?php 
                foreach ($sorted_label_types as $key => $sorted_label_type) {
                    if ($sorted_label_type == "type_checkbox" || $sorted_label_type == "type_radio" || $sorted_label_type == "type_own_select" || $sorted_label_type == "type_country" || $sorted_label_type == "type_paypal_select" || $sorted_label_type == "type_paypal_radio" || $sorted_label_type == "type_paypal_checkbox" || $sorted_label_type == "type_paypal_shipping") {
                        ?>
                    <option value="<?php 
                        echo $key;
                        ?>
"><?php 
                        echo $sorted_label_names_original[$key];
                        ?>
</option>
                    <?php 
                    }
                }
                ?>
            </select>
          </td>
          <td></td>
		    </tr>
		    <tr>
          <td class="key" style="vertical-align: middle;">
            <label>Select a Date:</label>
          </td>
          <td width="330">
            From: <input class="inputbox"  type="text" name="startstats" id="startstats" size="9" maxlength="9" />
                  <input type="reset" class="button" style="width: 22px; border-radius: 3px !important;"  value="..." name="startstats_but" id="startstats_but" onclick="return showCalendar('startstats','%Y-%m-%d');" /> 
                     
            To: <input class="inputbox" type="text" name="endstats" id="endstats" size="9" maxlength="9" />
                <input type="reset" class="button" style="width: 22px; border-radius: 3px !important;"  value="..." name="endstats_but" id="endstats_but" onclick="return showCalendar('endstats','%Y-%m-%d');" />
          </td>
          <td class="key" style="vertical-align: middle;">
            <input type="button" onclick="show_stats()" class="button-secondary" value="Show">
          </td>
		    </tr>
		  </table>
		  <div id="div_stats"></div>	
        <?php 
            }
        }
        ?>
    </form>	
    <script> 
      jQuery(window).load(function() {
        spider_popup();
      });
	  function show_stats() { 
		jQuery('#div_stats').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
		if(jQuery('#sorted_label_key').val()!="") {	 	  
		  jQuery('#div_stats').load('<?php 
        echo add_query_arg(array('action' => 'get_stats_fmc', 'page' => 'submissions_fmc'), admin_url('admin-ajax.php'));
        ?>
', {
		    'task': 'show_stats',
		    'form_id' : '<?php 
        echo $form_id;
        ?>
',
		    'sorted_label_key' : jQuery('#sorted_label_key').val(),
			'startdate' : jQuery('#startstats').val(), 
			'enddate' : jQuery('#endstats').val()
		    });
	    }		
		else
		  jQuery('#div_stats').html("Please select the field!")
	  }
      <?php 
        if ($ka_fielderov_search) {
            ?>
 
        document.getElementById('fields_filter').style.display = '';
        <?php 
        }
        ?>
    </script>
    <?php 
    }