public function Tours() { $SliderImages = SliderImages::all(); $tours = Tours::all(); $country = Country::all(); return View::make('tours.tours')->with('slider', $SliderImages)->with('tours', $tours)->with('country', $country); }
public function doMoveThis() { $plateau = $this; $from = getValue('case_from', null); $to = getValue('case_to', null); $tours = Tours::createFrom(partie()->getData()->tours); $regles = $this->regles; return self::doMove($plateau, $from, $to, $tours, $regles); }
public function ajax_move() { $this->initRegles(); $this->initPlateau(); $partie_data = partie()->getData(); $coup = $this->plateau->doMoveThis(); if (!is_null($partie_data->prise_multiple) && ($pion = $partie_data->prise_multiple->pion)) { if ($pion->id != $coup->pion->id || !$coup->aMange()) { return self::refus(array('Vous devez continuer votre prise multiple.')); } } if (is_array($coup)) { return self::refus($coup); } if (!$coup->aMange()) { if (Plateau::slotPeutManger($this->plateau, $coup->pion, $this->regles)) { return self::refus(array('Vous devez prendre le pion de l\'adversaire.')); } } $coup->execute(); $tours = Tours::createFrom($partie_data->tours); if ($coup->aMange() && !$coup->get_promotion && Plateau::peutManger($this->plateau, $coup->pion, $this->regles)) { $partie_data->prise_multiple = array('pion' => $coup->pion); } else { $tours->next(); $partie_data->prise_multiple = null; } switch ($res = $this->plateau->partieFinie()) { case 1: // slot 1 gagne // slot 1 gagne case 2: // slot 2 gagne partie()->getSlotNum($res)->addScore(1, true); case -1: // partie nulle partie()->terminer(); case 0: // partie en cours break; default: throw new Exception('résultat inattendu (' . $res . ')'); } $partie_data->tours = $tours; $partie_data->plateau = $this->plateau; partie()->setData($partie_data, true); $data = $partie_data; $data->lastMove = $coup->export(); return $data; }
* the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program 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 * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley, * California 95067, USA. or at email address contact@x2engine.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * X2Engine" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by X2Engine". *****************************************************************************************/ echo Tours::tips(array(array("content" => "<h3>" . Yii::t('marketing', "Welcome to the Campaign Creator!") . "</h3> " . Yii::t('marketing', "With campaigns, you can send out personalized emails to contacts, and track when they have been opened. Let's walk through the creation of your first Campaign."), 'type' => 'flash'), array('content' => Yii::t('marketing', "Insert the name of the campaign you will be running, for internal usage."), 'target' => '#Campaign_name'), array('content' => Yii::t('marketing', 'Select a contact list to send this campaign to, or create one here.'), 'target' => '#quick-create-list'), array('content' => Yii::t('marketing', 'Next, choose a template as your email, or design one from scratch below.'), 'target' => '#Campaign_template', 'highlight' => true), array('content' => Yii::t('marketing', 'Enable Redirect Links will allow you to track when links have been clicked. Any link in the body of your email will be converted to a special tracking link.'), 'target' => '#Campaign_enableRedirectLinks')));
$tour->tourUserAddValue4 = $_POST['tourUserAddValue4']; } if ($_POST['tourUserAddValue5']) { $tour->tourUserAddName5 = $_POST['tourUserAddName5']; $tour->tourUserAddValue5 = $_POST['tourUserAddValue5']; } if ($_POST['tourUserAddEmail1']) { $tour->tourUserAddEmail1 = $_POST['tourUserAddEmail1']; } if ($_POST['tourUserAddEmail2']) { $tour->tourUserAddEmail2 = $_POST['tourUserAddEmail2']; } $user->loadLinkedFromDB(); $user->Tours[$tour->getID()] = $tour; $user->storeLinkedInDB(); $tour = new Tours($_POST['applyTourID']); $tour->loadLinkedFromDB(); $tour->updateDB(); $gtext = $smarty->fetch('inc_userinfo.html'); $gtext .= $smarty->fetch('inc_userinfo_addvalues.html'); $gmail = $tour->Guides->guideEmail1; $text = $tour->tourUserType == 'WL' ? $tour->tourEmailTextWL : $tour->tourEmailText; $text .= $smarty->fetch('apply_additional_mail.html'); //pmail($user->userEmail,$text,"ваша заявка на поход $tour->tourTitle",$headers,$gmail); pmail($gmail, $gtext, "заявка на поход {$tour->tourTitle} {$tour->tourStartDate}-{$tour->tourEndDate}", $headers, $gmail); pmail($tour->Guides->guideEmail2, $gtext, "заявка на поход {$tour->tourTitle} {$tour->tourStartDate}-{$tour->tourEndDate}", $headers, $gmail); $message = 'APPLY_OK'; $smarty->assign('applymessage', $text); header("Location: tourinfo.php?tourID=" . $tour->getID() . "&message=" . urlencode($message)); exit; } else {
<?php require_once '../model/models.php'; require_once "form.php"; $form = new Form(); $model = new Model(); $tours = new Tours(); //echo "Connected!"; if (isset($_POST['date_tour']) && isset($_POST['qrcode']) && isset($_POST['description']) && isset($_POST['uid']) && isset($_POST['heure'])) { //echo "Connected!1"; if (isset($_POST['photo'])) { $photo = $_POST['photo']; } else { $photo = null; } if (isset($_POST['matricule'])) { $matricule = $form->securite_bdd(strip_tags($_POST['matricule'])); } else { $matricule = -1; } $date = $form->securite_bdd(strip_tags($_POST['date_tour'])); $heure = $form->securite_bdd(strip_tags($_POST['heure'])); $qrcode = $form->securite_bdd(strip_tags($_POST['qrcode'])); $description = $form->securite_bdd(strip_tags($_POST['description'])); $uid = $form->securite_bdd(strip_tags($_POST['uid'])); // echo htmlspecialchars("363663_3737373.jpeg"); // echo $form->securite_bdd(strip_tags("363663_3737373.jpeg")); // $date = "2016-03-02"; // $heure = "08:09:01"; // $photo = base64_encode_image("img/hqdefault.jpg", "jpeg"); // $qrcode = "5364564538837830";
public function ajax_move() { //print_r($this->_data()); $case_from = getValue('case_from', null); $case_to = getValue('case_to', null); // Si les cases from et to sont bien définie. if (is_null($case_from) || is_null($case_to)) { throw new Exception('Une coords n\'est pas définie'); } $from_x = $case_from['x']; $from_y = $case_from['y']; $to_x = $case_to['x']; $to_y = $case_to['y']; $from = $this->_case($from_x, $from_y); $to = $this->_case($to_x, $to_y); $tours = Tours::createFrom($this->_data()->tours); // Si la case de départ est bien occupée. if ($from == 0) { throw new Exception('Case de départ vide.'); } // Si c'est bien au slot de jouer. if ($tours->pasAMoiDeJouer()) { return AJAXResponse::error('Ce n\'est pas à vous de jouer.'); } // Si la case de départ est la même que celle d'arrivée. if ($from_x == $to_x && $from_y == $to_y) { return $this->ajax_update(); } // Si le slot joue bien ses pions et pas ceux de l'adversaire. if (($from - 1) % 2 != intval(slot()->position) - 1) { return AJAXResponse::error('On ne joue pas les pions de l\'adversaire namého !'); } // Si il ne déplace pas sur une case déjà occupée. if ($to != 0) { return AJAXResponse::error('Cette case est déjà occupée.'); } // Si le déplacement est valide, respect des règles des Dammes. if (!self::bonneCase($to_x, $to_y)) { return AJAXResponse::error('Vous devez vous déplacer en diagonale. n°1'); } $distance = self::distance($from_x, $from_y, $to_x, $to_y); if ($distance == 1) { if (Coords::direction($from_x, $from_y, $to_x, $to_y) < 0) { return AJAXResponse::error('Vous ne pouvez pas reculer.'); } } else { if ($distance == 2) { if (Coords::memeDiagonale($from_x, $from_y, $to_x, $to_y)) { $milieu = Coords::milieu($from_x, $from_y, $to_x, $to_y); $v = $this->_case($milieu->x, $milieu->y); // TODO Manger en arriere ou pas !! if ($v == 0) { // case sautée vide return AJAXResponse::error('Déplacement non autorisé n°2.'); } else { if (($v - 1) % 2 == 2 - slot()->position) { // pièce sautée adverse $this->_case($milieu->x, $milieu->y, 0); } else { if (($v - 1) % 2 == slot()->position - 1) { // pièce sautée alliée return AJAXResponse::error('Vous ne pouvez pas sauter vos pièces.'); } } } } else { return AJAXResponse::error('Vous devez vous déplacer en diagonale. n°2'); } } else { return AJAXResponse::error('Déplacement non autorisé. (' . self::distance($from_x, $from_y, $to_x, $to_y) . ')'); } } // Si tout est ok : $this->_case($to_x, $to_y, $from); $this->_case($from_x, $from_y, 0); $tours->next(); $data = $this->_data(); $data->tours = $tours; $this->_data($data); partie()->save(); return $this->ajax_update(); }
<?php require_once "../../config/init.php"; require_once "auth.php"; $smarty->assign('d_tourstatus', getTourStatus()); $year = is_numeric($_POST['year']) ? $_POST['year'] : date('Y'); $year .= '-01-01'; $tour = new Tours(); $options = array(); if (!is_numeric($_POST['year'])) { $options['strings_OR']['tourStatus'] = 'normal'; } $options['strings_OR'][2][] = array('field' => 'tourStartDate', 'eq' => '>=', 'value' => date('Y-01-01', strtotime($year))); $options['strings_OR'][2][] = array('field' => 'tourStartDate', 'eq' => '<', 'value' => date('Y-01-01', strtotime("{$year} +1 year"))); $_SQLDEBUG = 0; if ($guide->guideType !== 'admin') { $options['strings_OR']['guideID'] = $guide->getID(); $options['strings_OR']['guideID2'] = $guide->getID(); } $tours = $tour->searchFromDB($options); function so($a, $b) { $ccmp = array('normal' => 'a', 'closed' => 'b', 'hidden' => 'c'); $r = strcmp($ccmp[$a[tourStatus]], $ccmp[$b[tourStatus]]); if ($r === 0) { $r = strcmp($a[tourStartDate], $b[tourStartDate]); } return $r; } if (is_array($tours)) { uasort($tours, 'so');
<?php 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;
$t->tourUserModifyDate = date('Y-m-d H:i:s'); } $twt->commit(); } $user->Tours[$_POST['applyTourID']]->tourUserType = 'deleted'; $user->Tours[$_POST['applyTourID']]->tourUserModifyDate = date('Y-m-d H:i:s'); $subject = "отказ от тура {$tour->tourTitle}"; $body = "\n\t\tваш статус изменен. \n\t\tподробнее по ссылке 'http://www.velotur.ru/usertours.php'\n\t\t"; pmail($user->userEmail, $body, $subject, false, $gmail); $subject = "отказ от тура {$tour->tourTitle}"; $body = "\n\t\t\tПользователь {$user->userRussianName} {$user->userEmail} отказался от тура {$tour->tourTitle}\n\t\t\t<a href=\"http://velotur.ru/admin/tourinfo.php?tourID={$tour->tourID}&showUser={$user->userID}#showUser\">\n\t\t\thttp://velotur.ru/admin/tourinfo.php?tourID={$tour->tourID}&showUser={$user->userID}#showUser\n\t\t\t</a>\n\t\t"; pmail($tour->Guides->guideEmail1, $body, $subject, false, $gmail); pmail($tour->Guides->guideEmail2, $body, $subject, false, $gmail); $message .= "{$user->userEmail}: mail sent<br>"; $user->storeLinkedInDB(); $tour = new Tours($_POST['applyTourID']); $tour->loadLinkedFromDB(); $tour->updateDB(); } if (isset($_POST['tourUserCommentsTicket_add'])) { $user->Tours[$_POST['applyTourID']]->tourUserCommentsTicket .= "\n\n" . strip_tags($_POST['tourUserCommentsTicket_add']); $user->storeLinkedInDB(); } if (isset($_POST['tourUserCommentsUser'])) { $user->Tours[$_POST['applyTourID']]->tourUserCommentsUser = strip_tags($_POST['tourUserCommentsUser']); $user->storeLinkedInDB(); } header("Location: usertours.php"); } $uvalues = $user->getValues(); $options = array();
* the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program 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 * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley, * California 95067, USA. or at email address contact@x2engine.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * X2Engine" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by X2Engine". *****************************************************************************************/ echo Tours::tips(array());
<?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);
<?php require_once "../config/init.php"; if ($_POST['tourID']) { $_SESSION['tourID'] = $_POST['tourID']; } if ($_POST['type']) { $_SESSION['type'] = $_POST['type']; } $_reg_tourID = $_SESSION['tourID']; $_reg_type = $_SESSION['type']; $tour = new Tours($_reg_tourID); $tour->loadLinkedFromDB(); $smarty->assign('Tour', $tour->getValues()); $smarty->assign('type', $_reg_type); $smarty->assign($_POST); include "auth.php"; $smarty->assign('message', $message); $smarty->display('apply_ok.html');
* 02110-1301 USA. * * You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley, * California 95067, USA. or at email address contact@x2engine.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * X2Engine" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by X2Engine". *****************************************************************************************/ Tours::loadTips('marketing.create'); $this->pageTitle = Yii::t('marketing', 'Create Campaign'); $menuOptions = array('all', 'create', 'lists', 'newsletters', 'weblead', 'webtracker', 'x2flow'); $this->insertMenu($menuOptions); $form = $this->beginWidget('CActiveForm', array('id' => 'campaign-form', 'enableAjaxValidation' => false)); ?> <div class="page-title icon marketing"> <h2><?php echo Yii::t('marketing', 'Create Campaign'); ?> </h2> <?php echo CHtml::submitButton(Yii::t('module', 'Create'), array('class' => 'x2-button highlight right')); ?> </div>
/** * Action called to mark a tour (tip) as seen * @param int $id ID of the tip */ public function actionTourSeen($id) { Tours::model()->updateByPk($id, array('seen' => true)); echo 'success'; }
<?php require_once "../../config/init.php"; require_once "auth.php"; $smarty->assign('d_tourstatus', getTourStatus()); $t = new Tours(); $options = array(); $options[] = array('field' => 'tourStartDate', 'eq' => 'STRONGLIKE', 'value' => (int) $_POST['year'] . "%%"); if (!isset($_POST['tourStatus'])) { $options[] = array('field' => 'tourStatus', 'eq' => '!=', 'value' => 'hidden'); } else { $options['tourStatus'] = $_POST['tourStatus']; } $options[] = array('field' => 'tourStartDate', 'eq' => 'ORDERBY', 'value' => 'tourStartDate'); $tours = $t->searchFromDB($options); $smarty->assign('Tours', $tours); $smarty->assign($_POST); $smarty->assign('title', "- календарь " . (int) $_POST['year']); $smarty->display("calendar.html");
if ($_POST['tourUserAddValue4']) { $tour->tourUserAddName4 = $_POST['tourUserAddName4']; $tour->tourUserAddValue4 = $_POST['tourUserAddValue4']; } if ($_POST['tourUserAddValue5']) { $tour->tourUserAddName5 = $_POST['tourUserAddName5']; $tour->tourUserAddValue5 = $_POST['tourUserAddValue5']; } if ($_POST['tourUserCommentsUser']) { $tour->tourUserCommentsUser = $_POST['tourUserCommentsUser']; } $user->loadLinkedFromDB(); $user->Tours[$tour->getID()] = $tour; apply_discount($user->getID(), $tour->getID()); $user->storeLinkedInDB(); $tour = new Tours($_reg_tourID); $tour->loadLinkedFromDB(); $tour->updateDB(); email_apply($origuser, $tour); $user = $origuser; header("Location: /usertours.php?tourID=" . $tour->getID() . "&message=" . urlencode($message) . "#tour" . $tour->getID()); exit; } } } } } $smarty->assign('message', $message); $smarty->display('apply.html'); function email_apply($origuser, $tour) {
$user->Tours[$tour->getID()]->tourUserComments = $_POST['tourUserComments']; } if (isset($_POST['tourUserCommentsUser'])) { $user->Tours[$tour->getID()]->tourUserCommentsUser = $_POST['tourUserCommentsUser']; } if (isset($_POST['tourUserCommentsPrepay'])) { $user->Tours[$tour->getID()]->tourUserCommentsPrepay = $_POST['tourUserCommentsPrepay']; } if (isset($_POST['tourUserCommentsTicket'])) { $user->Tours[$tour->getID()]->tourUserCommentsTicket = $_POST['tourUserCommentsTicket']; } if (isset($_POST['tourUserCommentsRegVia'])) { $user->Tours[$tour->getID()]->tourUserCommentsRegVia = $_POST['tourUserCommentsRegVia']; } if (isset($_POST['newTourID']) && is_numeric($_POST['newTourID'])) { $newtour = new Tours((int) $_POST['newTourID']); if (!$newtour->getID()) { break; } $user->Tours[$newtour->getID()] = $user->Tours[$tour->getID()]; $user->Tours[$newtour->getID()]->tourID = $newtour->getID(); unset($user->Tours[$tour->getID()]); unset($tour->Users[$user->getID()]); $user->storeLinkedInDB(); $tour->updateDB(); $newtour->updateDB(); $payments = new tw_payments(); $payments->find_records(array('tourID' => $tour->getID(), 'userID' => $user->getID())); foreach ($payments as $p) { $p->tourID = $newtour->getID(); }
/** * Action to reset all tip and show them again */ public function actionResetTours() { Tours::model()->updateAll(array('seen' => null), 'profileId=:profileId', array('profileId' => Yii::app()->params->profile->id)); echo 'success'; }
/** * Checks if a tip has been seen returns false if it has been seen * @param string $key Key to find a tip for * @return mixed Returns false if the tip has been seen, and returns the tip object * if it has not been seen yet. */ public static function getTip($key) { $tip = self::model('Tours')->findByAttributes(array('profileId' => Yii::app()->params->profile->id, 'description' => $key)); if ($tip && $tip->seen) { return false; } if (empty($tip)) { $tip = new Tours(); $tip->profileId = Yii::app()->params->profile->id; $tip->description = $key; $tip->save(); } return $tip; }
if (!$isMyProfile && Yii::app()->user->id == $model->id) { $this->insertActionMenu(); } $this->noBackdrop = true; Yii::import('application.components.leftWidget.ProfileInfo'); Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/profile.js', CClientScript::POS_END); Yii::app()->clientScript->registerCssFiles('profileCombinedCss', array('profile.css', 'activityFeed.css', '../../../js/multiselect/css/ui.multiselect.css')); Yii::app()->clientScript->registerResponsiveCssFile(Yii::app()->theme->baseUrl . '/css/responsiveActivityFeed.css'); AuxLib::registerPassVarsToClientScriptScript('x2.profile', array('isMyProfile' => $isMyProfile ? 'true' : 'false'), 'profileScript'); $fullProfile = $isMyProfile ? 'full-profile' : ''; $width = ''; if ($isMyProfile) { $this->leftWidgets = array('ProfileInfo' => array('model' => $model)); $dashboard = $this->widget('ProfileDashboardManager', array('model' => $model)); list($width) = $dashboard->getColumnWidths(); Tours::loadTips('profile.index'); } ?> <div id='profile-content-container' class='<?php echo $fullProfile; ?> '> <div id='profile-info-container-outer'> <?php if (!$isMyProfile) { $this->renderPartial('_profileInfo', array('model' => $model)); } echo X2Html::getFlashes(); ?> </div>
<?php require_once "../../config/init.php"; require_once "auth.php"; $tour = new Tours((int) $_GET['tourID']); $tour->loadLinkedFromDB(); $user = new Users((int) $_GET['userID']); $user->loadLinkedFromDB(); $t = $user->Tours[$tour->getID()]; $t->tourUserRoomingType = $_GET['tourUserRoomingType']; $t->tourUserRoomingNo = $_GET['tourUserRoomingNo']; $t->tourUserRooming = trim($t->tourUserRoomingType . ' ' . $t->tourUserRoomingNo); $user->storeLinkedInDB();
* California 95067, USA. or at email address contact@x2engine.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * X2Engine" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by X2Engine". *****************************************************************************************/ Yii::app()->clientScript->registerPackage('X2CSS'); Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl() . '/js/profileSettings.js', CClientScript::POS_END); Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/css/profileSettings.css'); Tours::tips(array(array('content' => Yii::t('app', 'You can disable tips like this by unchecking this box.'), 'target' => '#Profile_showTours'))); $preferences = $model->theme; $miscLayoutSettings = $model->miscLayoutSettings; $passVariablesToClientScript = "\n x2.profileSettings.checkerImagePath = '" . Yii::app()->theme->getBaseUrl() . "/images/checkers.gif';\n x2.profileSettings.createThemeHint = '" . Yii::t('profile', 'Save your current theme settings as a predefined theme.') . "';\n x2.profileSettings.saveThemeHint = '" . Yii::t('profile', 'Update the settings of the currently selected predefined theme.') . "';\n x2.profileSettings.normalizedUnhideTagUrl = '" . CHtml::normalizeUrl(array("/profile/unhideTag")) . "';\n x2.profileSettings.translations = {\n themeImportDialogTitle: '" . Yii::t('profile', 'Import a Theme') . "',\n close: '" . Yii::t('app', 'close') . "',\n };\n x2.profileSettings.uploadedByAttrs = {};\n"; // pass array of predefined theme uploadedBy attributes to client foreach ($myThemes->data as $theme) { $passVariablesToClientScript .= "x2.profileSettings.uploadedByAttrs['" . $theme->id . "'] = '" . $theme->uploadedBy . "';"; } Yii::app()->clientScript->registerScript('passVariablesToClientScript', $passVariablesToClientScript, CClientScript::POS_END); // If the user was redirected from /site/upload and the "useId" parameter is // available, set the background to that so they get instant feedback if (isset($_GET['bgId'])) { $media = Media::model()->findByPk($_GET['bgId']); if ($media instanceof Media) { Yii::app()->clientScript->registerScript('setBackgroundToUploaded', '$("select#backgroundImg").val(' . $media->id . ').trigger("change");', CClientScript::POS_READY); }
public function delete_tours($id) { $tours = Tours::find($id); if ($tours->delete()) { return Redirect::to('AddTours')->with('save_delete', 'deleted'); } }
<?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");
<?php require_once "../model/session.php"; require_once '../model/models.php'; define('LIMIT', 500); $controllerCalled = 1; $_SESSION['page'] = "report"; $report = new Model(); $tours = new Tours(); $list = $report->_list("tours", "*"); $listTours = $tours->_list("tours", "*"); // La liste des titres des colonnes de la table tours. $toursKeys = Constants::getListKey()['tours']; //la taille du tableau tours dans la base $size = sizeof($list); //On divise le table par 500 pour ne pas afficher tout les donnees. $div = $size > LIMIT ? $size / LIMIT : 1; $limit = LIMIT; for ($i = 0; $i < sizeof($list); $i++) { foreach ($list[$i] as $key => $value) { if ($key == "guardtours_id") { $guardtours_id = $list[$i][$key]; $guard_id = $report->getBy("guardtours", "guard_id", "id", $guardtours_id); $nom = $report->getBy("guard", "nom", "id", $guard_id); $prenom = $report->getBy("guard", "prenom", "id", $guard_id); $list[$i][$key] = $nom . " " . $prenom; } } } // $mention = $tours->getMention("09:00:00", 1); include "../vue/report.php";