<file_sep><?php

session_start();

$email = filter_has_var(INPUT_POST, 'email') ? $_POST['email']: null; //grabs the username from the request stream
$password  = filter_has_var(INPUT_POST, 'password') ? $_POST['password']: null;
//grabs the password from the request stream

	if(empty(trim($email))) { //checks to see if username is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please enter your email</p>\n
                              <a href='../../login.php'>Go Back</a>"; //errors variable array for error messages.
	}  elseif (strlen($email) < 6 OR strlen($email) > 30) {
                  //checks string length of username, if less than six characters or greater than 30, then send error to screen.
	           $errors[] = "Emails must include between 6 and 30 characters";
      }

	if(empty(trim($password))) {
            //checks to see if password is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please enter your password</p>\n
                              <a href='../../login.php'>Go Back</a>"; //errors variable array for error messages.
            //tells user to go back and enter password
	} elseif (strlen($password) < 1 OR strlen($password) > 30) {
            //checks string length of password, if less than six characters or greater than 30, then send error to screen.
	           $errors[] = "Passwords must include between 6 and 30 characters";
      }

	if (!empty($errors)) { //if the errors variable is empty
		foreach ($errors as $currentError) {
                  echo $currentError; //store message in variable and display on the screen
		}
	} else { //else execute login process

		$email = filter_var($email, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$password = filter_var($password, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);

		include '../db.conn.php';	// make db connection

		/* Query the users database table to get the password hash for the username entered by the user in the logon form */

		$sql = "SELECT password FROM user WHERE email = ?";

		$stmt = mysqli_prepare($conn, $sql);	// prepare the sql statement

		/* Bind the $username entered by the user to the prepared statement. Note the “s” part indicates the data type used – in this case a string */

		mysqli_stmt_bind_param($stmt, "s", $email);

		mysqli_stmt_execute($stmt);	// execute the query

		/* Get the password hash from the query results for the given username and store it in the variable indicated */

		mysqli_stmt_bind_result($stmt, $passwordHash);

		/* Check if a record was returned by the query. If yes, then there was a username matching what was entered in the logon form and we can now test to see if the password entered in the logon form is the same as the stored (correct) one in the database. */


		if (mysqli_stmt_fetch($stmt)) {
			if (password_verify($password, $passwordHash)) {
				header('Location: ../../index.php');
			}
		} else {
    			echo "<p>Sorry your email or password is incorrect. Please try again.</p> <a href='../../login.php'>Go Back</a>";
		}

		mysqli_stmt_close($stmt);
		mysqli_close($conn);
	}
<file_sep><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Cohort - Profile</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--Links to external Librarys such as JQuery movile, material icons and CSS -->
		<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
		<link rel="stylesheet" href="resources/assets/css/app.css">
	</head>
	<body>
		<div id="home" data-role="page">
			<?php include "header.php" ?>
			<div class="profile-wrapper">
				<div class="back-to-home">
					<a href="routes.php"><i class="material-icons">arrow_back</i><p>Back to Home</p></a>
				</div>
				<div class="user-details">
					<div class="user-details-left">
						<img src="resources/assets/img/default-user.png" alt="Profile Picture">
					</div>
					<div class="user-details-right">
						<div class="profile-username">
							<h1><NAME></h1>
						</div>
						<div class="profile-rating">
							<p>ratinggoeshere</p>
							<img src="resources/assets/img/beginner.png" alt="Skill Level">
						</div>
					</div>
				</div>
				<a href="messages.php" class="send">Send a Message</a>
				<div class="profile-about">
					<h2>About Me</h2>
					<p>Curabitur blandit tempus porttitor. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
				</div>
				<div class="events-hosted">
					<h2>Events Hosted by John</h2>
				</div>
			</div>
		</div>
	</body>
</html>
<file_sep><?php

    $conn = mysqli_connect('localhost','USERNAME','PASSWORD','USERNAME');
    if (mysqli_connect_errno()) {
       echo "<p>Connection failed:".mysqli_connect_error()."</p>\n";
       mysqli_close($conn);
    }
    mysqli_set_charset($conn,"utf8");
<file_sep><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Cohort - Messages</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--Links to external Librarys such as JQuery movile, material icons and CSS -->
		<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
		<link rel="stylesheet" href="resources/assets/css/app.css">
	</head>
	<body>
		<div id="home" data-role="page">
			<?php include 'header.php'; ?>
			<div class="messages-wrapper">
				<h1>Conversations</h1>
				<div class="conversation-wrapper">
					<div class="conversation">
						<img src="resources/assets/img/default-user.png" alt="Profile">
						<div class="conversation-user">
							<p><NAME></p>
						</div>
						<i class="material-icons">more_horiz</i>
					</div>
					<div class="conversation">
						<img src="resources/assets/img/default-user.png" alt="Profile">
						<div class="conversation-user">
							<p><NAME></p>
						</div>
						<i class="material-icons">more_horiz</i>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
<file_sep>$( document ).ready(function() {

	//var divID = $('body').attr("id");

	/*if (divID.attr("id") === "home") {
	  $("li").css("opacity", "1");
  }*/

	$('.tablinks').click(function() {
		$('.tablinks').toggleClass('active');
	});

	$('.more-info').click(function() {
		$("html, body").animate({ scrollTop: $('#more-event-info').offset().top }, 1000);
		   return false;
	});

	$('.next-two').click(function() {
		$(".stage.one").css("display","none");
		$(".stage.two").css("display","block");

		$(".progress.one").css("opacity",".5");
		$(".progress.two").css("opacity","1");
	});

	$('.prev-one').click(function() {
		$(".stage.one").css("display","block");
		$(".stage.two").css("display","none");

		$(".progress.one").css("opacity","1");
		$(".progress.two").css("opacity",".5");
		$(".progress.three").css("opacity",".3");
		$(".progress.four").css("opacity",".2");
	});

	$('.next-three').click(function() {
		$(".stage.two").css("display","none");
		$(".stage.three").css("display","block");

		$(".progress.one").css("opacity",".3");
		$(".progress.two").css("opacity",".5");
		$(".progress.three").css("opacity","1");
	});

	$('.prev-two').click(function() {
		$(".stage.two").css("display","block");
		$(".stage.three").css("display","none");

		$(".progress.one").css("opacity",".5");
		$(".progress.two").css("opacity","1");
		$(".progress.three").css("opacity",".3");
		$(".progress.four").css("opacity",".2");
	});

	$('.next-four').click(function() {
		$(".stage.three").css("display","none");
		$(".stage.four").css("display","block");

		$(".progress.one").css("opacity",".2");
		$(".progress.two").css("opacity",".3");
		$(".progress.three").css("opacity",".5");
		$(".progress.four").css("opacity","1");
	});

	$('.prev-three').click(function() {
		$(".stage.three").css("display","block");
		$(".stage.four").css("display","none");

		$(".progress.one").css("opacity",".2");
		$(".progress.two").css("opacity",".3");
		$(".progress.three").css("opacity","1");
		$(".progress.four").css("opacity",".5");
	});

});
<file_sep><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Cohort - Routes</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--Links to external Librarys such as JQuery movile, material icons and CSS -->
		<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
		<link rel="stylesheet" href="resources/assets/css/app.css">
	</head>
	<body>
		<div id="home" data-role="page">
			<?php include 'header.php'; ?>
			<div class="details-wrapper">
				<div class="back-to-home">
					<a href="routes.php"><i class="material-icons">arrow_back</i><p>Back to Home</p></a>
				</div>
				<div class="route-details-content">
					<div class="route-host">
						<p>Route Created By: <a href="profile.php"><NAME></a></p>
						<p>ratingsgohere</p>
					</div>
					<img src="resources/assets/img/route.png" alt="Event Route">
					<div class="route-details-wrapper">
						<img src="resources/assets/img/distance.png" alt="Terrain"> 5 KM
						<i class="material-icons">timer</i> 23 MIN
						<img src="resources/assets/img/road.png" alt="Terrain"> ROAD
						<img src="resources/assets/img/beginner.png" alt="Skill Level">
					</div>
					<a href="create-from-route.php" class="create-from-route">CREATE EVENT FROM ROUTE</a>
				</div>
			</div>
		</div>
	</body>
</html>
<file_sep><?php

	//retreive each field input in to create event form
	$title = filter_has_var(INPUT_POST, 'title') ? $_POST['title']: null;
	$date = filter_has_var(INPUT_POST, 'date') ? $_POST['date']: null;
	$time = filter_has_var(INPUT_POST, 'time') ? $_POST['time']: null;
	$meeting = filter_has_var(INPUT_POST, 'meeting') ? $_POST['meeting']: null;
	$attendingNo = filter_has_var(INPUT_POST, 'attendingNo') ? $_POST['attendingNo']: null;
	$distance = filter_has_var(INPUT_POST, 'distance') ? $_POST['distance']: null;
	$unitofM = filter_has_var(INPUT_POST, 'unitofM') ? $_POST['unitofM']: null;
	$duration = filter_has_var(INPUT_POST, 'duration') ? $_POST['duration']: null;
	$terrain = filter_has_var(INPUT_POST, 'terrain') ? $_POST['terrain']: null;
	$skillLevel = filter_has_var(INPUT_POST, 'skillLevel') ? $_POST['skillLevel']: null;
	$description = filter_has_var(INPUT_POST, 'description') ? $_POST['description']: null;


	if(empty(trim($title))) { //checks to see if field is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please enter an event title!</p>\n
					<a href='/create-event.php'>Go Back</a>"; //errors variable array for error messages.
	}
	if(empty(trim($date))) { //checks to see if field is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please enter an event start date!</p>\n
					<a href='/create-event.php'>Go Back</a>"; //errors variable array for error messages.
	}
	if(empty(trim($time))) { //checks to see if field is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please enter an event start time!</p>\n
					<a href='/create-event.php'>Go Back</a>"; //errors variable array for error messages.
	}
	if(empty(trim($meeting))) { //checks to see if field is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please enter a meeting point for the event!</p>\n
					<a href='/create-event.php'>Go Back</a>"; //errors variable array for error messages.
	}
	if(empty(trim($distance))) { //checks to see if field is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please enter the distance of the route!</p>\n
					<a href='/create-event.php'>Go Back</a>"; //errors variable array for error messages.
	}
	if(empty(trim($duration))) { //checks to see if field is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please enter the duration of the route!</p>\n
					<a href='/create-event.php'>Go Back</a>"; //errors variable array for error messages.
	}
	if(empty(trim($skillLevel))) { //checks to see if field is empty or if there is white space after what is entered, for validation.
		$errors[] = "<p>Please select a skill level!</p>\n
					<a href='/create-event.php'>Go Back</a>"; //errors variable array for error messages.
	}
	if (!empty($errors)) { //if the errors variable is empty
		foreach ($errors as $currentError) {
			echo $currentError; //store field in variable and display on the screen
		}
	} else {

		$title = filter_var($title, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$date = filter_var($date, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$time = filter_var($time, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$meeting = filter_var($meeting, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$attendingNo = filter_var($attendingNo, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$distance = filter_var($distance, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$unitofM = filter_var($unitofM, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$duration = filter_var($duration, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$terrain = filter_var($terrain, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$skillLevel = filter_var($skillLevel, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);
		$description = filter_var($description, FILTER_SANITIZE_STRING, 	FILTER_FLAG_NO_ENCODE_QUOTES);

		include '../db.conn.php';	// make db connection

		$sqlCreate = "INSERT INTO event (hostID,routeID,title,eventDate,eventTime,meetingPoint,attending,distance,unitOfM,duration,terrain,skillLevel,description,location) VALUES (1,1,?,?,?,?,?,?,?,?,?,?,?,'newcastle')";


		$sqlCreateEvent = mysqli_prepare($conn, $sqlCreate);
		mysqli_stmt_bind_param($sqlCreateEvent,"ssssiisisis",$title,$date,$time,$meeting,$attendingNo,$distance,$unitofM,$duration,$terrain,$skillLevel,$description);
		mysqli_stmt_execute($sqlCreateEvent);
		mysqli_stmt_close($sqlCreateEvent);
		mysqli_close($conn);

		header('Location: ../../index.php');

	}
 ?>
<file_sep><?php
$email = filter_has_var(INPUT_POST, 'email') ? $_POST['email']: null;
$password = filter_has_var(INPUT_POST, 'password') ? $_POST['password']: null;
$forename = filter_has_var(INPUT_POST, 'forename') ? $_POST['forename']: null;
$surname = filter_has_var(INPUT_POST, 'surname') ? $_POST['surname']: null;
$dob = filter_has_var(INPUT_POST, 'dob') ? $_POST['dob']: null;
$skillLevel = filter_has_var(INPUT_POST, 'skillLevel') ? $_POST['skillLevel']: null;
$errors = array();

	if(empty(trim($email))) {
		$errors[] = "<p>Please enter an email address</p>\n";
	}

	if(empty(trim($password))) {
		$errors[] = "<p>Please enter a password</p>\n";
	}

	if(empty(trim($forename))) {
		$errors[] = "<p>Please enter your forename</p>\n";
	}

	if(empty(trim($surname))) {
		$errors[] = "<p>Please enter your surnamel</p>\n";
	}

	if(empty(trim($dob))) {
		$errors[] = "<p>Please enter your date of birth!</p>\n";
	}

	if(empty(trim($skillLevel))) {
		$errors[] = "<p>Please select a skill level!</p>\n";
	}

	if (!empty($errors)) {
		foreach ($errors as $currentError) {
			echo $currentError;
		}
	} else {

		include '../db.conn.php';	// make db connection

		$passwordHash = password_hash($password, PASSWORD_BCRYPT);

		$sqlRegister = "INSERT INTO user (email, password, forename, surname, dob, skillLevel) VALUES (?, ?, ?, ?, ?, ?)";

		$sqlProcess = mysqli_prepare($conn, $sqlRegister);
		mysqli_stmt_bind_param($sqlProcess,"sssssi", $email, $passwordHash, $forename, $surname, $dob, $skillLevel);
		mysqli_stmt_execute($sqlProcess);
		mysqli_stmt_close($sqlProcess);
		mysqli_close($conn);

		header('Location: ../../location-access.php');

	}
<file_sep><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Cohort - Events</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--Links to external Librarys such as JQuery movile, material icons and CSS -->
		<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
		<link rel="stylesheet" href="resources/assets/css/app.css">
		<script type="text/javascript">
			window.onload = function() {
			  var startPos;
			  var geoSuccess = function(position) {
			    startPos = position;
			    document.getElementById('startLat').innerHTML = startPos.coords.latitude;
			    document.getElementById('startLon').innerHTML = startPos.coords.longitude;
			  };
			  navigator.geolocation.getCurrentPosition(geoSuccess);
			  console.log(geoSuccess);
			};
		</script>
	</head>
	<body id="home">
		<!--?php
			include 'app/db.conn.php';
 		?-->
		<div id="home" data-role="page">
			<?php include "header.php" ?> <!-- include external php file, no need to repeat code -->
			<!-- content -->
			<div data-role="content" id="events-wrapper" data-position-true>
				<div class="filter-wrapper">
					<div class="filter-wrapper-left">
						<p>Runs Located in:</p>
						<a href="#"><h3>Newcastle</h3></a> <!--will be changed dynamically depending on location-->
					</div>
					<div class="filter-wrapper-right">
						<i class="material-icons">filter_list</i>
					</div>
				</div>
				<!--?php
					$sql = "SELECT *
	   					    FROM event e
						    INNER JOIN host h
						    ON e.hostID = h.hostID
						    INNER JOIN user u
						    ON h.userID = u.userID
						    WHERE location = 'newcastle'";

							$sqlEvent = mysqli_query($conn, $sql) or die(mysqli_error($conn)); //makes a connection to the database, if not kills connection, displays error

							if (mysqli_num_rows($sqlEvent) > 0) {

								while ($row = mysqli_fetch_assoc($sqlEvent)) { //fetches information
									$eventID = htmlspecialchars($row["eventID"]); //places attributes in to rows to be displayed
									$title = htmlspecialchars($row["title"]);
									$distance = htmlspecialchars($row["distance"]);
									$unit = htmlspecialchars($row["unitOfM"]);
									$duration = htmlspecialchars($row["duration"]);
									$terrain = htmlspecialchars($row["terrain"]);
									$skillLevel = htmlspecialchars($row["skillLevel"]);
									$host = htmlspecialchars($row["hostID"]);
									$forename = htmlspecialchars($row["forename"]);
									$surname = htmlspecialchars($row["surname"]);

									echo "<div id=\"$eventID\" class=\"event\">\n";
									echo "\t<div class=\"event-left\">\n";
									echo "\t\t<img src=\"resources/assets/img/event-img-eg.jpg\" alt=\"Event Image\"; class=\"event-img\">\n";
									echo "\t</div>\n";
									echo "\t<div class=\"event-right\">\n";
									echo "\t\t<div class=\"event-right-top\">\n";
									echo "\t\t\t<a href=\"event-details.php\"><h4>$title</h4></a>\n";
									echo "\t\t</div>\n";
									echo "\t\t<div class=\"event-right-center\">\n";
									echo "\t\t\t<p>Host: <a href=\"profile.php\">$forename $surname</a></p>\n";
									echo "\t\t\t<div class=\"rating-wrapper\">\n";
									echo "\t\t\t\tratinggoeshere\n";
									echo "\t\t\t</div>\n";
									echo "\t\t</div>\n";
									echo "\t\t<div class=\"event-right-bottom\">\n";
									echo "\t\t\t<div class=\"event-details\">\n";
									echo "\t\t\t\t<img src=\"resources/assets/img/distance.png\" alt=\"Distance\">$distance $unit\n";
									echo "\t\t\t\t<i class=\"material-icons\">timer</i>$duration\n";
									echo "\t\t\t\t<img src=\"resources/assets/img/road.png\" alt=\"Terrain\">$terrain\n";
									echo "\t\t\t</div>\n";
									if ($skillLevel === "1") {
										echo "\t\t\t<img src=\"resources/assets/img/beginner.png\" alt=\"Beginner\">\n";
									} elseif ($skillLevel === "2") {
										echo "\t\t\t<img src=\"resources/assets/img/intermediate.png\" alt=\"Intermediate\">\n";
									} elseif ($skillLevel === "3") {
										echo "\t\t\t<img src=\"resources/assets/img/advanced.png\" alt=\"Advanced\">\n";
									}
									echo "\t\t</div>\n";
									echo "\t</div>\n";
									echo "</div>\n";
								}
							} else {
								echo "error";
							}

							mysqli_free_result($sqlEvent); //free's up space and kills connection
						    //mysqli_close($conn);
			    ?-->
				<div class="event">
					<div class="event-left">
						<img src="resources/assets/img/event-img-eg.jpg" alt="Event Image" class="event-img">
					</div>
					<div class="event-right">
						<div class="event-right-top">
							<a href="event-details.php"><h4>Running title</h4></a>
						</div>
						<div class="event-right-center">
							<p>Host: <a href="profile.php"><NAME></a></p>
							<div class="rating-wrapper">
								ratinggoeshere
							</div>
						</div>
						<div class="event-right-bottom">
							<div class="event-details">
								<img src="resources/assets/img/distance.png" alt="Terrain"> 5 KM
								<i class="material-icons">timer</i> 23 MIN
								<img src="resources/assets/img/road.png" alt="Terrain"> ROAD
							</div>
							<img src="resources/assets/img/beginner.png" alt="Skill Level">
						</div>
					</div>
				</div>
				<div class="event">
					<div class="event-left">
						<img src="resources/assets/img/event-img-eg.jpg" alt="Event Image" class="event-img">
					</div>
					<div class="event-right">
						<div class="event-right-top">
							<a href="event-details.php"><h4>Running title</h4></a>
						</div>
						<div class="event-right-center">
							<p>Host: <a href="profile.php"><NAME></a></p>
							<div class="rating-wrapper">
								ratinggoeshere
							</div>
						</div>
						<div class="event-right-bottom">
							<div class="event-details">
								<img src="resources/assets/img/distance.png" alt="Terrain"> 5 KM
								<i class="material-icons">timer</i> 23 MIN
								<img src="resources/assets/img/road.png" alt="Terrain"> ROAD
							</div>
							<img src="resources/assets/img/intermediate.png" alt="Skill Level">
						</div>
					</div>
				</div>
				<div class="event">
					<div class="event-left">
						<img src="resources/assets/img/event-img-eg.jpg" alt="Event Image" class="event-img">
					</div>
					<div class="event-right">
						<div class="event-right-top">
							<a href="event-details.php"><h4>Running title</h4></a>
						</div>
						<div class="event-right-center">
							<p>Host: <a href="profile.php"><NAME></a></p>
							<div class="rating-wrapper">
								ratinggoeshere
							</div>
						</div>
						<div class="event-right-bottom">
							<div class="event-details">
								<img src="resources/assets/img/distance.png" alt="Terrain"> 5 KM
								<i class="material-icons">timer</i> 23 MIN
								<img src="resources/assets/img/road.png" alt="Terrain"> ROAD
							</div>
							<img src="resources/assets/img/advanced.png" alt="Skill Level">
						</div>
					</div>
				</div>
			</div>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
		<script src="./resources/assets/js/function.js"></script>
	</body>
</html>
<file_sep># ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: localhost (MySQL 5.6.28)
# Database: cohort
# Generation Time: 2017-04-17 10:02:53 +0000
# ************************************************************


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


# Dump of table attending
# ------------------------------------------------------------

DROP TABLE IF EXISTS `attending`;

CREATE TABLE `attending` (
  `attendingID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `eventID` int(11) NOT NULL,
  `userID` int(11) NOT NULL,
  `hostID` int(11) NOT NULL,
  `attendingTime` datetime NOT NULL,
  PRIMARY KEY (`attendingID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table conversations
# ------------------------------------------------------------

DROP TABLE IF EXISTS `conversations`;

CREATE TABLE `conversations` (
  `conversationID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `senderID` int(11) NOT NULL,
  `recipientID` int(11) NOT NULL,
  `conversationTime` datetime DEFAULT NULL,
  PRIMARY KEY (`conversationID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table event
# ------------------------------------------------------------

DROP TABLE IF EXISTS `event`;

CREATE TABLE `event` (
  `eventID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `hostID` int(11) NOT NULL,
  `routeID` int(11) NOT NULL,
  `title` varchar(100) NOT NULL DEFAULT '',
  `eventDate` date NOT NULL,
  `terrain` varchar(20) NOT NULL DEFAULT '',
  `distance` int(4) NOT NULL,
  `unitOfM` varchar(2) NOT NULL DEFAULT '',
  `skillLevel` int(2) NOT NULL,
  `description` text,
  `meetingPoint` varchar(250) DEFAULT NULL,
  `attending` int(100) DEFAULT NULL,
  `location` varchar(200) NOT NULL DEFAULT '',
  `duration` time NOT NULL,
  `eventTime` time NOT NULL,
  PRIMARY KEY (`eventID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

LOCK TABLES `event` WRITE;
/*!40000 ALTER TABLE `event` DISABLE KEYS */;

INSERT INTO `event` (`eventID`, `hostID`, `routeID`, `title`, `eventDate`, `terrain`, `distance`, `unitOfM`, `skillLevel`, `description`, `meetingPoint`, `attending`, `location`, `duration`, `eventTime`)
VALUES
	(20,1,1,'Running Test','2017-04-15','road',2,'km',3,'lol','At the shop',2,'newcastle','22:22:22','16:07:00'),
	(21,1,1,'Running Event','2017-04-21','road',2,'km',1,'hello','Habita',2,'newcastle','00:25:00','12:30:00');

/*!40000 ALTER TABLE `event` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table eventRating
# ------------------------------------------------------------

DROP TABLE IF EXISTS `eventRating`;

CREATE TABLE `eventRating` (
  `eRatingID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `eventID` int(11) NOT NULL,
  `eRatingTime` datetime NOT NULL,
  `eRating` int(11) NOT NULL,
  `eFeedback` text,
  PRIMARY KEY (`eRatingID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table host
# ------------------------------------------------------------

DROP TABLE IF EXISTS `host`;

CREATE TABLE `host` (
  `hostID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `userID` int(11) NOT NULL,
  PRIMARY KEY (`hostID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

LOCK TABLES `host` WRITE;
/*!40000 ALTER TABLE `host` DISABLE KEYS */;

INSERT INTO `host` (`hostID`, `userID`)
VALUES
	(1,5);

/*!40000 ALTER TABLE `host` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table hostRating
# ------------------------------------------------------------

DROP TABLE IF EXISTS `hostRating`;

CREATE TABLE `hostRating` (
  `hRatingID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `hostID` int(11) NOT NULL,
  `ratingTime` datetime NOT NULL,
  `hRating` int(11) NOT NULL,
  `hFeedback` text,
  PRIMARY KEY (`hRatingID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table messages
# ------------------------------------------------------------

DROP TABLE IF EXISTS `messages`;

CREATE TABLE `messages` (
  `messageID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `recipientID` int(11) NOT NULL,
  `senderID` int(11) NOT NULL,
  `message` text NOT NULL,
  `timeSent` time NOT NULL,
  `conversationID` int(11) NOT NULL,
  PRIMARY KEY (`messageID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table notifications
# ------------------------------------------------------------

DROP TABLE IF EXISTS `notifications`;

CREATE TABLE `notifications` (
  `notificationID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `userID` int(11) NOT NULL,
  `notifyType` int(10) NOT NULL,
  `notifyTime` datetime NOT NULL,
  PRIMARY KEY (`notificationID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table route
# ------------------------------------------------------------

DROP TABLE IF EXISTS `route`;

CREATE TABLE `route` (
  `routeID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `hostID` int(11) NOT NULL,
  `route` varchar(50) NOT NULL DEFAULT '',
  `media` varchar(50) DEFAULT '',
  PRIMARY KEY (`routeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

LOCK TABLES `route` WRITE;
/*!40000 ALTER TABLE `route` DISABLE KEYS */;

INSERT INTO `route` (`routeID`, `hostID`, `route`, `media`)
VALUES
	(1,1,'','');

/*!40000 ALTER TABLE `route` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table routeRating
# ------------------------------------------------------------

DROP TABLE IF EXISTS `routeRating`;

CREATE TABLE `routeRating` (
  `rRatingID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `routeID` int(11) NOT NULL,
  `rRatingTime` datetime NOT NULL,
  `rRating` int(11) NOT NULL,
  `rFeeback` text,
  PRIMARY KEY (`rRatingID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table user
# ------------------------------------------------------------

DROP TABLE IF EXISTS `user`;

CREATE TABLE `user` (
  `userID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `forename` varchar(20) NOT NULL DEFAULT '',
  `surname` varchar(50) NOT NULL DEFAULT '',
  `dob` date NOT NULL,
  `email` varchar(20) NOT NULL DEFAULT '',
  `password` varchar(20) NOT NULL DEFAULT '',
  `description` text,
  `skillLevel` int(2) NOT NULL,
  PRIMARY KEY (`userID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;

INSERT INTO `user` (`userID`, `forename`, `surname`, `dob`, `email`, `password`, `description`, `skillLevel`)
VALUES
	(5,'test','test','2222-02-22','<EMAIL>','$2y$10$dtGbZ.WQcTkal',NULL,1),
	(6,'Sam','Towel','1996-06-21','<EMAIL>','$2y$10$Uk3VluTxFbStc',NULL,2);

/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;



/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<file_sep><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Cohort - EVENT NAME GOES HERE</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--Links to external Librarys such as JQuery movile, material icons and CSS -->
		<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
		<link rel="stylesheet" href="resources/assets/css/app.css">
	</head>
	<body>
		<div id="home" data-role="page">
			<?php include "header.php" ?>
			<div class="event-details-wrapper">
				<div class="back-to-home">
					<a href="index.php"><i class="material-icons">arrow_back</i><p>Back to Home</p></a>
				</div>
				<div class="details-content">
					<div class="details-top-content">
						<h2>Running Title</h2>
						<div class="details-top-host">
							<p>Host: <a href="profile.php"><NAME></a></p> <p>ratinggoeshere</p>
						</div>
						<div class="details-top-host">
							<p><strong>Date:</strong> 21/01/2001</p> <p><strong>Time:</strong> 17:30</p>
						</div>
					</div>
					<img src="resources/assets/img/route.png" alt="Event Route">
					<div class="route-details-wrapper">
						<img src="resources/assets/img/distance.png" alt="Distance"> 5 KM
						<i class="material-icons">timer</i> 23 MIN
						<img src="resources/assets/img/road.png" alt="Terrain"> ROAD
						<img src="resources/assets/img/beginner.png" alt="Skill Level">
					</div>
					<a href="#more-event-info"><div class="more-info">
						<p>More Info</p>
						<i class="material-icons">keyboard_arrow_down</i>
					</div></a>
				</div>
			</div>
			<div id="more-event-info">
				<div class="attending">
					<p>3 people are attending, 5 people have bookmarked this event!</p>
					<div class="option-wrapper">
						<a href="#" class="attending">LET'S GO!</a>
					</div>
				</div>
				<div class="description">
					<h3>Description</h3>
					<p>Donec sed odio dui. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Sed posuere consectetur est at lobortis. Aenean lacinia bibendum nulla sed consectetur.</p>
				</div>
				<div class="comment-section">
					<h3>Comments</h3>
					<p>Any questions for the host about the event?<br>Fire away.</p>
					<form class="send-comment" action="commentprocess.php" method="post">
						<textarea class="message-box" name="message" cols="40" rows="5" placeholder="Type a message..."></textarea>
						<input type="submit" name="send" value="">
					</form>
					<div class="comment">
						<div class="comment-top">
							<img src="resources/assets/img/default-user.png" alt="Profile">
							<a href="profile.php"><h4><NAME></h4></a>
							<p>01/01/01 01:01:01</p>
						</div>
						<p>Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper.</p>
					</div>
					<div class="comment">
						<div class="comment-top">
							<img src="resources/assets/img/default-user.png" alt="Profile">
							<a href="profile.php"><h4><NAME></h4></a>
							<p>01/01/01 01:01:01</p>
						</div>
						<p>Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper.</p>
					</div>
				</div>
			</div>
		</div>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
		<script src="./resources/assets/js/function.js"></script>
	</body>
</html>
<file_sep><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Cohort - Account</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--Links to external Librarys such as JQuery movile, material icons and CSS -->
		<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
		<link rel="stylesheet" href="resources/assets/css/app.css">
	</head>
	<body>
		<div id="home" data-role="page">
			<?php include 'header.php'; ?>
			<div class="account-wrapper">
				<h1>My Account</h1>
				<p>View your profile, events and settings!</p>
				<div class="account-settings">
					<a href="profile.php"><div class="settings-option-wrapper">
						<p>View your Profile</p>
						<i class="material-icons">arrow_back</i>
					</div></a>
					<a href="attending.php"><div class="settings-option-wrapper">
						<p>Attending Events</p>
						<i class="material-icons">arrow_back</i>
					</div></a>
				</div>
				<h2>System Settings</h2>
				<div class="system-settings">
					<a href="account-settings.php"><div class="settings-option-wrapper">
						<p>Account Settings</p>
						<i class="material-icons">arrow_back</i>
					</div></a>
					<a href="system-settings"><div class="settings-option-wrapper">
						<p>System Settings</p>
						<i class="material-icons">arrow_back</i>
					</div></a>
					<a href="terms.php"><div class="settings-option-wrapper">
						<p>Terms &amp; Conditions</p>
						<i class="material-icons">arrow_back</i>
					</div></a>
					<a href="privacy.php"><div class="settings-option-wrapper">
						<p>Privacy Policy</p>
						<i class="material-icons">arrow_back</i>
					</div></a>
				</div>
				<a href="landing.php" class="signout">Sign out of Cohort</a>
			</div>
		</div>
	</body>
</html>
<file_sep><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Cohort - Routes</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!--Links to external Librarys such as JQuery movile, material icons and CSS -->
		<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
		<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
		<link rel="stylesheet" href="resources/assets/css/app.css">
	</head>
	<body>
		<div id="home" data-role="page">
			<?php include 'header.php'; ?>
			<div class="route-wrapper">
				<h1>Recommended Routes in Your Area </h1>
				<div class="ui-grid-a">
					<div class="ui-block-a">
						<a href="route-details.php"><img src="resources/assets/img/route.png" alt="route"></a>
						<div class="route-details-wrapper">
							<p>ratingsgohere</p>
							<img src="resources/assets/img/beginner.png" alt="Skill Level" class="skill">
						</div>
						<p>Created by: <a href="profile.php"><NAME></a></p>
					</div>
					<div class="ui-block-b">
						<a href="route-details.php"><img src="resources/assets/img/route.png" alt="route"></a>
						<div class="route-details-wrapper">
							<p>ratingsgohere</p>
							<img src="resources/assets/img/beginner.png" alt="Skill Level" class="skill">
						</div>
						<p>Created by: <a href="profile.php"><NAME></a></p>
					</div>
					<div class="ui-block-a">
						<a href="route-details.php"><img src="resources/assets/img/route.png" alt="route"></a>
						<div class="route-details-wrapper">
							<p>ratingsgohere</p>
							<img src="resources/assets/img/beginner.png" alt="Skill Level" class="skill">
						</div>
						<p>Created by: <a href="profile.php"><NAME></a></p>
					</div>
					<div class="ui-block-b">
						<a href="route-details.php"><img src="resources/assets/img/route.png" alt="route"></a>
						<div class="route-details-wrapper">
							<p>ratingsgohere</p>
							<img src="resources/assets/img/beginner.png" alt="Skill Level" class="skill">
						</div>
						<p>Created by: <a href="profile.php"><NAME></a></p>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
