Commit 3d740a56 authored by Kunal Krishna's avatar Kunal Krishna

final submission

parents
*{
font-family: 'Montserrat', sans-serif;
box-sizing: border-box;
}
body{
letter-spacing: 2px;
background-color: #edecea;
}
li{
color: #53514f;
font-size:25px;
}
h4{
text-decoration: none;
color: #e88924 ;
}
h2{
text-decoration: none;
color: #e88924 ;
}
a{
text-decoration: none;
color: #53514f;
}
td{
color: #53514f;
}
hr{
border:3px solid;
border-width: 30;
}
#title{
color: #e88924 ;
}
#maintitle{
font-size: 30px;
color: #e88924;
font-family: 'Montserrat', sans-serif;
padding:0;
align-content: center;
}
#maintitle p{
font-size: 20px;
color:black;
}
#para{
font-size: 20px;
padding-left:10px;
padding-right:30px;
padding-top:5px;
color:#94908c;
}
#para1{
font-size: 20px;
text-align: center;
margin-top: 50px;
vertical-align: center;
padding-left:30px;
padding-right:30px;
padding-top:15px;
color:#080814
}
.border{
border: 1px solid red;
}
.header img{
height:78px;
width:78px;
padding:5px;
}
.topnav a {
float: left;
color: #e88924;
background-color: #0e0e0d;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
font-family: 'Nunito', sans-serif;
font-family: 'Roboto Mono', monospace;
}
.header{
position: fixed;
padding-top: 10px;
padding-bottom: 10px;
padding-right: 10px;
margin-right: 0px;
width:100%;
background-color: #0e0e0d;
text-align: left;
font-family: 'Nunito', sans-serif;
font-family: 'Roboto Mono', monospace;
}
.header a:link{
text-decoration:none;
}
.header a:hover{
color: #e88924;
background-color: #e5e4e3;
}
.header_nobg{
position: fixed;
padding-top: 15px;
padding-bottom: 15px;
padding-right: 15px;
margin-right: 10px;
margin-bottom: 25px;
width:100%;
text-align: right;
font-family: 'Nunito', sans-serif;
font-family: 'Roboto Mono', monospace;
}
.footer{
position: fixed;
padding-top: 5px;
padding-bottom: 5px;
left:0;
bottom:0;
width:100%;
background-color: #0e0e0d;
text-align: center;
}
.icons img{
height:28px;
width:28px;
padding:5px;
}
.main{
padding:10px;
}
.main a{
text-decoration:none;
}
.main a:hover{
color: #e67f11 ;
}
.main img{
max-width:100%;
height:auto;
}
.sidenav{
height: 100%;
float: left;
background-color: #0e0e0d;
padding-top: 25px;
text-align: center;
}
.sidenav ul{
list-style-type: none;
margin: 0;
padding: 20px;
}
.sidenav li{
padding: 20px;
}
.sidenav a{
text-decoration:none;
font-size:20px;
color: #f9f7f4;
display: block;
}
.sidenav a:hover{
color: #e67f11 ;
}
@media only screen and (min-device-width: 320px) and (max-height: 480px) {
.main{
float: left;
}
}
#postlink{
display: block;
background: #fbfcfc ;
box-shadow: 0 0 2em 0 rgba(0, 0, 0, 0.2);
padding: 2em;
margin: 0 2em;
border-bottom: 1em solid #FF5733;
}
#postlink:hover{
color: #FF5733;
}
#postlink a{
text-decoration:none;
}
#seniorlink{
display: block;
background: #fbfcfc ;
box-shadow: 0 0 2em 0 rgba(0, 0, 0, 0.2);
padding: 2em;
margin: 0 2em;
border-bottom: 1em solid #900C3F ;
}
#seniorlink a{
text-decoration:none;
}
#seniorlink:hover{
color: #900C3F;
}
.green-textarea textarea.md-textarea:focus:not([readonly]) {
border-bottom: 1px solid #2ecc71;
box-shadow: 0 1px 0 0 #2ecc71;
}
.active-green-textarea.md-form label.active {
color: #2ecc71;
}
.active-green-textarea.md-form textarea.md-textarea:focus:not([readonly])+label {
color: #2ecc71;
}
#loginh2{
color: #2ecc71;
text-transform: uppercase;
font-weight: 200;
}
.anchor{
color: #0b5345 ;
}
#post_headings{
color: #53514f;
font-size: 20px;
padding-left:20px;
padding-right:20px;
}
#post_subheadings{
color: #080814;
font-size: 18px;
padding-left:20px;
padding-right:20px;
}
#post_body{
font-size: 20px;
vertical-align: center;
padding-left:20px;
padding-right:20px;
color:#94908c;
}
#post_company{
color: #53514f;
font-size: 20px;
padding-left:20px;
padding-right:20px;
}
#cse h6,h5{
color: #e88924;
text-decoration: none;
}
.card{
box-shadow: 0 0 1em 0 rgba(0, 0, 0, 0.2);
padding: 0em;
margin: 0em;
}
.navbar{
position:fixed;
background-color: #0e0e0d;
text-size:14px;
font-family: 'Nunito', sans-serif;
font-family: 'Roboto Mono', monospace;
}
#nav_icon{
width: 72px;
height:auto;
}
hr.line{
border: 2px solid;
color:#080814;
}
hr.lineform{
border: 2px solid;
color:#080814;
}
@media only screen and (max-width: 480px) {
#title {
display: none;
}
#iLinks{
display: none;
}
.whole{
margin-left: 25px;
margin-right: 25px;
margin-top: 10px;
padding-top: 10px;
}
}
\ No newline at end of file
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
/*background: #fdebd0;*/
background: radial-gradient( circle 939px at 94.7% 50%, rgba(0,178,169,1) 0%, rgba(0,106,101,1) 76.9% );
/*background-image: radial-gradient( circle 321px at 8.3% 75.7%, rgba(209,247,241,1) 0%, rgba(249,213,213,1) 81% );*/
}
.container{
position: absolute;
max-width: 800px;
height: 500px;
margin: auto;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.myLeftCtn{
position: relative;
background: #17202a;
border-radius: 25px;
height: 100%;
width: 100%;
padding: 25px;
padding-left: 50px;
border-bottom: 1em solid #E88924;
}
.myLeftCtn header{
color: #E88924;
font-size: 24px;
font-weight: 700;
margin-bottom: 20px;
}
.row{
height: 100%;
}
.myCard{
position: relative;
background: #17202a;
height: 100%;
border-radius: 25px;
-webkit-box-shadow: 0 1em 4em 1em rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 1em 4em 1em rgba(0, 0, 0, 0.5);
box-shadow: 0 1em 4em 1em rgba(0, 0, 0, 0.5);
}
.box{
position: relative;
margin: 20px;
margin-bottom: 100px;
}
.myLeftCtn .myInput{
width: 230px;
border-radius: 10px;
padding: 10px;
padding-left: 50px;
border: 2px solid #3498db;
-webkit-box-shadow: 0px 10px 49px -14px rgba(0, 0, 0, 0.7);
-moz-box-shadow: 0px 10px 49px -14px rgba(0, 0, 0, 0.7);
box-shadow: 0px 10px 49px -14px rgba(0, 0, 0, 0.7);
background-color: #fff;
}
.myLeftCtn .myInput:focus {
outline: none;
border-color: #e88924;
}
.myForm .dropdown{
position: relative;
margin-top: 50px;
}
.myLeftCtn .butt{
background: linear-gradient(45deg, #e88924, #eda252);
color: #fff;
width: 230px;
border: none;
border-radius: 10px;
padding: 10px;
-webkit-box-shadow: 0px 10px 41px -11px rgba(0, 0, 0, 0.7);
-moz-box-shadow: 0px 10px 41px -11px rgba(0, 0, 0, 0.7);
box-shadow: 0px 10px 41px -11px rgba(0, 0, 0, 0.7);
}
.myLeftCtn .butt:hover{
background: linear-gradient(45deg, #f1b97d, #f7d6b2);
}
.myLeftCtn .butt:focus{
outline: none;
}
.myLeftCtn .fas{
position: relative;
color: #191919;
left: 36px;
}
.container {
padding: 2rem 0rem;
}
@media (min-width: 576px) {
.modal-dialog {
max-width: 400px;
}
.modal-dialog .modal-content {
padding: 1rem;
}
}
.modal-header .close {
margin-top: -1.5rem;
}
.form-title {
margin: -2rem 0rem 2rem;
}
.btn-round {
border-radius: 1rem;
}
.delimiter {
padding: 1rem;
}
.signup-section {
padding: 0.3rem 0rem;
}
\ No newline at end of file
table{
border-collapse: collapse;
border-spacing: 0;
width: 100%;
border: 1px solid #ddd;
}
th, td{
text-align: left;
padding: 8px;
}
th{
background-color: gray;
}
tr:nth-child(even){background-color: #E6DEDC;}
.editbtn{
transition: all linear 0.2s;
background:#66ad44;
border:none;
font-size: 13px;
line-height: 22px;
border-radius: 0;
padding: 6px 14px;
font-family: 'Montserrat', sans-serif;
border-radius: 2px;
color: white;
}
.editbtn a{
text-decoration: none;
color: black;
}
.delbtn{
transition: all linear 0.2s;
background: #FC0527;
border: none;
font-size: 13px;
line-height: 22px;
border-radius: 0;
padding: 6px 14px;
font-family: 'Montserrat', sans-serif;
border-radius: 2px;
color: white;
}
.delbtn a{
text-decoration: none;
color: #FEFEFE;
}
<?php
include 'server.php';
session_start();
// error_reporting(1);
if(isset($_SESSION['loggedin']))
{
$error = array();
$id = $_GET['id'];
$sql = "DELETE FROM posts WHERE id = '$id'";
if (mysqli_query($db, $sql)) {
header("location: seeyourposts.php");
} else {
echo "Error deleting record: " . mysqli_error($conn);
}
mysqli_close($db);
}
?>
<?php include('server.php'); ?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>َLogin</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<form class="box" action="demologin.php" method="post">
<h1>Login</h1>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<input type="submit" name="login_user" value="Login">
<a href="demoreg.php" class="anchor">New User?</a>
</form>
</body>
</html>
<?php include('server.php') ?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/styles/normalize.css">
<link rel="stylesheet" href="assets/styles/main.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<title>َRegistration Form</title>
<link rel="stylesheet" href="css/style_demoreg.css">
<script type="text/javascript">
function pswcheck(){
var a = document.getElementById("password").value;
var b = document.getElementById("confirm_password").value;
if(a != b){
document.getElementById('msg1').innerHTML="**Password did'n matched";
return false;
}
}
</script>
</head>
<body>
<div class="container">
<div class="myCard">
<div class="row">
<div class="col-md-12">
<div class="myLeftCtn">
<form action="demoreg.php" class="myForm text-center" method="post" onsubmit="return pswcheck()">
<?php include('error.php'); ?>
<header>Create new Account</header>
<div class="form-group">
<i class="fas fa-user"></i>
<input class="myInput" type="text" name="name" value="" placeholder="Name" id="firstname" required>
<div class="invalid-feedback">Please fill out this field</div>
</div>
<div class="form-group">
<i class="fas fa-user"></i>
<input class="myInput" type="text" name="roll" value="" placeholder="Roll Number" id="lastname" required>
<div class="invalid-feedback">Please fill out this field</div>
</div>
<div class="form-group">
<i class="fas fa-envelope"></i>
<input class="myInput" type="email" name="email" value="" placeholder="Email" id="email" required>
<div class="invalid-feedback">Please fill out this field</div>
</div>
<div class="form-group">
<i class="fas fa-graduation-cap"></i>
<select class="myInput" id="dropdown" data-target="province" name="branch" required>
<option value="-1">SELECT BRANCH</option>
<option>Computer Science</option>
</select>
<div class="invalid-feedback">Please fill out this field</div>
</div>
<div class="form-group">
<i class="fas fa-lock"></i>
<input class="myInput" type="password" name="password1" value="" placeholder="Password" id="password" required>
<div class="invalid-feedback">Please fill out this field</div>
</div>
<div class="form-group">
<i class="fas fa-lock"></i>
<input class="myInput" type="password" name="password2" value="" placeholder="Confirm Password" id="confirm_password" required><br><span id="msg1" style="color: red"></span>
<div class="invalid-feedback">Please fill out this field</div>
</div>
<input class="butt" type="submit" name="submit" value="CREATE ACCOUNT"><br>
<a href="index.php" class="anchor">already have account?</a>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
This diff is collapsed.
<?php
include('server.php');
if(!$_SESSION['loggedin']) {
header("location: index.php");
}
$a = $_GET['posts_id'];
echo "<pre/>";
print_r($_GET);
if(isset($_POST['update'])) {
// update code below
// $a = $_SESSION['posts_id'];
// echo "<pre/>";
// print_r($a);
// die;
$name = mysqli_real_escape_string($db, $_POST['name']);
$roll = mysqli_real_escape_string($db, $_POST['roll']);
$email = mysqli_real_escape_string($db, $_POST['email']);
$coursetaken = mysqli_real_escape_string($db, $_POST['coursetaken']);
$company = mysqli_real_escape_string($db, $_POST['companyname']);
$story = mysqli_real_escape_string($db, $_POST['story']);
$student_id = mysqli_real_escape_string($db, $_POST['student_id']);
// $roundprovided = mysqli_real_escape_string($db, $_POST['roundprovided']);
// $roundprovided = $_POST['roundprovided'];
$roundprovided = implode(",", $_POST['roundprovided']);
$roundcleared = implode(",", $_POST['roundcleared']);
// echo $story;
// die;
$created = date('Y-m-d H:i:s');
$sql = "UPDATE posts SET name = '$name',roll = '$roll' , email = '$email', coursetaken = '$coursetaken',companyname='$company',story='$story',roundprovided='$roundprovided',roundcleared='$roundcleared',created_at='$created' WHERE id=$a";
// die;
$result = mysqli_query($db, $sql);
header("location: profile.php");
}
?>
\ No newline at end of file
<?php if(count($error)>0): ?>
<div>
<?php
foreach ($error as $errors) : ?>
<p><?php echo $errors ?></p>
<?php endforeach; ?>
</div>
<?php endif ?>
\ No newline at end of file
<?php include('experience.php'); ?>
<?php
include('server.php');
if(isset($_SESSION['loggedin']))
{
$user_email = $_SESSION['Logged_email'];
$student_id = $_SESSION['id'];
$name = $_SESSION['name'];
$roll = $_SESSION['roll'];
// die;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Placement Experience | Share</title>
<!-- Bootstrap -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!--user icon -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@800&family=Roboto+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="row">
<div class="col-sm-3" style="left:0px;">
<div class="container-fluid sidenav">
<a href="mainpage.php"><img src="img/logoo.png" style="width:100px; margin-top:15px;"></a>
<br><br>
<div id="cse">
<a style="text-decoration: none;" href="https://www.cse.iitb.ac.in" target="_blank">
<h6 style="text-align: center;">Department of</h6>
<h6 style="text-align: center;">Computer Science and Engineering</h6>
<h5 style="text-align: center;">IIT Bombay</h5>
</a>
</div>
<br><br>
<ul>
<li><a href="mainpage.php"> HOME </a></li>
<li><a href="posts.php"> POSTS </a></li>
<li><a href="exp_form.php">SHARE</a></li>
<li><a href="profile.php"> PROFILE </a></li>
</ul>
<br><br>
<div id="iLinks">
<h5>Important Links</h5>
<ul>
<li style="font-size:10px;"><a href="http://www.iitb.ac.in/" target=_blank> IITB Home</a></li>
<li style="font-size:10px;"><a href="https://www.cse.iitb.ac.in/"> CSE@IITB </a></li>
<li style="font-size:10px;"><a href="https://asc.iitb.ac.in/"> ASC </a></li>
</ul>
</div>
<br><br>
</div>
</div>
<div class="container-fluid col-md-8 whole" style="margin-top:0px;">
<div class="row">
<div class="col-sm-8 main" id="title">
<img src="img/heading_trans.png" alt="placementExperience" style="align-content: center; margin-left: 25%; margin-right: 25%;">
</div>
<div class="col-sm-4" style="left:0px; padding-top:20px; vertical-align: center;">
<button id="logout" type="button" class="btn btn-info btn-round" style="float:right;">
Logout
</button>
<a href="profile.php"><i class="fa fa-user-circle-o" style="font-size:36px; float:right; padding-right:10px;" ></i></a>
</div>
</div>
<hr class="lineform">
<h2 style="text-align: center;"><b>Experience Form</b></h2>
<br>
<div class="bg-white p-5 mb-5">
<form action="experience.php" method="post">
<div class="form-group">
<label for="name">Name:</label>
<input type="hidden" name="student_id" value="<?= ($student_id) ?: $student_id ?>">
<input type="text" class="form-control" placeholder="Enter full name" id="name" name="name" required value="<?= ($name) ?: $name ?>" readonly>
</div>
<div class="form-group">
<label for="roll">Roll No:</label>
<input type="text" class="form-control" placeholder="Enter CSE Roll number" id="roll" name="roll" required value="<?= ($roll) ?: $roll ?>" readonly>
</div>
<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" placeholder="Enter email" id="email" name="email" required value="<?= ($user_email) ?: $user_email ?>" readonly>
</div>
<div class="form-group">
<label for="course">Courses Taken (all semesters):</label>
<input type="text" class="form-control" placeholder="Enter comma separated course codes ( eg: CS601,CS725 )" id="course" name="coursetaken" required>
</div>
<div class="form-group">
<label for="company">Company Name:</label>
<input type="text" class="form-control" placeholder="Enter company's official name" id="company" name="companyname" required>
</div>
<br>
<h5>Rounds provided by company:</h5>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" value="Written/Aptitude Round" id="written" name="roundprovided[]">
<label class="custom-control-label" for="written">Written/Aptitude Round</label>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="coding" name="roundprovided[]" value="Coding Round">
<label class="custom-control-label" for="coding">Coding Round</label>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="gd" name="roundprovided[]" value="Group Discussion">
<label class="custom-control-label" for="gd">Group Discussion</label>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="int1" name="roundprovided[]" value="1st Interview Round">
<label class="custom-control-label" for="int1">1st Interview Round</label>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="int2" name="roundprovided[]" value="2nd Interview (HR) Round">
<label class="custom-control-label" for="int2">2nd Interview (HR) Round</label>
</div>
<br>
<h5>Rounds you have cleared:</h5>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="written2" name="roundcleared[]" value="Written/Aptitude Round">
<label class="custom-control-label" for="written2">Written/Aptitude Round</label>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="coding2" name="roundcleared[]" value="Coding Round">
<label class="custom-control-label" for="coding2">Coding Round</label>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="gd2" name="roundcleared[]" value="Group Discussion">
<label class="custom-control-label" for="gd2">Group Discussion</label>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="int12" name="roundcleared[]" value="1st Interview Round">
<label class="custom-control-label" for="int12">1st Interview Round</label>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="int22" name="roundcleared[]" value="2nd Interview (HR) Round">
<label class="custom-control-label" for="int22">2nd Interview (HR) Round</label>
</div>
<br>
<div class="md-form mb-4 green-textarea active-green-textarea">
<label for="story">Your Story/Experience:</label>
<textarea id="story" class="md-textarea form-control" rows="12" placeholder="Please restrict yourself to 100 words . . ." name="story" required></textarea>
</div>
<input class="btn btn-primary" type="submit" name="submit" value="Submit">
</form>
</div>
</div>
</div>
<b><br>
<div class="footer">
<p style="color:#e88924">&#9400; Copyright@IITB</p>
</div>
<!-- Bootstrap scripts -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript">
document.getElementById("logout").onclick = function () {
location.href = "logout.php";
};
</script>
</body>
</html>
<?php
}
else{
header("location: index.php");
}
?>
\ No newline at end of file
<?php
include('server.php');
if(!$_SESSION['loggedin']) {
header("location: index.php");
}
session_start();
error_reporting(0);
//intializing variable
$name = "";
$email = "";
$roll = "";
$coursetaken = "";
$company = "";
$roundprovided = "";
$roundcleared = "";
$story = "";
$error = array();
$servername = "localhost";
$username = "root";
$pass = "";
$dbname = "webpage";
// Create connection
$db = mysqli_connect($servername, $username, $pass, $dbname);
if(isset($_POST['submit'])){
$name = mysqli_real_escape_string($db, $_POST['name']);
$roll = mysqli_real_escape_string($db, $_POST['roll']);
$email = mysqli_real_escape_string($db, $_POST['email']);
$coursetaken = mysqli_real_escape_string($db, $_POST['coursetaken']);
$company = mysqli_real_escape_string($db, $_POST['companyname']);
$story = mysqli_real_escape_string($db, $_POST['story']);
$student_id = mysqli_real_escape_string($db, $_POST['student_id']);
$roundprovided = implode(",", $_POST['roundprovided']);
$roundcleared = implode(",", $_POST['roundcleared']);
$created = date('Y-m-d H:i:s');
if(empty($name)){array_push($error, "Name is required");}
if(empty($roll)) {array_push($error, "roll is required");}
if(empty($email)){array_push($error, "Email is required");}
if(empty($coursetaken)){array_push($error, "Course Name is required");}
if(empty($company)){array_push($error, "Company Name is required");}
if(empty($story)){array_push($error, "Story is required");}
if(count($error)==0)
{
$inset_query ="INSERT INTO posts(student_id,name,roll,email,coursetaken,companyname,story,roundprovided,roundcleared,created_at) VALUES ('$student_id','$name','$roll','$email','$coursetaken','$company','$story','$roundprovided','$roundcleared','$created')";
mysqli_query($db, $inset_query) or die(mysqli_error());
header("location: profile.php");
}
}
?>
\ No newline at end of file
<?php include('server.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Placement Experience</title>
<!-- Bootstrap -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Bootstrap CSS -->
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.2/css/bootstrap.min.css'>
<!-- Font Awesome CSS -->
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.3.1/css/all.css'>
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@800&family=Roboto+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/style_login.css">
<!-- topnav -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
function logcheck(){
var a = document.getElementById("email").value;
var b = document.getElementById("password").value;
if(!a){
document.getElementById('msg1').innerHTML="**Enter email";
return false;
}
if(!b){
document.getElementById('msg2').innerHTML="**Enter password";
return false;
}
}
</script>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark">
<a class="navbar-brand" href="#"><img id="nav_icon" src=img/logoo.png style="width=72px; height=48px;"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="posts.php">Posts</a>
</li>
<li class="nav-item">
<a class="nav-link" href="exp_form.php">Share</a>
</li>
</ul>
</div>
<div style="float:right">
<button id="signup" type="button" class="btn btn-info btn-round" style="float:right; margin-right: 10px;">
Sign Up
</button>
<button type="button" class="btn btn-info btn-round" data-toggle="modal" data-target="#loginModal" style="float:right; margin-right: 10px">
Login
</button>
</div>
</nav>
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header border-bottom-0">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-title text-center">
<h4>Login</h4>
</div>
<div class="d-flex flex-column text-center">
<form action="server.php" method="post">
<div class="form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Email">
<span id="msg1" style="color: red"></span>
</div>
<div class="form-group">
<input type="password" class="form-control" name ="password" id="password" placeholder="Password">
<span id="msg2" style="color: red"></span>
</div>
<input type="submit" class="btn btn-info btn-block btn-round" name="login_user" value="Login" onsubmit="return logcheck()">
</form>
</div>
</div>
<div class="modal-footer d-flex justify-content-center anchor">
<div class="signup-section">Not a member yet? </div><br>
<div class="signup-section"><a href="demoreg.php" class="text-info"> Sign Up</a>.</div>
</div>
</div>
</div>
</div>
<div class="banner">
<img src="img/banner.png" style="width:100%">
</div>
<div class="container">
<div class="row">
<div class="container col-sm-10 main whole">
<div>
<hr class="line" style="border-color: #e67f11">
<p id="para1">A single place where all the on-campus job interview experiences of students exists. Filter out experiences according to year, course, etc. Share your own story with fellow students.</p><br>
<hr class="line" style="border-color: #e67f11">
<br><br>
</div>
</div>
</div>
<div class="row">
<div class="container col-md-6" style="text-align: center">
<a href="posts.php" id="postlink">
<h1><i class="fa fa-comments" aria-hidden="true"></i></h1>
<h2 style="color: #FF5733">See the Posts</h2><br>
<h5 style="color:#080814">Read the experiences shared by the seniors who have gone through the process.</h5>
</a>
</div>
<div class="container col-md-6" style="text-align: center">
<a href="exp_form.php" id="seniorlink">
<h1><i class="fa fa-pencil-square-o" aria-hidden="true"></i></h1>
<h2 style="color: #900C3F">Share your Experience</h2><br>
<h5 style="color:#080814">Share your experience of interview if you have gone through one.</h5>
</a>
</div>
</div>
</div>
<br><br><br>
<div class="footer">
<p style="color:#e88924">&#9400; Copyright@IITB</p>
</div>
<!-- Bootstrap scripts -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- Login popup scripts -->
<script src='https://code.jquery.com/jquery-3.3.1.slim.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js'></script>
<script src='https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js'></script>
<script src="js/script.js"></script>
<script type="text/javascript">
document.getElementById("signup").onclick = function () {
location.href = "demoreg.php";
};
</script>
</body>
</html>
$(document).ready(function() { $('#loginModal').modal('show');
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
});
\ No newline at end of file
<?php
include('server.php');
session_destroy();
unset($_SESSION['loggedin']);
header("location: index.php");
?>
\ No newline at end of file
<?php
include('server.php');
if(isset($_SESSION['loggedin']))
{
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Placement Experience</title>
<!-- Bootstrap -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Bootstrap CSS -->
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.2/css/bootstrap.min.css'>
<!-- Font Awesome CSS -->
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.3.1/css/all.css'>
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@800&family=Roboto+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/style_login.css">
<!-- topnav -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
function logcheck(){
var a = document.getElementById("email").value;
var b = document.getElementById("password").value;
if(!a){
document.getElementById('msg1').innerHTML="**Enter email";
return false;
}
if(!b){
document.getElementById('msg2').innerHTML="**Enter password";
return false;
}
}
</script>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark">
<a class="navbar-brand" href="#"><img id="nav_icon" src=img/logoo.png style="width=72px; height=48px;"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="posts.php">Posts</a>
</li>
<li class="nav-item">
<a class="nav-link" href="exp_form.php">Share</a>
</li>
</ul>
</div>
<div style="float:right">
<button id="logout" type="button" class="btn btn-info btn-round" style="float:right; padding-top: 10px">
Logout
</button>
<a href="profile.php"><i class="fa fa-user-circle-o" style="font-size:36px; float:right; padding-right:10px;" ></i></a>
</div>
</nav>
<div class="banner">
<img src="img/banner.png" style="width:100%">
</div>
<div class="container">
<div class="row ">
<div class="container col-sm-10 main whole">
<div>
<hr class="line" style="border-color: #e67f11">
<p id="para1">A single place where all the on-campus job interview experiences of students exits. Filter out experiences according to year,course,etc. Share your own story with fellow students.</p><br>
<hr class="line" style="border-color: #e67f11">
<br><br>
</div>
</div>
</div>
<div class="row">
<div class="container col-md-6" style="text-align: center">
<a href="posts.php" id="postlink">
<h1><i class="fa fa-comments" aria-hidden="true"></i></h1>
<h2 style="color: #FF5733">See the Posts</h2><br>
<h5 style="color:#080814">Read the experiences shared by the seniors who have gone through the process.</h5>
</a>
</div>
<div class="container col-md-6" style="text-align: center">
<a href="exp_form.php" id="seniorlink">
<h1><i class="fa fa-pencil-square-o" aria-hidden="true"></i></h1>
<h2 style="color: #900C3F">Share your Experience</h2><br>
<h5 style="color:#080814">Share your experience of interview if you have gone through one.</h5>
</a>
</div>
</div>
</div>
<br><br><br>
<div class="footer">
<p style="color:#e88924">&#9400; Copyright@IITB</p>
</div>
<!-- Bootstrap scripts -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- Login popup scripts -->
<script src='https://code.jquery.com/jquery-3.3.1.slim.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js'></script>
<script src='https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js'></script>
<script src="js/script.js"></script>
<script type="text/javascript">
document.getElementById("logout").onclick = function () {
location.href = "logout.php";
};
</script>
<script>
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
</script>
</body>
</html>
<?php
}
else{
header("location: index.php");
}
?>
\ No newline at end of file
<?php
include('server.php');
if(isset($_SESSION['loggedin']))
{
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PlacementExperience | Posts</title>
<!-- Bootstrap -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@800&family=Roboto+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<!--user icon -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- External CSS -->
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="row">
<div class="col-sm-3" style="left:0px;">
<div class="container-fluid sidenav">
<a href="mainpage.php"><img src="img/logoo.png" style="width:100px; margin-top:15px;"></a>
<br><br>
<div id="cse">
<a style="text-decoration: none;" href="https://www.cse.iitb.ac.in" target="_blank">
<h6 style="text-align: center;">Department of</h6>
<h6 style="text-align: center;">Computer Science and Engineering</h6>
<h5 style="text-align: center;">IIT Bombay</h5>
</a>
</div>
<br><br>
<ul>
<li><a href="mainpage.php"> HOME </a></li>
<li><a href="posts.php"> POSTS </a></li>
<li><a href="exp_form.php">SHARE</a></li>
<li><a href="profile.php"> PROFILE </a></li>
</ul>
<br><br>
<div id="iLinks">
<h5>Important Links</h5>
<ul>
<li style="font-size:10px;"><a href="http://www.iitb.ac.in/" target=_blank> IITB Home</a></li>
<li style="font-size:10px;"><a href="https://www.cse.iitb.ac.in/"> CSE@IITB </a></li>
<li style="font-size:10px;"><a href="https://asc.iitb.ac.in/"> ASC </a></li>
</ul>
</div>
<br><br>
</div>
</div>
<div class="container-fluid col-md-8 whole" style="margin-top:0px;">
<div class="row">
<div class="col-sm-8 main" id="title">
<img src="img/heading_trans.png" alt="placementExperience" style="align-content: center; margin-left: 25%; margin-right: 25%;">
</div>
<div class="col-sm-4" style="left:0px; padding-top:20px; vertical-align: center;">
<button id="logout" type="button" class="btn btn-info btn-round" style="float:right;">
Logout
</button>
<a href="profile.php"><i class="fa fa-user-circle-o" style="font-size:36px; float:right; padding-right:10px;" ></i></a>
</div>
</div>
<hr class="lineform">
<h3 style="color: #e67f11; text-align: center">Posts</h3>
<!-- Search Field -->
<div style="float:right">
<form action="" method="post">
<input id="search" name="search" type="text" placeholder="Search By Company Name" onkeyup="stoppedTyping()">
<input class="primary" id="submit" name="searchbtn" type="submit" value="Search">
</form>
</div>
<br><br>
<!--Fetching Posts -->
<?php
$user_email = $_SESSION['Logged_email'];
if(!isset($_POST['searchbtn'])){
$sql = "SELECT id,name, companyname, story, roundprovided, created_at FROM posts ORDER BY created_at DESC";
$result = mysqli_query($db, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
?>
<div class="card bg-white" style="border:3px solid gray;">
<div class="card-header">
<?php echo '<p id="post_headings"><b>Name:</b> ' .$row['name']. '</p>';?>
<?php echo '<h4 id="post_company"><b>Company:</b> '.$row['companyname'].'</h4>';?>
<?php echo '<p id="post_company"><b>Round Provided:</b> '.$row['roundprovided'].'</p>';?>
</div>
<div class="card-body">
<?php echo '<p id="post_body"> '.$row['story'].'</p>'; ?>
</div>
<div class="card-footer">
<?php echo '<h6 style="float: right;"> Posted on '.date('jS M Y', strtotime($row['created_at'])).'</h6>';?>
</div>
</div>
<br><br>
<?php
}
}
}else{
$search = $_POST['search'];
$sql = "SELECT id,name, companyname, story, roundprovided, created_at FROM posts WHERE companyname like '$search%' ORDER BY created_at DESC";
$result = mysqli_query($db, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
?>
<div class="card bg-white" style="border:3px solid gray;">
<div class="card-header">
<?php echo '<p id="post_headings"><b>Name:</b> ' .$row['name']. '</p>';?>
<?php echo '<h4 id="post_company"><b>Company:</b> '.$row['companyname'].'</h4>';?>
<?php echo '<p id="post_company"><b>Round Provided:</b> '.$row['roundprovided'].'</p>';?>
</div>
<div class="card-body">
<?php echo '<p id="post_body"> '.$row['story'].'</p>'; ?>
</div>
<div class="card-footer">
<?php echo '<h6 style="float: right;"> Posted on '.date('jS M Y', strtotime($row['created_at'])).'</h6>';?>
</div>
</div>
<br><br>
<?php
}
}else{echo '<em style="color:red; font-size:50px;"><i>No Result Found</i></em>';}
}
mysqli_close($conn);
?>
</div>
</div>
</div>
<br><br>
<div class="footer">
<p style="color:#e88924">&#9400; Copyright@IITB</p>
</div>
<!-- Bootstrap scripts -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript">
document.getElementById("logout").onclick = function () {
location.href = "logout.php";
};
function stoppedTyping(){
if(this.value.length > 0) {
document.getElementById('searchbtn').disabled = false;
} else {
document.getElementById('searchbtn').disabled = true;
}
}
</script>
</body>
</html>
<?php
}
else{
header("location: index.php");
}
?>
\ No newline at end of file
<?php
include 'server.php';
session_start();
error_reporting(0);
if(isset($_SESSION['loggedin']))
{
$error = array();
$servername = "localhost";
$username = "root";
$pass = "";
$dbname = "webpage";
// Create connection
$db = mysqli_connect($servername, $username, $pass, $dbname);
// Check connection
if (!$db) {
die("Connection failed: " . mysqli_connect_error());
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PlacementExperience | Profile</title>
<!-- Bootstrap -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@800&family=Roboto+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<!--user icon -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- External CSS -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" href="css/style_yourpost.css">
<script type="text/javascript">
function confirmationDelete(anchor)
{
var conf = confirm('Are you sure want to delete this record?');
if(conf)
window.location=anchor.attr("href");
}
</script>
</head>
<body>
<div class="row">
<div class="col-sm-3" style="left:0px;">
<div class="container-fluid sidenav">
<a href="mainpage.php"><img src="img/logoo.png" style="width:100px; margin-top:15px;"></a>
<br><br>
<div id="cse">
<a style="text-decoration: none;" href="https://www.cse.iitb.ac.in" target="_blank">
<h6 style="text-align: center;">Department of</h6>
<h6 style="text-align: center;">Computer Science and Engineering</h6>
<h5 style="text-align: center;">IIT Bombay</h5>
</a>
</div>
<br><br>
<ul>
<li><a href="mainpage.php"> HOME </a></li>
<li><a href="posts.php"> POSTS </a></li>
<li><a href="exp_form.php">SHARE</a></li>
<li><a href="profile.php"> PROFILE </a></li>
</ul>
<br><br>
<div id="iLinks">
<h5>Important Links</h5>
<ul>
<li style="font-size:10px;"><a href="http://www.iitb.ac.in/" target=_blank> IITB Home</a></li>
<li style="font-size:10px;"><a href="https://www.cse.iitb.ac.in/"> CSE@IITB </a></li>
<li style="font-size:10px;"><a href="https://asc.iitb.ac.in/"> ASC </a></li>
</ul>
</div>
<br><br>
</div>
</div>
<div class="container-fluid col-md-8 whole" style="margin-top:0px;">
<div class="row">
<div class="col-sm-8 main" id="title">
<img src="img/heading_trans.png" alt="placementExperience" style="align-content: center; margin-left: 25%; margin-right: 25%;">
</div>
<div class="col-sm-4" style="left:0px; padding-top:20px; vertical-align: center;">
<button id="logout" type="button" class="btn btn-info btn-round" style="float:right;">
Logout
</button>
<a href="profile.php"><i class="fa fa-user-circle-o" style="font-size:36px; float:right; padding-right:10px;" ></i></a>
</div>
</div>
<hr class="lineform">
<h3 style="color: #e67f11">Profile</h3><br>
<?php
$user_email = $_SESSION['Logged_email'];
$sql_smt= "SELECT name, roll, email, branch FROM student WHERE email = '$user_email' ";
$result = mysqli_query($db, $sql_smt);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
?>
<div class="card bg-white" style="border:3px solid gray; max-width: 300px; height:auto;">
<div class="card-header">
<?php echo '<p id="post_headings"><b>Name :</b> ' .$row['name']. '</p>'; ?>
<?php echo '<p id="post_headings"><b>Roll No. :</b> ' .$row['roll']. '</p>'; ?>
<?php echo '<p id="post_headings"><b>Branch :</b> ' .$row['branch']. '</p>'; ?>
<?php echo '<p id="post_headings"><b>Email :</b> ' .$row['email']. '</p>';
}
}
mysqli_close($conn);
?>
</div>
</div>
<br>
<h3 style="color: #e67f11"> Your Posts : </h3>
<table>
<th>Company</th>
<th>Posted Date</th>
<th>Update</th>
<th>Delete</th>
<?php
$user_email = $_SESSION['Logged_email'];
$sql_smt= "SELECT id, companyname, created_at FROM posts WHERE email = '$user_email' ORDER BY created_at DESC";
$result = mysqli_query($db, $sql_smt);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo '<tr>';
echo '<td>'.$row['companyname'].'</td>';
echo '<td>'.date('jS M Y', strtotime($row['created_at'])).'</td>';
mysqli_close($conn);
?>
<td>
<button class="editbtn"><a href="edit_exp.php?id=<?= $row['id']; ?>">Edit</a></button>
</td>
<td>
<button class="delbtn"><a onclick='javascript:confirmationDelete($(this));return false;' href="delpost.php?id=<?= $row['id']; ?>">Delete</a></button>
</td>
<?php
echo '</tr>';
}
}
?>
</table>
<button class="editbtn"><a href="exp_form.php">Add New Article</a></button>
</div>
</div>
<div class="footer">
<p style="color:#e88924">&#9400; Copyright@IITB</p>
</div>
<!-- Bootstrap scripts -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript">
document.getElementById("logout").onclick = function () {
location.href = "logout.php";
};
</script>
</body>
</html>
<?php
}
else{
header("location: index.php");
}
?>
\ No newline at end of file
<?php
session_start();
error_reporting(0);
//intializing variable
$firstname = "";
$lastname = "";
$email = "";
$branch = "";
$password1 = "";
$password2 = "";
$error = array();
$servername = "localhost";
$username = "root";
$pass = "";
$dbname = "webpage";
// Create connection
$db = mysqli_connect($servername, $username, $pass, $dbname);
//Registering user
if(isset($_POST['submit'])){
$name = mysqli_real_escape_string($db, $_POST['name']);
$roll = mysqli_real_escape_string($db, $_POST['roll']);
$email = mysqli_real_escape_string($db, $_POST['email']);
$branch = mysqli_real_escape_string($db, $_POST['branch']);
$password1 = mysqli_real_escape_string($db, $_POST['password1']);
$password2 = mysqli_real_escape_string($db, $_POST['password2']);
if(empty($name)){array_push($error, "firstname is required");}
if(empty($roll)) {array_push($error, "lastname is required");}
if(empty($email)){array_push($error, "email is required");}
if(empty($branch)){array_push($error, "branch is required");}
if(empty($password1)){array_push($error, "password1 is required");}
if(empty($password2)){array_push($error, "password2 is required");}
if($password1 != $password2){array_push($error, "password must be same !!");}
$email_check_query = "SELECT * FROM student WHERE email = '$email' LIMIT 1";
$result = mysqli_query($db, $email_check_query);
$user = mysqli_fetch_assoc($result);
if($user){
if($user['email'] == $email){
array_push($error, "Email has already been exits");
}
}
if(count($error)==0)
{
$password = md5($password1);
$created = date('Y-m-d H:i:s');
$inset_query ="INSERT INTO student(name, roll, email,branch,password,created_at) VALUES ('$name','$roll','$email','$branch','$password','$created')";
mysqli_query($db, $inset_query);
$_SESSION['email'] = $email;
$_SESSION['success'] = "You are now logged in";
header("location: index.php");
}
}
if(isset($_POST['login_user'])){
$email = mysqli_real_escape_string($db, $_POST['email']);
$password = mysqli_real_escape_string($db, $_POST['password']);
$err =0;
if(empty($email)){
array_push($error, "Username is required");
header("location: index.php");
$err += 1;
}
if(empty($password)){
array_push($error, "password is required");
header("location: index.php");
$err += 1;
}
$password = md5($password);
$query = "SELECT * FROM student WHERE email = '$email' AND password = '$password'";
$result = mysqli_query($db, $query);
$row = mysqli_fetch_row($result);
$id = $row[0];
$name = $row[1];
$roll = $row[2];
if(count($error) == 0){
if(mysqli_num_rows($result) == 1){
$_SESSION['Logged_email'] = $email;
$_SESSION['id'] = $id;
$_SESSION['name'] = $name;
$_SESSION['roll'] = $roll;
$_SESSION['loggedin'] = '1';
// $_SESSION['success'] = "You are logged in successfully";
//header("Location: index1.php");
echo "Login successfully".$email.$password;
header("location: mainpage.php");
}
else{
echo "Login Failed !!";
}
}
else{
echo "Login Failed !!";
}
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment