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
 
@@ -286,19 +286,22 @@ class Schedule
 
    }		
 

	
 
    echo "\n";
 

	
 
    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>
 
                    <label><strong>Display:</strong></label>
 
                    <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";
 
			
 
	for($nn = $first_permutation + 1; $nn <= $last_permutation; $nn++)
 
	  {
 
@@ -320,12 +323,13 @@ class Schedule
 

	
 
	echo "  <div class=\"scroller\">\n"
 
	  . "    <div class=\"scontent\">\n";
 
		
 
	for($i = $first_permutation; $i < $last_permutation; $i++)
 
	  {
 
             $syns = array();
 
	     echo  '      <div class="section" id="tabs-' . ($i+1) . "\">\n";
 
  
 
	    // Beginning of table
 
	    echo "        <table style=\"empty-cells:show;\" border=\"1\" cellspacing=\"0\">\n";
 
				
 
	    // Header row
 
@@ -390,12 +394,13 @@ class Schedule
 
					. htmlentities($class->getName(), ENT_QUOTES) . '-'
 
					. htmlentities($section->getLetter(), ENT_QUOTES) . "\n"
 
					. '<span class="prof block">' . htmlentities($section->getProf(), ENT_QUOTES) . "</span>\n"
 
					. '<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;
 
				    }
 
			}
 
		    }
 

	
 
		  if ($rowspan[$dayLoop] > 0)
 
@@ -413,12 +418,14 @@ class Schedule
 
		}
 
		
 
		// End of row
 
		echo "          </tr>\n";
 
	      }
 

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

	
 
	    // End of table
 
	    echo "        </table>\n"
 
	      . '      </div> <!-- id="section' . ($i + 1) . "\" -->\n";
 
	  }
 

	
 
	echo $table
scripts/displayTables.js
Show inline comments
 
@@ -42,8 +42,26 @@ function show_box_change()
 
}
 

	
 
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
 
@@ -219,6 +219,15 @@ td.center {
 
  display:none;
 
}
 
#savedBox p {
 
  padding:0;
 
  margin:0;
 
}
 
.syns {
 
  display:none;
 
}
 
#regCodes {
 
  float: right;
 
}
 
.synList {
 
  margin-left: 1em;
 
}
0 comments (0 inline, 0 general)