Exemple #1
0
<?php

require_once "../config/init.php";
$smarty->assign('d_apply', getApplyStatus());
$t = new Tours((int) $_POST['tourID']);
$t->loadLinkedFromDB();
function so($a, $b)
{
    $ccmp = array('apply' => 'a', 'WL' => 'b', 'completed' => 'c', 'deleted' => 'd');
    $r = strcmp($ccmp[$a->tourUserType], $ccmp[$b->tourUserType]);
    if ($r === 0) {
        $r = strcmp($a->userRussianName, $b->userRussianName);
    }
    return $r;
}
function fo($a)
{
    return in_array($a->tourUserType, array('apply', 'completed'));
}
if (is_array($t->Users)) {
    $t->Users = array_filter($t->Users, 'fo');
    uasort($t->Users, 'so');
}
$smarty->assign($t->getValues());
$smarty->assign('title', sprintf("- информация по походу %s (%s - %s) ", $t->tourTitle, $t->tourStartDate, $t->tourEndDate));
$smarty->display("tourinfo.html");
Exemple #2
0
<?php

require_once "../config/init.php";
if ($_POST['tourID']) {
    $_SESSION['tourID'] = $_POST['tourID'];
}
$_reg_tourID = $_SESSION['tourID'];
$tour = new Tours($_reg_tourID);
$tour->loadLinkedFromDB();
$smarty->assign('Tour', $tour->getValues());
$smarty->assign("addvaluesArray", $tour->getAddValuesArray());
$applyType = '';
if ($tour->_allowPreApply()) {
    $applyType = 'WL';
}
if ($tour->_allowWaitinglist()) {
    $applyType = 'WL';
}
if ($tour->_allowApply()) {
    $applyType = 'apply';
}
$_POST['applyType'] = $applyType;
$smarty->assign('type', $applyType);
$smarty->assign($_POST);
include "auth.php";
include "restricted.php";
$smarty->assign('d_userSex', getUserSex());
$smarty->assign('d_userHowFound', getUserHowFound());
$user->loadLinkedFromDB();
if (isset($_POST['applyFriend'])) {
    $v = $user->getValues();
Exemple #3
0
<?php

$smarty->assign('d_tourstatus', getTourStatus());
$smarty->assign('d_tourdifficulty', getTripDifficulty());
$smarty->assign('d_tourcomfort', getTripComfort());
$tour = new Tours();
$smarty->assign('TourAllYears', $tour->getAllFutureYears());
$options = array();
if (is_numeric($_POST['year'])) {
    $year = (int) $_POST['year'];
    //$options['strings_OR'][]=array('field'=>'tourStartDate','eq'=>'STRONGLIKE','value'=>"$year%%");
    $options['strings_OR'][] = array('field' => 'tourStartDate', 'eq' => 'STRONGLIKE', 'value' => "{$year}%%");
    $options['strings_OR'][] = array('field' => 'tourEndDate', 'eq' => 'STRONGLIKE', 'value' => "{$year}%%");
} else {
    //$year=date("Y");
    //if (date("m")>8) $year++;
    $options[] = array('field' => 'tourStartDate', 'eq' => '>=', 'value' => date('Y-m-d H:i:s', strtotime('-1 week')));
    $options[] = array('field' => 'tourStartDate', 'eq' => '<=', 'value' => date('Y-m-d H:i:s', strtotime('+1 year')));
}
$smarty->assign('year', $year);
$t = new Tours();
$options[] = array('field' => 'tourStatus', 'eq' => '!=', 'value' => 'hidden');
$options[] = array('field' => 'tourStartDate', 'eq' => 'ORDERBY', 'value' => 'tourStartDate');
$tours = $t->searchObjectsFromDB($options);
if (is_array($tours)) {
    foreach ($tours as $t) {
        $t->loadLinkedFromDB();
        $toursv[] = $t->getValues();
    }
}
$smarty->assign('Tours', $toursv);
Exemple #4
0
        foreach ($recipients_userid as $id) {
            $DBCLASS->query(sprintf('replace into m2m_mailhistory_tw_users (tw_users_id,mailhistory_id) values (%d,%d)', $id, $rec->get_id()));
        }
    }
}
if ($_POST['type'] !== 'finlist') {
    if ($t->guideID) {
        $g = new Guides($t->guideID);
        $t->Users[] = $g;
    }
    if ($t->guideID2) {
        $g = new Guides($t->guideID2);
        $t->Users[] = $g;
    }
}
$smarty->assign("Tour", $t->getValues());
$smarty->assign("addvaluesArray", $t->getAddValuesArray());
$t = $t->getValues();
if ($_POST['tourID'] != $_SESSION['tourinfo_sid']) {
    $_SESSION['tourinfo_s'] = $_SESSION['tourinfo_sr'] = FALSE;
    $_SESSION['tourinfo_sid'] = $_POST['tourID'];
} else {
    if (isset($_POST['s'])) {
        if ($_POST['s'] == $_SESSION['tourinfo_s']) {
            $_SESSION['tourinfo_sr'] = $_SESSION['tourinfo_sr'] ? FALSE : TRUE;
        }
        if ($_POST['s'] == 'tourUserType') {
            $_SESSION['tourinfo_s'] = $_SESSION['tourinfo_sr'] = FALSE;
        } else {
            $_SESSION['tourinfo_s'] = $_POST['s'];
        }
Exemple #5
0
require_once "../../config/init.php";
require_once "auth.php";
$smarty->assign('d_tourdifficulty', getTripDifficulty());
$smarty->assign('d_tourcomfort', getTripComfort());
$smarty->assign('d_tourstatus', getTourStatus());
$smarty->assign('d_tourPlacesGender', getPlacesGender());
$g = new Guides();
$smarty->assign('Guides', $g->getHTMLSelect('guideName'));
loadclass('RentabikeSet');
$rbs = new RentabikeSet();
$smarty->assign('rentabikeSet', $rbs->getHTMLSelect('name'));
$tour = new Tours((int) $_POST['_id']);
if (is_numeric($_POST['tripID'])) {
    $trip = new Trips((int) $_POST['tripID']);
    $v = $trip->getValues();
    $tv = $tour->getValues();
    foreach ($v as $k => $r) {
        $tk = str_replace('trip', 'tour', $k);
        if ($tk != 'tourID' && array_key_exists($tk, $tour->_EQUALS)) {
            $tour->{$tk} = $r;
        }
    }
}
$smarty->assign($tour->getValues());
$smarty->assign($_POST);
$output = $smarty->fetch("tour_edit.html");
if (!empty($_POST) && !empty($_POST[formSubmit]) && ($smarty->_validate_processed == 1 && $smarty->_validate_error != 1)) {
    include "_default.action.php";
    exit;
}
$smarty->display("tour_edit.html");