本文整理汇总了PHP中UserService::getUserMainClimbingAreas方法的典型用法代码示例。如果您正苦于以下问题:PHP UserService::getUserMainClimbingAreas方法的具体用法?PHP UserService::getUserMainClimbingAreas怎么用?PHP UserService::getUserMainClimbingAreas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserService
的用法示例。
在下文中一共展示了UserService::getUserMainClimbingAreas方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$show_project = $userprefs['show_project'];
$show_redpoint = $userprefs['show_redpoint'];
$show_flash = $userprefs['show_flash'];
$show_onsight = $userprefs['show_onsight'];
$minB = $userprefs['minV'];
$maxB = $userprefs['maxV'];
$minTR = $userprefs['minTR'];
$maxTR = $userprefs['maxTR'];
$minL = $userprefs['minL'];
$maxL = $userprefs['maxL'];
$boulderGradingID = $userprefs['boulderGradingSystemID'];
$routeGradingID = $userprefs['routeGradingSystemID'];
//Find out user's country
$countryCode = $userService->getUserCountryCode($userid);
//find user's main gym
$mainClimbingAreas = $userService->getUserMainClimbingAreas($userid);
$main_gymid = $mainClimbingAreas['main_gym'];
$main_cragid = $mainClimbingAreas['main_crag'];
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Gym Climbing Tracker</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Latest compiled and minified CSS -->
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/datepicker.css">
<link rel="stylesheet" type="text/css" href="style.php/mycss.scss">
示例2: UserService
<?php
include "./core/bootstrap.php";
//connect to database
include 'dbconnect.php';
//check that user has a valid cookie, redirect if no valid cookie
include 'php_common/cookiecheck.php';
//get user's country
$userService = new UserService();
$countryCode = $userService->getUserCountryCode($userid);
$main_gymid = $userService->getUserMainClimbingAreas($userid)["main_gym"];
$gym_options = '<option value="">Select a Gym...</option>';
include 'genGymOptions.php';
$eventAdded = 0;
$note = "";
if (isset($_POST['event-submit'])) {
//first check if event has already been added
$stmt = $db->prepare("SELECT * FROM events WHERE LOWER(event_name)=LOWER(:event_name) AND gymid=:gymid AND event_startdate=:start_date");
$stmt->execute(array(':event_name' => $_POST['event-name'], ':gymid' => $_POST['gymid'], ':start_date' => $_POST['start-date']));
if ($stmt->rowCount() > 0) {
//a duplicate event has been added
$prev_event_result = $stmt->fetch(PDO::FETCH_ASSOC);
$prev_event_id = $prev_event_result['event_id'];
$note .= "<div class='container'><div class='alert alert-danger' style='text-align:center'>This <a href='event.php?event_id=" . $prev_event_id . "'>event</a> has already been added to the calendar.</div></div>";
} else {
$stmt = $db->prepare("INSERT INTO events (event_name,gymid,event_startdate,event_enddate,event_desc,event_website,event_facebook) VALUES (:event_name,:gymid,:start_date,:end_date,:event_desc,:event_website,:event_facebook)");
$stmt->execute(array(':event_name' => $_POST['event-name'], ':gymid' => $_POST['gymid'], ':start_date' => $_POST['start-date'], ':end_date' => $_POST['end-date'], ':event_desc' => $_POST['event-desc'], ':event_website' => $_POST['event-website'], ':event_facebook' => $_POST['event-facebook']));
//get the last event id inserted
$event_id = $db->lastInsertId();
$taglist = array('comp-tag', 'festival-tag', 'workshop-tag', 'party-tag', 'retail-tag', 'other-tag');
foreach ($taglist as $curr_tag) {