function testdbCrewsModule() { $s1 = new Crew("13-10-20", "foodpantry", 3, null, "", ""); $this->assertTrue(insert_dbCrews($s1)); $this->assertEqual(select_dbCrews($s1->get_id())->get_date(), $s1->get_date()); $this->assertTrue(delete_dbCrews($s1->get_id())); $s2 = new Crew("13-10-21", "foodbank", 3, null, "", ""); $this->assertTrue(insert_dbCrews($s2)); $s2 = new Crew("13-10-21", "foodbank", 2, null, "", ""); $this->assertTrue(update_dbCrews($s2)); $this->assertTrue(delete_dbCrews($s2->get_id())); echo "testdbCrews complete"; }
$crew = select_dbCrews($crewid); if (!$crew instanceof Crew) { echo "<p>Invalid Crew ID Supplied. Click on \"Calendar\" above to edit crews.</p>"; } else { if (!process_fill_vacancy($_POST, $crew, $group) && !process_add_volunteer($_POST, $crew, $group)) { if (process_unfill_crew($_POST, $crew, $group)) { $crew = select_dbCrews($crewid); } else { if (process_add_slot($_POST, $crew, $group)) { $crew = select_dbCrews($crewid); } else { if (process_clear_crew($_POST, $crew, $group)) { $crew = select_dbCrews($crewid); } else { if (process_ignore_slot($_POST, $crew, $group)) { $crew = select_dbCrews($crewid); } } } } $persons = $crew->get_persons(); echo "<br><br><table align=\"center\" border=\"1px\"><tr><td align=\"center\" colspan=\"3\"><b>" . get_crew_name_from_id($crewid) . "</b></td><td></td></tr>"; echo "<tr><td valign=\"top\"><br> " . do_slot_num($crew->get_slots()) . "</td><td>"; if ($_SESSION['access_level'] == 2) { echo "<form method=\"POST\" style=\"margin-bottom:0;\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"_submit_add_slot\" value=\"1\"><br>\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"Add Slot\"\n\t\t\t\t\t\t\t\t\t\t\tname=\"submit\" >\n\t\t\t\t\t\t\t\t\t\t\t</form></td><td><br>"; echo "<form method=\"POST\" style=\"margin-bottom:0;\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"_submit_clear_crew\" value=\"1\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"Clear Entire Crew\"\n\t\t\t\t\t\t\t\t\t\t\tname=\"submit\" >\n\t\t\t\t\t\t\t\t\t\t\t</form></td>"; } else { echo "</td><td></td>"; } echo "<td></td></tr>"; echo display_filled_slots($persons);