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
 
@@ -92,6 +92,17 @@ function school_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.
 
 *
 
@@ -133,6 +144,7 @@ function school_cache($schools)
 
	  $domain_cache_ptr[$domain_part] = $school['id'];
 
	}
 
    }
 
  uasort($list_cache, 'school_cmp');
 

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

	
class.class.php
Show inline comments
 
@@ -73,10 +73,10 @@ class Classes
 
  {
 
    $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)
class.schedule.php
Show inline comments
 
@@ -290,7 +290,7 @@ class Schedule
 
	"\n</script>"; */
 
      $headcode = array('outputStyle',  'jQuery', 'jQueryUI', 'uiTabsKeyboard');
 
    }
 
    $outputPage = new page($this->getName(), $headcode);
 
    $outputPage = new Page(htmlentities($this->getName()), $headcode);
 

	
 

	
 

	
 
@@ -377,11 +377,11 @@ class Schedule
 
			      {
 
				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;
 
				}
 
			      }
 
@@ -420,11 +420,11 @@ class Schedule
 
			      {
 
				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;
 
				}
 
			      }
 
@@ -463,11 +463,11 @@ class Schedule
 
			      {
 
				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;
 
				}
 
			      }
 
@@ -506,11 +506,11 @@ class Schedule
 
			      {
 
				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;
 
				}
 
			      }
 
@@ -549,11 +549,11 @@ class Schedule
 
			      {
 
				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;
 
				}
 
			      }
class.section.php
Show inline comments
 
@@ -172,7 +172,7 @@ class Section
 
	$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;
 
      }
 
@@ -242,7 +242,7 @@ class Section
 
	  . "  </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";
inc/class.page.php
Show inline comments
 
@@ -40,6 +40,10 @@ class 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;
 
@@ -91,14 +95,14 @@ class page
 
	 . "  </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();
 
 }
 

	
 
  /**
 
@@ -171,7 +175,8 @@ class page
 
		<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" -->
input.php
Show inline comments
 
@@ -51,16 +51,19 @@ if ($school && (!empty($_REQUEST['school
 
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;
 
  }
 
@@ -76,7 +79,7 @@ if (!empty($_REQUEST['selectschool'])
 
<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">
school.d/default.inc
Show inline comments
 
@@ -41,11 +41,11 @@ function default_instructions_html()
 
</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
 
@@ -140,7 +140,7 @@
 
	//--------------------------------------------------
 
	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++;
 
	};
 
	
 
@@ -176,7 +176,7 @@
 
	//--------------------------------------------------
 
	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>');
 
	});
 

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