This commit is contained in:
louiscklaw
2025-02-01 01:58:47 +08:00
parent b3da7aaef5
commit 04dbefcbaf
1259 changed files with 280657 additions and 0 deletions

View File

@@ -0,0 +1,217 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Yummy Everywhere</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="main.js"></script>
</head>
<script>
$(document).ready(function(){
$("#actionComment").click(function(){
var foodComment = $("#foodComment").val();
var foodRato =$("#foodRato").val();
console.log(foodComment);
if(foodComment.length=="" || foodRato==""){
$("#commentAlert").html("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Comment and Rato is required</font></div></div></div>");
return;
}
if(foodRato>5|| foodRato<0)
return;
var date = new Date();
console.log(date.getDate()+ " " + date.getDay()+ " " + date.getMonth());
var curDate = date.getFullYear() + "-" + (date.getMonth()+1)+ "-"+ date.getDate();
$("#comment").append("<div class='card horizontal'><div class='card-stacked'><div class='card-content'><h6>"+sessionStorage.getItem("username")+" said:</h6>"+foodComment+" ("+foodRato+"/5.0)<br><br>Date: "+curDate+"</div></div></div>");
$("#foodComment").val("");
$("#foodRato").val("");
});
})
</script>
<body>
<nav>
<div class="nav-wrapper container">
<a id="logo-container" href="../index.html" class="brand-logo ">Yummy Everywhere</a>
<ul class="right">
</ul>
</div>
</nav>
<ul id="slide-out" class="sidenav">
</ul>
<!--- Fav Box -->
<div id="modal_box" class="bottom-sheet">
</div>
<div id="index-banner" class="parallax-container">
<div class="parallax" style="height: 10px"><img src="../images/NeNeChickenTKO.jpeg"></div>
</div>
<div class="container" style="margin-top: 10px">
<div class="row">
<div class="col s12 m8 card" style="min-height: 515px">
<ul id="tabs-swipe-demo" class="tabs">
<li class="tab col s3"><a class="active" href="#test-swipe-1">Fired Chicken</a></li>
<li class="tab col s3"><a href="#test-swipe-2">Other</a></li>
</ul>
<div id="test-swipe-1" class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Crispy Fried Chicken</p>
<p>$150.0</p>
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Creamy Fried Chicken</p>
<p>$166.0</p>
</div>
</div>
</div>
</div>
<div id="test-swipe-2" class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Kimchi Rice</p>
<p>$98.0</p>
</div>
</div>
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p id="foodRestaurantLocation"><h4>ABC Chicken</h4>Open Hour: 9:00 AM - 9:00 PM<br>Tel: 31800000<br>Address: Shop 225, 2/F, East Point City, 8 Chung Wa Road, Tseung Kwan O, Hong Kong<br>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1845.6321957204013!2d114.25828058379905!3d22.305838490238212!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3404038d5a180b63%3A0xe2e64ecf5e89d9b7!2z5aSp5pmJ6ZmE6L-R6Zyy5aSp5YGc6LuK5aC0!5e0!3m2!1szh-TW!2shk!4v1570870535847!5m2!1szh-TW!2shk" frameborder="0" style="border:0;" width="100%" height=300px></iframe>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
Comment<br>
<div id="comment">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<h6>stephy@gmail.com said:</h6>
It is Good (3.2/ 5.0)<br><br>
Date: 2019-10-01
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<h6>tonywong@gmail.com said:</h6>
It is Bad (3.2/ 5.0)<br><br>
Date: 2019-10-02
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s12">
<div class="row">
<div id="commentAlert"></div>
<div class="input-field col s12">
Input Your comment:<br>
<textarea id="foodComment" class="materialize-textarea" placeholder="Comment..."></textarea>
</div>
<div class="input-field col s3 m3">
Rato:<input id="foodRato" type="number" class="validate" min="0.0" max="5.0">/5.0
</div>
</div>
<button class="btn waves-effect waves-light" type="submit" id="actionComment">Submit
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../search.html" class="waves-effect waves-light btn" id="btnBack">Back</a>
</div>
<!-- Modal Structure -->
<div id="modal1" class="modal" style="width: 400px;">
<div class="row center-align">
<div class="col s12 modal-content">
<span class="flow-text" id="loginInfo">
<div id="loginAlert"></div>
<h4 style="border-bottom: 1px solid #ebebeb; height: 50px;">LOGIN</h4>
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input id="loginEmail" type="text" class="validate" required>
<label for="loginEmail">Email</label>
</div><br>
<div class="input-field col s12">
<i class="material-icons prefix">vpn_key</i>
<input id="loginPwd" type="password" class="validate" required>
<label for="loginPwd">Password</label>
</div>
<a class="waves-effect waves-light btn col s10 offset-s1" style="margin-top: 50px" id="btnSubmitLogin">LOGIN</a>
<h6 class=" col s12">Don"t have an account? <a href="#" id="createAccount">Sign up here</a></h6>
</span>
<span class="flow-text" id="createInfo">
<div id="pwdAlert"></div>
<h4 style='border-bottom: 1px solid #ebebeb; height: 50px;'>REGISTER</h4><div class='input-field col s6'><input id='first_name' type='text' class='validate' required><label for='first_name'>First Name</label></div><div class='input-field col s6'><input id='last_name' type='text' class='validate' required><label for='last_name'>Last Name</label></div><div class='input-field col s12'><input id='regEmail' type='email' class='validate' required><label for='regEmail'>Email</label></div><div class='input-field col s12'><input id='regPassword' type='password' class='validate' required><label for='regPassword'>Password</label></div><div class='input-field col s12'><input id='checkPassword' type='password' class='validate' required><label for='checkPassword'>Confirm Password</label></div><a class='waves-effect waves-light btn col s10 offset-s1' style='margin-top: 50px' id='btnSubmitRegister'>REGISTER</a><h6 class='col s12' id="changeLogin">You have an account? <a href='#' id='loginAccount'>Login</a></h6>
</span>
</div>
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l3 s12">
<h5 class="white-text">Connect</h5>
<ul>
<li><a class="white-text" href="../aboutus.html">About Us</a></li>
<li><a class="white-text" href="../userGuide.html">User Guide</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">Copyright © 2019 InnoTech HK Inc. All rights reserved</div>
</div>
</footer>
<!-- Scripts-->
</body>
</html>

View File

@@ -0,0 +1,222 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Yummy Everywhere</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="main.js"></script>
</head>
<script>
$(document).ready(function(){
$("#actionComment").click(function(){
var foodComment = $("#foodComment").val();
var foodRato =$("#foodRato").val();
if(foodComment.length=="" || foodRato==""){
$("#commentAlert").html("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Comment and Rato is required</font></div></div></div>");
return;
}
if(foodRato>5|| foodRato<0)
return;
var date = new Date();
var curDate = date.getFullYear() + "-" + (date.getMonth()+1)+ "-"+ date.getDate();
$("#comment").append("<div class='card horizontal'><div class='card-stacked'><div class='card-content'><h6>"+sessionStorage.getItem("username")+" said:</h6>"+foodComment+" ("+foodRato+"/5.0)<br><br>Date: "+curDate+"</div></div></div>");
$("#foodComment").val("");
$("#foodRato").val("");
});
})
</script>
<body>
<nav>
<div class="nav-wrapper container">
<a id="logo-container" href="../index.html" class="brand-logo ">Yummy Everywhere</a>
<ul class="right">
</ul>
</div>
</nav>
<ul id="slide-out" class="sidenav">
</ul>
<!--- Fav Box -->
<div id="modal_box" class="bottom-sheet">
</div>
<div id="index-banner" class="parallax-container">
<div class="parallax" style="height: 10px"><img src="../images/NeNeChickenTst-1.jpg"></div>
</div>
<div class="container" style="margin-top: 50px">
<div class="row">
<div class="col s12 m8 card" style="min-height: 515px">
<ul id="tabs-swipe-demo" class="tabs">
<li class="tab col s3"><a class="active" href="#test-swipe-1">Fired Chicken</a></li>
<li class="tab col s3"><a href="#test-swipe-2">Single Order</a></li>
<li class="tab col s3"><a href="#test-swipe-3">Other</a></li>
</ul>
<div id="test-swipe-1" class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Crispy Fried Chicken</p>
<p>$150.0</p>
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Creamy Fried Chicken</p>
<p>$166.0</p>
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Green Chicken</p>
<p>$174.0</p>
</div>
</div>
</div>
</div>
<div id="test-swipe-2" class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Rice Roll</p>
<p>$78.0</p>
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Ginseng Soup</p>
<p>$178.0</p>
</div>
</div>
</div>
</div>
<div id="test-swipe-3" class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Kimchi Rice</p>
<p>$98.0</p>
</div>
</div>
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p id="foodRestaurantLocation"><h4>NeNe Chicken</h4>Open Hour: 9:00 AM - 9:00 PM<br>Tel: 21800000<br>Address: Shop 225, 3/F, East Point City, 8 Chung Wa Road, Tseung Kwan O, Hong Kong<br>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1845.6321957204013!2d114.25828058379905!3d22.305838490238212!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3404038d5a180b63%3A0xe2e64ecf5e89d9b7!2z5aSp5pmJ6ZmE6L-R6Zyy5aSp5YGc6LuK5aC0!5e0!3m2!1szh-TW!2shk!4v1570870535847!5m2!1szh-TW!2shk" frameborder="0" style="border:0;" width="100%" height=300px></iframe>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
Comment<br>
<div id="comment">
</div>
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s12">
<div class="row">
<div id="commentAlert"></div>
<div class="input-field col s12">
Input Your comment:<br>
<textarea id="foodComment" class="materialize-textarea" placeholder="Comment..."></textarea>
</div>
<div class="input-field col s3 m3">
Rato:<input id="foodRato" type="number" class="validate" min="0.0" max="5.0">/5.0
</div>
</div>
<button class="btn waves-effect waves-light" type="submit" id="actionComment">Submit
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../search.html" class="waves-effect waves-light btn" id="btnBack">Back</a>
</div>
<!-- Modal Structure -->
<div id="modal1" class="modal" style="width: 400px;">
<div class="row center-align">
<div class="col s12 modal-content">
<span class="flow-text" id="loginInfo">
<div id="loginAlert"></div>
<h4 style="border-bottom: 1px solid #ebebeb; height: 50px;">LOGIN</h4>
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input id="loginEmail" type="text" class="validate" required>
<label for="loginEmail">Email</label>
</div><br>
<div class="input-field col s12">
<i class="material-icons prefix">vpn_key</i>
<input id="loginPwd" type="password" class="validate" required>
<label for="loginPwd">Password</label>
</div>
<a class="waves-effect waves-light btn col s10 offset-s1" style="margin-top: 50px" id="btnSubmitLogin">LOGIN</a>
<h6 class=" col s12">Don"t have an account? <a href="#" id="createAccount">Sign up here</a></h6>
</span>
<span class="flow-text" id="createInfo">
<div id="pwdAlert"></div>
<h4 style='border-bottom: 1px solid #ebebeb; height: 50px;'>REGISTER</h4><div class='input-field col s6'><input id='first_name' type='text' class='validate' required><label for='first_name'>First Name</label></div><div class='input-field col s6'><input id='last_name' type='text' class='validate' required><label for='last_name'>Last Name</label></div><div class='input-field col s12'><input id='regEmail' type='email' class='validate' required><label for='regEmail'>Email</label></div><div class='input-field col s12'><input id='regPassword' type='password' class='validate' required><label for='regPassword'>Password</label></div><div class='input-field col s12'><input id='checkPassword' type='password' class='validate' required><label for='checkPassword'>Confirm Password</label></div><a class='waves-effect waves-light btn col s10 offset-s1' style='margin-top: 50px' id='btnSubmitRegister'>REGISTER</a><h6 class='col s12' id="changeLogin">You have an account? <a href='#' id='loginAccount'>Login</a></h6>
</span>
</div>
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l3 s12">
<h5 class="white-text">Connect</h5>
<ul>
<li><a class="white-text" href="../aboutus.html">About Us</a></li>
<li><a class="white-text" href="../userGuide.html">User Guide</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">Copyright © 2019 InnoTech HK Inc. All rights reserved</div>
</div>
</footer>
<!-- Scripts-->
</body>
</html>

View File

@@ -0,0 +1,220 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Yummy Everywhere</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="main.js"></script>
</head>
<script>
$(document).ready(function(){
$("#actionComment").click(function(){
var foodComment = $("#foodComment").val();
var foodRato =$("#foodRato").val();
console.log(foodComment);
if(foodComment.length=="" || foodRato==""){
$("#commentAlert").html("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Comment and Rato is required</font></div></div></div>");
return;
}
if(foodRato>5|| foodRato<0)
return;
var date = new Date();
console.log(date.getDate()+ " " + date.getDay()+ " " + date.getMonth());
var curDate = date.getFullYear() + "-" + (date.getMonth()+1)+ "-"+ date.getDate();
$("#comment").append("<div class='card horizontal'><div class='card-stacked'><div class='card-content'><h6>"+sessionStorage.getItem("username")+" said:</h6>"+foodComment+" ("+foodRato+"/5.0)<br><br>Date: "+curDate+"</div></div></div>");
$("#foodComment").val("");
$("#foodRato").val("");
});
})
</script>
<body>
<nav>
<div class="nav-wrapper container">
<a id="logo-container" href="../index.html" class="brand-logo ">Yummy Everywhere</a>
<ul class="right">
</ul>
</div>
</nav>
<ul id="slide-out" class="sidenav">
</ul>
<!--- Fav Box -->
<div id="modal_box" class="bottom-sheet">
</div>
<div id="index-banner" class="parallax-container">
<div class="parallax" style="height: 10px"><img src="../images/TeaWood-1.jpg"></div>
</div>
<div class="container" style="margin-top: 50px">
<div class="row">
<div class="col s12 m8 card" style="min-height: 515px">
<ul id="tabs-swipe-demo" class="tabs">
<li class="tab col s3"><a class="active" href="#test-swipe-1">TAIWANESE DISHES</a></li>
<li class="tab col s3"><a href="#test-swipe-2">RICE</a></li>
</ul>
<div id="test-swipe-1" class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Fired Chicken Pieces</p>
<p>$68.0</p>
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Sweet Soft-boiled Egg</p>
<p>$42.0</p>
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Wonton with Chili Oil</p>
<p>$66.0</p>
</div>
</div>
</div>
</div>
<div id="test-swipe-2" class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Rice with Marinated Minced Pork and Soft-boiled Egg</p>
<p>$77.0</p>
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Rice with Fried Chicken Fillet, Marinated Minced Pork</p>
<p>$77.0</p>
</div>
</div>
</div>
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p>Rice with Fried Pork and Marinated Minced Pork</p>
<p>$77.0</p>
</div>
</div>
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p id="foodRestaurantLocation"><h4>TeaWood Cafe</h4>Open Hour: 9:00 AM - 8:00 PM<br>Tel: 21812300<br>Address: Shop L4-19, 4/F, apm Millennium City 5, 418 Kwun Tong Road, Kwun Tong, Hong Kong<br>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3691.096920074908!2d114.2229437828064!3d22.31217400715772!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0xf5e1a2461194aa9a!2zYXBt5Ym157SA5LmL5Z-ONeacnw!5e0!3m2!1szh-TW!2shk!4v1570882726423!5m2!1szh-TW!2shk" frameborder="0" style="border:0;" width="100%" height=300px></iframe>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
Comment<br>
<div id="comment">
</div>
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s12">
<div class="row">
<div id="commentAlert"></div>
<div class="input-field col s12">
Input Your comment:<br>
<textarea id="foodComment" class="materialize-textarea" placeholder="Comment..."></textarea>
</div>
<div class="input-field col s3 m3">
Rato:<input id="foodRato" type="number" class="validate" min="0.0" max="5.0">/5.0
</div>
</div>
<button class="btn waves-effect waves-light" type="submit" id="actionComment">Submit
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../search.html" class="waves-effect waves-light btn" id="btnBack">Back</a>
</div>
<!-- Modal Structure -->
<div id="modal1" class="modal" style="width: 400px;">
<div class="row center-align">
<div class="col s12 modal-content">
<span class="flow-text" id="loginInfo">
<div id="loginAlert"></div>
<h4 style="border-bottom: 1px solid #ebebeb; height: 50px;">LOGIN</h4>
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input id="loginEmail" type="text" class="validate" required>
<label for="loginEmail">Email</label>
</div><br>
<div class="input-field col s12">
<i class="material-icons prefix">vpn_key</i>
<input id="loginPwd" type="password" class="validate" required>
<label for="loginPwd">Password</label>
</div>
<a class="waves-effect waves-light btn col s10 offset-s1" style="margin-top: 50px" id="btnSubmitLogin">LOGIN</a>
<h6 class=" col s12">Don"t have an account? <a href="#" id="createAccount">Sign up here</a></h6>
</span>
<span class="flow-text" id="createInfo">
<div id="pwdAlert"></div>
<h4 style='border-bottom: 1px solid #ebebeb; height: 50px;'>REGISTER</h4><div class='input-field col s6'><input id='first_name' type='text' class='validate' required><label for='first_name'>First Name</label></div><div class='input-field col s6'><input id='last_name' type='text' class='validate' required><label for='last_name'>Last Name</label></div><div class='input-field col s12'><input id='regEmail' type='email' class='validate' required><label for='regEmail'>Email</label></div><div class='input-field col s12'><input id='regPassword' type='password' class='validate' required><label for='regPassword'>Password</label></div><div class='input-field col s12'><input id='checkPassword' type='password' class='validate' required><label for='checkPassword'>Confirm Password</label></div><a class='waves-effect waves-light btn col s10 offset-s1' style='margin-top: 50px' id='btnSubmitRegister'>REGISTER</a><h6 class='col s12' id="changeLogin">You have an account? <a href='#' id='loginAccount'>Login</a></h6>
</span>
</div>
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l3 s12">
<h5 class="white-text">Connect</h5>
<ul>
<li><a class="white-text" href="../aboutus.html">About Us</a></li>
<li><a class="white-text" href="../userGuide.html">User Guide</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">Copyright © 2019 InnoTech HK Inc. All rights reserved</div>
</div>
</footer>
<!-- Scripts-->
</body>
</html>

View File

@@ -0,0 +1,162 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Yummy Everywhere</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="main.js"></script>
</head>
<script>
$(document).ready(function(){
$("#actionComment").click(function(){
var foodComment = $("#foodComment").val();
var foodRato =$("#foodRato").val();
console.log(foodComment);
if(foodComment.length=="" || foodRato==""){
$("#commentAlert").html("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Comment and Rato is required</font></div></div></div>");
return;
}
if(foodRato>5|| foodRato<0)
return;
var date = new Date();
console.log(date.getDate()+ " " + date.getDay()+ " " + date.getMonth());
var curDate = date.getFullYear() + "-" + (date.getMonth()+1)+ "-"+ date.getDate();
$("#comment").append("<div class='card horizontal'><div class='card-stacked'><div class='card-content'><h6>"+sessionStorage.getItem("username")+" said:</h6>"+foodComment+" ("+foodRato+"/5.0)<br><br>Date: "+curDate+"</div></div></div>");
$("#foodComment").val("");
$("#foodRato").val("");
});
})
</script>
<body>
<nav>
<div class="nav-wrapper container">
<a id="logo-container" href="../index.html" class="brand-logo ">Yummy Everywhere</a>
<ul class="right">
</ul>
</div>
</nav>
<ul id="slide-out" class="sidenav">
</ul>
<!--- Fav Box -->
<div id="modal_box" class="bottom-sheet">
</div>
<div id="index-banner" class="parallax-container">
<div class="parallax" style="height: 10px"><img src="../images/TamJai-1.jpg"></div>
</div>
<div class="container" style="margin-top: 50px">
<div class="row">
<div class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p id="foodRestaurantLocation"><h4>TamJai SamGor</h4>Open Hour: 11:00 AM - 10:00 PM<br>Tel: 21805650<br>Address: Portion A, Shop 15, G/F, Kai Tin Tower, 55-63 Kai Tin Road, Lam Tin, Hong Kong<br>
<iframe src="https://www.google.com/maps/embed?pb=!1m16!1m12!1m3!1d3691.174919978861!2d114.23165941537265!3d22.30922344820756!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!2m1!1s%20Portion%20A%2C%20Shop%2015%2C%20G%2FF%2C%20Kai%20Tin%20Tower%2C%2055-63%20Kai%20Tin%20Road%2C%20Lam%20Tin%2C%20Hong%20Kong!5e0!3m2!1szh-TW!2shk!4v1570883956564!5m2!1szh-TW!2shk" frameborder="0" style="border:0;" width="100%" height=300px></iframe>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
Comment<br>
<div id="comment">
</div>
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s12">
<div class="row">
<div id="commentAlert"></div>
<div class="input-field col s12">
Input Your comment:<br>
<textarea id="foodComment" class="materialize-textarea" placeholder="Comment..."></textarea>
</div>
<div class="input-field col s3 m3">
Rato:<input id="foodRato" type="number" class="validate" min="0.0" max="5.0">/5.0
</div>
</div>
<button class="btn waves-effect waves-light" type="submit" id="actionComment">Submit
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../search.html" class="waves-effect waves-light btn" id="btnBack">Back</a>
</div>
<!-- Modal Structure -->
<div id="modal1" class="modal" style="width: 400px;">
<div class="row center-align">
<div class="col s12 modal-content">
<span class="flow-text" id="loginInfo">
<div id="loginAlert"></div>
<h4 style="border-bottom: 1px solid #ebebeb; height: 50px;">LOGIN</h4>
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input id="loginEmail" type="text" class="validate" required>
<label for="loginEmail">Email</label>
</div><br>
<div class="input-field col s12">
<i class="material-icons prefix">vpn_key</i>
<input id="loginPwd" type="password" class="validate" required>
<label for="loginPwd">Password</label>
</div>
<a class="waves-effect waves-light btn col s10 offset-s1" style="margin-top: 50px" id="btnSubmitLogin">LOGIN</a>
<h6 class=" col s12">Don"t have an account? <a href="#" id="createAccount">Sign up here</a></h6>
</span>
<span class="flow-text" id="createInfo">
<div id="pwdAlert"></div>
<h4 style='border-bottom: 1px solid #ebebeb; height: 50px;'>REGISTER</h4><div class='input-field col s6'><input id='first_name' type='text' class='validate' required><label for='first_name'>First Name</label></div><div class='input-field col s6'><input id='last_name' type='text' class='validate' required><label for='last_name'>Last Name</label></div><div class='input-field col s12'><input id='regEmail' type='email' class='validate' required><label for='regEmail'>Email</label></div><div class='input-field col s12'><input id='regPassword' type='password' class='validate' required><label for='regPassword'>Password</label></div><div class='input-field col s12'><input id='checkPassword' type='password' class='validate' required><label for='checkPassword'>Confirm Password</label></div><a class='waves-effect waves-light btn col s10 offset-s1' style='margin-top: 50px' id='btnSubmitRegister'>REGISTER</a><h6 class='col s12' id="changeLogin">You have an account? <a href='#' id='loginAccount'>Login</a></h6>
</span>
</div>
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l3 s12">
<h5 class="white-text">Connect</h5>
<ul>
<li><a class="white-text" href="../aboutus.html">About Us</a></li>
<li><a class="white-text" href="../userGuide.html">User Guide</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">Copyright © 2019 InnoTech HK Inc. All rights reserved</div>
</div>
</footer>
<!-- Scripts-->
</body>
</html>

View File

@@ -0,0 +1,162 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Yummy Everywhere</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="main.js"></script>
</head>
<script>
$(document).ready(function(){
$("#actionComment").click(function(){
var foodComment = $("#foodComment").val();
var foodRato =$("#foodRato").val();
console.log(foodComment);
if(foodComment.length=="" || foodRato==""){
$("#commentAlert").html("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Comment and Rato is required</font></div></div></div>");
return;
}
if(foodRato>5|| foodRato<0)
return;
var date = new Date();
console.log(date.getDate()+ " " + date.getDay()+ " " + date.getMonth());
var curDate = date.getFullYear() + "-" + (date.getMonth()+1)+ "-"+ date.getDate();
$("#comment").append("<div class='card horizontal'><div class='card-stacked'><div class='card-content'><h6>"+sessionStorage.getItem("username")+" said:</h6>"+foodComment+" ("+foodRato+"/5.0)<br><br>Date: "+curDate+"</div></div></div>");
$("#foodComment").val("");
$("#foodRato").val("");
});
})
</script>
<body>
<nav>
<div class="nav-wrapper container">
<a id="logo-container" href="../index.html" class="brand-logo ">Yummy Everywhere</a>
<ul class="right">
</ul>
</div>
</nav>
<ul id="slide-out" class="sidenav">
</ul>
<!--- Fav Box -->
<div id="modal_box" class="bottom-sheet">
</div>
<div id="index-banner" class="parallax-container">
<div class="parallax" style="height: 10px"><img src="../images/Satay-1.jpg"></div>
</div>
<div class="container" style="margin-top: 50px">
<div class="row">
<div class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p id="foodRestaurantLocation"><h4>Satay King</h4>Open Hour: 11:00 AM - 9:30 PM<br>Tel: 21801230<br>Address: Room D, G/F, Block 2, Kwun Tong Industrial Centre, 464-466 Kwun Tong Road, Kwun Tong, X Hong Kong<br>
<iframe src="https://www.google.com/maps/embed?pb=!1m16!1m12!1m3!1d3691.1414156713886!2d114.22580881533696!3d22.3104908853182!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!2m1!1sRoom%20C%20%26%20D%2C%20G%2FF%2C%20Block%202%2C%20Kwun%20Tong%20Industrial%20Centre%2C%20464-466%20Kwun%20Tong%20Road%2C%20Kwun%20Tong%2C%20X%20Hong%20Kong!5e0!3m2!1szh-TW!2shk!4v1570884269224!5m2!1szh-TW!2shk" frameborder="0" style="border:0;" width="100%" height=300px></iframe>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
Comment<br>
<div id="comment">
</div>
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s12">
<div class="row">
<div id="commentAlert"></div>
<div class="input-field col s12">
Input Your comment:<br>
<textarea id="foodComment" class="materialize-textarea" placeholder="Comment..."></textarea>
</div>
<div class="input-field col s3 m3">
Rato:<input id="foodRato" type="number" class="validate" min="0.0" max="5.0">/5.0
</div>
</div>
<button class="btn waves-effect waves-light" type="submit" id="actionComment">Submit
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../search.html" class="waves-effect waves-light btn" id="btnBack">Back</a>
</div>
<!-- Modal Structure -->
<div id="modal1" class="modal" style="width: 400px;">
<div class="row center-align">
<div class="col s12 modal-content">
<span class="flow-text" id="loginInfo">
<div id="loginAlert"></div>
<h4 style="border-bottom: 1px solid #ebebeb; height: 50px;">LOGIN</h4>
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input id="loginEmail" type="text" class="validate" required>
<label for="loginEmail">Email</label>
</div><br>
<div class="input-field col s12">
<i class="material-icons prefix">vpn_key</i>
<input id="loginPwd" type="password" class="validate" required>
<label for="loginPwd">Password</label>
</div>
<a class="waves-effect waves-light btn col s10 offset-s1" style="margin-top: 50px" id="btnSubmitLogin">LOGIN</a>
<h6 class=" col s12">Don"t have an account? <a href="#" id="createAccount">Sign up here</a></h6>
</span>
<span class="flow-text" id="createInfo">
<div id="pwdAlert"></div>
<h4 style='border-bottom: 1px solid #ebebeb; height: 50px;'>REGISTER</h4><div class='input-field col s6'><input id='first_name' type='text' class='validate' required><label for='first_name'>First Name</label></div><div class='input-field col s6'><input id='last_name' type='text' class='validate' required><label for='last_name'>Last Name</label></div><div class='input-field col s12'><input id='regEmail' type='email' class='validate' required><label for='regEmail'>Email</label></div><div class='input-field col s12'><input id='regPassword' type='password' class='validate' required><label for='regPassword'>Password</label></div><div class='input-field col s12'><input id='checkPassword' type='password' class='validate' required><label for='checkPassword'>Confirm Password</label></div><a class='waves-effect waves-light btn col s10 offset-s1' style='margin-top: 50px' id='btnSubmitRegister'>REGISTER</a><h6 class='col s12' id="changeLogin">You have an account? <a href='#' id='loginAccount'>Login</a></h6>
</span>
</div>
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l3 s12">
<h5 class="white-text">Connect</h5>
<ul>
<li><a class="white-text" href="../aboutus.html">About Us</a></li>
<li><a class="white-text" href="../userGuide.html">User Guide</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">Copyright © 2019 InnoTech HK Inc. All rights reserved</div>
</div>
</footer>
<!-- Scripts-->
</body>
</html>

View File

@@ -0,0 +1,161 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Yummy Everywhere</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="main.js"></script>
</head>
<script>
$(document).ready(function(){
$("#actionComment").click(function(){
var foodComment = $("#foodComment").val();
var foodRato =$("#foodRato").val();
console.log(foodComment);
if(foodComment.length=="" || foodRato==""){
$("#commentAlert").html("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Comment and Rato is required</font></div></div></div>");
return;
}
if(foodRato>5|| foodRato<0)
return;
var date = new Date();
var curDate = date.getFullYear() + "-" + (date.getMonth()+1)+ "-"+ date.getDate();
$("#comment").append("<div class='card horizontal'><div class='card-stacked'><div class='card-content'><h6>"+sessionStorage.getItem("username")+" said:</h6>"+foodComment+" ("+foodRato+"/5.0)<br><br>Date: "+curDate+"</div></div></div>");
$("#foodComment").val("");
$("#foodRato").val("");
});
})
</script>
<body>
<nav>
<div class="nav-wrapper container">
<a id="logo-container" href="../index.html" class="brand-logo ">Yummy Everywhere</a>
<ul class="right">
</ul>
</div>
</nav>
<ul id="slide-out" class="sidenav">
</ul>
<!--- Fav Box -->
<div id="modal_box" class="bottom-sheet">
</div>
<div id="index-banner" class="parallax-container">
<div class="parallax" style="height: 10px"><img src="../images/Dimsum-1.jpg"></div>
</div>
<div class="container" style="margin-top: 50px">
<div class="row">
<div class="col s12">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
<p id="foodRestaurantLocation"><h4>YUM CHA</h4>Open Hour: 11:30 AM - 11:00 PM<br>Tel: 31800000<br>Address: Emperor Watch Jewellery Ctr, 2/F Russell St, Causeway Bay, Hong Kong<br>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3104.5680681006934!2d114.18119310259462!3d22.278958210544527!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x2cbada1dd12d85a9!2z6aOy6Iy2!5e0!3m2!1szh-TW!2shk!4v1570884414408!5m2!1szh-TW!2shk" frameborder="0" style="border:0;" width="100%" height=300px></iframe>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="card horizontal">
<div class="card-stacked">
<div class="card-content">
Comment<br>
<div id="comment">
</div>
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s12">
<div class="row">
<div id="commentAlert"></div>
<div class="input-field col s12">
Input Your comment:<br>
<textarea id="foodComment" class="materialize-textarea" placeholder="Comment..."></textarea>
</div>
<div class="input-field col s3 m3">
Rato:<input id="foodRato" type="number" class="validate" min="0.0" max="5.0">/5.0
</div>
</div>
<button class="btn waves-effect waves-light" type="submit" id="actionComment">Submit
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="../search.html" class="waves-effect waves-light btn" id="btnBack">Back</a>
</div>
<!-- Modal Structure -->
<div id="modal1" class="modal" style="width: 400px;">
<div class="row center-align">
<div class="col s12 modal-content">
<span class="flow-text" id="loginInfo">
<div id="loginAlert"></div>
<h4 style="border-bottom: 1px solid #ebebeb; height: 50px;">LOGIN</h4>
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input id="loginEmail" type="text" class="validate" required>
<label for="loginEmail">Email</label>
</div><br>
<div class="input-field col s12">
<i class="material-icons prefix">vpn_key</i>
<input id="loginPwd" type="password" class="validate" required>
<label for="loginPwd">Password</label>
</div>
<a class="waves-effect waves-light btn col s10 offset-s1" style="margin-top: 50px" id="btnSubmitLogin">LOGIN</a>
<h6 class=" col s12">Don"t have an account? <a href="#" id="createAccount">Sign up here</a></h6>
</span>
<span class="flow-text" id="createInfo">
<div id="pwdAlert"></div>
<h4 style='border-bottom: 1px solid #ebebeb; height: 50px;'>REGISTER</h4><div class='input-field col s6'><input id='first_name' type='text' class='validate' required><label for='first_name'>First Name</label></div><div class='input-field col s6'><input id='last_name' type='text' class='validate' required><label for='last_name'>Last Name</label></div><div class='input-field col s12'><input id='regEmail' type='email' class='validate' required><label for='regEmail'>Email</label></div><div class='input-field col s12'><input id='regPassword' type='password' class='validate' required><label for='regPassword'>Password</label></div><div class='input-field col s12'><input id='checkPassword' type='password' class='validate' required><label for='checkPassword'>Confirm Password</label></div><a class='waves-effect waves-light btn col s10 offset-s1' style='margin-top: 50px' id='btnSubmitRegister'>REGISTER</a><h6 class='col s12' id="changeLogin">You have an account? <a href='#' id='loginAccount'>Login</a></h6>
</span>
</div>
</div>
<div class="modal-footer">
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l3 s12">
<h5 class="white-text">Connect</h5>
<ul>
<li><a class="white-text" href="../aboutus.html">About Us</a></li>
<li><a class="white-text" href="../userGuide.html">User Guide</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">Copyright © 2019 InnoTech HK Inc. All rights reserved</div>
</div>
</footer>
<!-- Scripts-->
</body>
</html>

View File

@@ -0,0 +1,480 @@
$(document).ready(function() {
$.ajaxSetup({ cache: false });
$.LoadFav = function(){
$("#navBookMark").click(function(){
$("#favModal").html("");
$("#modal_box").html("");
$("#modal_box").html("<div class='modal-content' id='favModal'><h4>Favorite Restaurant</h4></div><div class='modal-footer'><a href='#!' class='modal-action modal-close waves-effect waves-red btn'>Close</a></div>");
$.getJSON("../jsonDB/"+sessionStorage.getItem("username")+".json", function(obj){
try{
$.getJSON("../jsonDB/restaurants.json", function(result){
for(var i=0; i<obj.favorite.length; i++)
$.each(result.restaurants, function(index,name){
if(obj.favorite[i] == name.id){
$("#favModal").append("<ul class='collection' id='delcollFav"+name.id+"'><li class='collection-item avatar'><img src='../"+name.image+"' id='favImg'class='circle'><span class='title' id='favTitle'>"+name.name+"</span><p id='favTag"+obj.favorite[i] +"'></p><a href='#' class='secondary-content deleteFav' id='Delfav"+name.id+"' ><i class='material-icons red-text' >delete</i></a></li></ul>");
$.deleteFav();
$.each(name.tag, function(tagIndex, tagName){
$("#favTag"+obj.favorite[i]).append("<div class='chip'>" + tagName + "</div>");
});
}
});
});
//});
}catch(err){
console.log("NOT Thing here");
}
});
});
}
$.deleteFav = function(){
$(".deleteFav").click(function(){
var favVal = $(this).attr("id").substring(6,7);
$.getJSON("../jsonDB/"+sessionStorage.getItem("username")+".json", function(obj){
$.each(obj.favorite, function(favIndex, favName){
if(favVal == favName){
obj.favorite.splice(favIndex, 1);
console.log(obj);
$.ajax({
url: "../jsonDB/update.php",
type: "POST",
dataType: "json",
data: {dataCus: JSON.stringify(obj), dataEmail: sessionStorage.getItem("username"), fav: 1}
});
$("#delcollFav"+favVal).effect("slide");
$("#delcollFav"+favVal).html("");
}
console.log()
$("#fav"+favVal).html("<i class='material-icons'>favorite</i></a>");
});
});
});
}
$.windowsChecksize = function() {
var winWidth = $(window).width();
console.log(sessionStorage.getItem("rule"));
if (winWidth < 943) {
if(sessionStorage.getItem("username")){
$("nav .right").html("<li><a id='btnLoginNav' data-target='slide-out' class='sidenav-trigger'><i class='material-icons lighten-3 icon-brand' >account_circle</i></a></li>");
}else{
$("nav .right").html("<li id='btnLoginNavli'><a id='btnLogin'><i class='material-icons lighten-3 icon-brand' >account_circle</i></a></li>");
}
} else {
if(sessionStorage.getItem("username")){
$("nav .right").html("<li><div id='btnLoginNav' data-target='slide-out' class='sidenav-trigger'><a class='waves-effect waves-light btn'><i class='material-icons left' >menu</i>Menu</a></div></li>");
}else{
$("nav .right").html("<li id='btnLoginNavli'><a class='waves-effect waves-light btn' id='btnLogin'><i class='material-icons left center' >account_circle</i>Login</a></li>");
}
}
if(sessionStorage.getItem("username")){
$("#slide-out").html("");
$("#modal_box").addClass("modal");
$("#modal_box").html("");
$("#favModal").html("");
$('.sidenav').sidenav();
if(sessionStorage.getItem("rule")=="operator"){
$("#slide-out").append("<li><div class='user-view'><div class='background'><img src='../images/office-1.jpg'></div><a href='#user'><img class='circle' id='navIcon' src='../images/icon/yuna.jpg'></a><a href='#name'><span class='white-text name' id='navName'></span></a><a href='#email'><span class='white-text email' id='navEmail'></span></a> </div></li><li><a href='../operatorIndex.html'><i class='material-icons'>people</i>Restaurant Management</a></li><li><a href='../Info.html'><i class='material-icons'>settings</i>Personal Information</a></li><li><a href='#!' id='navLogout'>Log Out</a></li>");
$("#btnBack").attr("href","../operatorIndex.html");
}else if (sessionStorage.getItem("rule")=="admin"){
$("#slide-out").append("<li><div class='user-view'><div class='background'><img src='../images/office-1.jpg'></div><a href='#user'><img class='circle' id='navIcon' src='../images/icon/yuna.jpg'></a><a href='#name'><span class='white-text name' id='navName'></span></a><a href='#email'><span class='white-text email' id='navEmail'></span></a> </div></li><li><a href='../admin.html'><i class='material-icons'>people</i>User Management</a></li><li><a href='../Info.html'><i class='material-icons'>settings</i>Personal Information</a></li><li><a href='#!' id='navLogout'>Log Out</a></li>");
}else{
$("#slide-out").append("<li><div class='user-view'><div class='background'><img src='../images/office-1.jpg'></div><a href='#user'><img class='circle' id='navIcon' src='../images/icon/yuna.jpg'></a><a href='#name'><span class='white-text name' id='navName'></span></a><a href='#email'><span class='white-text email' id='navEmail'></span></a> </div></li><li><a href='#modal_box' id='navBookMark' class='modal-trigger'><i class='material-icons'>bookmark</i>favorite restaurant</a></li><li><a href='../Info.html'><i class='material-icons'>settings</i>Personal Information</a></li><li><a href='#!' id='navLogout'>Log Out</a></li>");
}
$("#navName").append(sessionStorage.getItem("name"));
$("#navEmail").append(sessionStorage.getItem("username"));
$("#navLogout").click(function(){
sessionStorage.removeItem("username");
sessionStorage.removeItem("name");
window.location.replace("../index.html");
});
$("#modal_box").html("<div class='modal-content' id='favModal'><h4>Favorite Restaurant</h4></div><div class='modal-footer'><a href='#!' class='modal-action modal-close waves-effect waves-red btn'>Close</a></div>");
$.LoadFav();
}
$("#btnLogin").click(function() {
$('#modal1').modal('open');
});
}
$.getRestanauent = function(){
$.getJSON("../jsonDB/restaurants.json", function(result) {
$.each(result.restaurants, function(index, name) {
var count = 0,
rate = 0;
$.each(result.commRestaurants, function(comIndex, comName) {
if (name.id == comName.resID) {
rate += comName.rate;
count++;
}
});
rate /= count;
if (isNaN(rate))
rate = "Not a comment";
else
rate = "Rate: " + rate + "/5.0";
$("#menu").append("<a href='menu/foodRestaurant"+name.id+".html'><div class='col s12 m4 searchRest'><div class='card'><div class='card-image'><img src='" + name.image + "'><a class='btn-floating halfway-fab waves-effect waves-light red fav' id='fav" + name.id + "'></a></div><div class='card-content'><span class='card-title'>" + name.name + "</span><p>" + rate + "</p></div><div class='card-action' id='" + name.id + "'></a>");
$.each(name.tag, function(tagIndex, tagName) {
$("#" + name.id).append("<div class='chip'>" + tagName + "</div></div></div></div>");
});
if(sessionStorage.getItem("username")){
$.getJSON("../jsonDB/"+sessionStorage.getItem("username")+".json", function(obj){
var seaVaild = false;
$.each(obj.favorite, function(seaFavIndex, seaFavName){
if(seaFavName == name.id){
seaVaild = true;
$("#fav"+name.id).append("<i class='material-icons'>delete</i></a>");
}
});
if(!seaVaild)
$("#fav"+name.id).append("<i class='material-icons'>favorite</i></a>");
});
}else{
$("#fav"+name.id).append("<i class='material-icons'>favorite</i></a>");
}
});
var foodText = GetURLParameter('food');
if(typeof foodText!="undefined"){
$(".searchRest").hide().filter(":contains('" + foodText + "')").show();
}
if(!sessionStorage.getItem("username")){
$(".searchRest a").attr("href", "#");
$(".searchRest a").click(function(){
$("#btnLoginNavli a").click();
});
}else{
$.clickFav();
}
});
}
$.clickFav = function(){
$(".fav").click(function(){
if(sessionStorage.getItem("username")){
var favVal = $(this).attr("id").substring(3,4);
var vaild = false;
$.getJSON("../jsonDB/"+sessionStorage.getItem("username")+".json", function(obj){
$.each(obj.favorite, function(favIndex, favName){
if(favVal == favName){
vaild = true;
obj.favorite.splice(favIndex, 1);
$("#fav"+favVal).html("<i class='material-icons'>favorite</i>");
}
});
if(!vaild){
obj.favorite.push(favVal);
console.log(obj);
$("#fav"+favVal).html("<i class='material-icons'>delete</i>");
}
$.ajax({
url: "../jsonDB/update.php",
type: "POST",
dataType: "json",
data: {dataCus: JSON.stringify(obj), dataEmail: sessionStorage.getItem("username"), fav: 1},
});
});
}else{
$("#btnLoginNavli a").click();
}
});
}
$("#createInfo").hide();
$("#createAccount").click(function() {
$("#loginInfo").hide();
$("#createInfo").show();
});
$("#loginAccount").click(function() {
$("#createInfo").hide();
$("#loginInfo").show();
});
$(window).resize(function() {
$.windowsChecksize();
});
//$("#btnFBLogin").click(function(){
//
//});
$("#btnSubmitLogin").click(function() {
$("#loginAlert").html("");
var loginPwd = $("#loginPwd").val();
var loginEmail = $("#loginEmail").val();
if(loginEmail=="" && loginPwd==""){
$("#loginAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>The Email and password is required!</font></div></div></div>");
}else if(loginEmail==""){
$("#loginAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Missing the Email Address</font></div></div></div>");
}else if(loginPwd==""){
$("#loginAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Missing the Password</font></div></div></div>");
}else{
var valid = true;
$.getJSON("../jsonDb/adminCustomer.json",function(result){
$.each(result.customers, function(index, name){
if(name.email==loginEmail && name.pwd!=loginPwd){
valid = false;
$("#loginAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Your Password is Worng.</font></div></div></div>");
}else if(name.email==loginEmail && name.pwd==loginPwd){
//$("#navIcon").attr("src", name.icon);
$("#loginAlert").html("");
valid = false;
sessionStorage.setItem("username", name.email);
sessionStorage.setItem("name", name.fname+ " " + name.lname);
sessionStorage.setItem("rule", name.rule);
if(sessionStorage.getItem("rule")=="operator")
window.location.replace("operatorIndex.html");
else if(sessionStorage.getItem("rule")=="admin")
window.location.replace("admin.html");
else{
location.reload();
}
valid = false;
}
});
if(valid)
$("#loginAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Your Email or Password is Worng!</font></div></div></div>");
$("#loginAlert").effect("shake");
});
}
});
$("#btnSubmitRegister").click(function(){
$("#pwdAlert").html("");
var pwd = $("#regPassword").val();
var pwdCheck = $("#checkPassword").val();
var email = $("#regEmail").val();
var fname = $("#first_name").val();
var lname = $("#last_name").val();
var valid = false;
if(pwd=="" && pwdCheck=="" && email=="" && fname=="" && lname==""){
$("#pwdAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>You need input the all field!</font></div></div></div>");
valid = true;
$("#pwdAlert").effect("shake");
return 0;
}
$.getJSON("../jsonDB/adminCustomer.json", function(obj){
$.each(obj.customers, function(index,name){
if(name.email == email){
$("#pwdAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Your Email Registed!</font></div></div></div>");
valid = true;
$("#pwdAlert").effect("shake");
}
});
});
if(pwd != pwdCheck){
$("#pwdAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Your Comfirm Password Not Match!</font></div></div></div>");
$("#pwdAlert").effect("shake");
valid = true;
}
if(!valid){
$.getJSON("../jsonDB/adminCustomer.json", function(obj){
var getID = 0;
$.each(obj.customers, function(index, name){
if(getID<name.userID)
getID = name.userID;
});
getID++;
var customer = {
userID: getID,
email: email,
fname: fname,
lname: lname,
pwd: pwd,
rule: "user"
}
obj.customers.push(customer);
$.ajax({
url: "../jsonDB/update.php",
type: "POST",
dataType: "json",
data: {dataAdmin: JSON.stringify(obj), dataCus: JSON.stringify(customer), dataEmail: email}
});
$("#changeLogin a").click();
$("#loginAlert").append("<div class='row'><div class='col s12'><div class='card-panel green lighten-1' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Your Account Created.</font></div></div></div>");
$("#loginAlert").effect("slide");
});
}
});
$.checkRestaurantInf = function(){
var name = $("#createRestaurantName").val();
var tel = $("#createRestaureantTel").val();
var address = $("#createRestaureantAdde").val();
var area = $("#createRestaurantSelect").val();
var opTime = $("#createRestaureantOPTime").val();
var clTime = $("#createRestaureantCLTime").val();
var valid = true;
$("#stepOneAlert").html("");
if(name=="" && tel=="" && address=="" && area=="" && opTime=="" && clTime==""){
$("#stepOneAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>You need input the all field!</font></div></div></div>");
valid=false;
}
if(name==""){
$("#stepOneAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Missing the Restaurant Name</font></div></div></div>");
valid=false;
}
if(tel==""){
$("#stepOneAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Missing the Restaurant Name</font></div></div></div>");
valid=false;
}
if(address==""){
$("#stepOneAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Missing the Restaurant Address</font></div></div></div>");
valid=false;
}
if(clTime==""||opTime==""){
$("#stepOneAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Missing the Restaurant opening hours</font></div></div></div>");
valid=false;
}
if(!valid){
$("#firstStep").addClass("red-text");
}
}
$("#btnAddCatalog").click(function(){
$("#menuCatAlert").html();
var cataHidd = $("#catalogHidden").prop("checked");
var catalog = $("#catalog").val();
var cataAllDay = $("#catalogAllDay").prop("checked");
var invalid = true;
if(!cataAllDay){
var startTime = $("#catalogTo").val();
var closeTime = $("#catalogCl").val();
}
if(catalog==""){
$("#menuCatAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Please input your catalog</font></div></div></div>");
invalid=false;
}
if(!cataAllDay && startTime=="" && closeTime==""){
$("#menuCatAlert").append("<div class='row'><div class='col s12'><div class='card-panel red lighten-1 left' style=' width: 100%; line-height: 0px; text-align: left'><font size='2' class='white-text'>Missing the Catalog Time</font></div></div></div>");
invalid=false;
}
if(!invalid){
$("#secondStep i").addClass("red-text");
}
if(invalid){
$("#catalogTable").append("<tr><td>"+catalog+"</td><td>"+cataAllDay+"</td><td>"+startTime+"</td><td>"+closeTime+"</td><td class='catalogHide'>"+cataHidd+"</td><td><a class='btn-floating btn-small waves-effect waves-light red btnCataDelete'><i class='material-icons'>delete</i></a> <a class='btn-floating btn-small waves-effect waves-light teal lighten-2 btnCataChange'><i class='material-icons'>repeat</i></a></td></tr>");
$("#catalog").text();
$("#secondStep i").removeClass("red-text");
$(".btnCataChange").click(function(){
var disVal = $(this).parents("tr").children("td:eq(4)").html();
alert(disVal);
if(disVal=="false"){
$(this).parents("tr").children("td:eq(4)").html("true") ;
}else{
$(this).parents("tr").children("td:eq(4)").html("false") ;
}
});
$(".btnCataDelete").click(function(){
$(this).parents("tr").remove();
});
}
});
$("#secondStep").click(function(){
$.checkRestaurantInf();
});
function btnSave(){
$("#btnMenuSave").click(function(){
var name = $("#createRestaurantName").val();
var tel = $("#createRestaureantTel").val();
var address = $("#createRestaureantAdde").val();
var opTime = $("#createRestaureantOPTime").val();
var clTime = $("#createRestaureantCLTime").val();
var valid = true;
if(name==""){
$("#menuMissing").append("Section 1: Restaurant name<br>");
valid=false;
}
if(tel==""){
$("#menuMissing").append("Section 1: Restaurant Telphone<br>");
}
if(address==""){
$("#menuMissing").append("Section 1: Restaurant Address<br>");
valid=false;
}
if(clTime==""||opTime==""){
$("#menuMissing").append("Section 1: Restaurant Open and close time<br>");
valid=false;
}
if(address=="" || tel=="" || name=="" || clTime==""||opTime==""){
$("#firstStep").addClass("red-text");
}
if($("#catalogTable tr").length<2){
$("#menuMissing").append("Section 2: The Restaurant catalog<br>");
valid=false;
$("#secondStep").addClass("red-text");
}
if($("#resturantMenu tr").length<2){
$("#menuMissing").append("Section 3: The Restaurant food<br>");
valid=false;
$("#stepThrid").addClass("red-text");
}
if(valid){
$(this).removeClass("modal-trigger");
$("#menuAlert").html("");
$("#stepOneAlert").html("");
$("#menuCatAlert").html("");
$("#secondStep").removeClass("red-text");
$("#firstStep").removeClass("red-text");
$("#stepThrid").removeClass("red-text");
$("#createRestaurantName").val("");
$("#createRestaureantTel").val("");
$("#createRestaureantAdde").text("");
$("#createRestaurantSelect").val("");
$("#createRestaureantOPTime").val("");
$("#createRestaureantCLTime").val("");
$("#catalogTable").html("<tr><th>Catalog Name</th><th>All Day</th><th>Start Time</th><th>Close Time</th><th>Hidden</th><th>Action</th></tr>");
$("#resturantMenu").html("<tr><th>Food Name</th><th>Catalog</th><th>Price</th><th>Display</th><th>Action</th></tr>");
}
});
}
function GetURLParameter(sParam) {
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++) {
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
return sParameterName[1];
}
}
btnSave();
$.deleteFav();
$.clickFav();
$.windowsChecksize();
$('.chips-placeholder').chips({
placeholder: 'The Food tag',
secondaryPlaceholder: '+Tag',
});
$('.parallax').parallax();
$('.modal').modal();
$('.collapsible').collapsible();
$('select').formSelect();
$('.tabs').tabs();
$('#createRestaurantSelect').formSelect();
});// JavaScript Document