Skip to content

Commit 0c64181

Browse files
committed
demo dataset added
1 parent 6a65f21 commit 0c64181

File tree

10 files changed

+375
-0
lines changed

10 files changed

+375
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>User Information</title>
5+
</head>
6+
<body>
7+
8+
<p align="center">All Users Informations</p>
9+
10+
<?php
11+
12+
session_start();
13+
14+
$host = "localhost";
15+
$username = "root";
16+
$password = "";
17+
$db_name = "aps";
18+
$connection = mysqli_connect($host, $username, $password) or die("Host not connected");
19+
mysqli_select_db($connection, $db_name) or die("DB not selected");
20+
21+
$sql = "SELECT * FROM user";
22+
$result = mysqli_query($connection,$sql);
23+
24+
echo '<table align="center">
25+
<th>First Name</th>
26+
<th>Last Name</th>
27+
<th>Date Of Birth</th>
28+
<th>Gender</th>
29+
<th>Email</th>';
30+
31+
while ($row = mysqli_fetch_assoc($result)) {
32+
33+
echo '<tr>
34+
<td>'.$row['firstname'].'</td>
35+
<td>'.$row['lastname'].'</td>
36+
<td>'.$row['date_of_birth'].'</td>
37+
<td>'.$row['gender'].'</td>
38+
<td>'.$row['email'].'</td>
39+
</tr>';
40+
}
41+
42+
echo '</table>';
43+
44+
?>
45+
46+
<br>
47+
48+
<p align="center"><a href="loginSuccess.php">Go Back</a></p>
49+
50+
</body>
51+
</html>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 4.5.1
3+
-- http://www.phpmyadmin.net
4+
--
5+
-- Host: 127.0.0.1
6+
-- Generation Time: Sep 09, 2017 at 09:59 PM
7+
-- Server version: 10.1.16-MariaDB
8+
-- PHP Version: 5.6.24
9+
10+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11+
SET time_zone = "+00:00";
12+
13+
14+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17+
/*!40101 SET NAMES utf8mb4 */;
18+
19+
--
20+
-- Database: `aps`
21+
--
22+
23+
-- --------------------------------------------------------
24+
25+
--
26+
-- Table structure for table `user`
27+
--
28+
29+
CREATE TABLE `user` (
30+
`id` int(11) NOT NULL,
31+
`firstname` varchar(20) NOT NULL,
32+
`lastname` varchar(20) NOT NULL,
33+
`date_of_birth` date NOT NULL,
34+
`gender` varchar(10) NOT NULL,
35+
`email` varchar(30) NOT NULL,
36+
`password` varchar(20) NOT NULL
37+
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
38+
39+
--
40+
-- Dumping data for table `user`
41+
--
42+
43+
INSERT INTO `user` (`id`, `firstname`, `lastname`, `date_of_birth`, `gender`, `email`, `password`) VALUES
44+
(1, 'farzana', 'ripa', '1993-10-07', 'female', 'ripa@gmail.com', '12345'),
45+
(2, 'Ja', 'Bin', '1994-09-14', 'female', 'jabin@gmail.com', 'abcd'),
46+
(3, 'Admin', '', '1990-01-01', '', 'admin@aps.com', 'admin123');
47+
48+
--
49+
-- Indexes for dumped tables
50+
--
51+
52+
--
53+
-- Indexes for table `user`
54+
--
55+
ALTER TABLE `user`
56+
ADD PRIMARY KEY (`id`);
57+
58+
--
59+
-- AUTO_INCREMENT for dumped tables
60+
--
61+
62+
--
63+
-- AUTO_INCREMENT for table `user`
64+
--
65+
ALTER TABLE `user`
66+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
67+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
68+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
69+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
session_start();
4+
5+
$host = "localhost";
6+
$username = "root";
7+
$password = "";
8+
$db_name = "aps";
9+
$connection = mysqli_connect($host, $username, $password) or die("Host not connected");
10+
mysqli_select_db($connection, $db_name) or die("DB not selected");
11+
12+
$email = $_POST['email'];
13+
$password = $_POST['password'];
14+
15+
$sql = "SELECT * FROM user WHERE email='$email'";
16+
$result = mysqli_query($connection, $sql);
17+
$row = mysqli_fetch_assoc($result);
18+
19+
if ($row['password']==$password){
20+
21+
$_SESSION['login_id']=$row['id'];
22+
$_SESSION['login_email']=$row['email'];
23+
24+
header("Location: loginSuccess.php");
25+
}
26+
27+
else{
28+
29+
echo "Sorry. Invalid Email or Password";
30+
}
31+
32+
?>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Login</title>
5+
</head>
6+
<body>
7+
8+
<h2 align="center">Admission Process System</h2>
9+
<h3 align="center">Please Login</h3>
10+
11+
<form align="center" method="POST" action="checkLogin.php">
12+
13+
Email:<br>
14+
<input type="email" name="email"><br>
15+
16+
Password:<br>
17+
<input type="password" name="password"><br>
18+
19+
<input type="submit" value="Submit" name="submit">
20+
21+
</form>
22+
23+
<p align="center">If you are not registered, Please <a href="registration.html">click here</a></p>
24+
25+
26+
</body>
27+
</html>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Menu</title>
5+
</head>
6+
<body>
7+
8+
<h2 align="center">Welcome</h2>
9+
10+
<?php
11+
12+
session_start();
13+
14+
$email = $_SESSION['login_email'];
15+
16+
if ($email == "admin@aps.com") {
17+
18+
echo '<p align="center">
19+
<a href="allUusersInformationView.php">View All Users Information</a>
20+
<a href="logout.php">Logout</a>
21+
</p>';
22+
}
23+
24+
else{
25+
26+
echo '<p align="center">
27+
<a href="userInformationView.php">View Information</a>
28+
<a href="logout.php">Logout</a>
29+
</p>';
30+
}
31+
32+
?>
33+
34+
</body>
35+
</html>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
session_start();
4+
5+
if(session_status()!=NULL){
6+
session_destroy();
7+
header("Location: login.html");
8+
}
9+
10+
?>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
alert(latestMessage);
2+
console.log(latestMessage);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Registation</title>
5+
</head>
6+
<body>
7+
8+
<h2 align="center">Admission Process System</h2>
9+
<h3 align="center">Register</h3>
10+
11+
<form align="center" method="POST" action="registration_action.php">
12+
First name:<br>
13+
<input type="text" name="firstname"><br>
14+
15+
Last name:<br>
16+
<input type="text" name="lastname"><br>
17+
18+
Date of Birth:<br>
19+
<input type="date" name="dob"><br>
20+
21+
Gender:<br>
22+
<input type="radio" name="gender" value="male" checked> Male<br>
23+
<input type="radio" name="gender" value="female"> Female<br>
24+
<input type="radio" name="gender" value="other"> Other<br>
25+
26+
27+
Email:<br>
28+
<input type="email" name="email"><br>
29+
30+
Password:<br>
31+
<input type="password" name="password"><br>
32+
33+
<input type="submit" value="Submit" name="submit">
34+
35+
</form>
36+
37+
<p align="center">Already registered? Please <a href="login.html">login</a></p>
38+
39+
40+
</body>
41+
</html>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
$host = "localhost";
4+
$username = "root";
5+
$password = "";
6+
$db_name = "aps";
7+
$connection = mysqli_connect($host, $username, $password) or die("Host not connected");
8+
mysqli_select_db($connection, $db_name) or die("DB not selected");
9+
10+
11+
if(isset($_POST['submit'])){
12+
13+
$firstname = $_POST['firstname'];
14+
$lastname = $_POST['lastname'];
15+
$dob = $_POST['dob'];
16+
$gender = $_POST['gender'];
17+
$email = $_POST['email'];
18+
$password = $_POST['password'];
19+
20+
$sql = "SELECT email FROM user WHERE email='$email'";
21+
$result = mysqli_query($connection, $sql);
22+
23+
if (mysqli_fetch_assoc($result)) {
24+
echo 'Sorry';
25+
}
26+
27+
else{
28+
29+
30+
$sql = "INSERT INTO user (firstname, lastname, date_of_birth, gender, email, password) VALUES ('$firstname', '$lastname', '$dob', '$gender', '$email', '$password')";
31+
$result = mysqli_query($connection, $sql);
32+
33+
34+
if ($result) {
35+
36+
header("Location: login.html");
37+
die();
38+
}
39+
40+
else {
41+
42+
echo "Sorry. Registration Failed";
43+
}
44+
}
45+
}
46+
47+
?>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>User Information</title>
5+
</head>
6+
<body>
7+
8+
<p align="center">Your Informations</p>
9+
10+
<?php
11+
12+
session_start();
13+
14+
$host = "localhost";
15+
$username = "root";
16+
$password = "";
17+
$db_name = "aps";
18+
$connection = mysqli_connect($host, $username, $password) or die("Host not connected");
19+
mysqli_select_db($connection, $db_name) or die("DB not selected");
20+
21+
$id = $_SESSION['login_id'];
22+
$sql = "SELECT * FROM user WHERE id='$id'";
23+
$result = mysqli_query($connection,$sql);
24+
$row = mysqli_fetch_assoc($result);
25+
26+
echo '<table align="center">
27+
<tr>
28+
<td>First Name</td>
29+
<td>'.$row['firstname'].'</td>
30+
</tr>
31+
<tr>
32+
<td>Last Name</td>
33+
<td>'.$row['lastname'].'</td>
34+
</tr>
35+
<tr>
36+
<td>Date of Birth</td>
37+
<td>'.$row['date_of_birth'].'</td>
38+
</tr>
39+
<tr>
40+
<td>Gender</td>
41+
<td>'.$row['gender'].'</td>
42+
</tr>
43+
<tr>
44+
<td>Email</td>
45+
<td>'.$row['email'].'</td>
46+
</tr>
47+
</table>';
48+
49+
?>
50+
51+
<br>
52+
53+
<p align="center"><a href="loginSuccess.php">Go Back</a></p>
54+
<script type="text/javascript">
55+
var latestMessage = "<?php echo $id; ?>";
56+
57+
58+
</script>
59+
<script type="text/javascript" src="new 1.js"></script>
60+
</body>
61+
</html>

0 commit comments

Comments
 (0)