<html>
<HEAD>
	<link rel='stylesheet' type='text/css' href='../CSS/Font.css'>
</HEAD>
<BODY>
<h4>Projects</h4>
<form method="post" action="add_apps.php?added=yes">
	<input type="hidden" name="source_file" value="Projects.php"></input>
	<table>
		<tr>
			<td><h5>Project title</h5></td>
			<td><h5>Status       </h5></td>
			<!--td><h5>Description  </h5></td-->
		</tr>


<?php
		require "../Common/openDB.php";
		$file = fopen("../ProjectsList.csv","r");
		$i = 0;
		while(! feof($file)){
			$i++;
			$line = fgets($file);
			if(startsWith($line, "#") || $line == "")continue;
			$tokens = explode("!",$line);
			echo ("<tr>");
			echo("<td><input type='text' readonly name='prompt{$i}' value='{$tokens[1]}' size='80'/></input></td>");
			echo("<td>{$tokens[2]}</td>");
			//echo("<td>{$tokens[3]}</td>");
			echo ("</tr>");
		}

		fclose($file);

?>
	</table>
	<!--
	<table>
	<tr><td align="center">
		<input type="submit" name="ok" value="save" />
		<input type="submit" name="cancel" value="cancel" />
	</td></tr>
	</table>
	-->
</form>

<?php


if(isset($_POST[ok])){
	if($_POST[prompt] == "" || $_POST[argument] == "" || $_POST[prompt] == NULL || $_POST[argument] == NULL){
		$msg = "Under development";
	}else{

		// return with message
		$msg = "Project information saved";
	}
	header("location: SplashScreen/SplashScreen.html?message={$msg}");

}elseif(isset($_POST[cancel])){
	header("location: SplashScreen/SplashScreen.html");;
}














?>

</body>
</html>
