-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcouncelling_advisor.php
130 lines (105 loc) · 3.84 KB
/
councelling_advisor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<html>
<head>
<title>JOSAA Analysis</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
</head>
<body class="is-preload">
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<header id="header">
<div class="inner">
<!-- Logo -->
<a href="index.html" class="logo">
<span class="symbol"><img src="images/logo.svg" alt="" /></span><span class="title">JOSAA DATA ANALYSIS</span>
</a>
<!-- Nav -->
<!-- <nav>
<ul>
<li><a href="#menu">Menu</a></li>
</ul>
</nav> -->
<!-- Navigation Bar -->
<nav >
<!-- <a href="try.html"><img class="navimg" src="images/cropped.png" width=50% height=50%></a> -->
<div style = "float:right" >
<ul>
<!-- dropdown -->
<div class="dropdown">
<button class="dropbtn"><li class="item"><p class = "pred">Predictors</p></li>
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="councelling_advisor.php">College Advisor</a>
<a href="closing_rank_predictor.php">Rank Predictor</a>
</div>
</div>
<!-- dropdown -->
<!-- <li class="item"><a href="college-advisor.php">Predictors</a></li> -->
<li class="item"><a href="team.html">About Team</a></li>
</ul>
</div>
</nav>
</div>
</header>
<div class = "DIV1">
<center>
<h1 style="margin:0 0 0.5em 0"> College Advisor </h1>
<p style="font-size:30">A tool to get an estimate of your upcoming college and branch based on your JEE rank.
<br> Suggestions are provided based on past 3 years data.</p>
</center>
</div>
<div class = "DIV4">
<div class = "DIV3">
<form action="" method="post" class="form">
<b><p class="rank"> Enter Rank <input type="number" name="rank"> </p></b>
<br>
<br>
<b><p class="rank"> Select Category </p></b>
<select class = "dropforcp" name="cat">
<option value="">Select</option>
<option value="Open">Open </option>
<option value="OBC-NCL">OBC-NCL</option>
<option value="EWS">EWS</option>
<option value="SC">SC</option>
<option value="ST">ST</option>
<option value="PWD">PWD</option>
</select>
<input type="submit" value="Submit" class="gap">
<input type="reset" value="Reset" class="gap">
</form>
</div>
<?php
$servername = "localhost";
$port_no = 3306;
$username = "devanshu";
$password = "passwords";
$myDB= "mydb";
try{
$conn = new PDO("mysql:host=$servername;port=$port_no;dbname=$myDB", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if ( isset($_POST['rank']) && isset($_POST['cat'])) {
$stmt = $conn->query("SELECT institute,program FROM rank_data natural join IIT natural join program where OR_<= {$_POST['rank']} and CR>= {$_POST['rank']} and seattype = \"{$_POST['cat']}\" GROUP BY institute,program ORDER BY CR ;");
echo '<table border="1">',"\n";
echo "<tr> <td> Institute </td> <td> Branch </td> </tr>";
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>";
echo "<td>";
echo $row['institute'];
echo "</td>";
echo "<td>";
echo $row['program'];
echo "</td>";
}
}
}
catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>
</div>
</body>
</html>