<?php
$search_jobs_link = "jobs/jobs.html";
$search_cv_link = "resumes/resumes.html";

function getSelectedMenuStyle($var, $val, $class, $active_class) {
	$str = '';
	if(isset($_REQUEST[$var]) && $_REQUEST[$var] == $val) {
		$str .= ' class="'.$class.'  '.$active_class.'" ';
	}
	else {
		$str .= ' class="'.$class.'" ';
	}
	return $str;
}

if(!isset($_REQUEST['jobs_step'])) {
	$_REQUEST['jobs_step'] = "jobs_add";
}

if(isset($_SESSION['member_id']) && $_SESSION['member_id']>0) {
	$member_id = $_SESSION['member_id'];
	$search_jobs_link = "my_jobs/jobs_job_list.html";
	$search_cv_link = "my_jobs/jobs_cv_list.html";
	
	$account_jobs_link = "my_jobs/jobs_add.html";
	$account_cv_link = "my_jobs/jobs_add_cv.html";
	$myaccount_link = "account/my_account.html";
}
?>


<div class="article cyprus">
    <header>
        <h1>Jobs / Resumes</h1>
    </header>
    <div class="article-body cyprus">
        <?php
        $exclude_menu_for = array();
        if(isset($_REQUEST['jobs_step']) && !in_array($_REQUEST['jobs_step'], $exclude_menu_for)) {
            $search_jobs_class = $_REQUEST['jobs_step'] == "jobs_job_list" ? "active" : "";
            $search_cvs_class = $_REQUEST['jobs_step'] == "jobs_cv_list" ? "active" : "";

            $account_jobs_class = $_REQUEST['jobs_step'] == "jobs_add" ? "active" : "";
            $account_cv_class = $_REQUEST['jobs_step'] == "jobs_add_cv" ? "active" : "";
            $myaccount_class = $_REQUEST['jobs_step'] == "my_account" ? "active" : "";
            ?>
            <ul class="nav nav-pills no-margin" role="tablist">
                <li role="presentation" class="<?= $search_jobs_class; ?>">
                    <a href="<?php print $search_jobs_link; ?>" id="browse_ads" class="classif_action">Search Jobs</a>
                </li>
                <li role="presentation" class="<?= $search_cvs_class; ?>">
                    <a href="<?php print $search_cv_link; ?>" id="browse_ads" class="classif_action">Search CVs</a>
                </li>
                <?php
                if ($member_id > 0) {
                    ?>
                    <li role="presentation" class="<?= $account_jobs_class; ?>">
                        <a href="<?php print $account_jobs_link; ?>" id="publish_ads">My Jobs</a>
                    </li>
                    <li role="presentation" class="<?= $account_cv_class; ?>">
                        <a href="<?php print $account_cv_link; ?>" id="view_account">My CV</a>
                    </li>
                    <li role="presentation" class="<?= $myaccount_class; ?>">
                        <a href="<?php print $myaccount_link; ?>" id="view_account">My Account</a>
                    </li>
                    <?php
                }

                ?>
            </ul>
            <?php
        }
        ?>
    </div>
</div>


<?php
// Get the modules prefix
$dot_include = "";
$mod_include_pref	= "amodules/";
if(!is_dir($mod_include_pref)) {
	$mod_include_pref = "../" . $mod_include_pref;
	$dot_include = "../" . $dot_include;
	if(!is_dir($mod_include_pref)) {
		$mod_include_pref = "../" . $mod_include_pref;
		$dot_include = "../" . $dot_include;
		if(!is_dir($mod_include_pref)) {
			$mod_include_pref = "../" . $mod_include_pref;
			$dot_include = "../" . $dot_include;
		}
	}
}



if(isset($_REQUEST['jobs_step'])) {
	$jobs_step = $_REQUEST['jobs_step'];
	$included_step = $mod_include_pref.$jobs_step.".php";
	//echo $included_step;
	include_once($included_step);
}
else {
	$included_step = $mod_include_pref."jobs_add.php";
	//echo $included_step;
	include_once($included_step);
}
?>

