<?php
if (!defined('ABSPATH'))
    die('Restricted Access');
?>
<div class="wjportal-main-up-wrapper">
<?php
if(!WPJOBPORTALincluder::getTemplate('templates/header',array('wpjobportal_module' => 'resume'))){
    return;
}
if (wpjobportal::$_error_flag == null) { ?>
    <div class="wjportal-main-wrapper wjportal-clearfix">
        <div class="wjportal-page-header">
            <div class="wjportal-page-header-cnt">
                <?php
                    WPJOBPORTALincluder::getTemplate('templates/pagetitle',array('wpjobportal_module' => 'resumesearch','wpjobportal_layout'=>'resumelist'));
                ?>
            </div>
            <div class="wjportal-header-actions">
            <?php
                $wpjobportal_image1 = esc_url(WPJOBPORTAL_PLUGIN_URL) . "includes/images/sort-up.png";
                $wpjobportal_image2 = esc_url(WPJOBPORTAL_PLUGIN_URL) . "includes/images/sort-down.png";
                if (wpjobportal::$_data['sortby'] == 1) {
                    $wpjobportal_image = $wpjobportal_image1;
                } else {
                    $wpjobportal_image = $wpjobportal_image2;
                }
                $wpjobportal_categoryarray = array(
                    (object) array('id' => 1, 'text' => esc_html(__('Application Title', 'wp-job-portal'))),
                    (object) array('id' => 2, 'text' => esc_html(__('First Name', 'wp-job-portal'))),
                    (object) array('id' => 3, 'text' => esc_html(__('Category', 'wp-job-portal'))),
                    (object) array('id' => 4, 'text' => esc_html(__('Job Type', 'wp-job-portal'))),
                    (object) array('id' => 5, 'text' => esc_html(__('Location', 'wp-job-portal'))),
                    (object) array('id' => 6, 'text' => esc_html(__('Created', 'wp-job-portal')))
                );
            // resume filters
                WPJOBPORTALincluder::getTemplate('resume/views/frontend/filter',array(
                    'wpjobportal_sortbylist' => $wpjobportal_categoryarray,
                    'wpjobportal_filter' => 'resume',
                    'wpjobportal_image' => $wpjobportal_image,
                    'wpjobportal_image1' => $wpjobportal_image1,
                    'wpjobportal_image2' => $wpjobportal_image2
                ));
            ?>
            </div>
        </div>
        <?php /*
        <div class="wjportal-filter-search-main-wrp">
            <?php if(in_array('airesumesearch', wpjobportal::$_active_addons)){ ?>
                <form class="wjportal-form-wrp" id="job_form" method="post" action="<?php echo esc_url(wpjobportal::wpjobportal_makeUrl(array('wpjobportalme'=>'resume', 'wpjobportallt'=>'resumes'))); ?>">
                    <?php
                    // resume ai Search
                    WPJOBPORTALincluder::getTemplate('resume/views/frontend/filter',array(
                        'wpjobportal_filter' => 'airesumesearch',
                    )); ?>
                </form>
            <?php }?>
        </div>
        */
            if (isset(wpjobportal::$_data['fromtags'])) {
                $wpjobportal_heading = esc_html(__('Resumes By Tag', 'wp-job-portal')) . ' [' . wpjobportal::$_data['fromtags'] . ']';
            }else {
                $wpjobportal_heading = esc_html(__('Resumes', 'wp-job-portal'));
            }
        ?>
        <div class="wjportal-resume-list-wrp">
        <?php
            //Resume Search Save addons
            if(in_array('resumesearch', wpjobportal::$_active_addons)){
                do_action('wpjobportal_addons_resume_search_save_form');
            }
            if (isset(wpjobportal::$_data[0]) && !empty(wpjobportal::$_data[0])) {?>
                <form id="resume_form" method="post" action="<?php echo esc_url(wpjobportal::wpjobportal_makeUrl(array('wpjobportalme'=>'resume','wpjobportallt'=>'resumes','wpjobportalpageid' =>wpjobportal::wpjobportal_getPageid()))); ?>">
                <?php
                foreach (wpjobportal::$_data[0] AS $wpjobportal_myresume) {
                    //Load Template View Resume
                    WPJOBPORTALincluder::getTemplate('resume/views/frontend/resumelist',array(
                        'wpjobportal_module' => 'resume',
                        'wpjobportal_myresume' => $wpjobportal_myresume,
                        'wpjobportal_percentage' => '',
                        'wpjobportal_control' => ''
                    ));
                }
                if (wpjobportal::$_data[1]) {
                    WPJOBPORTALincluder::getTemplate('templates/pagination',array('wpjobportal_module' => 'resume','pagination' => wpjobportal::$_data[1]));
                }
                echo wp_kses(WPJOBPORTALformfield::hidden('sortby', wpjobportal::$_data['sortby']),WPJOBPORTAL_ALLOWED_TAGS);
                echo wp_kses(WPJOBPORTALformfield::hidden('sorton', wpjobportal::$_data['sorton']),WPJOBPORTAL_ALLOWED_TAGS);
                echo wp_kses(WPJOBPORTALformfield::hidden('jsformresumesearch', 1),WPJOBPORTAL_ALLOWED_TAGS);
                echo wp_kses(WPJOBPORTALformfield::hidden('WPJOBPORTAL_form_search', 'WPJOBPORTAL_SEARCH'),WPJOBPORTAL_ALLOWED_TAGS);
                echo wp_kses(WPJOBPORTALformfield::hidden('wpjobportallay', 'resumes'),WPJOBPORTAL_ALLOWED_TAGS);
                echo wp_kses(WPJOBPORTALformfield::hidden('resume_filter', isset(wpjobportal::$_data['filter']) ? wpjobportalphplib::wpJP_safe_encoding(wp_json_encode(wpjobportal::$_data['filter'])) : ''),WPJOBPORTAL_ALLOWED_TAGS);

                ?>
                </form>
                <?php
            } else {
                WPJOBPORTALlayout::getNoRecordFound();
            }
        }
    ?>
</div>
</div>


