예제 #1
0
<?php

session_start();
header('Content-Type: text/html; charset=utf-8');
require dirname(__DIR__) . '/function_lib/db_class.php';
require dirname(__DIR__) . '/function_lib/rating_class.php';
require dirname(__DIR__) . '/function_lib/login_class.php';
if (isset($_POST["action"])) {
    $login = new login();
    if ($_POST["action"] == "get_rating") {
        $id_name = $_POST["idName"];
        if ($login->checkLog()) {
            $barRat = new BarRating($id_name, $login->uid, $login->sn);
            $response_rating["average"] = $barRat->rating_count();
            if ($barRat->is_set_rating) {
                $response_rating["userReting"] = $barRat->user_reting;
            }
        } else {
            $RC = new RatCount($id_name);
            $response_rating["average"] = $RC->rating_count();
        }
        $response_rating = json_encode($response_rating);
        echo $response_rating;
    }
    if ($_POST["action"] == "set_rating") {
        $rating_type = $_POST["ratingType"];
        $rating = $_POST["rating"];
        $id_name = $_POST["idName"];
        if ($login->checkLog()) {
            $id_name = $_POST["idName"];
            $barRat = new BarRating($id_name, $login->uid, $login->sn);
예제 #2
0
<?php

session_start();
header('Content-Type: text/html; charset=utf-8');
require_once "function_lib/db_class.php";
require_once "function_lib/rating_class.php";
require_once "function_lib/login_class.php";
require_once "function_lib/bars_output.php";
$login = new login();
$authoriz = $login->checkLog();
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		
		<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
		<script src="js/jquery-1.11.3.min.js"></script>
		<script src="js/bootstrap.js"></script>
		<script src="js/typeahead.jquery.js"></script>
		<!--
			<script src="https://twitter.github.io/typeahead.js/releases/latest/typeahead.bundle.js"></script>
		-->
		<link href="css/style.css" rel="stylesheet" type="text/css">
		
	</head>
	<body>
		<div class="wrapper"> <!--wrapper ends before footer-->
			<header id="">
				<div class="block_width menu_bar"style="height:100%;">
					<a href="index.php" class="btn">Hookah bars</a>