Example #1
0
    exit;
}
$ADK_HIKE->sanitize();
$ADK_HIKE->save($con);
foreach ($ADK_HIKE->peaks as $ADK_PEAK) {
    $ADK_HIKE->addPeak($con, $ADK_PEAK);
}
$preFileIDs = explode(',', $_POST['prefileids']);
if (count($preFileIDs) > 0 && $preFileIDs[0] != '') {
    $ADK_HIKE->addFiles($con, $preFileIDs);
}
if (count($ADK_FILES->files) > 0) {
    $ADK_FILES->save($con);
    $ADK_HIKE->addFiles($con, $ADK_FILES->fileIDs);
}
$ADK_HIKES = new Hikes();
$ADK_HIKES->userid = $ADK_HIKE->userid;
$ADK_HIKES->get($con);
$ADK_HIKER = new Hiker();
$ADK_HIKER->id = $ADK_HIKE->userid;
$ADK_HIKER->get($con);
if ($_SESSION['ADK_USERGROUP_CDE'] === 'HIK' && hasNotNotifiedInLastDay($ADK_HIKE->id, $ADK_HIKES)) {
    //notify corr
    require_once 'classes/Correspondent.php';
    $ADK_CORRESPONDENT = new Correspondent();
    $ADK_CORRESPONDENT->id = $ADK_HIKER->corrid;
    $ADK_CORRESPONDENT->get($con);
    foreach ($ADK_HIKES->hikes as $hike) {
        if ($hike->id === $ADK_HIKE->id) {
            $ADK_HIKE->label = $hike->label;
        }
Example #2
0
<?php

//Imports
require_once 'includes/db/db_conn.php';
require_once 'includes/db/SELECT.php';
require_once 'includes/classes/Correspondent.php';
require_once 'includes/classes/File.php';
require_once 'includes/classes/Hike.php';
require_once 'includes/classes/Hiker.php';
require_once 'includes/classes/Peak.php';
if (!isset($_SESSION['ADK_USER_ID']) || !is_numeric($_SESSION['ADK_USER_ID'])) {
    header("Location: ./");
}
$ADK_USER_ID = intval($_SESSION['ADK_USER_ID']);
$con = connect_db();
$ADK_HIKER = new Hiker();
$ADK_HIKER->id = $ADK_USER_ID;
$ADK_HIKER->get($con);
if ($ADK_HIKER->name == '') {
    header("Location: ./");
}
$ADK_HIKES = new Hikes();
$ADK_HIKES->userid = $ADK_USER_ID;
$ADK_HIKES->get($con);
$ADK_PEAKS = new Peaks();
$ADK_PEAKS->get($con);
$ADK_CORRESPONDENT = new Correspondent();
$ADK_CORRESPONDENT->id = $ADK_HIKER->corrid;
$ADK_CORRESPONDENT->get($con);
$con->close();
Example #3
0
require_once 'classes/Hike.php';
require_once 'classes/Hiker.php';
require_once 'classes/File.php';
require_once 'classes/Peak.php';
if (!isset($_POST['userid']) || !is_numeric($_POST['userid'])) {
    http_response_code(400);
    exit;
}
if (!isset($_POST['hikeid']) || !is_numeric($_POST['hikeid'])) {
    http_response_code(400);
    exit;
}
$ADK_USER_ID = intval($_POST['userid']);
$ADK_HIKE_ID = intval($_POST['hikeid']);
$con = connect_db();
$ADK_HIKE = new Hike();
$ADK_HIKE->id = $ADK_HIKE_ID;
$ADK_HIKE->userid = $ADK_USER_ID;
$ADK_HIKE->delete($con);
$ADK_HIKES = new Hikes();
$ADK_HIKES->userid = $ADK_USER_ID;
$ADK_HIKES->get($con);
$ADK_HIKER = new Hiker();
$ADK_HIKER->id = $ADK_USER_ID;
$ADK_HIKER->get($con);
if ($_SESSION['ADK_USERGROUP_CDE'] === 'HIK') {
    Hiker::updateLastActive($con, intval($_SESSION['ADK_USER_ID']));
}
$con->close();
http_response_code(200);
$ADK_HIKES->renderTable($ADK_HIKER->numpeaks, $ADK_HIKER->numclimbed, $ADK_HIKER->percent);