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>"; }
// load type of items to display (online / offline) $type = trim($_GET["type"]); // make sure type is set if ($type == "") { $type = "online"; } // transform $type into $online (Y/N) if ($type == "offline") { $online = "N"; } else { $online = "Y"; } // get items total $items_total = fetchSimpleTotal("projects", "online = '" . $online . "'"); // get items results $items_result = fetchProjects(CMS_LANG, $online, "name", 0, 0); // set id for css purposes $id = 4; // global vars for includes $g_section = 'Projects'; $g_sub_section = $type; $g_sub_sub_section = $items_total; // include header include 'inc/header.inc.php'; // include menu include 'inc/menu.inc.php'; ?> <?php if ($_GET['result'] == 'delete_ok') { ?>
function getCountNONEmptyProjectsForPredmet($predmet, $ag) { $count = 0; $projects = fetchProjects($predmet, $ag); foreach ($projects as $project) { $nMembers = getCountMembersForProject($project[id]); if ($nMembers > 0) { $count++; } } return $count; }
$error_str .= "<li>Image: Fichier doit être un .jpg</li>"; } } } // fetch locations from [locations] table $locations_result = fetchLocations(CMS_LANG); // set id for css purposes $id = 1; // global vars for includes $g_section = 'Locations'; $g_sub_section = $_GET['action'] != '' ? $_GET['action'] : 'Add'; // include header include 'inc/header.inc.php'; // include menu include 'inc/menu.inc.php'; $projects = fetchProjects(CMS_LANG); ?> <?php if ($form_error != "") { ?> <div class="error_msg"> <ul> <?php echo $error_str; ?> </ul> </div> <?php } else { if ($form_success) {
<?php $second_resource = sizeof($URI) > 0 ? array_shift($URI) : ""; $third_resource = sizeof($URI) > 0 ? array_shift($URI) : ""; if ($second_resource === "") { ?> <a href="/admin/menu"><<< Back to Menu</a><br> <a href="/admin/projects/new">Create new Project</a><br> <table cellspacing=0> <?php $color = 1; foreach (fetchProjects() as $project) { echo '<tr class="' . ($color > 0 ? "white" : "grey") . '"><td><a target="_blank" href="' . $mainSite . 'projects/' . $project['id'] . '">' . $project['name'] . '</a></td>'; echo '<td>' . $project['id'] . '</td>'; echo '<td><a href="/admin/projects/edit/' . $project['id'] . '">Edit</a></td>'; echo '<td><a href="/admin/deleteproject/' . $project['id'] . '" onclick="return confirm(\'are you sure?\')">Delete</a></td>'; $color *= -1; } ?> </table> <?php } else { if ($second_resource === "new") { ?> <a href="/admin/projects"><<< Back to Project Management</a><br><br> <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>