Skip to content
This repository was archived by the owner on May 13, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Gate Pass Digitalization.pptx
Binary file not shown.
1 change: 0 additions & 1 deletion README.md

This file was deleted.

Binary file added cbit.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions check.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php $conn = new mysqli("localhost","root","","student");
$id=$_POST["id"];
$sql = "SELECT * from pass where Rollnum='$id'";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
?>

<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
background-color:#0AF3F0;
font-size:20px;
}

td, th {
border: 1px solid #dddddd;
text-align: center;
padding: 5px;
font-size:20px;
}

</style>

<body style="background-color:#afeeee">
<title>Security Login</title>
<center>
<img src="cbit.jpg" alt="CBIT LOGO" width="100" length="100" align="left">
<h1 style="background-color:DodgerBlue ; font-size:45px; padding:20px; border:10px solid gray; margin :0; width:850px">Chaitanya Bharathi Institute of Technology</h1>
<hr>
<div align="right"><a href="">Logout</a></div>
<h3 style="background-color:#0AF3F0 ; font-size:35px; padding:10px; border:10px solid gray; margin :0; width:400px">Today's Responces</font></h3>
<br><br>
<table>
<tr>
<th>Roll number</th>
<th>Approval</th>
<th>Time</th>
</tr>

<tr>
<td><?php echo "" . $row["Rollnum"]?></td>
<td><?php echo "".$row["Approval"]?></td>
<td><?php echo "". $row["Time"]?></td>
</tr>

</center>
</body>
</head>

</html>


14 changes: 14 additions & 0 deletions conn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
$servername = "localhost";
$username = "username";
$password = "password";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
20 changes: 20 additions & 0 deletions hodapprove.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

print_r($_POST);
$arr=array_keys($_POST);
$rid=$arr[1];
$conn = new mysqli("localhost","root","","student");
if($_POST['request']=='approve')
{
$sql = "UPDATE `pass` SET `Approval`='yes' WHERE passid='$rid'";
$result = $conn->query($sql);
//echo " request is approved";

}
else{
$sql = "UPDATE `pass` SET `Approval`=\'no\' WHERE passid='$rid'";
//echo $conn->error();
$result = $conn->query($sql);
echo "request is denied";}
header('Location:hodapprove1.php');
?>
27 changes: 27 additions & 0 deletions hodapprove1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
session_start();
$uname=$_SESSION["uname"];
$conn = new mysqli("localhost","root","","student");
$sql = "SELECT * FROM `pass` WHERE pass.Branch='$uname'AND pass.Approval<>'yes' AND pass.Approval<>'no'";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {

echo "id: " . $row["Reason"]. " - Name: " . $row["Date"]. " " . $row["Time"]. "<br>";
echo "<html>";
$rid=$row["passid"];
echo"<form action='hodapprove.php' method='post'>";
echo'<input type="radio" name="request" value="approve">approve';
echo'<input type="radio" name="request" value="deny">deny';
//$_SESSION["rid"]=$rid;
////echo $rid;
echo"<input type='submit' name='$rid' value='done'/>";
echo"</form>";
echo"</html>";
}
} else {
echo "0 results";
}
?>
35 changes: 35 additions & 0 deletions hodlogin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@


<!DOCTYPE html>
<html>
<head>
<body style="background-color:#afeeee">
<title>Staff Login</title>
<center>
<img src="cbit.jpg" alt="CBIT LOGO" width="100" length="100" align="left">
<h1 style="background-color:DodgerBlue ; font-size:45px; padding:20px; border:10px solid gray; margin :0; width:850px">Chaitanya Bharathi Institute of Technology</h1>
<hr>

<h3 style="background-color:#0AF3F0 ; font-size:35px; padding:10px; border:10px solid gray; margin :0; width:400px">Staff Login</font></h3>

<form name="Staff Login" action="hodvalidate.php" method="post">
<br><br><br>

<b><font style="font-size:25px">Username:</font></b>

<input type="text" name="uname">
<br>

<b><font style="font-size:25px">Password:</font></b>

<input type="password" name="pw">
<br><br>

<input type="submit" value="Submit">

</form>
</center>
</body>
</head>

</html>
28 changes: 28 additions & 0 deletions hodvalidate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

session_start();
$db = mysqli_connect("localhost","root","","student");
if($_SERVER["REQUEST_METHOD"] == "POST") {
// username and password sent from form

$uname = $_POST['uname'];
$pw = $_POST['pw'];

$sql = "SELECT Id FROM hod WHERE Name = '$uname' and Password = '$pw'";
$result = mysqli_query($db,$sql);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
//$active = $row['active'];

$count = mysqli_num_rows($result);
$_SESSION["uname"]=$uname;

// If result matched $myusername and $mypassword, table row must be 1 row

if($count >= 1) {
header('Location:hodapprove1.php');

}else {
echo "Your Login Name or Password is invalid";
}
}
?>
31 changes: 31 additions & 0 deletions insertdb.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "student";
$uname=$_POST['uname'];
$pw=$_POST['pw'];
$uid=$_POST['uid'];
$branch=$_POST['branch'];
$year=$_POST['year'];

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

$sql = "INSERT INTO student1 (Name,Password,Rollnum,Branch,Year)
VALUES ('$uname','$pw','$uid','$branch','$year')";

if ($conn->query($sql) === TRUE) {
header('Location:login.html');
//echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>
35 changes: 35 additions & 0 deletions login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

<!DOCTYPE html>
<html>
<head>
<body style="background-color:#afeeee">
<title>Student Login</title>
<center>
<img src="cbit.jpg" alt="CBIT LOGO" width="100" length="100" align="left">
<h1 style="background-color:DodgerBlue ; font-size:45px; padding:20px; border:10px solid gray; margin :0; width:850px">Chaitanya Bharathi Institute of Technology</h1>
<hr>

<h3 style="background-color:#0AF3F0 ; font-size:35px; padding:10px; border:10px solid gray; margin :0; width:400px">Student Login</font></h3>
<center><a href="register.html"><button class="button button1" style="font-size: 40px;font-family:'Verdana';" >Register Here</button></a></center><br>
<form action="validate.php" method="post" name="Student/Staff Login" action="Login">
<br><br><br>

<b><font style="font-size:25px">Username:</font></b>

<input type="text" name="uname">
<br>

<b><font style="font-size:25px">Password:</font></b>

<input type="password" name="pw">
<br><br>

<input type="submit" value="Submit">
<br>

</form>
</center>
</body>
</head>

</html>
7 changes: 7 additions & 0 deletions logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
session_start();

if(session_destroy()) {
header("Location: login.html");
}
?>
40 changes: 40 additions & 0 deletions main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

<!DOCTYPE html>
<html>
<head>
<title>PAGE1</title>
<style>

.button {
background-color: #02061A;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
font-family:
}
.button1 {border-radius: 50%;}
</style>
</head>
<body bgcolor="#afeeee" >
<img src="cbit.png" alt="CBIT LOGO" width="100" length="100" align="left">
<center><h1 style="background-color:DodgerBlue;font-size:35px;font-family:'Verdana'; padding:20px;border:10px solid gray;margin:0;width:850px">Chaitanya Bharathi Institute Of Technology</h1></center>

<center><h1 style="font-size:px;font-family:'Verdana';background-color:DodgerBlue;">Gate-Pass </h1></center>

<center><p style="font-size:25px;font-family:'Verdana'" >Please select an option to continue:</p></center>

<center><a href="login.html"><button class="button button1" style="font-size: 40px;font-family:'Verdana';" >Student Login</button></a></center><br>

<center><a href="hodlogin.html"><button class="button button1" style="font-size: 40px;font-family:'Verdana';">Lecturer Login</button></a></center><br>

<center><a href="securitylogin.html"><button class="button button1" style="font-size: 40px;font-family:'Verdana';">Security Login</button></a></center>
<br>

</body>
</html>
44 changes: 44 additions & 0 deletions register.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

<!DOCTYPE html>
<html >
<head >
<title>STUDENT</title>

</head>
<body bgcolor="#afeeee">

<center><h1 style="background-color:DodgerBlue;font-size:30px;font-family:'Verdana'; padding:20px;border:10px solid gray;margin:0;width:850px">Chaitanya Bharathi Institute Of Technology</h1>
<h1 style="font-size:25px;font-family:'Verdana';">Registration Page</h1>
<p style="font-size:20px;font-family:'Verdana';">Enter following details and press register:</p>

<form action="insertdb.php" method="post" >
<p style=" font-family:'Verdana'; font-size: 20px">Name:</p>
<input size="20" type="text" name="uname">
<br>

<p style="font-size: 20px;font-family:'Verdana';">Roll Number:</p>
<input size="20" type="text" name="uid">
<br>

<p style="font-size: 20px;font-family:'Verdana';">password:</p>
<input size="20" type="password" name="pw">
<br>

<p style="font-size: 20px;font-family:'Verdana';">Email Address:</p>
<input size="20" type="Email" name="email">
<br>

<p style="font-size: 20px;font-family:'Verdana';">year</p>
<input type="radio" name="year" value="first">1/4<br/>
<input type="radio" name="year" value="second">2/4<br/>
<input type="radio" name="year" value="third">3/4<br/>
<input type="radio" name="year" value="fourth">4/4<br/>
<p style="font-size: 20px;font-family:'Verdana';">branch:</p>
<input type="text" name="branch" >
<br>
<br>
<input type="submit" name="">
</center>
</form>
</body>
</html>
Loading