Changeset - 807664acef3a
[Not reviewed]
default
0 3 0
Ethan Zonca - 15 years ago 2010-12-08 23:32:44
ez@ethanzonca.com
Added registration code interface. The implemention is functional, but a bit rough for filling the syns[] array in php
3 files changed with 34 insertions and 0 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -289,6 +289,8 @@ class Schedule
 

	
 
    if($this->nPermutations > 0)
 
      {
 

	
 
        echo '<div id="regDialog" title="Registration Codes"><p>Enter these codes into your school\'s online course registration system to register for classes:</p><div id="regDialogList"></div></div>';
 
	echo '<div id="tabs">' . "\n" .
 
               '<div id="show-box" class="show-buttons">
 
                  <form>
 
@@ -296,6 +298,7 @@ class Schedule
 
                    <input id="show-prof" name="show-prof" type="checkbox" checked="checked" /><label for="show-prof">Professor</label>
 
                    <input id="show-location" name="show-location" type="checkbox" /><label for="show-location">Room</label>
 
                    <input id="show-synonym" name="show-synonym" type="checkbox" /><label for="show-synonym">Synonym</label>
 
                    <div id="regCodes"><label><a href="#">Registration Codes</a></label></div>
 
                  </form>
 
                </div> <!-- id="show-box" -->'
 
	     . '<div id="the-tabs"><ul>' . "\n";
 
@@ -323,6 +326,7 @@ class Schedule
 
		
 
	for($i = $first_permutation; $i < $last_permutation; $i++)
 
	  {
 
             $syns = array();
 
	     echo  '      <div class="section" id="tabs-' . ($i+1) . "\">\n";
 
  
 
	    // Beginning of table
 
@@ -393,6 +397,7 @@ class Schedule
 
					. '<span class="location block">' . htmlentities($current_meeting->getLocation(), ENT_QUOTES) . "</span>\n"
 
					. '<span class="synonym block">' . htmlentities($section->getSynonym(), ENT_QUOTES) . "</span>\n"
 
					. "</td>\n";
 
				      $syns[$section->getSynonym()] = $section->getSynonym();
 
				      $filled = TRUE;
 
				    }
 
			}
 
@@ -416,6 +421,8 @@ class Schedule
 
		echo "          </tr>\n";
 
	      }
 

	
 
            echo '<div class="syns'.$i.'">'.  json_encode($syns) . '</div>';
 

	
 
	    // End of table
 
	    echo "        </table>\n"
 
	      . '      </div> <!-- id="section' . ($i + 1) . "\" -->\n";
scripts/displayTables.js
Show inline comments
 
@@ -45,5 +45,23 @@ jQuery(document).ready( function()
 
  {
 
      jQuery('#show-box input').change(show_box_change);
 
      jQuery('#show-box input').change();
 

	
 
      jQuery("#regDialog").dialog({ modal: true, width: 550, resizable: false, draggable: false, autoOpen: false });   
 
      jQuery('#regCodes').click( function() {
 
        jQuery('#regDialogList').empty();
 
        var currSec = '.syns' + jQuery('#tabs').tabs('option','selected');
 

	
 
        var jHtml = jQuery(currSec).html();
 
        var secs = eval('(' + jHtml + ')');
 
        var output = '<p class=\'synList\'>';
 
        for( var i in secs ) {
 
          output = output + secs[i] + '<br />';
 
        }
 
        output = output + '</p>';
 
        jQuery('#regDialogList').append(output);
 

	
 
        jQuery("#regDialog").dialog("open");
 
      });
 
  }
 
);
 

	
styles/general.css
Show inline comments
 
@@ -222,3 +222,12 @@ td.center {
 
  padding:0;
 
  margin:0;
 
}
 
.syns {
 
  display:none;
 
}
 
#regCodes {
 
  float: right;
 
}
 
.synList {
 
  margin-left: 1em;
 
}
0 comments (0 inline, 0 general)