# HG changeset patch # User Ethan Zonca # Date 2010-12-08 23:32:44 # Node ID 807664acef3aae38ff4516a2f18e7425abedc17c # Parent 1e00f007fa8dbfbe94746ad78c0b0a65ffea3b3a Added registration code interface. The implemention is functional, but a bit rough for filling the syns[] array in php diff --git a/class.schedule.php b/class.schedule.php --- a/class.schedule.php +++ b/class.schedule.php @@ -289,6 +289,8 @@ class Schedule if($this->nPermutations > 0) { + + echo '

Enter these codes into your school\'s online course registration system to register for classes:

'; echo '
' . "\n" . '
@@ -296,6 +298,7 @@ class Schedule +
' . '
    ' . "\n"; @@ -323,6 +326,7 @@ class Schedule for($i = $first_permutation; $i < $last_permutation; $i++) { + $syns = array(); echo '
    \n"; // Beginning of table @@ -393,6 +397,7 @@ class Schedule . '' . htmlentities($current_meeting->getLocation(), ENT_QUOTES) . "\n" . '' . htmlentities($section->getSynonym(), ENT_QUOTES) . "\n" . "\n"; + $syns[$section->getSynonym()] = $section->getSynonym(); $filled = TRUE; } } @@ -416,6 +421,8 @@ class Schedule echo " \n"; } + echo '
    '. json_encode($syns) . '
    '; + // End of table echo " \n" . '
    \n"; diff --git a/scripts/displayTables.js b/scripts/displayTables.js --- a/scripts/displayTables.js +++ b/scripts/displayTables.js @@ -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 = '

    '; + for( var i in secs ) { + output = output + secs[i] + '
    '; + } + output = output + '

    '; + jQuery('#regDialogList').append(output); + + jQuery("#regDialog").dialog("open"); + }); } ); + diff --git a/styles/general.css b/styles/general.css --- a/styles/general.css +++ b/styles/general.css @@ -222,3 +222,12 @@ td.center { padding:0; margin:0; } +.syns { + display:none; +} +#regCodes { + float: right; +} +.synList { + margin-left: 1em; +}