And Run Main - PHP Create Data Base in Mysql From Placementdb - SQL File
And Run Main - PHP Create Data Base in Mysql From Placementdb - SQL File
main.php.....................................................................................................................................................2
admdash.php...............................................................................................................................................4
adminlogin.php...........................................................................................................................................6
AdmnJobResult.php....................................................................................................................................7
applyjob.php................................................................................................................................................8
check.php....................................................................................................................................................9
checkers.php.............................................................................................................................................10
chngpwd.php.............................................................................................................................................12
CreateJob.php...........................................................................................................................................13
dispStuList.php..........................................................................................................................................15
logout.php.................................................................................................................................................17
NewUser.php.............................................................................................................................................18
saveAppJob.php........................................................................................................................................19
savedata.php.............................................................................................................................................20
savepwd.php.............................................................................................................................................22
saveresult.php...........................................................................................................................................23
saveStu.php...............................................................................................................................................24
saveuser.php.............................................................................................................................................26
showdata.php............................................................................................................................................27
studash.php...............................................................................................................................................29
studetails.php............................................................................................................................................31
stulogin.php...............................................................................................................................................33
style.css.....................................................................................................................................................34
placementdb.sql........................................................................................................................................38
NOTE: Create the files with the names mentioned in a folder in xampp/htdocs
and run main.php
</head>
<body>
<link href="style.css" rel="stylesheet" type="text/css">
<div class="container">
<div class="top-menu">
College Placement System
</div>
<div class="login-menu">
<a href="stulogin.php">Student Login</a>  <a href="Adminlogin.php">Admin
Login</a>      
</div>
<?php
$con=mysqli_connect("localhost","root","","placementdb");
$qry="select * from placement_tbl where expDate>'".date("Y-m-d")."'";
$run=mysqli_query($con,$qry);
while ($rows=mysqli_fetch_array($run))
{
echo "<div class=\"jobbox\">";
echo "<h3>".$rows['JobID'].". ".$rows['JobDesc']."</h3>"." <p><font color=red> Last
Date for Applying :".$rows['ExpDate']."</font></p>" ;
echo "<b>Company:</b>".$rows['CompanyName']."<br>";
echo "<b>Location:</b>".$rows['Location']."<br>";
echo "<b>Date of Interview:</b>".$rows['InterviewDate']."<br>";
echo "<b>Stream:</b>".$rows['Stream']."      <b>Salary
Package:</b>".$rows['SalPackage']."<br>";
echo "<b>Qualification:</b>".$rows['Qualification']."     
<b>Other Requirements:</b>".$rows['OtherReq']."<br>";
echo "</div>";
}
?>
</div>
</body>
</html>
admdash.php
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#newJob").click(function(){
$("#contents").load("CreateJob.php");
});
$("#newUser").click(function(){
$("#contents").load("NewUser.php");
});
$("#ChangePwd").click(function(){
$("#contents").load("chngpwd.php");
});
$("#UpdateRes").click(function(){
$("#contents").load("AdmnJobResult.php");
});
});
</script>
</head>
<body>
<link href="style.css" rel="stylesheet" type="text/css">
<div class="container">
<div class="top-menu">
College Placement System
</div>
<div class="login-menu">
<a href="logout.php"><?php session_start(); echo $_SESSION['username'];?
> Logout</a>      
</div>
<div class="clearfix">
<div class="left-menu">
<div class="listItem"><a id="newJob" href="#"> Create a New Job</a></div>
<div class="listItem"><a id="newUser" href="#"> Add a New user</a></div>
<div class="listItem"><a id="ChangePwd" href="#">Change password</div>
<div class="listItem"><a id="UpdateRes" href="#">Update Result</div>
</div>
<div class="dataform" ">
<div class="form-data" id="contents" style=" box-shadow: 10px 10px lightgrey;">
</div>
</div>
</div>
</div>
</body>
</html>
adminlogin.php
<html>
<body>
<link href="style.css" rel="stylesheet" type="text/css">
<div class="container">
<div class="top-menu">
College Placement System
</div>
<form method="post" action="check.php">
<div class="loginblock"><center>
<font style="font-size:20px; font-weight:bold;"> Admin Login</font><br><br><br><br>
User Name:<input type="string" name="uname"><br><br>
Password:<input type="password" name="pwd"><br><br>
<input type="hidden" name="usertype" value="A">
<input type="submit" name="submit" name="submit"><br><br><br></center>
</div>
</form>
</div>
</body>
</html>
AdmnJobResult.php
<html>
<body>
<form method = "post" action="dispStuList.php" >
<table align="center" border="1" width="100%">
<tr>
<td><div class="labl">Job: </div></td>
<td>
<?php
$con=mysqli_connect("localhost","root","","placementdb");
$qry="select JobID, JobDesc from placement_tbl";
$run=mysqli_query($con,$qry);
echo '<select name="jid">';
while ($rows=mysqli_fetch_array($run))
{
</td>
</tr>
</form>
</body>
</html>
applyjob.php
<html>
<body>
<form method = "post" action="saveAppJob.php">
<table align="center" border="1" width="70%">
<tr>
<td><div class="labl">Job: </div></td>
<td>
<?php
$con=mysqli_connect("localhost","root","","placementdb");
$qry="select JobID, JobDesc from placement_tbl";
$run=mysqli_query($con,$qry);
echo '<select name="jid">';
while ($rows=mysqli_fetch_array($run))
{
}
?>
</td>
</tr>
<th colspan="2" style="background-color:#0055CC;" > <input type = "submit" name = "submit"
value="Save Details" style="font-size:16px;font-weight:bold; padding:5px;color: #0055CC; text-shadow:
2px 2px 4px orange;" > </th>
</table>
</form>
</body>
</html>
check.php
<form method="get">
<?php
$conn = mysqli_connect("localhost", "root", "","placementDB");
mysqli_close($conn);
?>
</form>
checkers.php
session_start();
$un=$_SESSION['username'];
?>
</table>
chngpwd.php
<html>
<body>
<form method = "post" action="savepwd.php">
<table align="center" border="1" width="70%">
<tr>
<td><div class="labl">Old Password: </div></td>
<td><input type="password" name="oldpwd" ></td>
</tr>
<tr>
<td><div class="labl">New Password: </div></td>
<td><input type="password" name="newpwd" ></td>
</tr>
<tr>
<td><div class="labl">Confirm New Password: </div></td>
<td><input type="password" name="cnewpwd" ></td>
</tr>
</form>
</body>
</html>
CreateJob.php
<html>
<body>
<form method = "post" action ="savedata.php">
<table align="center" border="1" width="70%">
</form>
</body>
</html>
dispStuList.php
<html>
<body>
<form method = "post" action ="savedata.php">
<table align="center" border="1" width="70%">
</form>
</body>
</html>
logout.php
<?php
session_start();
session_destroy();
//echo "<script>alert('Logout successful');</script>";
header('refresh:0;url=http://localhost:8088/placement/main.php');
?>
NewUser.php
<html>
<body>
<form method = "post" action="saveuser.php">
<table align="center" border="1" width="70%">
<tr>
<td><div class="labl">User Name: </div></td>
<td><input type="string" name="username" ></td>
</tr>
<tr>
<td><div class="labl">Password: </div></td>
<td><input type="password" name="password" ></td>
</tr>
<tr>
<td><div class="labl">User Type: </div></td>
<td><input type="radio" name="userType" value="admin"> Admin<input type="radio"
name="userType" value="student">Student
</td>
</tr>
</form>
</body>
</html>
saveAppJob.php
<?php
$con=mysqli_connect("localhost","root","","placementdb");
session_start();
$sid=$_SESSION['username'];
$jid=$_POST['jid'];
$qry="insert into jobapply_tbl (StuID, JobID) values ('$sid',$jid)";
if (mysqli_query($con,$qry)==true)
{
?>
savedata.php
<?php
if(isset($_POST['submit']))
{
$con=mysqli_connect("localhost","root","","placementdb");
$run=mysqli_query($con,$qry);
while ($rows=mysqli_fetch_array($run))
{
$jid=$rows[0];
}
if (mysqli_query($con,$qry)==true)
{
//echo $qry;
echo "<script>alert('Data saved');</script>";
header('refresh:0;url=http://localhost:8088/placement/admdash.php?
uname='.$un);
}
else
{
//echo $qry;
echo "<script>alert('could not save data');</script>";
header('refresh:0;url=http://localhost:8088/placement/admdash.php?uname='.
$un);
}
}
else
{
echo "<script>alert('fields cannot be left empty');</script>";
header('refresh:0;url=http://localhost:8088/placement/admdash.php?uname='.$un);
}
}
?>
savepwd.php
<?php
$con=mysqli_connect("localhost","root","","placementdb");
session_start();
$sid=$_SESSION['username'];
$opwd=$_POST['oldpwd'];
$npwd=$_POST['newpwd'];
$cnpwd=$_POST['cnewpwd'];
if ($npwd!=$cnpwd)
{
echo "<script>alert('password do not match');</script>";
header('refresh:0;url=http://localhost:8088/placement/studash.php?uname='.$sid);
}
else
{
$qry="update users set password='$npwd' where username='$sid'" ;
if (mysqli_query($con,$qry)==true)
{
?>
saveresult.php
<?php
if(isset($_POST['submit']))
{
$con=mysqli_connect("localhost","root","","placementdb");
session_start();
$un=$_SESSION['username'];
$jid=$_POST["jobid"];
$res=$_POST["result"];
foreach ($res as $r )
{
$qry="update jobapply_tbl set qualified=1 where JobID='$jid' and StuID='$r'";
$a=mysqli_query($con,$qry);
}
if ($a==true)
{
//echo $qry;
echo "<script>alert('Data saved');</script>";
header('refresh:0;url=http://localhost:8088/placement/admdash.php?
uname='.$un);
}
else
{
//echo $qry;
echo "<script>alert('could not save data');</script>";
header('refresh:0;url=http://localhost:8088/placement/admdash.php?uname='.
$un);
}
}
?>
saveStu.php
<?php
if(isset($_POST['submit']))
{
$con=mysqli_connect("localhost","root","","placementdb");
if (mysqli_query($con,$qry)==true)
{
if (mysqli_query($con,$qry)==true)
{
?>
showdata.php
<form method = "post" action ="saveresult.php" >
<table border="1">
<tr>
<th>User name</th>
<th>Student ID</th>
<th>student Name</th>
<th>Result</th>
</tr>
<?php
$con=mysqli_connect("localhost","root","","placementdb");
if(isset($_POST['submit']))
{
$jid=$_POST['jid'];
$("#stuDetails").click(function(){
$("#contents").load("stuDetails.php");
});
$("#ApplyJob").click(function(){
$("#contents").load("applyjob.php");
});
$("#CheckRes").click(function(){
$("#contents").load("checkres.php");
});
$("#ChangePwd").click(function(){
$("#contents").load("chngpwd.php");
});
});
</script>
</head>
<body>
<link href="style.css" rel="stylesheet" type="text/css">
<div class="container">
<div class="top-menu">
College Placement System
</div>
<div class="login-menu">
<?php
session_start();
$un=$_SESSION["username"];
echo '<a href="logout.php">'.$un.' Logout</a>      ';
?>
</div>
<div class="clearfix">
<div class="left-menu">
<div class="listItem"><a id="stuDetails" href="#">Enter Your Details</a></div>
<div class="listItem"><a id="ApplyJob" href="#">Apply for a Job</a></div>
<div class="listItem"><a id="CheckRes" href="#">Check Interview Result</a></div>
<div class="listItem"><a id="ChangePwd" href="#">Change password</a></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
studetails.php
<html>
<body>
<form method = "post" action="saveStu.php">
<table align="center" border="1" width="70%">
</form>
</body>
</html>
stulogin.php
<html>
<link href="style.css" rel="stylesheet" type="text/css">
<body>
<form method="post" action="check.php">
<div class="container">
<div class="top-menu">
College Placement System
</div>
<div class="loginblock"><center>
<font style="font-size:20px; font-weight:bold;"> Student Login</font><br><br><br><br>
User Name:<input type="string" name="uname"><br><br>
Password:<input type="password" name="pwd"><br><br>
<input type="hidden" name="usertype" value="S">
<input type="submit" name="submit" name="submit"><br><br><br></center>
</div>
</div>
</form>
</body>
</html>
style.css
.container
{
background-color: #ffffff;
width:100%;
height:100%;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
.left-menu
{
width:15%;
height:90%;
background-color: #99BBBB;
padding-top:10px;
padding-left:10px;
padding-right:0px;
float: left;
border: 2px solid #005544;
}
.top-menu
{
width:100%;
height:5%;
background-color: #FF6622;
float:top;
text-align:center;
font-family:verdana;
font-size:24;
text-transform:float;
font-weight: bold;
padding-top:10px;
text-shadow: 1px 1px #dddddd;
}
.listItem
{
font-family:verdana;
font-size:14;
text-transform:float;
font-weight: bold;
padding-top:10px;
padding-bottom:10px;
background-color:#99BBCC;
border-bottom: 4px solid #0055CC;
}
.dataform
{
width:80%;
height:90%;
font-family:verdana;
font-size:12;
padding-top:10px;
padding-bottom:10px;
padding-left:5px;
background-color:#ffffff;
border: 2px solid #005544;
float: right;
}
.form-data
{
width:90%;
height:80%;
border: 2px solid #ffffff;
background-color: #99dddd;
padding-top:10px;
padding-bottom:10px;
padding-left:5px;
margin-top: 50px;
margin-bottom: 50px;
margin-right: 50px;
margin-left: 50px;
}
.labl
{
font-family:verdana;
font-size:14;
font-weight: bold;
}
table
{
margin-top: 50px;
border-color:#99aaaa;
border-collapse: collapse;
}
tr{
height: 50px;
}
th
{
text-align:center;
padding: 10px;
background-color:#ddddee;
}
td {
text-align: left;
}
.jobbox
{
width:60%;
height:200px;
border: 2px solid ;
background-color: #ffffff;
padding-top:5px;
padding-bottom:5px;
padding-left:5px;
margin-top: 20px;
margin-bottom: 20px;
border-color:#99aaaa;
border-collapse: collapse;
margin-left: 20%;
border-style: ridge;
border-width: 2px 10px 4px 20px;
}
.login-menu
{
width:100%;
height:2%;
background-color: #1111cc;
float:top;
text-align:right;
font-family:verdana;
font-size:12;
padding-top:10px;
padding-bottom:10px;
color: #FFffff;
}
a:link {
color: white;
}
/* visited link */
a:visited {
color: white;
}
.loginblock
{
width:20%;
height:200px;
border: 2px solid ;
background-color: #ffffff;
padding:30px 30px 30px 30px;
margin-top: 10%;
border-color:#33aaaa;
border-collapse: collapse;
margin-left: 35%;
border-style: ridge;
border-width: 2px 10px 4px 20px;
text-align:center;
font-family:verdana;
font-size:16px;
}
placementdb.sql
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 28, 2019 at 06:35 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
--
-- Database: `placementdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `jobapply_tbl`
--
-- --------------------------------------------------------
--
-- Table structure for table `placement_tbl`
--
-- --------------------------------------------------------
--
-- Table structure for table `stureg_tbl`
--
-- --------------------------------------------------------
--
-- Table structure for table `users`
--