public function saveNewAbsence($team, $event) { Flight::auth()->check(); $absence = new absence(Flight::request()->data); $absence->store(); if (isset($event)) { Flight::redirect("/event/" . $event); } else { Flight::redirect("/team/" . $team); } }
function show_absence_forms($template) { global $personID; $db = new db_alloc(); $query = prepare("SELECT * FROM absence WHERE personID=%d", $personID); $db->query($query); $absence = new absence(); while ($db->next_record()) { $absence->read_db_record($db); $absence->set_values("absence_"); include_template($template); } }
* * allocPSA is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public * License for more details. * * You should have received a copy of the GNU Affero General Public License * along with allocPSA. If not, see <http://www.gnu.org/licenses/>. */ require_once "../alloc.php"; $absenceID = $_POST["absenceID"] or $absenceID = $_GET["absenceID"]; $returnToParent = $_GET["returnToParent"] or $returnToParent = $_POST["returnToParent"]; $TPL["returnToParent"] = $returnToParent; $urls["home"] = $TPL["url_alloc_home"]; $urls["calendar"] = $TPL["url_alloc_taskCalendar"] . "personID=" . $personID; $absence = new absence(); if ($absenceID) { $absence->set_id($absenceID); $absence->select(); $absence->set_values(); $personID = $absence->get_value("personID"); } $person = new person(); $personID = $personID or $personID = $_POST["personID"] or $personID = $_GET["personID"]; if ($personID) { $person->set_id($personID); $person->select(); } $db = new db_alloc(); if ($_POST["save"]) { // Saving a record