-
Notifications
You must be signed in to change notification settings - Fork 0
/
getinfo.php
102 lines (83 loc) · 2.19 KB
/
getinfo.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
<?php
error_reporting(E_ERROR | E_PARSE);
$course = $_GET['q'];
$oarsinfourl = "http://172.26.142.75:6060/Utils/CourseInfoPopup.asp?Course=";
$html = new DOMDocument();
$html->loadHTMLFile($oarsinfourl.$course);
$table = $html->getElementsByTagName('table');
if ($table->length == 0) {
echo 'ERROR!';
}
else{
$table = $html->getElementsByTagName('table')->item(0);
$string = '<!DOCTYPE html>
<html lang="en">
<head>
<title>Course Information</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<link rel="stylesheet" href="styles/style.css">
<script src="scripts/jquery.min.js"></script>
<script src="scripts/bootstrap.min.js"></script>
<link rel="stylesheet" href="styles/jquery-ui.css">
<script src="scripts/jquery-1.10.2.js"></script>
<script src="scripts/jquery-ui.js"></script>
<script>
$(function() {
var availableTags = [
"",
""
];
$.ajax({
url: "values.txt",
type: "GET",
data: {},
async: false, //blocks window close
success : function(data) {
availableTags = data.split("\n");
}
});
$( "#course" ).autocomplete({
source: availableTags
});
});
function genUserFriendlyCourseStatus(status)
{
var stat=new String(status);
var answer;
if (stat.valueOf()=="A")
answer="Auto-Accept";
else if (stat.valueOf()=="R")
answer="Auto-Deny";
else
answer="Request";
document.write(answer);
}
</script>
</head>
<body>
<div class="container" style="height: 100%; margin-top: 5%; padding-left: 20%;">'.$html->saveHTML($table).'
</div>
<br>
<br>
<div align="center" >
<button class="btn btn-info" id="getlistbutton">Get Student List</button>
<br>
<br>
<br>
<button class="btn btn-success btn-lg" id="anothercoursebutton">Check Another Course</button>
</div>
<script>
$("#getlistbutton").click(function(){
window.location.assign("http://oars.cc.iitk.ac.in:6060/Course/download/excelnologin.asp?ccc='.$course.'");
});
$("#anothercoursebutton").click(function(){
window.location.assign("index.html");
});
</script>
</body>
</html>';
echo $string;
}
?>