Changeset - 8b02c8161ab3
[Not reviewed]
Merge default
0 8 0
ethanzonca - 15 years ago 2010-10-14 19:39:45

Merge
8 files changed with 49 insertions and 29 deletions:
0 comments (0 inline, 0 general)
admin/rehash.php
Show inline comments
 
@@ -83,24 +83,35 @@ function school_list()
 
	continue;
 

	
 
      $school_id_list[] = $matches[1];
 
    }
 

	
 
  closedir($schoold_dir);
 

	
 
  return $school_id_list;
 
}
 

	
 
/**
 
 * \brief
 
 *   Compare the two schools by their names.
 
 *
 
 * \see strcmp()
 
 */
 
function school_cmp($school_a, $school_b)
 
{
 
  return strcmp($school_a['name'], $school_b['name']);
 
}
 

	
 
/**
 
 * \brief
 
 *   Write out the cache file which remembers the list of available
 
 *   schools.
 
 *
 
 * \todo
 
 *   If the list of displayed schools is to be sorted, this is the
 
 *   place to do it.
 
 *
 
 * \param $schools
 
 *   An array of school handles.
 
 */
 
function school_cache($schools)
 
{
 
@@ -124,24 +135,25 @@ function school_cache($schools)
 
		  || !is_array($domain_cache_ptr[$domain_part]))
 
		$domain_cache_ptr[$domain_part] = array();
 
	      $domain_cache_ptr =& $domain_cache_ptr[$domain_part];
 
	    }
 
	  /*
 
	   * get the last part which is unambiguously identifies this
 
	   * school combined with the previous parts
 
	   */
 
	  $domain_part = array_shift($domain_parts);
 
	  $domain_cache_ptr[$domain_part] = $school['id'];
 
	}
 
    }
 
  uasort($list_cache, 'school_cmp');
 

	
 
  $cache = array('list' => $list_cache, 'domains' => $domain_cache);
 

	
 

	
 
  $cache_file_name = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
 
    . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'schools';
 
  $cache_file = fopen($cache_file_name, 'wb');
 
  if ($cache_file === FALSE)
 
    {
 
      fprintf(STDERR, "Unable to open `%s' for writing\n",
 
	      $cache_file_name);
 
      return 1;
class.class.php
Show inline comments
 
@@ -64,24 +64,24 @@ class Classes
 
  {
 
    return $this->name;
 
  }
 

	
 
  /**
 
   * \brief
 
   *   Renders this Classes into something suitable for input.php.
 
   */
 
  function input_form_render($class_key)
 
  {
 
    $n = "\n";
 
    $out = '<tr title="' . $class_key . '" class="class class' . $class_key . '">' . $n
 
      . '  <td><input type="text" class="required defText" title="Class Name" name="postData[' . $class_key . '][name]" value="' . str_replace('"', '&quot;', $this->getName()) . '"/></td>' . $n
 
      . '  <td><input type="text" class="required defText" title="Class Name" name="postData[' . $class_key . '][name]" value="' . htmlentities($this->getName()) . '"/></td>' . $n
 
      . '  <td colspan="8"></td>' . $n
 
      . '  <td class="tdInput"><div class="addSection"><input type="button" value="Add section" /></div></td>' . $n
 
      . '  <td class="tdInput"><div class="deleteClass"><input type="button" value="Remove" /></div></td>' . $n
 
      . '  <td class="tdInput"><div class="addSection"><input type="button" value="Add section" class="gray" /></div></td>' . $n
 
      . '  <td class="tdInput"><div class="deleteClass"><input type="button" value="Remove" class="gray" /></div></td>' . $n
 
      . "</tr>\n";
 

	
 
    foreach ($this->sections as $key => $section)
 
      $out .= $section->input_form_render($class_key, $key);
 

	
 
    return $out;
 
  }
 
}
class.schedule.php
Show inline comments
 
@@ -281,25 +281,25 @@ class Schedule
 
    */
 
    $footcloser = '';
 

	
 
    if(isset($_REQUEST['print']) && $_REQUEST['print'] != ''){
 
      $headcode = array('jQuery', 'jQueryUI', 'uiTabsKeyboard', 'outputStyle', 'outputPrintStyle');
 
    }
 
    else {
 
/*      $footcloser .="<script type=\"text/javascript\" charset=\"utf-8\">". 
 
	"\n\tvar my_glider = new Glider('my-glider', {duration:0});".
 
	"\n</script>"; */
 
      $headcode = array('outputStyle',  'jQuery', 'jQueryUI', 'uiTabsKeyboard');
 
    }
 
    $outputPage = new page($this->getName(), $headcode);
 
    $outputPage = new Page(htmlentities($this->getName()), $headcode);
 

	
 

	
 

	
 
    if(isset($_REQUEST['print'])){
 
 
 
     echo '<script type="text/javascript">';
 
      echo 'jQuery(document).ready( function() {';
 
 
 
      /* If user entered items to print */
 
      if($_REQUEST['print'] != 'all'){
 
	echo 'jQuery(\'.section\').hide();';
 
	$items = explode(',', $_REQUEST['print']);
 
@@ -368,29 +368,29 @@ class Schedule
 

	
 
		//---------------MONDAY---------------
 
		for($j = 0; $j < $this->nclasses; $j++)
 
		  {
 
		    if($M == -1)
 
		      {
 
			if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getM())
 
			  {
 
			    if(($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() >= $time[$r]) && ($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() < $time[$r+1]))
 
			      {
 
				if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
				  {
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				    $M = $j;
 
				    $filled = true;
 
				  } else {
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				  $filled = true;
 
				}
 
			      }
 
			  }
 
		      } else {
 
		      if($j == $M)
 
			{
 
			  if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
			    {
 
			      $table .= "\n\t\t<td class=\"mid class{$j}\">&nbsp;</td>";
 
			      $filled = true;
 
			    } else {
 
@@ -411,29 +411,29 @@ class Schedule
 
               	                     
 
		//---------------TUESDAY---------------
 
		for($j = 0; $j < $this->nclasses; $j++)
 
		  {
 
		    if($Tu == -1)
 
		      {
 
			if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getTu())
 
			  {
 
			    if(($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() >= $time[$r]) && ($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() < $time[$r+1]))
 
			      {
 
				if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
				  {
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				    $Tu = $j;
 
				    $filled = true;
 
				  } else {
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				  $filled = true;
 
				}
 
			      }
 
			  }
 
		      } else {
 
		      if($j == $Tu)
 
			{
 
			  if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
			    {
 
			      $table .= "\n\t\t<td class=\"mid class{$j}\">&nbsp;</td>";
 
			      $filled = true;
 
			    } else {
 
@@ -454,29 +454,29 @@ class Schedule
 
	
 
		//---------------WEDNESDAY---------------
 
		for($j = 0; $j < $this->nclasses; $j++)
 
		  {
 
		    if($W == -1)
 
		      {
 
			if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getW())
 
			  {
 
			    if(($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() >= $time[$r]) && ($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() < $time[$r+1]))
 
			      {
 
				if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
				  {
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				    $W = $j;
 
				    $filled = true;
 
				  } else {
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				  $filled = true;
 
				}
 
			      }
 
			  }
 
		      } else {
 
		      if($j == $W)
 
			{
 
			  if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
			    {
 
			      $table .= "\n\t\t<td class=\"mid class{$j}\">&nbsp;</td>";
 
			      $filled = true;
 
			    } else {
 
@@ -497,29 +497,29 @@ class Schedule
 

	
 
		//---------------THURSDAY---------------
 
		for($j = 0; $j < $this->nclasses; $j++)
 
		  {
 
		    if($Th == -1)
 
		      {
 
			if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getTh())
 
			  {
 
			    if(($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() >= $time[$r]) && ($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() < $time[$r+1]))
 
			      {
 
				if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
				  {
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				    $Th = $j;
 
				    $filled = true;
 
				  } else {
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				  $filled = true;
 
				}
 
			      }
 
			  }
 
		      } else {
 
		      if($j == $Th)
 
			{
 
			  if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
			    {
 
			      $table .= "\n\t\t<td class=\"mid class{$j}\">&nbsp;</td>";
 
			      $filled = true;
 
			    } else {
 
@@ -540,29 +540,29 @@ class Schedule
 

	
 
		//---------------FRIDAY---------------
 
		for($j = 0; $j < $this->nclasses; $j++)
 
		  {
 
		    if($F == -1)
 
		      {
 
			if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getF())
 
			  {
 
			    if(($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() >= $time[$r]) && ($this->classStorage[$j]->getSection($this->storage[$i][$j])->getStartTime() < $time[$r+1]))
 
			      {
 
				if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
				  {
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				    $table .= "\n\t\t<td class=\"top class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				    $F = $j;
 
				    $filled = true;
 
				  } else {
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . $this->classStorage[$j]->getName() . " " . $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() . "</td>";
 
				  $table .= "\n\t\t<td class=\"single class{$j}\">" . htmlentities($this->classStorage[$j]->getName()) . " " . htmlentities( $this->classStorage[$j]->getSection($this->storage[$i][$j])->getLetter() ) . "</td>";
 
				  $filled = true;
 
				}
 
			      }
 
			  }
 
		      } else {
 
		      if($j == $F)
 
			{
 
			  if($this->classStorage[$j]->getSection($this->storage[$i][$j])->getEndTime() > $time[$r+1])
 
			    {
 
			      $table .= "\n\t\t<td class=\"mid class{$j}\">&nbsp;</td>";
 
			      $filled = true;
 
			    } else {
class.section.php
Show inline comments
 
@@ -163,25 +163,25 @@ class Section
 
  {
 
    static $n = "\n";
 
    $out = '<tr class="section class' . $class_key . '">' . $n
 
      . '  <td class="none"></td>' . $n;
 
    switch ($section_format)
 
      {
 
      case 'numerous':
 
      default:
 
	/* see customIds() in scheduleInput.js */
 
	$out .= '  <td class="sectionIdentifier center">' . $n
 
	. '    <input type="text" size="1" class="required" title="Section Name"' . $n
 
	. '           name="postData[' . $class_key . '][' . $section_key . '][letter]"' . $n
 
	. '           value="' . $this->letter . '" />' . $n
 
	. '           value="' . htmlentities($this->letter) . '" />' . $n
 
	. "  </td>\n";
 
      break;
 
      }
 

	
 
    $out .= "  <td>\n"
 
      . '    <select class="selectRequired" name="postData[' . $class_key . '][' . $section_key . '][start]">' . $n;
 
    for ($h = 7; $h <= 21; $h ++)
 
      {
 
	$nm = 'p';
 
	$hr = $h;
 
	if ($h < 12)
 
	  $nm = 'a';
 
@@ -233,20 +233,20 @@ class Section
 
    foreach ($this->bdays as $day_key => $day_enabled)
 
      {
 
	if ($day_enabled)
 
	  $day_enabled = 'checked="checked"';
 
	else
 
	  $day_enabled = '';
 
	$out .= "  <td>\n"
 
	  . '    <input type="checkbox" class="daysRequired"'
 
	  . '           name="postData[' . $class_key . '][' . $section_key . '][days][' . $day_key . ']" value="1" ' . $day_enabled . ' />' . $n
 
	  . "  </td>\n";
 
      }
 

	
 
    $out .= '  <td><div class="deleteSection"><input type="button" value="X" /></div></td>' . $n;
 
    $out .= '  <td><div class="deleteSection"><input type="button" value="X" class="gray" /></div></td>' . $n;
 
    $out .= '  <td></td>' . $n;
 

	
 
    $out .= "</tr>\n";
 

	
 
    return $out;
 
  }
 
}
inc/class.page.php
Show inline comments
 
@@ -31,24 +31,28 @@ class page
 

	
 
  /*
 
   * Google analytics ga.js tracking code. Expanded in __construct().
 
   */
 
  private $trackingcode = '';
 

	
 
  private $pagetitle = ''; // Title of page
 
  private $scripts = array(); // Scripts to include on page
 

	
 
  /* the current school. See get_school(). */
 
  private $school;
 

	
 
  /**
 
   * \param $ntitle
 
   *   Must be a valid HTML string (i.e., escaped with htmlentities()).
 
   */
 
  public function __construct($ntitle, $nscripts = array(), $immediate = TRUE)
 
  {
 
    global $ga_trackers;
 

	
 
    require_once('school.inc');
 

	
 
    // Scripts and styles available to include
 
    $this->headCode['jQuery'] = '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript" />';
 
    $this->headCode['jQueryUI'] = '<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/jquery-ui.min.js" type="text/javascript" /><link rel="stylesheet" href="styles/jqueryui.css" type="text/css" media="screen" charset="utf-8" />';
 
    $this->headCode['jValidate'] = '<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.pack.js"></script>';
 
    $this->headCode['schedInput'] = '<script type="text/javascript" src="scripts/scheduleInput.js"></script>';
 
    $this->headCode['outputPrintStyle'] = '<link rel="stylesheet" href="styles/print.css" type="text/css" media="screen" charset="utf-8" />';
 
@@ -82,32 +86,32 @@ class page
 
       $i = 0;
 
       foreach ($ga_trackers as $ga_tracker)
 
	 {
 
	   $this->trackingcode .= "\n"
 
	     . '      mytrackers[' . $i . '] = _gat._getTracker(\'' . $ga_tracker . "');\n"
 
	     . '      mytrackers[' . $i . "]._trackPageview();\n";
 
	 }
 

	
 
       $this->trackingcode .= '  ' . ($this->xhtml ? ']]>'       : '') . "\n"
 
	 . "  </script>\n";
 
     }
 

	
 
   self::session_start();
 
    self::session_start();
 
    /* everything that needs sessions started to work: */
 

	
 
    $this->school = school_load_guess();
 

	
 
    if($immediate
 
       && $ntitle != "NOHEAD")
 
      $this->head();
 

	
 
    /* everything that needs sessions started to work: */
 

	
 
    $this->school = school_load_guess();
 
 }
 

	
 
  /**
 
   * \brief
 
   *   Adds some headcode to this page.
 
   *
 
   * \param $key
 
   *   The key to register this headcode under.
 
   * \param $code
 
   *   The actual code, such as a <script/>.
 
   * \param $enable
 
   *   Whether or not to enable this code while adding it.
 
@@ -162,25 +166,26 @@ class page
 
  }
 

	
 

	
 

	
 
  public function foot(){
 
    echo '</div> <!-- id="content" -->';
 
    $this->pageGenTime = round(microtime(), 3);
 
    echo '  <div id="footer">
 
  	    <div id="leftfoot" style="float:left; margin-top: 1em;">
 
		<a href="feedback.php">Submit Feedback</a>
 
            </div>
 
            <div id="rightfoot"><h5>&copy; '. date('Y').' <a href="http://protofusion.org/~nathang/">Nathan Gelderloos</a><br />
 
              <a href="http://ethanzonca.com">Ethan Zonca</a>
 
              <a href="http://ethanzonca.com">Ethan Zonca</a><br />
 
			  <a href="http://ohnopub.net">Nathan Phillip Brink</a>
 
            </h5>
 
	  </div>
 
        </div> <!-- id="footer" -->
 
      </div>';
 
    echo $this->trackingcode;
 
    echo '</body></html>';
 
  }
 

	
 
  public function secondsToCompound($seconds) {
 
      $ret = "";
 
      $hours = intval(intval($seconds) / 3600);
 
      $ret .= "$hours:";
input.php
Show inline comments
 
@@ -42,50 +42,53 @@ var sectionsOfClass = Array();
 

	
 
/*
 
 * Force a student to choose a school or declare he's a generic
 
 * student before displaying the input form. To do this, we need
 
 * another variable in $_SESSION: $_SESSION['school_chosen'].
 
 */
 
$school = $inputPage->get_school();
 
if ($school && (!empty($_REQUEST['school']) || $school['id'] != 'default'))
 
  $_SESSION['school_chosen'] = TRUE;
 
if (!empty($_REQUEST['selectschool'])
 
    || $school['id'] == 'default' && !isset($_SESSION['school_chosen']))
 
  {
 
    $next_page = 'input.php';
 
    if (isset($_GET['s']))
 
      $next_page .= '?s=' . (int)$_GET['s'];
 
?>
 
<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">generic
 
  the <a href="<?php echo $next_page . (strpos($next_page, '?') === FALSE ? '?' : '&amp;'); ?>school=default">generic
 
  settings</a>.
 
</p>
 
<?php
 
    $inputPage->showSchools('input.php');
 
    $inputPage->showSchools($next_page);
 
    $inputPage->foot();
 
    exit;
 
  }
 

	
 
$inputPage->showSavedScheds($_SESSION);
 
?>
 
<p>
 
  Welcome to SlatePermutate<?php $inputPage->addressStudent(', ', '',
 
  FALSE); ?>! To get started, enter in some of your
 
  classes, and add available sections for each class.
 
</p>
 
<form method="post" action="process.php" id="scheduleForm">
 
<br />
 
<label>Schedule Name</label><br />
 
<input id="scheduleName" style="margin-bottom: 1em;" class="defText required" type="text" size="25" title="(e.g., Spring <?php echo Date('Y'); ?>)" name="postData[name]"
 
<?php if ($sch) echo 'value="' . str_replace('"', '&quot;', $sch->getName()) . '"'; /*"*/ ?>
 
<?php if ($sch) echo 'value="' . htmlentities($sch->getName()) . '"'; /*"*/ ?>
 
/>
 

	
 
<table id="container">
 
  <tr><td>
 
    <table id="jsrows">
 
	<!-- Header -->
 
	<tr>
 
		<td>Class</td>
 
		<td class="center" id="letterNumber">Section</td>
 
		<td class="center">Start Time</td>
 
		<td class="center">End Time</td>
 
		<td class="center">M</td>
school.d/default.inc
Show inline comments
 
@@ -32,21 +32,21 @@ function default_info()
 
	       );
 
}
 

	
 
function default_instructions_html()
 
{
 
  return <<<EOF
 
<h2>Generic Instructions</h2>
 
<p>
 
  <tt>slate_permutate</tt> can be a useful tool for scheduling your next semester at the college you attend.
 
</p>
 
<ol>
 
  <li>Get in touch with your advisor and find out what courses you need to take next semester.</li>
 
  <li>Look up each course which your advisor specified in your college's course catalog. Note the different sectxions for each course..</li>
 
  <li>Look up each course which your advisor specified in your college's course catalog. Note the different sections for each course..</li>
 
  <li>Enter each course into a <tt>slate_permutate</tt> schedule. For each course, add the sections listed in your school's course catalogue (at your discretion).</li>
 
  <li>Submit your list of courses and their sections. Let <tt>slate_permutate</tt> perform its magic.</li>
 
  <li>View all of the different permutations of your schedule and find a few that work for you.</li>
 
  <li>Print our your preferred schedule by selecting a schedule an choosing your User-Agent's print option.</li>
 
  <li>Print out your preferred schedule by selecting a schedule an choosing your User-Agent's print option.</li>
 
  <li>Wait until it's your turn to register and grab your preferred sections before they fill up!</li>
 
</ol>
 
EOF;
 
}
scripts/scheduleInput.js
Show inline comments
 
@@ -131,25 +131,25 @@
 
			<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][2]" value="1" /></td>\
 
			<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][3]" value="1" /></td>\
 
			<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][4]" value="1" /></td>';
 
	
 
		return result;
 
	}
 

	
 
	//--------------------------------------------------
 
	// Adds a new class to the input.
 
	//--------------------------------------------------
 
	function addRow(){
 
		sectionsOfClass[classNum] = 0; // This is class 0, initialize at 0
 
		jQuery('#jsrows').append('<tr title="' + classNum + '" class="class class' + classNum + '"><td><input type="text" class="required defText" title="Class Name" name="postData[' + classNum + '][name]" /></td><td colspan="8"></td><td class="tdInput"><div class="addSection"><input class="gray" type="button" value="Add section" /></div></td><td class="tdInput"><div class="deleteClass"><input class="gray" type="button" value="Remove" /></div></td></tr>');
 
		jQuery('#jsrows').append('<tr title="' + classNum + '" class="class class' + classNum + '"><td><input type="text" class="required defText" title="Class Name" name="postData[' + classNum + '][name]" /></td><td colspan="8"></td><td class="tdInput"><div class="addSection"><input type="button" value="Add section" class="gray" /></div></td><td class="tdInput"><div class="deleteClass"><input type="button" value="Remove" class="gray" /></div></td></tr>');
 
		classNum++;
 
	};
 
	
 
	addRow(); // Add initial row
 

	
 
	//--------------------------------------------------
 
	// Adds a new class when the add class button is 
 
	// clicked.
 
	//--------------------------------------------------
 
	jQuery('#addclass').click(function() {
 
		addRow();
 
	});
 
@@ -167,25 +167,25 @@
 
	// Deletes the selected section from the input.
 
	//--------------------------------------------------
 
	jQuery('.deleteSection').live('click', function() {
 
		sectionsOfClass[jQuery(this).parent().parent().attr("title")]--; // TODO: this only decreases the number of classes, so php should loop until this number of classes is found in the array
 
		jQuery(this).parent().parent().remove();
 
	});
 

	
 
	//--------------------------------------------------
 
	// Adds a section to the selected class.
 
	//--------------------------------------------------
 
	jQuery('.addSection').live('click', function() {
 
		sectionsOfClass[jQuery(this).parent().parent().attr("title")]++; // Increases sectionsOfClass[classNum]
 
		jQuery(this).parent().parent().after('<tr class="section class' + jQuery(this).parent().parent().attr("title") + '"><td class="none"></td>' + getCommonInputs(jQuery(this).parent().parent().attr("title")) + '<td><div class="deleteSection"><input class="gray" type="button" value="x" /></div></td><td></td></tr>');
 
		jQuery(this).parent().parent().after('<tr class="section class' + jQuery(this).parent().parent().attr("title") + '"><td class="none"></td>' + getCommonInputs(jQuery(this).parent().parent().attr("title")) + '<td><div class="deleteSection"><input type="button" value="x" class="gray" /></div></td><td></td></tr>');
 
	});
 

	
 
	//--------------------------------------------------
 
	// Resets the form
 
	//--------------------------------------------------
 
	jQuery('#reset').click(function() {
 
		jQuery('#scheduleForm').resetForm();
 
	});
 

	
 
	//--------------------------------------------------
 
	// Default text
 
	//--------------------------------------------------
0 comments (0 inline, 0 general)