Changeset - 1e78016d4463
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2010-10-09 19:26:35
ohnobinki@ohnopublishing.net
A less messy way to force the user to choose his school the first time he navigates to input.php.
1 file changed with 7 insertions and 6 deletions:
0 comments (0 inline, 0 general)
input.php
Show inline comments
 
@@ -39,30 +39,31 @@ var sectionsOfClass = Array();
 
// </script>', TRUE);
 

	
 
$inputPage->head();
 

	
 
/*
 
 * Force a student to choose a school or declare he's a generic
 
 * student before displaying the input form.
 
 * student before displaying the input form. To do this, we need
 
 * another variable in $_SESSION: $_SESSION['school_chosen'].
 
 */
 
$school = $inputPage->get_school();
 
if ($_REQUEST['setted'] == 1 || $school['id'] != 'default')
 
  $_SESSION['school_setted'] = TRUE;
 
if ($_REQUEST['school'] == 1 || $school['id'] != 'default')
 
  $_SESSION['school_chosen'] = TRUE;
 
if ($_REQUEST['selectschool'] == 1
 
    || $school['id'] == 'default' && !isset($_SESSION['school_setted']))
 
    || $school['id'] == 'default' && !isset($_SESSION['school_chosen']))
 
  {
 
?>
 
<h2>School Selection</h2>
 
<p>
 
  Choose the school you attend from the list below. <b>If you cannot
 
  find your school</b>, you may proceed using
 
  the <a href="input.php?school=default&amp;setted=1">generic
 
  the <a href="input.php?school=default">generic
 
  settings</a>.
 
</p>
 
<?php
 
    $inputPage->showSchools('input.php?setted=1');
 
    $inputPage->showSchools('input.php');
 
    $inputPage->foot();
 
    exit;
 
  }
 

	
 
$inputPage->showSavedScheds($_SESSION);
 
?>
0 comments (0 inline, 0 general)