Changeset - fc6b04256a92
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 15 years ago 2010-09-30 21:24:05
ohnobinki@ohnopublishing.net
Fix validation errors caused by closing </div> confusion.
2 files changed with 19 insertions and 7 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -262,25 +262,25 @@ class Schedule
 

	
 
			
 

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

	
 
			*/
 
		$footcloser = '';
 

	
 
                if(isset($_REQUEST['print']) && $_REQUEST['print'] != ''){
 
	                $headcode = array('jQuery', 'outputStyle', 'outputPrintStyle');
 
		}
 
		else {
 
			$footcloser .="</div></div><script type=\"text/javascript\" charset=\"utf-8\">". 
 
			$footcloser .="<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">';
 
			echo 'jQuery(document).ready( function() {';
 

	
 
			/* If user entered items to print */
 
			if($_REQUEST['print'] != 'all'){
 
@@ -304,32 +304,35 @@ class Schedule
 
			echo '<p><span id="selectItems"><a href="#">Select Schedules to Print</a></span> :: <a href="'.$_SERVER["SCRIPT_NAME"].'?savedkey=0">Return to normal view</a> :: <a href="input.php">Home</a></p>';
 
			echo '<div  id="selectItemsInput"><p><form action="'.$_SERVER["SCRIPT_NAME"].'?savedkey=0"><label><strong>Schedules to Print</strong> <em>(seperate with commas, "all" for all)</em></label><br /><input type="text" name="print" /><input type="submit" value="submit" /><span id="cancelItems"><input type="button" value="cancel" /></span></form></p></div>';
 
		}
 
		else {
 
			echo '<p><a href="'.$_SERVER["SCRIPT_NAME"].'?savedkey=0&amp;print=all">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\">";
 
			$table .= "<div class=\"my-glider\">\n"
 
			  . "  <div class=\"controls\">\n";
 
			
 
			for($nn = 1; $nn <= $this->nPermutations; $nn++)
 
			{
 
			$table .= "<a href=\"#section" . $nn . "\">&nbsp;" . $nn . "&nbsp;</a>";
 
			}
 
			
 
			$table .= "</div><div class=\"scroller\"><div class=\"scontent\">";
 
			$table .= "  </div> <!-- class=\"controls\" -->\n"
 
			  . "  <div class=\"scroller\">"
 
			  . "    <div class=\"scontent\">";
 
		
 
			for($i = 0; $i < $this->nPermutations; $i++)
 
			{
 
				$table .= "<div class=\"section\" id=\"section" . ($i+1) . "\">";
 
  
 
				// Beginning of table
 
				$table .= "<table style=\"empty-cells:show;\" border=\"1\" cellspacing=\"0\">";
 
				
 
				// Header row
 
				$table .= "\n\t<tr>\n\t\t<td class=\"none\">" . ($i+1) . "</td>\n\t\t<td class=\"day\">Monday</td>\n\t\t<td class=\"day\">Tuesday</td>\n\t\t<td class=\"day\">Wednesday</td>\n\t\t<td class=\"day\">Thursday</td>\n\t\t<td class=\"day\">Friday</td>\n\t</tr>";
 

	
 
				for($r = 0; $r < (count($time)-1); $r++)
 
@@ -554,28 +557,32 @@ class Schedule
 
					// If the cell was not filled, fill it with an empty cell.
 
					if(!$filled)
 
					{
 
						$table .= "\n\t\t<td class=\"none\">&nbsp;</td>";
 
					}
 
					$filled = false;
 

	
 
					// End of row
 
					$table .= "\n\t</tr>";
 
				}
 

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

	
 
			echo $table . "</div>" . $footcloser; // Closes off the content div
 
			echo $table
 
			  . "    </div> <!-- class=\"scontent\" -->\n"
 
			  . "  </div> <!-- class=\"scroller\" -->\n"
 
			  . "</div> <!-- id=\"my-glider\" -->\n"
 
			  . $footcloser; // Closes off the content div
 
		} else {
 
			echo '<html><body><p>There are no possible schedules. Please try again.</p></body></html>';
 
		}
 

	
 
		/* edit button */
 
		if (!isset($savedkey))
 
		  {
 
		    if (isset($_REQUEST['savedkey']))
 
		      $savedkey = (int)$_REQUEST['savedkey'];
 
		    else
 
		      /*
 
		       * if this is a new saved schedule, it'll be the
inc/class.page.php
Show inline comments
 
@@ -109,27 +109,32 @@ class page {
 

	
 
    // Write out all passed scripts
 
    foreach ($this->scripts as $i){
 
    	echo $this->headCode["$i"];
 
    }
 

	
 
    echo '</head>
 
	  <body '.$this->bodyargs.' ><div id="page">';
 
    echo $this->top(); // Write out top
 
  }
 

	
 
  public function foot(){
 
    echo '</div>';
 
    echo '</div> <!-- id="content" -->';
 
    $this->pageGenTime = round(microtime(), 3);
 
    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></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> <!-- id="footer" -->
 
</div>';
 
    echo $this->trackingcode;
 
    echo '</body></html>';
 
  }
 

	
 
  public function secondsToCompound($seconds) {
 
      $ret = "";
 
      $hours = intval(intval($seconds) / 3600);
 
      $ret .= "$hours:";
 
      $minutes = bcmod((intval($seconds) / 60),60);
 
      $ret .= "$minutes:";
 
      $seconds = bcmod(intval($seconds),60);
 
      $ret .= "$seconds";
0 comments (0 inline, 0 general)