Changeset - 1a11bfb5181e
[Not reviewed]
default
0 4 0
ethanzonca - 15 years ago 2010-09-23 21:17:08

Made output use the page class
4 files changed with 40 insertions and 16 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -11,6 +11,7 @@
 
include_once 'errors.php';
 
include_once 'class.class.php';
 
include_once 'class.section.php';
 
include_once 'inc/class.page.php';
 

	
 
class Schedule
 
{
 
@@ -209,9 +210,10 @@ class Schedule
 
		$filled = false;
 
		$time = array(700,730,800,830,900,930,1000,1030,1100,1130,1200,1230,1300,1330,1400,1430,1500,1530,1600,1630,1700,1730,1800,1830,1900,1930,2000,2030,2100,2130, 2200);
 

	
 

	
 
		// Reminder:
 
		// border-style:top right bottom left
 
		$header .= "<html><head><title>" . $this->getName() . " :: " . $this->title . "</title>\n\n<style type=\"text/css\">".
 
		/* $header .= "<html><head><title>" . $this->getName() . " :: " . $this->title . "</title>\n\n<style type=\"text/css\">".
 
				"\n.top{\n\tborder-style:solid solid none solid;\nbackground-color:#dddddd;\n}".
 
				"\n.mid{\n\tborder-style:none solid none solid;\nbackground-color:#dddddd;\n}".
 
				"\n.end{\n\tborder-style:none solid solid solid;\nbackground-color:#dddddd;\n}".
 
@@ -238,16 +240,33 @@ class Schedule
 
			
 
			"\n</head><body>".
 

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

	
 
			"\n\n<div id=\"header\">\n<h1><em>SlatePermutate</em> - Scheduler</h1><h3>Schedule name: " . $this->getName() . "</h3>\n</div><div id=\"content\">";
 
			
 
		$footer .="</div></div><script type=\"text/javascript\" charset=\"utf-8\">". 
 

	
 
			"\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);
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 
		echo "<p>There were a total of " . $this->possiblePermutations . " possible permutations. Only " . $this->nPermutations . " permutations had no class conflicts.</p>";
 
			
 
		$footcloser .="</div></div><script type=\"text/javascript\" charset=\"utf-8\">". 
 
			"\n\tvar my_glider = new Glider('my-glider', {duration:0});".
 
			"\n</script>\n\n</div><div id=\"footer\">\n<h5>&copy; " . Date("Y") . " <a href=\"http://protofusion.org/~nathang/\">Nathan Gelderloos</a><br />".
 
			"\nwith special thanks to <a href=\"http://ethanzonca.com\">Ethan Zonca</a></h5>\n</div>";
 
			"\n</script>";
 

	
 
		$footer .="\n\n</body></html>";
 

	
 
		if($this->nPermutations > 0)
 
		{
 
@@ -504,10 +523,11 @@ class Schedule
 
				$table .= "</table></div>";
 
			}
 

	
 
			echo $header . $table . $footer;   
 
			echo $table . $footcloser;   
 
		} else {
 
			echo '<html><body><p>There are no possible schedules. Please try again.</p></body></html>';
 
		}
 
		$outputPage->foot();
 
	}
 

	
 
	//--------------------------------------------------
 
@@ -533,4 +553,4 @@ class Schedule
 

	
 
}
 

	
 
?>
 
\ No newline at end of file
 
?>
inc/class.page.php
Show inline comments
 
@@ -25,7 +25,7 @@ class page {
 
				  })();
 
				</script>'; // Google analytics ga.js tracking code
 

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

	
 
  public function __construct($ntitle, $nscripts = array() ){
 
@@ -33,8 +33,10 @@ class page {
 
    $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->title = $ntitle;
 
    $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();
 
@@ -43,7 +45,7 @@ class page {
 

	
 
  private function top(){
 
    echo '<div id="header">
 
          <h1><em>SlatePermutate</em> -  Scheduler</h1>
 
          <h1><em>SlatePermutate</em> - '.$this->pagetitle.'</h1>
 
          </div>
 
          <div id="content">';
 
  }
 
@@ -57,7 +59,7 @@ class page {
 
    echo '<!DOCTYPE ' . $this->doctype . '>
 
	  <html ' . $this->htmlargs . '>
 
	  <head>
 
	    <title>' . $this->title . ' :: ' . $this->base_title . '</title>
 
	    <title>' . $this->pagetitle . ' :: ' . $this->base_title . '</title>
 
           <link rel="stylesheet" href="styles/general.css" type="text/css" media="screen" charset="utf-8">';
 

	
 
    // Write out all passed scripts
 
@@ -104,4 +106,4 @@ class page {
 

	
 
}
 

	
 
?>
 
\ No newline at end of file
 
?>
input.php
Show inline comments
 
@@ -50,6 +50,7 @@ include_once 'inc/class.page.php';
 
<ul>
 
	<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
styles/general.css
Show inline comments
 
@@ -54,3 +54,4 @@
 
		padding: .5em;
 
		padding-top: .8em;
 
	}
 

	
0 comments (0 inline, 0 general)