Skip to content
Browse files

Now to be thrown out.

  • Loading branch information...
1 parent 983c5bb commit fc0aed7a3fb4a31286aecf99b6e7b290da440cc1 @46bit committed Mar 20, 2012
Showing with 40 additions and 7 deletions.
  1. +1 −1 helper.php
  2. +1 −1 index.php
  3. +38 −5 result.php
View
2 helper.php
@@ -94,7 +94,7 @@ function soc_to_vacancy_count ($soc, $jcp = FALSE, $trimSoc = 3)
{
$endpoint .= '?offices=' . rawurlencode($jcp);
}
- $lookup = ukces_api($endpoint);
+ $lookup = ukces_api($endpoint, FALSE, FALSE);
return count($lookup->result);
}
View
2 index.php
@@ -30,7 +30,7 @@
<input type="text" name="live-in" placeholder="I live in..." />
</div>
<div class="field">
- <input type="text" name="want-to" placeholder="I want to do..." />
+ <input type="text" name="want-to" placeholder="I want to be a..." />
</div>
<div class="field">
<input type="text" name="am-studying" placeholder="I study..." />
View
43 result.php
@@ -1,7 +1,34 @@
<?php
require_once 'helper.php';
-?>
-<!DOCTYPE html>
+
+$dropout = FALSE;
+
+$job = $_POST['want-to'];
+
+$soc = job_to_soc($job);
+$wage = soc_to_wage($soc) * 52;
+$n_jobs = soc_to_vacancy_count($soc);
+
+if (($weekly_wage / 30000) > 0.5)
+{
+ $dropout = TRUE;
+}
+if ($n_jobs > 100)
+{
+ $dropout = TRUE;
+}
+
+if (strpos(strtolower($job), 'startup'))
+{
+ $dropout = TRUE;
+}
+
+if ($_POST['beware-parents'])
+{
+ $dropout = FALSE;
+}
+
+?><!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6 iep9 iep8"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7 iep9 iep8"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8 iep9"> <![endif]-->
@@ -26,9 +53,15 @@
<div id="page">
<div id="main">
<div class="results">
- <p class="in-short">Yes</p>
- <p>Before you get bored and go crazy</p>
- <p class="try-again"><a href="index.php">&larr; I forgot who I am</a></p>
+ <?php if ($dropout) { ?>
+ <p class="in-short">Yes</p>
+ <p>Before you get bored and go crazy</p>
+ <p class="try-again"><a href="index.php">&larr; I forgot who I am</a></p>
+ <?php } else { ?>
+ <p class="in-short">No</p>
+ <p>Be a good student and stay at University</p>
+ <p class="try-again"><a href="index.php">&larr; I forgot who I am</a></p>
+ <?php } ?>
</div>
</div>
<footer id="footer">

0 comments on commit fc0aed7

Please sign in to comment.
Something went wrong with that request. Please try again.