コード例 #1
0
ファイル: login.php プロジェクト: jianwan3/cmuyak
    } else {
        $err_msg = "Invalid login";
    }
}
?>
<html>
	<head>
		<title>Login</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('login');
?>
      <div class="jumbotron">
		<form class="form-signin" role="form" action='login.php' method='POST'>
			<h2 class="form-signin-heading">Login</h2>
			<h3 class="form-signin-heading"><?php 
echo $err_msg;
?>
 </h3>
			<input type="text" class="form-control" name='username' placeholder="Username" required autofocus>
			<input type="password" class="form-control" name='pw' placeholder="Password" required>
			<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
	  </form>
      </div>
	</body>
</html>
コード例 #2
0
ファイル: user.php プロジェクト: jianwan3/cmuyak
if (!isset($_GET['user'])) {
    header('Location: ' . $home . 'login.php');
}
$dbh = db_connect($MY_HOST, $MY_DB_PORT, $MY_DB, $DB_USER, $DB_PW);
?>
<html>
	<head>
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('user', $_SESSION['user']);
?>

<?php 
html_user($dbh, $_GET['user'], $_SESSION['user']);
?>

<?php 
$num_posts = 0;
if (isset($_GET['start'])) {
    $resp = get_user_posts($dbh, $_GET['user'], 15, $_GET['start']);
} else {
    $resp = get_user_posts($dbh, $_GET['user'], 15);
}
$last_time = -1;
if ($resp['status'] == 1) {
コード例 #3
0
ファイル: search.php プロジェクト: jianwan3/cmuyak
			        	distance.attr("readonly", true);
			        	location.attr("disabled", true);			        							
					}
					
				});				
			});	
		</script>		
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 		<div class="container">
			<?php 
html_nav('search', $_SESSION['user']);
?>

			<div class="row" style='border-bottom: 1px solid #ccc;'>
				<form action='search.php' method='POST'>
				<div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
					<div class="col-md-3"> <b>Keyword</b><br>(required *): </div>
					<div class="col-md-9"> 
<?php 
echo '<input type="text" class="form-control" value="' . $_POST['keyword'] . '"
						  name="keyword" placeholder="keyword of post" required autofocus>';
?>
					</div>
				</div>
				<hr>
				<div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
コード例 #4
0
ファイル: stats.php プロジェクト: jianwan3/cmuyak
include "config.php";
include "private_functions.php";
include "functions.php";
$dbh = db_connect($MY_HOST, $MY_DB_PORT, $MY_DB, $DB_USER, $DB_PW);
?>
<html>
	<head>
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('stats', $_SESSION['user']);
?>

	  <div class="row" style='border-bottom: 1px solid #000; margin-bottom: 10px;'>
		  <div class="row" style='padding-left: 10px; padding-right: 10px; padding-top: 5px;'>
				<div class="col-md-10"><h2>Most Active Users</h2></div>
		  </div>
		</div>
<?php 
$num_result = 0;
$resp = get_most_active_users($dbh, 5);
if ($resp['status'] == 1) {
    $users = $resp['users'];
    for ($i = 0; $i < count($users); $i++) {
        html_user($dbh, $users[$i], $_SESSION['user']);
        $num_result++;
コード例 #5
0
ファイル: register.php プロジェクト: jianwan3/cmuyak
    } else {
        $err_msg = "Usernames can only consist of letters or numbers";
    }
}
?>
<html>
	<head>
		<title>Register</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('register');
?>
      <div class="jumbotron">
		<form class="form-signin" role="form" action='register.php' method='POST'>
			<h2 class="form-signin-heading">Register</h2>
			<h3 class="form-signin-heading"><?php 
echo $err_msg;
?>
 </h3>
			<input type="text" class="form-control" name='username' placeholder="Username" required autofocus>
			<input type="password" class="form-control" name='pw' placeholder="Password" required>
			<button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
	  </form>
      </div>
	</body>
</html>
コード例 #6
0
ファイル: find_users.php プロジェクト: jinxicmu/CMU-Postly
include "config.php";
include "private_functions.php";
include "functions.php";
$dbh = db_connect($MY_HOST, $MY_DB_PORT, $MY_DB, $DB_USER, $DB_PW);
?>
<html>
	<head>
		<title>Postly</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('findUsers', $_SESSION['user']);
?>

	  <div class="row" style='border-bottom: 1px solid #ccc;'>
		<form action='find_users.php' method='GET'>
	  <div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
			<div class="col-md-10"> <input style='height: 45px; padding:10px; font-size: 21px' type="text" class="form-control" name='username' placeholder="Username" required autofocus> </div>
			<div class="col-md-2"> <button class="btn btn-lg btn-primary btn-block" type="submit">Search</button> </div>
	  </div>
	  </form>
		</div>


<?php 
$num_results = 0;
if (isset($_GET['username'])) {
コード例 #7
0
ファイル: find_tags.php プロジェクト: jianwan3/cmuyak
include "config.php";
include "private_functions.php";
include "functions.php";
$dbh = db_connect($MY_HOST, $MY_DB_PORT, $MY_DB, $DB_USER, $DB_PW);
?>
<html>
	<head>
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('findTag', $_SESSION['user']);
?>

	  <div class="row" style='border-bottom: 1px solid #ccc;'>
		<form action='find_tags.php' method='GET'>
	  <div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
			<div class="col-md-10"> 
				<div class="input-group input-group-lg">
  					<span class="input-group-addon" id="sizing-addon1">#</span>
<?php 
if (isset($_GET['tagname'])) {
    $tagname = $_GET['tagname'];
}
echo '<input style=\'height: 45px; padding:10px; font-size: 21px\' value="' . $_GET['tagname'] . '"
	type="text" class="form-control" name=\'tagname\' placeholder="tagname" required autofocus>';
?>
コード例 #8
0
ファイル: timeline.php プロジェクト: jinxicmu/CMU-Postly
    if ($res['status'] == 0) {
        $err_msg = "<h4 style='text-align:center;'>Error posting message</h4>";
    }
}
?>
<html>
	<head>
		<title>Postly</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('timeline', $_SESSION['user']);
?>
	  <div class="row" style='border-bottom: 1px solid #ccc;'>
<?php 
echo $err_msg;
?>
		<form action='timeline.php' method='POST'>
	  <div class="row" style='padding-left: 30px; padding-right: 30px'>
			<input class="form-control" name="title" placeholder="title"></textarea>
	  </div>
	  <div class="row" style='padding-left: 30px; padding-right: 30px'>
			<textarea class="form-control" rows="4" name="message" placeholder="content"></textarea>
	  </div>
	  <div class="row" style='padding-left: 30px; padding-right: 30px; padding-top: 5px;'>
			<div class="col-md-10"></div>
			<div class="col-md-2"> <button class="btn btn-lg btn-primary btn-block" type="submit">Post</button> </div>