function getProjectsContent($path) { global $title; include 'blog.php'; $action = array_shift($path); if ($action == "") { $title = "Projects" . $title; $content = '<h1>Projects</h1><p>Below is a list of personal (and maybe some group) projects that I thought deserved their own page. Feel free to contact me (see the footer) if you\'de like to know more about a certain project or endeavor.</p>'; $content .= '<p class="subtitle">The following projects are listed in order of their most recent blog post activity.</p>'; foreach (fetchProjects() as $project) { $content .= getProjectSummary($project); } return $content; } else { $project = fetchProject($action); if ($project == null) { return get404(); } else { $title = $project['name'] . " (Project)" . $title; return getProject($project); } } return "<h1>Projects</h1>"; }
<?php if ($_SESSION['phrase'] != $correctAdminPhrase) { exit; } $projectID = $URI[0]; $project = fetchProject($projectID); $fp = fopen('deleted_projects.txt', 'a'); fwrite($fp, "\n\n##################################################\n"); fwrite($fp, print_r($project, TRUE)); fwrite($fp, "##################################################\n"); fclose($fp); $delete = "DELETE FROM projects WHERE id='" . $projectID . "';"; #echo $delete . '<br>'; mysql_query($delete) or die(mysql_error()); ?> <a href="/admin/projects"><<< Back to Project Management</a><br><br> Project Deleted. Data saved in backup text file.
<form action="/admin/newproject" method="post"> <table cellspacing=0> <tr><td>Name:</td><td><input type="text" name="name"></td></tr> <tr><td>ID:</td><td><input type="text" name="id"></td></tr> <tr><td>Tag:</td><td><input type="text" name="tag_id"></td></tr> <tr><td>Image:</td><td><input type="text" name="image_location"></td></tr> <tr><td>Intro Content:</td><td><textarea style="height:200px;" name="intro_content"></textarea></td></tr> <tr><td>Main Content:</td><td><textarea name="main_content"></textarea></td></tr> </table> <br> <input type="submit" value="Create"> </form> <?php } else { if ($second_resource === "edit") { $project = fetchProject($third_resource); ?> <a href="/admin/projects"><<< Back to Project Management</a><br><br> <form action="/admin/editproject" method="post"> <table cellspacing=0> <tr><td>Name:</td><td><input type="text" name="name" value="<?php echo $project['name']; ?> "></td></tr> <tr><td>ID:</td><td><input type="text" name="id" value="<?php echo $project['id']; ?> "></td></tr> <tr><td>Tag:</td><td><input type="text" name="tag_id" value="<?php echo $project['tag_id']; ?>