Changeset - 5cce14d5f1c2
[Not reviewed]
default
0 2 0
ethanzonca - 15 years ago 2010-07-09 22:52:37

Added title functionality
2 files changed with 14 insertions and 10 deletions:
0 comments (0 inline, 0 general)
input.php
Show inline comments
 
@@ -244,30 +244,31 @@
 
if(isset($_SESSION['saved']))
 
	foreach($_SESSION['saved'] as $key => $schedule)
 
		echo "<a href=\"process.php?savedkey=$key\">Saved Schedule $key</a><br />";
 
else
 
	echo "No saved schedules!<br />";
 
?>
 

	
 
	</p>
 

	
 
<form method="post" action="process.php" id="scheduleForm">
 

	
 
<table id="jsrows">
 
<!--	<tr>
 
	<tr id="namecol">
 
		<td colspan="11">Name this schedule:
 
			<input type="text" class="required" name="postData[name]" />
 
			(For example: Fall <?php echo Date("Y"); ?>)
 
		</td>
 
	</tr>-->
 
	</tr>
 

	
 
<!-- Header -->
 
	<tr>
 
		<td>Class</td>
 
		<td class="center">Letter</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>
 
		<td class="center">Add</td>
process.php
Show inline comments
 
@@ -59,35 +59,38 @@ function prettyTime($time){
 
$DEBUG = false;
 
if(isset($_GET['debug']))
 
	$DEBUG = $_GET['debug'];
 

	
 
if(!$DEBUG){
 

	
 
	if(isset($_GET['savedkey'])){
 
		$savedSched = unserialize($_SESSION['saved'][$_GET['savedkey']]);
 
                $savedSched->findPossibilities();
 
		$savedSched->writeoutTables();
 
	}
 
	else{
 
		$allClasses = new Schedule("Fall 2010");
 
		$allClasses = new Schedule($_POST['postData']['name']);
 
	
 
		foreach(sortInputs($_POST) as $class)
 
		{
 
			$allClasses->addClass($class['name']);
 
	
 
			foreach($class as $section)
 
				if(is_array($section)) // Skip the name, which isn't a section
 
				{
 
			             $allClasses->addSection($class['name'], $section['letter'], $section['start'], $section['end'], arrayToDays($section['days']));
 
				}
 
			if(is_array($class)) // Skip the schedule name
 
			{
 
				$allClasses->addClass($class['name']);
 
		
 
				foreach($class as $section)
 
					if(is_array($section)) // Skip the section name, which isn't a section
 
					{
 
				             $allClasses->addSection($class['name'], $section['letter'], $section['start'], $section['end'], arrayToDays($section['days']));
 
					}
 
			}
 
		}
 
		$allClasses->findPossibilities();
 
		$allClasses->writeoutTables();
 
		if(!isset($_SESSION['saved']))
 
			$_SESSION['saved'] = array();
 
		array_push ( $_SESSION['saved'], serialize($allClasses));
 
	}
 

	
 
} else {
 

	
 

	
 
	echo '<pre>DEBUG OUTPUT: <br /><br />';
0 comments (0 inline, 0 general)