本文整理汇总了PHP中Rating::retrieveAvgScore方法的典型用法代码示例。如果您正苦于以下问题:PHP Rating::retrieveAvgScore方法的具体用法?PHP Rating::retrieveAvgScore怎么用?PHP Rating::retrieveAvgScore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rating
的用法示例。
在下文中一共展示了Rating::retrieveAvgScore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchCaptain
public function searchCaptain($zip)
{
$db = Database::getInstance();
$mysqli = $db->getConnection();
$query = "SELECT * FROM captain WHERE zip = {$zip}";
$result = $mysqli->query($query);
$counter = 0;
$captList = array();
include_once "class/Rating.class.php";
while ($news_row = $result->fetch_array()) {
$captain = new Captain();
$rating21 = new Rating();
$scoreFromRating = $rating21->retrieveAvgScore($news_row['captain_id']);
$captain = $captain->createCaptainObject($captain, $news_row);
$captain->setScore($scoreFromRating);
$captList[$counter] = $captain;
$counter++;
}
return $captList;
}
示例2: elseif
$captainId = $_GET['captainId'];
} elseif ($_SESSION['userType'] == "Captain") {
$captainId = $_SESSION['userId'];
}
$captList = $captain->retrieveCaptainProfile($captainId);
$captName = $captList[0]->getFirstName() . " " . $captList[0]->getLastName();
$rating = 0;
$street = $captList[0]->getStreet();
$state = $captList[0]->getState();
$city = $captList[0]->getCity();
$zip = $captList[0]->getZip();
$pic = $captList[0]->getCaptainPic();
$address = $street . " " . $city . "," . $state . " " . $zip;
$email = $captList[0]->getEmail();
$ratingC = new Rating();
$rating = $ratingC->retrieveAvgScore($captainId);
$changeProfileStatus = "Enabled";
if (isset($_GET['captainId']) && isset($_SESSION['userType'])) {
if ($_SESSION['userType'] == "Captain") {
$session_capt_id = $_SESSION['userId'];
$get_capt_id = $_GET['captainId'];
if ($session_capt_id == $get_capt_id) {
$changeProfileStatus = "Enabled";
} else {
$changeProfileStatus = "Disabled";
}
}
}
?>
示例3: array
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
include_once "class/Captain.class.php";
include_once "class/Rating.class.php";
$captList = array();
$captain = new Captain();
$captList = $captain->retrieveCaptain();
for ($i = 0; $i < sizeof($captList); $i++) {
$captName = $captList[$i]->getFirstName() . " " . $captList[$i]->getLastName();
$captPic = $captList[$i]->getCaptainPic();
$captId = $captList[$i]->getCaptainId();
$captLocation = $captList[$i]->getCity() . ", " . $captList[$i]->getState() . " " . $captList[$i]->getZip();
$rating = new Rating();
$score = $rating->retrieveAvgScore($captId);
?>
<div class="col-xs-6 col-sm-4 col-md-3 captClass">
<div class="thumbnail tb">
<img class="thumbnail-img img-thumbnail" src="<?php
echo $captPic;
?>
" alt="...">
<div class="caption">
<h3><?php
echo $captName;
?>
</h3>
<div id="captRate" class="captRate" data-score="<?php
if ($captId == 81) {