Changeset - 986e496149ed
[Not reviewed]
default
0 3 0
ethanzonca - 15 years ago 2010-09-23 23:28:46

Additional minor changes
3 files changed with 23 insertions and 19 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -236,45 +236,46 @@ class Schedule
 
			"\n<link rel=\"stylesheet\" href=\"styles/glider.css\" type=\"text/css\" media=\"screen\" charset=\"utf-8\">".
 
			"\n<script src=\"scripts/prototype.js\" type=\"text/javascript\" charset=\"utf-8\"></script>". 
 
			"\n<script src=\"scripts/effects.js\" type=\"text/javascript\" charset=\"utf-8\"></script>".
 
			"\n<script src=\"scripts/glider.js\" type=\"text/javascript\" charset=\"utf-8\"></script>".
 
			
 
			"\n</head><body>".
 

	
 
			
 

	
 
			"\n\n<div id=\"header\">\n<h1><em>SlatePermutate</em> - Scheduler</h1><h3>Schedule name: " . $this->getName() . "</h3>\n</div><div id=\"content\">".
 

	
 
			*/
 
		$headcode = array('outputStyle', 'gliderHeadcode');
 
		$outputPage = new page($this->getName(), $headcode);
 

	
 

	
 

	
 

	
 

	
 

	
 
		$footcloser = '';
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 
		echo "<p>There were a total of " . $this->possiblePermutations . " possible permutations. Only " . $this->nPermutations . " permutations had no class conflicts.</p>";
 
			
 
                if(isset($_REQUEST['print'])){
 
	                $headcode = array('outputStyle', 'outputPrintStyle');
 
		}
 
		else {
 
		$footcloser .="</div></div><script type=\"text/javascript\" charset=\"utf-8\">". 
 
			"\n\tvar my_glider = new Glider('my-glider', {duration:0});".
 
			"\n</script>";
 
			$headcode = array('outputStyle', 'gliderHeadcode');
 
		}
 
		$outputPage = new page($this->getName(), $headcode);
 

	
 
		if(isset($_REQUEST['print'])){
 
			echo '<script type="text/javascript">window.print();</script>';
 
			echo '<p><a href="'.$_SERVER["SCRIPT_NAME"].'?savedkey=0">Return to normal view</a> :: <a href="input.php">Home</a></p>';
 
		}
 
		else {
 
			echo '<p><a href="'.$_SERVER["SCRIPT_NAME"].'?savedkey=0&print=1">Print</a> :: <a href="input.php">Home</a></p>';
 
		}
 

	
 
		echo "<p>There were a total of " . $this->possiblePermutations . " possible permutations. Only " . $this->nPermutations . " permutations had no class conflicts.</p>";
 

	
 

	
 
		if($this->nPermutations > 0)
 
		{
 
			$table .= "<div id=\"my-glider\"><div class=\"controls\">";
 
			
 
			for($nn = 1; $nn <= $this->nPermutations; $nn++)
 
			{
 
			$table .= "<a href=\"#section" . $nn . "\">&nbsp;" . $nn . "&nbsp;</a>";
 
			}
 
			
 
			$table .= "</div><div class=\"scroller\"><div class=\"scontent\">";
inc/class.page.php
Show inline comments
 
@@ -24,24 +24,25 @@ class page {
 
				    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);
 
				  })();
 
				</script>'; // Google analytics ga.js tracking code
 

	
 
  private $pagetitle = ''; // Title of page
 
  private $scripts = array(); // Scripts to include on page
 

	
 
  public function __construct($ntitle, $nscripts = array() ){
 
    // Scripts and styles available to include
 
    $this->headCode['jQuery'] = '<script src="http://www.google.com/jsapi"></script><script type="text/javascript" charset="utf-8"> google.load("jquery", "1.3.2"); google.load("jqueryui", "1.7.2");</script>';
 
    $this->headCode['jValidate'] = '<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.pack.js"></script>';
 
    $this->headCode['schedInput'] = '<script type="text/javascript" src="scripts/scheduleInput.js"></script>';
 
    $this->headCode['outputPrintStyle'] = '<link rel="stylesheet" href="styles/print.css" type="text/css" media="screen" charset="utf-8">';
 
    $this->headCode['outputStyle'] = '<link rel="stylesheet" href="styles/output.css" type="text/css" media="screen" charset="utf-8">'; 
 
    $this->headCode['gliderHeadcode'] = '<link rel="stylesheet" href="styles/glider.css" type="text/css" media="screen" charset="utf-8"><script src="scripts/prototype.js" type="text/javascript" charset="utf-8"></script><script src="scripts/effects.js" type="text/javascript" charset="utf-8"></script><script src="scripts/glider.js" type="text/javascript" charset="utf-8"></script>'; 
 

	
 
   $this->pagetitle = $ntitle;
 
    $this->scripts = $nscripts;
 
    if($ntitle != "NOHEAD")
 
      $this->head();
 

	
 
 }
 

	
 
  private function top(){
 
    echo '<div id="header">
input.php
Show inline comments
 
@@ -13,25 +13,25 @@ include_once 'inc/class.page.php';
 
?>
 

	
 
<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>
 
	</tr>
 
	<tr>
 
		<td colspan="11" style="padding-bottom: 2em;">Section Numbering Style: <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>
 
		<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>
 

	
 
	<!-- Header -->
 
	<tr>
 
		<td>Class</td>
 
		<td class="center" id="letterNumber">Section</td>
 
		<td class="center">Start Time</td>
 
		<td class="center">End Time</td>
 
		<td class="center">M</td>
 
		<td class="center">Tu</td>
 
		<td class="center">W</td>
 
		<td class="center">Th</td>
 
		<td class="center">F</td>
 
@@ -44,23 +44,25 @@ include_once 'inc/class.page.php';
 
</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>
 

	
 
</form>
 

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

	
 
<h3>TODO:</h3>
 

	
 
<ul>
 
	<li>Add print stylesheet and button to output page</li>
 
	<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>
 
	<li>After selecting a start time, set the end time to one hour after the start time</li>
 
        <li><strong>Append</strong> sections</li>
 
        <li>Move the add class button to somewhere nicer, maybe a gray row at the bottom. Make the submit button more obvious.</li>
 
	<li>Form validation to ensure endtime is after starttime, at least one day is checked.</li>
 
	<li>Auto-populate form based on saved schedule?</li>
 
        <li>Grab data from school sites such as <a href="http://www.cedarville.edu/courses/schedule/2010fa_be_bebl.htm" target="_blank">this?</a></li>
 
</ul>
 

	
 
<?php
 
$inputPage->foot();
0 comments (0 inline, 0 general)