Example #1
0
        if ($arr[0] != 'question') {
            continue;
        }
        $id = $arr[1];
        $post_variable = 'radio_' . $id;
        $total_questions++;
        if (isset($_POST[$post_variable]) && $value == $_POST[$post_variable]) {
            $correct_answers++;
        }
        $removed[] = $key;
    }
    foreach ($removed as $key) {
        unset($_SESSION[$key]);
    }
    $result = $correct_answers / $total_questions * 100;
    add_result($result, $_SESSION['user_id'], $exam_id);
    header("Location: exams.php");
    echo "Result: " . $result . "%<br/>\n";
}
?>

<html>
	<head>
		<title> Enter Exam </title>
	</head>
	<body>
		<h3><?php 
echo $exam_name;
?>
</h3>
		<hr/>
Example #2
0
    }
    /*---------------Category---------------*/
    if (isset($u_category) && $u_category !== "Industry" && $u_category !== "") {
        validate_category();
    }
    /*---------------Location---------------*/
    if (isset($u_location) && $u_location !== "Location" && $u_location !== "") {
        validate_location();
    }
    /*---------------keywords---------------*/
    if (isset($u_keywords) && $u_keywords !== "") {
        validate_keywords_and();
    }
    /*---------------Display Result---------------*/
    if ($correct_result == true) {
        add_result($input);
    }
}
//END FOR LOOP
$feedback = "<h3>Your search returned {$result_count} results</h3>";
if ($results == "") {
    echo "<div class='container-fluid'>\n  <h3 class='text-center'>There are currently no jobs available for the industry/location selected.</h3>\n  <br>\n  <h3 class='text-center'>Click one of the links below to see current jobs in a specific industry.</h3>\n  <br>\n  <div class='col-md-12 col-lg-12 col-sm-12 col-xs-12 no-search-results'>\n  <div class='col-lg-6 col-md-6 col-sm-12 col-xs-12'>\n  <a class='btn btn-primary full-width' href='biotech-pharma-medical-device-jobs'>Biotech - Pharma - Medical Device Jobs</a>\n  </div>\n  <div class='col-lg-6 col-md-6 col-sm-12 col-xs-12'>\n  <a class='btn btn-primary full-width' href='engineering-design-jobs'>Engineering & Design Jobs</a>\n  </div>\n  <div class='col-lg-6 col-md-6 col-sm-12 col-xs-12'>\n  <a class='btn btn-primary full-width' href='construction-infrastructure-jobs'>Construction & Infrastructure Jobs</a>\n  </div>\n  <div class='col-lg-6 col-md-6 col-sm-12 col-xs-12'>\n  <a class='btn btn-primary full-width' href='manufacturing-food-beverage-jobs'>Manufacturing Jobs</a>\n  </div>\n  </div>\n  </div>";
} else {
    echo $feedback;
    echo $header;
    echo $results;
}
/*---------------Google Analytics for Site Search---------------*/
if (isset($_POST['search_location']) || isset($_POST['search_category']) || isset($_POST['search_bar'])) {
    keyword_analytics($u_keywords, $u_category, $u_location);
}
Example #3
0
$timestamp = time();
$today_day = (int) @date("j", $timestamp);
$today_month = (int) @date("n", $timestamp);
$today_year = (int) @date("Y", $timestamp);
$result = 0;
// Determine and resolve ambiguities.
/*
	Expected input:
	* (nothing) = today
	* 7 = date of current month (if sane), or today in given year (if sane)
	* 5/6 = day & month in current year (if sane), order locale-dependent
	* 4/5/6 = day, month, year (if sane), order locale-dependent
*/
$numbers = preg_match_all("/[0-9]+/i", $in, $matches);
// Show today's date.
add_result($w, $today_day, $today_month, four_digit_year($today_year));
// Send results back to Alfred.
echo $w->toxml();
// -- Functions --
function add_result($workflow, $theDay, $theMonth, $theYear)
{
    global $today_day, $today_month, $today_year;
    global $result;
    $theTimestamp = @mktime(0, 0, 0, $today_month, $today_day, $today_year);
    $WeekNumber = @strftime("%V", $theTimestamp);
    $workflow->result($result . $WeekNumber, $WeekNumber, $WeekNumber, "The week number is {$WeekNumber}", "./icons/blank.png", 'yes');
    $result++;
}
function four_digit_year($yr)
{
    global $today_year;
Example #4
0
    if ($job_department == $xml_job_department) {
        $ranking += 1;
        echo "dep";
    }
    if ($job_country == $xml_job_country) {
        $ranking += 1;
        echo "count";
    }
    foreach ($titles_array as $secondary_title) {
        if (in_array($secondary_title, $xml_titles_array, true)) {
            $ranking += 2;
            var_dump($secondary_title);
            echo "s match";
        }
    }
    add_result($ranking, $input);
}
//END FOR LOOP
function result_comp($a, $b)
{
    if (array_keys($a)[0] == array_keys($b)[0]) {
        return 0;
    }
    return array_keys($a)[0] < array_keys($b)[0] ? -1 : 1;
}
usort($results, "result_comp");
$results = array_reverse($results);
//echo $feedback;
//echo $header;
$slice = array_slice($results, 0, 5);
foreach ($slice as $sub) {