-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize the login, log out and register module; integrate all the mo…
…dule into system
- Loading branch information
Showing
24 changed files
with
451 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
0 | ||
update food: update food | ||
set name = 'noodle', price = '89', description ='good' | ||
where food_id = 2 | ||
update food: update food | ||
set name = 'lobster', price = '1999', description ='hello Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.s' | ||
where food_id = 1 | ||
update food: update food | ||
set name = 'lobster', price = '986', description ='hello Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.s' | ||
where food_id = 1 | ||
update food: update food | ||
set name = 'lobster', price = '456', description ='hello Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.s' | ||
where food_id = 1 | ||
update food: update food | ||
set name = 'lobster', price = '45877', description ='hello Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.s' | ||
where food_id = 1 | ||
old user id: and old merchant id: 1 and name: guchen | ||
now user id: and now merchant id: and name: guchen | ||
old user id: 9 and old merchant id: and name: nanding | ||
now user id: and now merchant id: and name: nanding | ||
begin================ | ||
end======================= | ||
begin================ | ||
end======================= | ||
begin================ | ||
end======================= | ||
begin================ | ||
end======================= | ||
begin================ | ||
insert into malign_according values(NULL, | ||
1, | ||
'24' | ||
) | ||
end======================= | ||
begin================ | ||
insert into malign_according values(NULL, | ||
1, | ||
'25' | ||
'31' | ||
) | ||
end======================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
// include function files for this application | ||
require_once('food_galaxy_fns.php'); | ||
session_start(); | ||
|
||
|
||
//create short variable names | ||
$username = $_POST['username']; | ||
$passwd = $_POST['passwd']; | ||
$type = $_POST['type']; | ||
|
||
if ($username && $passwd) { | ||
// they have just tried logging in | ||
|
||
$id = login($username, $passwd, $type); | ||
if($id != -1){ | ||
if($type == 0) | ||
$_SESSION['valid_user'] = $id; | ||
else if($type == 1) | ||
$_SESSION['valid_merchant'] = $id; | ||
$_SESSION['name'] = $username; | ||
do_html_header('Home Page'); | ||
echo '<div class="form-group" id="success_message"> | ||
<div class="col-sm-offset-2 col-sm-8"> | ||
<div class="alert alert-success"> | ||
<h3> Log in Success! Now, you can use more service! </h3> | ||
</div> | ||
</div> | ||
</div>'; | ||
|
||
} | ||
else{ | ||
echo '<div class="form-group" id="success_message"> | ||
<div class="col-sm-offset-2 col-sm-8"> | ||
<div class="alert alert-danger"> | ||
<h3> logged in Failure. <a href="login.php">Click here to log in again</a></h3> | ||
</div> | ||
</div> | ||
</div>'; | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
|
||
|
||
do_html_footer(); | ||
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,58 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Food Galaxy Manager</title> | ||
<meta name="keywords" content=""> | ||
<meta name="description" content=""> | ||
<?php | ||
require_once('food_galaxy_fns.php'); | ||
do_html_header('Welcome to Food Galaxy, please login'); | ||
|
||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="author" content=""> | ||
<link rel="shortcut icon" href="favicon.png"> | ||
<link href="css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="https://manager.wasify.com/assets/css/public.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<div class="container container-body" id="managerLogin"> | ||
<div class="row"> | ||
<div class="col-sm-offset-4 col-sm-4 text-center"> | ||
<div style="margin-top:25%"> | ||
<div class="loginLogo"><img class="img-responsive" src="https://manager.wasify.com/assets/img/logo-big.png"></div> | ||
<div class="alert alert-danger">Wrong username or password, please try again</div> | ||
<form class="form-signin" role="form" action="login" method="post"> | ||
<div class="form-group"> | ||
<input type="email" class="form-control" id="email" name="email" maxlength="50" placeholder="Email" value=""> | ||
<input type="password" class="form-control" id="pass" name="pass" maxlength="20" placeholder="Password" value=""> | ||
</div> | ||
<button type="submit" class="btn btn-lg btn-success btn-block" name="commandLogin" value="1">Login</button> | ||
<div class="loginLinks"> | ||
<a href="#">Forgotten password?</a> | ||
<br><a href="#" rel="nofollow" data-toggle="modal" data-target="#signUp">Not a user yet? Try Food Galaxy!</a> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
//display_site_info(); | ||
?> | ||
|
||
|
||
|
||
<div class = "container"> | ||
<form class="form-horizontal" method="post" action="home.php"> | ||
<div class="form-group"> | ||
<label for="inputEmail3" class="col-sm-2 control-label">Username</label> | ||
<div class="col-sm-10"> | ||
<input type="text" class="form-control" name="username" placeholder=""> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="inputPassword3" class="col-sm-2 control-label">Password</label> | ||
<div class="col-sm-10"> | ||
<input type="password" class="form-control" name="passwd" placeholder=""> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="inputEmail3" class="col-sm-2 control-label">Login as:</label> | ||
<div class="col-sm-10"> | ||
<select class="form-control" name="type"> | ||
<option value="0">Customer</option> | ||
<option value="1">Merchant</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<div class="checkbox"> | ||
<label> | ||
<input type="checkbox"> Remember me | ||
</label> | ||
<label for="inputEmail3" class=" control-label"><a href="register_form.php"><b>Not a member?</b></a></label> | ||
<label for="inputEmail3" class=" control-label"><a href="forgot_form.php"><b>Forgot your password?</b></a></label> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<button type="submit" class="btn btn-primary">Sign in</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
|
||
<?php | ||
do_html_footer(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,75 @@ | ||
<?php | ||
require_once('food_galaxy_fns.php'); | ||
do_html_header(''); | ||
do_html_header('Welcome to Food Galaxy, please login'); | ||
|
||
display_site_info(); | ||
display_login_form(); | ||
//display_site_info(); | ||
?> | ||
|
||
<p><a href="register_form.php">Not a member?</a></p> | ||
<form method="post" action="home.php"> | ||
<table bgcolor="#cccccc"> | ||
<tr> | ||
<td colspan="2">Members log in here:</td> | ||
<tr> | ||
<td>Username:</td> | ||
<td><input type="text" name="username"/></td></tr> | ||
<tr> | ||
<td>Password:</td> | ||
<td><input type="password" name="passwd"/></td></tr> | ||
<tr> | ||
<td colspan="2" align="center"> | ||
<input type="submit" value="Log in"/></td></tr> | ||
<tr> | ||
<td colspan="2"><a href="forgot_form.php">Forgot your password?</a></td> | ||
</tr> | ||
</table></form> | ||
|
||
<div class = "container"> | ||
<form class="form-horizontal" method="post" action="home.php"> | ||
<div class="form-group"> | ||
<label for="inputEmail3" class="col-sm-2 control-label">Username</label> | ||
<div class="col-sm-10"> | ||
<input type="text" class="form-control" name="username" placeholder=""> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="inputPassword3" class="col-sm-2 control-label">Password</label> | ||
<div class="col-sm-10"> | ||
<input type="password" class="form-control" name="passwd" placeholder=""> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="inputEmail3" class="col-sm-2 control-label">Login as:</label> | ||
<div class="col-sm-10"> | ||
<select class="form-control" name="type"> | ||
<option value="0">Customer</option> | ||
<option value="1">Merchant</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<div class="checkbox"> | ||
<label> | ||
<input type="checkbox"> Remember me | ||
</label> | ||
<label for="inputEmail3" class=" control-label"><a href="register_form.php"><b>Not a member?</b></a></label> | ||
<label for="inputEmail3" class=" control-label"><a href="forgot_form.php"><b>Forgot your password?</b></a></label> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<button type="submit" class="btn btn-primary">Sign in</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
|
||
<?php | ||
do_html_footer(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
session_start(); | ||
unset($_SESSION['valid_user']); | ||
unset($_SESSION['valid_merchant']); | ||
unset($_SESSION['name']); | ||
session_destroy(); | ||
|
||
require_once('food_galaxy_fns.php'); | ||
do_html_header('You have logged out'); | ||
?> | ||
|
||
<?php | ||
do_html_footer(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.