Esempio n. 1
0
function getEvents($_db, $category, $param)
{
    if ($param == "All") {
        $query = "SELECT `Name`, `Description`, `Image` FROM `USA2SA Attractions` WHERE `Type` = '{$category}'";
    } else {
        $query = "SELECT `Name`, `Description`, `Image` FROM `USA2SA Attractions` WHERE `Type` = '{$category}' AND `Location` = '{$param}'";
    }
    if (!($result = $_db->query($query))) {
        die('There was an error running the query [' . $_db->error . ']');
    }
    $output = '';
    while ($row = $result->fetch_assoc()) {
        $param = $row['Name'];
        $output = $output . '  <div class="span4 offer">
    	<div class="offer-wrap">
   	    <a href = "./Attraction.php?attraction=' . $row['Name'] . '"><img src="' . $server_root . 'Pictures/' . $row['Image'] . '" /></a>
        <span class="label label-success">' . rating($_db, $param) . '</span>
        <div class="padding">
        <h2 class="text-center text-info">' . $row['Name'] . '</h2>
          <h4 class="text-center">Description</h4>
        </div>
        </div>
    </div>';
    }
    return $output;
}
Esempio n. 2
0
 public function __construct($id)
 {
     $db = Database::obtain();
     $sql = 'SELECT * FROM users WHERE id = ' . $db->escape($id);
     $userinfo = $db->query_first($sql);
     $this->id = $userinfo['id'];
     $this->nickname = $userinfo['nickname'];
     $this->steamid = $userinfo['steamid'];
     $this->country = $userinfo['country'];
     $this->email = $userinfo['email'];
     $this->banpoints = $userinfo['banpoints'];
     $this->rating = rating($this->id);
     $this->mainclass = mainclass($this->id);
     $this->avatar = APIGet($this->steamid, avatar);
     $this->etf2lid = str_replace('STEAM_', '', GetAuthID($this->steamid));
     $this->division = etf2ldiv($this->etf2lid);
     $this->latitude = $userinfo['latitude'];
     $this->longitude = $userinfo['longitude'];
     $this->status = $userinfo['status'];
 }
<?php

/** !
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* [filename] is a part of PeopleAggregator.
* [description including history]
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* @author [creator, or "Original Author"]
* @license http://bit.ly/aVWqRV PayAsYouGo License
* @copyright Copyright (c) 2010 Broadband Mechanics
* @package PeopleAggregator
*/
$login_required = TRUE;
//including necessary files
$use_theme = 'Beta';
//TODO : Remove this when new UI is completely implemented.
include_once "web/includes/page.php";
require 'api/Rating/Rating.php';
$Rating = new Rating();
if (!empty($_POST)) {
    $Rating->set_rating_type(@$_POST['rating_type']);
    $Rating->set_type_id(@(int) $_POST['type_id']);
    $Rating->set_rating(@(int) $_POST['rating']);
    $Rating->set_max_rating(@(int) $_POST['max_rating']);
    $Rating->set_user_id(@(int) $login_uid);
    $Rating->rate();
    $rating = rating(@$_POST['rating_type'], @(int) $_POST['type_id']);
    print $rating['overall'];
}
Esempio n. 4
0
            <tr>
                <th>Friend name</th>
                <th class="first">Title for the idea</th>
                <th>Idea's rating</th>
            </tr>
            <?php 
$odd = 0;
foreach ($ideas as $idea) {
    if ($odd % 2 == 0) {
        echo "<tr class=\"odd\">";
    } else {
        echo "<tr>";
    }
    echo '<td><fb:name uid="' . $idea->aid . '" /></td>';
    echo '<td><h4><a href="/' . $this->app_url . '/ideas/see/' . $idea->id . '">' . $idea->title . '</a></h4></td>';
    echo "<td>" . rating($idea->rating, $idea->votes, $idea->id) . "</td>";
    echo "</tr>";
    $odd++;
}
?>
            <?php 
if (isset($hasposts)) {
    // has pagination
    ?>
            <tr>
                <th class="bottom">
                <?php 
    if ($hasposts < 0) {
        // at the end
        ?>
                <a href="<?php 
Esempio n. 5
0
<?php

require_once 'elo-calculator.php';
if (!empty($_POST['S1']) or !empty($_POST['S2']) or !empty($_POST['R1']) or !empty($_POST['R2'])) {
    // $elo_calculator = new elo_calculator();
    $results = rating($_POST['S1'], $_POST['S2'], $_POST['R1'], $_POST['R2']);
    $R = $results;
}
?>
fdsafdsaf
<form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" method="post">
    <table>
        <tr>
            <td>&nbsp;</td>
            <td>Player 1</td>
            <td>Player 2</td>
        </tr>
        <tr>
            <td>Points:</td>
            <td><input type="text" size="5" name="R1" value="<?php 
if (!empty($R['R1'])) {
    echo $R['R1'];
}
?>
"/></td>
            <td><input type="text" name="R2" size="5" value="<?php 
if (!empty($R['R2'])) {
    echo $R['R2'];
Esempio n. 6
0
<div align="center">
  <?php 
$darkgreen = '<span style="color:DarkGreen;"><img style="vertical-align: -5%;" width="11" height="11" src="./images/up.png">&nbsp;';
$darkred = '<span style="color:DarkRed;"><img style="vertical-align: -5%;" width="11" height="11" src="./images/down.png">&nbsp;';
$avt = rating($res, $lang);
$avtdmg = $avt['rat'];
$avt_ = array('total', 'win', 'lose', 'alive', 'spot', 'des', 'hit_r', 'dmg', 'cap', 'def', 'exp');
$avt_ = array_fill_keys($avt_, 0);
foreach ($res as $name => $val) {
    $avt_eff[$eff_rating[$name]['eff']] = $name;
    $avt_mexp[] = $val['exp'][$lang['exp_max']];
    $avt_['total'] += $val['overall'][$lang['total']];
    $avt_['win'] += $val['overall'][$lang['victories']];
    $avt_['lose'] += $val['overall'][$lang['defeats']];
    $avt_['alive'] += $val['overall'][$lang['alive']];
    $avt_['spot'] += $val['perform'][$lang['spotted']];
    $avt_['des'] += $val['perform'][$lang['destroyed']];
    $avt_['hit_r'] += $val['perform'][$lang['hit_ratio']];
    $avt_['dmg'] += $val['perform'][$lang['damage']];
    $avt_['cap'] += $val['perform'][$lang['capture']];
    $avt_['def'] += $val['perform'][$lang['defend']];
    $avt_['exp'] += $val['exp'][$lang['total_exp']];
}
krsort($avt_eff);
$avt_eff = array_slice($avt_eff, 0, 5, true);
?>

<table cellspacing="0" cellpadding="0" width="100%" style="border-width: 0; ">
   <tbody>
    <tr>
      <td align="center">
review($reviews, 0, $num_reviews / 2);
review($reviews, round($num_reviews / 2), $num_reviews);
?>
				
			</div>
			
			<p>(1-<?php 
echo $num_reviews;
?>
) of <?php 
echo $num_reviews;
?>
</p>
			
			<?php 
rating($score);
?>
		</div>

		<div id="validator">
			<a href="https://webster.cs.washington.edu/validate-html.php">
			<img src="https://webster.cs.washington.edu/images/w3c-html.png" 
			alt="Valid HTML5" /></a><br />
			<a href="https://webster.cs.washington.edu/validate-css.php">
			<img src="https://webster.cs.washington.edu/images/w3c-css.png" 
			alt="Valid CSS" /></a>
		</div>
		
		<?php 
banner();
?>
Esempio n. 8
0
 function getFilledItemDescriptionTemplate(&$catItem)
 {
     global $structureMgr, $templatesMgr;
     if (count($catItem) == 0) {
         trigger_error("Invaid function call - arguments array is empty.", PM_FATAL);
     }
     $tplName = GetCfg("TemplatesPath") . "/Catalogue/" . $catItem["DescriptionTemplate"];
     $tpl = $templatesMgr->getTemplate(-1, $tplName);
     $blocks = $templatesMgr->getValidTags($tpl, array("container", "picture", "description", "spec", "details", "zoom"));
     //SPECIFICATIONS
     $spec = "";
     $specs = array("Compatibility" => "Марка", "accPlantName" => "Производитель");
     $count = 0;
     foreach ($specs as $key => $val) {
         if (isset($catItem[$key]) && $catItem[$key]) {
             $style = $count > 0 ? "mid" : "up";
             $sp = $blocks["spec"];
             $sp = str_replace("%style%", $style, $sp);
             $sp = str_replace("%spec_name%", $val, $sp);
             $sp = str_replace("%spec_value%", $catItem[$key], $sp);
             $spec .= $sp;
             $count++;
         }
     }
     $props = $this->getCatItemProperties($catItem["sID"], "CatItem", $structureMgr->getParentPageID($catItem["sID"]));
     $prop_list = "";
     foreach ($props as $prop) {
         if ($prop[3] && !$prop[4]) {
             $style = $count > 0 ? "mid" : "up";
             $sp = $blocks["spec"];
             $sp = str_replace("%style%", $style, $sp);
             $sp = str_replace("%spec_name%", $prop[1], $sp);
             $sp = str_replace("%spec_value%", "{$prop['3']} {$prop['2']}", $sp);
             $spec .= $sp;
             $count++;
         }
     }
     $bonusName = "";
     $bonusValue = "";
     $oldPriceStyle = "";
     switch ($catItem["ptID"]) {
         case 2:
             $typeClass = "t_bonus";
             $bonusName = "<strong>Спецпредложение (<a href=\"/main/club\">по карте</a>):</strong>";
             $bonusValue = "<span class=\"t_bonus\">" . $catItem["ptPercent"] . "% </span><br/> ";
             break;
         case 3:
             $typeClass = "t_bonus";
             $bonusName = "<strong>Спецпредложение (<a href=\"/main/club\">по карте</a>):</strong>";
             $bonusValue = "<span class=\"t_bonus\">" . $catItem["ptPercent"] . "% </span><br/> ";
             break;
         case 4:
             $typeClass = "t_bonus";
             $bonusName = "<strong>Спецпредложение (<a href=\"/main/club\">по карте</a>):</strong>";
             $bonusValue = "<span class=\"t_bonus\">" . $catItem["ptPercent"] . "% </span><br/> ";
             break;
         case 5:
             $typeClass = "t_salepr";
             $oldPriceStyle = "<span class=\"t_old\">";
             $bonusName = "<strong>Распродажа:</strong>";
             $bonusValue = "<span class=\"t_sale\">" . $catItem["ptPercent"] . "% </span><br/> ";
             break;
         case 6:
             $typeClass = "t_salepr";
             $oldPriceStyle = "<span class=\"t_old\">";
             $bonusName = "<strong>Распродажа:</strong>";
             $bonusValue = "<span class=\"t_sale\">" . $catItem["ptPercent"] . "% </span><br/> ";
             break;
         case 7:
             $typeClass = "t_salepr";
             $oldPriceStyle = "<span class=\"t_old\">";
             $bonusName = "<strong>Распродажа:</strong>";
             $bonusValue = "<span class=\"t_sale\">" . $catItem["ptPercent"] . "% </span><br/> ";
             break;
     }
     //$tpl = str_replace("%bonus%", $bonus, $tpl);
     if ($bonusName && $bonusValue) {
         $style = $count > 0 ? "mid" : "up";
         $sp = $blocks["spec"];
         $sp = str_replace("%style%", $style, $sp);
         $sp = str_replace("%spec_name%", $bonusName, $sp);
         $sp = str_replace("%spec_value%", "- " . $bonusValue, $sp);
         $spec .= $sp;
         $count++;
     }
     $sID = $catItem['sID'];
     // ID товара в структуре
     //DETAILS & COMMENTS
     function pages($count, $per_page)
     {
         $out = 'Страницы';
         $page = isset($_GET['compage']) && is_numeric($_GET['compage']) ? $_GET['compage'] : 1;
         $pages = ceil($count / $per_page);
         if ($page > $pages || $page < 1) {
             $page = 1;
         }
         for ($i = 1; $i <= $pages; $i++) {
             $out .= ' - ';
             if ($i != $page) {
                 $out .= '<a href="?compage=' . $i . '">' . $i . '</a>';
             } else {
                 $out .= $i;
             }
         }
         return $out;
     }
     $iCountComments = 0;
     $oResult = mysql_query("SELECT COUNT(cID) FROM pm_comments WHERE sID = '{$sID}' AND public = '1'");
     if ($oResult && mysql_num_rows($oResult)) {
         list($iCountComments) = mysql_fetch_array($oResult);
     }
     $blocks['details'] = str_replace('{com_count}', $iCountComments, $blocks['details']);
     $page = isset($_GET['compage']) && is_numeric($_GET['compage']) ? $_GET['compage'] : 1;
     $com_num = 15;
     $pages = ceil($iCountComments / $com_num);
     if ($page > $pages || $page < 1) {
         $page = 1;
     }
     $com_from = ($page - 1) * $com_num;
     // получить комментарии страницы
     $oResult = mysql_query("SELECT * FROM pm_comments WHERE sID = '{$sID}' AND public='1' ORDER BY date ASC LIMIT {$com_from}, {$com_num}");
     $aComments = array();
     $htmlComments = '';
     if ($pages > 1) {
         $htmlComments .= '<div class="comment">' . pages($iCountComments, $com_num) . '</div>';
     }
     // составить html-код списка комментариев
     if ($oResult && mysql_num_rows($oResult)) {
         while ($v = mysql_fetch_assoc($oResult)) {
             $htmlComments .= '<div class="comment">' . date('d-m-Y', $v['date']) . ' | <strong>';
             if ($v['email']) {
                 $htmlComments .= '<a href="mailto:' . $v['email'] . '">' . strip_tags($v['name']) . '</a>';
             } else {
                 $htmlComments .= strip_tags($v['name']);
             }
             $htmlComments .= '</strong><br />';
             $htmlComments .= nl2br($v['comment']);
             $htmlComments .= '</div>';
         }
     } else {
         $htmlComments .= '<div class="comment">Здесь пока никто не оставил комментариев.</div>';
     }
     // Защитный код
     $sCode = '0000' . rand(0, 9999);
     $sCode = substr($sCode, strlen($sCode) - 4, 4);
     mysql_query("INSERT INTO pm_comments_codes (id, date, code) VALUES ('', " . time() . ", '{$sCode}')");
     $iCode = mysql_insert_id();
     if (empty($iCode)) {
         die('bad arguments');
     }
     mysql_query("DELETE FROM pm_comments_codes WHERE date < '" . (time() - 600) . "'");
     $tplComments = file_get_contents('_pm/templates/Catalogue/comment.html');
     $tplComments = str_replace('{comments}', $htmlComments, $tplComments);
     $tplComments = str_replace('{code}', $iCode, $tplComments);
     $tplComments = str_replace('{sID}', $sID, $tplComments);
     $tplComments = str_replace('{name}', $_POST['comment']['Name'], $tplComments);
     $tplComments = str_replace('{email}', $_POST['comment']['Email'], $tplComments);
     $tplComments = str_replace('{text}', $_POST['comment']['Text'], $tplComments);
     if (isset($_POST['comment']['Error']) && $_POST['comment']['Error']) {
         $sError = '<div style="padding:5px; margin:5px; text-align:center; border:1px solid red;">' . $_POST['comment']['Error'] . '</div>';
         $tplComments = str_replace('{error}', $sError, $tplComments);
     } else {
         $tplComments = str_replace('{error}', '', $tplComments);
     }
     $blocks['details'] = str_replace('{com_content}', $tplComments, $blocks['details']);
     $blocks['details'] = str_replace('{id}', $sID, $blocks['details']);
     $details = $structureMgr->getData($catItem["sID"]);
     if ($details) {
         $blocks['details'] = str_replace('{content}', $details, $blocks['details']);
         if (isset($_POST['comment']['sID'])) {
             $blocks['details'] = str_replace('{detals_none}', 2, $blocks['details']);
         } else {
             $blocks['details'] = str_replace('{detals_none}', 0, $blocks['details']);
         }
     } else {
         $blocks['details'] = str_replace('{content}', '', $blocks['details']);
         $blocks['details'] = str_replace('{detals_none}', 1, $blocks['details']);
     }
     //ZOOM
     //echo GetCfg("ROOT") . $catItem["PicturePath"] . "/" . $catItem["sID"] . "_3.jpg";
     if (file_exists(GetCfg("ROOT") . $catItem["PicturePath"] . "/" . $catItem["sID"] . "_3.jpg")) {
         //$catItem["bigPicture"] = $catItem["PicturePath"] . "/" . $catItem["sID"] . "_3.jpg";
         $catItem["bigPicture"] = "/pic.php?sID=" . $catItem["sID"];
     } else {
         $catItem["bigPicture"] = "";
     }
     if ($catItem["bigPicture"]) {
         $zoom = str_replace("%link%", $catItem["bigPicture"], $blocks["zoom"]);
     } else {
         $zoom = "";
     }
     if (file_exists(GetCfg("ROOT") . $catItem["PicturePath"] . "/" . $catItem["sID"] . "_2.jpg")) {
         $catItem["stdPicture"] = $catItem["PicturePath"] . "/" . $catItem["sID"] . "_2.jpg";
     } else {
         if (!isset($catItem["stdPicture"]) || !$catItem["stdPicture"]) {
             $bigLogo = str_replace(".gif", "_2.gif", $catItem["logotype"]);
             if ($catItem["logotype"] != NULL && file_exists(GetCfg("ROOT") . $bigLogo)) {
                 $catItem["stdPicture"] = $bigLogo;
             } else {
                 $catItem["stdPicture"] = "/products/empty_2.gif";
             }
         }
     }
     if ($zoom) {
         $blocks["picture"] = str_replace("%aopen%", "<a style=\"cursor: pointer\" onClick=\"openPopupWindow('" . $catItem["bigPicture"] . "', 450, 450); return false;\">", $blocks["picture"]);
         $blocks["picture"] = str_replace("%aclose%", "</a>", $blocks["picture"]);
     } else {
         $blocks["picture"] = str_replace("%aopen%", "", $blocks["picture"]);
         $blocks["picture"] = str_replace("%aclose%", "", $blocks["picture"]);
     }
     /**
      * Добавление поля "РЕЙТИНГ"
      */
     $aRatingTypes = array(0 => 'Общий рейтинг', 1 => 'Функции', 2 => 'Цена', 3 => 'Качество');
     $aRating = array(0, 0, 0, 0);
     $oResult = mysql_query("SELECT type, grade, count FROM pm_rating WHERE sID='{$sID}' LIMIT 3");
     $iRatingGrage = 0;
     $iRatingCount = 0;
     if ($oResult && mysql_num_rows($oResult) == 3) {
         while ($oRating = mysql_fetch_assoc($oResult)) {
             $aRating[$oRating['type']] = $oRating['grade'] / $oRating['count'];
             $iRatingCount = $oRating['count'];
         }
     }
     $aRating[0] = ($aRating[1] + $aRating[2] + $aRating[3]) / 3;
     for ($i = 0; $i <= 3; $i++) {
         $aRating[$i] = number_format($aRating[$i], 1, '.', '');
     }
     function rating($r, $name)
     {
         list($r1, $r2) = explode('.', $r);
         $content = '';
         $count = 5;
         if ($r2 >= 8) {
             $r1++;
             $r2 = 0;
         } elseif ($r2 < 3) {
             $r2 = 0;
         } else {
             $r2 = 1;
         }
         for ($i = 1; $i <= $r1; $i++) {
             $content .= '<img src="/images/star/' . $name . '.gif" alt="" />';
             $count--;
         }
         if ($r2) {
             $content .= '<img src="/images/star/' . $name . '_half.gif" alt="" />';
             $count--;
         }
         while ($count) {
             $content .= '<img src="/images/star/' . $name . '_empty.gif" alt="" />';
             $count--;
         }
         return $content;
     }
     $htmlRating = '';
     $htmlRating .= '<div class="rating"><div class="red">' . $aRating[0] . '</div><div class="text">' . $aRatingTypes[0] . '</div><div class="stars">' . rating($aRating[0], 'green') . '</div></div>';
     for ($i = 1; $i <= 3; $i++) {
         $htmlRating .= '<div class="rating1"><div class="black">' . $aRating[$i] . '</div><div class="text">' . $aRatingTypes[$i] . '</div><div class="stars">' . rating($aRating[$i], 'black') . '</div></div>';
     }
     $htmlRating .= '<div class="separate">';
     $htmlRating .= '<img src="/images/podrobnee_ocenit.gif" id="ratingBtn" alt="Оценить" />' . '<div id="ratingStatus">Товар оценили (' . $iRatingCount . ')</div></div>' . '<input type="hidden" name="ratingsID" id="ratingsID" value="' . $sID . '" />';
     $blocks['picture'] = str_replace('%rating%', $htmlRating, $blocks['picture']);
     /**
      * Конец кода для поля "РЕЙТИНГ"
      */
     /* !!!MAIN job here */
     if ($catItem["ptPercent"] == 0 && $catItem["ptID"] != 8) {
         $firstPrice = "<strong>" . round($catItem["salePrice"] - $catItem["salePrice"] * 5 / 100) . "</strong>" . " / ";
     } else {
         if ($catItem["ptID"] != 8) {
             $firstPrice = "<strong><span class=\"" . $typeClass . "\">" . round($catItem["salePrice"] - $catItem["salePrice"] * $catItem["ptPercent"] / 100) . "</span></strong>" . " / ";
         }
     }
     //$tpl = str_replace("%price%", "$firstPrice" . " / " . $catItem["salePrice"] . " руб.", $tpl);
     $tpl = str_replace("%price%", "{$firstPrice}" . $oldPriceStyle . $catItem["salePrice"] . ($oldPriceStyle ? "</span>" : "") . " руб.", $tpl);
     $blocks["description"] = str_replace("%price%", "{$firstPrice}" . $oldPriceStyle . $catItem["salePrice"] . ($oldPriceStyle ? "</span>" : ""), $blocks["description"]);
     //$blocks["description"] = str_replace("%bonus%", $bonus, $blocks["description"]);
     $blocks["description"] = str_replace("%spec%", $spec, $blocks["description"]);
     $blocks["description"] = str_replace("%details%", $blocks["details"], $blocks["description"]);
     $blocks["description"] = str_replace("%goodID%", $catItem["accID"], $blocks["description"]);
     $blocks["picture"] = str_replace("%zoom%", $zoom, $blocks["picture"]);
     $blocks["picture"] = str_replace("%image%", $catItem["stdPicture"], $blocks["picture"]);
     $blocks["picture"] = str_replace("%good_name%", $catItem["ShortTitle"], $blocks["picture"]);
     $blocks["container"] = str_replace("%picture%", $blocks["picture"], $blocks["container"]);
     $blocks["container"] = str_replace("%description%", $blocks["description"], $blocks["container"]);
     return $blocks["container"];
 }
Esempio n. 9
0
     $locale = "";
     if (isset($_REQUEST['locale'])) {
         $locale = $_REQUEST['locale'];
     }
     addInterestsLanguage($locale);
     break;
 case 'rating':
     $cups = 0;
     if (isset($_REQUEST['cups'])) {
         $cups = $_REQUEST['cups'];
     }
     $threadid = "";
     if (isset($_REQUEST['threadid'])) {
         $threadid = $_REQUEST['threadid'];
     }
     rating($threadid, $cups);
     break;
 case "load_interest_tree_node":
     $node = 'Root';
     if (isset($_REQUEST['node'])) {
         $node = $_REQUEST['node'];
     }
     $type = 'All';
     if (isset($_REQUEST['type'])) {
         $type = $_REQUEST['type'];
     }
     loadInterestTreeNode($node, $type);
     break;
 case "edit_thread":
     $threadid = "";
     if (isset($_REQUEST['threadid'])) {
Esempio n. 10
0
<?php

include 'core/init.php';
rating();
/* mysql_connect('localhost', 'root', '');
mysql_select_db("rating") or die($connection_error);


$activity = $_POST['activity'];
$post_rating = $_POST['rating'];

$find_data = mysql_query("SELECT * FROM  rates WHERE activity ='$activity'");

while ($row = mysql_fetch_assoc($find_data))
{

$id = $row['id'];
$current_rating = $row['rating'];
$current_hits = $row['hits'];


}	

$new_hits = $current_hits + 1;
$update_hits = mysql_query("UPDATE rates  SET hits = '$new_hits' WHERE id ='$id'");

$pre_rating = $current_rating + $post_rating;
$new_rating = $pre_rating / $new_hits;

$update_rating =mysql_query("UPDATE rates SET rating = '$new_rating' WHERE id = '$id'");
 * @todo
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @version 0.0.0-1
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @author Cyberspace Networks <*****@*****.**>
 * @license GNU General Public License
 * @copyright Copyright (c) 2000-2014 Cyberspace Networks
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * The lastest version of Cyberspace Networks CoreSystem can be obtained from:
 * http://developer.cyberspace-networks.com/
 * For questions, help, comments, discussion, etc. please visit
 * https://github.com/CyberspaceNetworks/CoreSystem
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
global $login_uid;
$rating = rating('content', $contents->content_id);
?>

<div class="blog_post">
    <!-- Post -->
    <div class="post">
        <h2><a href="<?php 
echo htmlspecialchars($permalink);
?>
"><?php 
echo $contents->title;
?>
</a></h2>
        <div class="user-block">
            <a href="<?php 
echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $contents->author->user_id;
Esempio n. 12
0
echo $this->app_url;
?>
/ideas/delete/<?php 
echo $idea[0]->id;
?>
">Delete</fb:owner-action>
</fb:mediaheader>
<div id="idea_text">
    <p><?php 
echo $idea[0]->message;
?>
</p>
</div>
<div id="idea_rating">
    <?php 
echo rating($idea[0]->rating, $idea[0]->votes, $idea[0]->id);
?>
    <?php 
if (isset($rated) && $rated) {
    ?>
        <span style="border-bottom: 1px solid #e2c822; padding: 1px;">Thank you for your vote!</span>
    <?php 
}
?>
    Current rating <?php 
if ($idea[0]->votes) {
    echo "is " . round($idea[0]->rating / $idea[0]->votes, 2);
}
?>
 based on <?php 
echo $idea[0]->votes;
Esempio n. 13
0
          </ul>
        </div>
      </div>
    </div>
  </div>
</nav>

<div class="container" id="main">
  <div class="row">
    <div class="span12">
      <h1 class="text-left"><?php 
echo $attraction;
?>
</h1>
      <p class="lead text-left"><?php 
echo rating($db, $attraction);
?>
</i><button type="button" class="btn btn-success" id = "rateIt">Rate it</button></p>
    </div>
  </div>
  <div class="row">
      <?php 
echo displayAttraction($db, $attraction);
?>
  </div>
    <hr>
  <div class="row">
      <div class="span12">
        <h2 class="hotel-name"> Comments</h2><br>
        <?php 
echo getComments($db, $attraction);
Esempio n. 14
0
  </div>
</nav>
    
    
<header class="hidden-phone inner"></header>
<div class="container" id="main">
  <div class="row">
    <div class="span12">
      <h1 class="text-left">Cape Town</h1>
      <p class="lead text-left">Cape Town is a port city on South Africa’s southwest coast, on a peninsula beneath the imposing Table Mountain. Slowly rotating cable cars climb to the mountain’s flat top, from which there are sweeping views of the city, the busy harbor and boats heading for Robben Island in Table Bay. The notorious prison that once held Nelson Mandela is now a living museum.</p>
    </div>
  </div>
  <div class="row">
    <div class="span6">
        <h2 class="hotel-name"> Comments<br></h2>Overall Rating: <?php 
echo rating($db, $location);
?>
<button type="button" class="btn btn-success" id = "rateIt">Rate it</button>
        <hr>
          <?php 
echo getComments($db, $location);
?>
      <div class="form-group">
          <br>
          <textarea class="form-control" rows="5" placeholder="500 Characters Max" id="commentArea"></textarea>
          <button type="button" class="btn btn-primary" id = "commentButton">Comment</button>
        </div>
    </div>
    <div class="span6">
      <h2 class="text-center">Attractions/Activities</h2>
      <ul class="thumbnails">
Esempio n. 15
0
 function comments()
 {
     //prednacteni hodnoceni a favourite useru
     $i = 0;
     $num_fav = 0;
     if ($this->type == 'book' || $this->type == 'author') {
         $sql_r = sql_query("select user, value from rating\n                                    where (type = '" . $this->type . "'\n                                    and item = '" . $this->item . "')");
         while ($data_r = sql_fetch_object($sql_r)) {
             $rating[$data_r->user] = $data_r->value;
         }
         //nejdrive vypis oblibenych uzivatelu
         if ($this->uid) {
             $sql = sql_query("select users.nick, users.id, users.photo,\n                                  comments.time, comments.text, comments.id as 'c_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcomments.is_spoiler\n                                  from users, comments, favourite_users\n                                  where (users.id = comments.user\n                                  and comments.type = '" . $this->type . "'\n                                  and comments.item = '" . $this->item . "'\n                                  and favourite_users.favourite_user = users.id\n                                  and favourite_users.user = '******')\n                                  order by " . $this->order . "");
             while ($data = sql_fetch_object($sql)) {
                 $comments[$i] = $data;
                 $i++;
                 $num_fav++;
             }
         }
     }
     $sql = sql_query("select users.nick, users.id, users.photo,\n                          comments.time, comments.text, comments.id as 'c_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomments.is_spoiler\n                          from users, comments\n                          where (users.id = comments.user\n                          and comments.type = '" . $this->type . "'\n                          and comments.item = '" . $this->item . "')\n                          order by " . $this->order . "");
     while ($data = sql_fetch_object($sql)) {
         //aby se znova nevypisovali oblibeni useri
         for ($j = 0; $j < $num_fav; $j++) {
             if ($data->c_id == $comments[$j]->c_id) {
                 continue 2;
             }
         }
         $comments[$i] = $data;
         $i++;
     }
     for ($j = 0; $j < $i; $j++) {
         $data = $comments[$j];
         $nick = $data->nick;
         $time = $data->time;
         $text = nl2br(strip_tags($data->text));
         $u_id = $data->id;
         $c_id = $data->c_id;
         $time = date('j. n. Y, G:i', $time);
         $url = make_url($this->l->l("uzivatel") . " " . $u_id . " " . $nick);
         //kotva pro odkazy
         echo "      <a name=\"" . $c_id . "\" class=\"anchor_shift\"></a>\n";
         echo "      <div class=\"comment\" itemprop=\"Comment\" itemscope itemtype=\"http://schema.org/Comment\">\n";
         echo "      <div class=\"comment_avatar\">\n";
         if ($j < $num_fav) {
             echo "       <img src=\"grafika/list_1_icon_red.png\" alt=\"" . $this->l->t("fav_user") . "\" title=\"" . $this->l->t("fav_user") . "\" class=\"comment_fav_user\" />\n";
         }
         if ($data->photo == 'yes') {
             echo "              <a href=\"" . $url . "\"><img src=\"users/" . $data->id . ".jpg\" alt=\"" . $data->nick . "\" class=\"round\" /></a>\n";
         } else {
             echo "              <a href=\"" . $url . "\"><img src=\"users/0.jpg\" alt=\"" . $data->nick . "\" class=\"round\" /></a>\n";
         }
         echo "      </div>\n";
         echo "      <div class=\"comment_header\">\n";
         if (isset($rating[$u_id])) {
             echo "       <div class=\"comment_rating\">\n";
             rating($this->l, $rating[$u_id], "star_mini");
             echo "       </div>\n";
         }
         echo "\t\t\t\t<a href=\"" . $url . "\"><span itemprop=\"author\">" . $nick . "</span></a>\n";
         echo "\t\t\t\t &nbsp; <span class=\"date_span\" itemprop=\"dateCreated\">" . $time . "</span>\n";
         //zobrazuje se pouze u mich prispevku a pouze nejvejsich nez 24 hodin
         $time_c = time();
         $time_c = $time_c - 24 * 3600;
         if ($this->uid == $u_id) {
             echo "        &nbsp &nbsp\n";
             echo "\t\t\t\t<img src=\"grafika/icon_edit.png\" alt=\"\" />&nbsp;\n";
             echo "\t\t\t\t<a href=\"?edit=" . $c_id . "#subitems\" title=\"" . $this->l->t("edit") . "\" class=\"comment_control\">" . $this->l->t("edit") . "</a> &nbsp;&nbsp; \n";
             echo "\t\t\t\t<img src=\"grafika/icon_delete.png\" alt=\"\" />&nbsp;\n";
             echo "        <a href=\"?del=" . $c_id . "#subitems\" title=\"" . $this->l->t("del") . "\" class=\"comment_control\">" . $this->l->t("del") . "</a>\n";
         }
         echo "      </div>\n";
         echo "      <div class=\"comment_content\" itemprop=\"text\">\n";
         if ($data->is_spoiler) {
             echo "<b>" . $this->l->t("contain") . " <abbr title=\"" . $this->l->t("spoiler_desc") . "\">" . $this->l->t("spoiler") . "</abbr></b> <img src=\"grafika/spoiler.png\" alt=\"" . $this->l->t("spoiler") . "\" />  ";
         }
         echo "      " . $text . "\n";
         echo "      </div>\n";
         echo "      </div>\n";
         echo "      <div class=\"clear\"></div>\n";
     }
     echo "      <br />\n";
     echo "      <br />\n";
 }
Esempio n. 16
0
    ?>
</td>
							<td><?php 
    echo $row['c_name'] . " " . $row['c_surname'];
    ?>
</td>		
							<td><?php 
    echo $row['rating'];
    ?>
</td>
							<td><?php 
    echo $row['p_duration'] . " sec";
    ?>
</td>
							<td><?php 
    echo "\$ " . $row['rating'] * round($row['p_duration']) * 2 * rating($row['day']);
    ?>
</td>		
							<td><?php 
    echo $row['promotional_product'];
    ?>
</td>
							<td><?php 
    echo $row['day'];
    ?>
</td>
						 </tr>
				<?php 
}
?>
			</table>