Changeset - e2436d712885
[Not reviewed]
default
0 4 0
ethanzonca - 15 years ago 2010-09-25 00:59:01

Additional updates, visual changes, etc
4 files changed with 37 insertions and 16 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -75,13 +75,13 @@ class page {
 
    echo $this->top(); // Write out top
 
  }
 

	
 
  public function foot(){
 
    echo '</div>';
 
    $this->pageGenTime = round(microtime(), 3);
 
    echo '<div id="footer"><h5>&copy; '. date('Y').' <a href="http://protofusion.org/~nathang/">Nathan Gelderloos</a><br /> with special thanks to <a href="http://ethanzonca.com">Ethan Zonca</a></h5></div>';
 
    echo '<div id="footer"><h5>&copy; '. date('Y').' <a href="http://protofusion.org/~nathang/">Nathan Gelderloos</a> <br /> <a href="http://ethanzonca.com">Ethan Zonca</a></h5></div>';
 
    echo $this->trackingcode;
 
    echo '</body></html>';
 
  }
 

	
 
  public function secondsToCompound($seconds) {
 
      $ret = "";
input.php
Show inline comments
 
@@ -8,24 +8,24 @@ include_once 'inc/class.page.php';
 

	
 
$scripts = array('jQuery','jValidate','schedInput');
 
$inputPage = new page('Scheduler', $scripts);
 
$inputPage->showSavedScheds($_SESSION);
 

	
 
?>
 

	
 
<p>Welcome to SlatePermutate! 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">
 
<table>
 
  <tr>
 
    <table id="jsrows">
 
	<tr>
 
		<td colspan="11" style="padding-bottom:2em;"><input id="scheduleName" class="defText" type="text" class="required" title="Schedule Name" name="postData[name]" />
 
			<em>(For example: Fall <?php echo Date("Y"); ?>)</em>
 
		<td colspan="11"><input id="scheduleName" style="margin-bottom: 2em;" class="defText required" type="text" size="25" title="Schedule Name (e.g., Spring 2011)" name="postData[name]" />
 
		
 
		</td>
 
	</tr>
 
	<tr>
 
		<td colspan="11" style="padding-bottom: 2em;"><select id="isNumeric" type="text" class="required" name="isnumbered" ><option value="numerous">Custom Section Labels</option><option value="numbered">Numbered Section Labels</option><option value="lettered">Lettered Section Labels</option></select>
 
		<td class="advanced" colspan="11" style="padding-bottom: 2em; padding-top: .5em;"><em>Section Labels: </em><select id="isNumeric" type="text" class="required" name="isnumbered" ><option value="numerous">Custom</option><option value="numbered">Numbered</option><option value="lettered">Lettered</option></select>
 

	
 
	<!-- Header -->
 
	<tr>
 
		<td>Class</td>
 
		<td class="center" id="letterNumber">Section</td>
 
		<td class="center">Start Time</td>
 
@@ -37,22 +37,23 @@ include_once 'inc/class.page.php';
 
		<td class="center">F</td>
 
		<td class="center"></td>
 
		<td class="center"></td>
 
	</tr>
 
    </table>
 
  </tr>
 
  <tr><td> <span class="gray" style="padding: 0 3.5em 0 3.5em;" id="addclass">Add Class - This row should be just as wide as the one above someday</span></td></tr>
 
  <tr><td> <span class="gray" style="padding: 0 3.5em 0 3.5em;" id="addclass">Add Class</span></td></tr>
 
</table>
 

	
 
<!-- <div class="paddingtop" id="classage"><input type="button" value="Add class" /></div> -->
 
<div class="paddingtop"><input style="float:left;" type="submit" value="Find me a schedule!" /></div>
 
<div class="paddingtop"><input style="float:left;" type="submit" value="Find a schedule" /></div>
 

	
 
</form>
 

	
 
<p>&nbsp;<br /></p>
 

	
 
<p><span id="showadvanced"><a href="#">Show Advanced Options</a></span></p>
 
<span class="advanced">
 
<h3>TODO:</h3>
 

	
 
<ul>
 
	<li>Autoincrement section num/letter/custom labels</li>
 
	<li>Make output and print output formatting look nicer</li>
 
	<li>Make printing work for saved jobs where jobkey != 0</li>
scripts/scheduleInput.js
Show inline comments
 
@@ -11,12 +11,27 @@
 
				return false; 
 
			} 
 
			else return true; 
 
		}, 
 
		"<p class=\"error\">Please select a time</p>" 
 
	); 
 
	jQuery.validator.addMethod( 
 
		"daysRequired", 
 
		function(value, element) { 
 
			var checkedCount = 0;
 
			jQuery(element).parent().children('.daysRequired:checked').each( function() {
 
				checkedCount++;
 
			});
 
			if (checkedCount == 0) 
 
			{ 
 
				return false; 
 
			} 
 
			else return true; 
 
		}, 
 
		"<p class=\"error\">Pick a day!</p>" 
 
	); 
 

	
 
/* Doesn't work right now:  */ /*
 
	jQuery.validator.addMethod( 
 
		"daysRequired", 
 
		function(value, element) { 
 
			var numChecked = 0;
 
@@ -38,13 +53,13 @@
 
*/
 

	
 
	jQuery.validator.addClassRules("selectRequired", {
 
		selectNone: true
 
	});
 
	
 
	jQuery.validator.addClassRules("daysRequire", {
 
	jQuery.validator.addClassRules("daysRequired", {
 
		daysRequired: true
 
	});
 

	
 
    jQuery(document).ready(function() {
 
	//--------------------------------------------------
 
	// Validates the form (pre-submission check)
 
@@ -69,13 +84,13 @@
 
                                <select name="'+name+'"><option value="-">-</option><option value="A">A</option><option value="B">B</option>\
 
                                <option value="C">C</option><option value="D">D</option><option value="E">E</option><option value="F">F</option><option value="G">G</option>\
 
                                <option value="H">H</option><option value="I">I</option><option value="J">J</option><option value="K">K</option></select></td>\
 
                                </select></td>';
 
	}
 
	function customIds(name){
 
		return '<td class="sectionIdentifier center"><input type="text" size="1" class="required" title="Schedule Name" name="' + name + '" /></td>';
 
		return '<td class="sectionIdentifier center"><input type="text" size="1" class="required" name="' + name + '" /></td>';
 
	}
 

	
 
	//--------------------------------------------------
 
	// Returns the common inputs for each new section.
 
	//--------------------------------------------------
 
	function getCommonInputs(cnum) {
 
@@ -121,17 +136,17 @@
 
				<option value="1620">4:20 pm</option><option value="1650">4:50 pm</option>\
 
				<option value="1720">5:20 pm</option><option value="1750">5:50 pm</option>\
 
				<option value="1820">6:20 pm</option><option value="1850">6:50 pm</option>\
 
				<option value="1920">7:20 pm</option><option value="1950">7:50 pm</option>\
 
				<option value="2020">8:20 pm</option><option value="2050">8:50 pm</option>\
 
				<option value="2120">9:20 pm</option></select></td>\
 
			<td><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][0]" value="1" /></td>\
 
			<td><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][1]" value="1" /></td>\
 
			<td><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][2]" value="1" /></td>\
 
			<td><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][3]" value="1" /></td>\
 
			<td><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][4]" value="1" /></td>';
 
			<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][0]" value="1" /></td>\
 
			<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][1]" value="1" /></td>\
 
			<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.
 
@@ -234,10 +249,14 @@
 
           jQuery(this).append(customIds(name));
 
         });
 

	
 
      }
 

	
 
    });
 
    
 

	
 
  jQuery('.advanced').hide();    
 
  jQuery('#showadvanced').click( function() {
 
    jQuery('#showadvanced').hide();
 
    jQuery('.advanced').slideToggle();
 
  });
 
});
 

	
styles/general.css
Show inline comments
 
@@ -61,12 +61,13 @@
 
.addClassRow {
 
  padding: 2px;
 
  width: 30em;
 

	
 
}
 
.gray {
 
  border: 1px dashed #999;
 
  text-align: center!important;
 
  background: #BBB!important;
 
  cursor:default;
 
}
 
.gray:hover {
 
  background: #CCC!important;
0 comments (0 inline, 0 general)