-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstudent.php
More file actions
79 lines (60 loc) · 1.88 KB
/
student.php
File metadata and controls
79 lines (60 loc) · 1.88 KB
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
<?php
session_start();
$ch = curl_init();
$url = sprintf('https://api.sandbox.slcedu.org/api/rest/v1/students/%s', $_GET['UUID']);
$token = $_SESSION['access_token'];
$code = $_SESSION['code'];
$auth = sprintf('Authorization: bearer %s', $token);
//echo $auth;
$headers = array(
'Content-Type: application/vnd.slc+json',
'Accept: application/vnd.slc+json',
$auth);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, FALSE);
curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
if (DISABLE_SSL_CHECKS == TRUE) {
// WARNING: this would prevent curl from detecting a 'man in the middle' attack
// See note in settings.php
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
}
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
//header('Content-type: application/json');
//echo $result;
$student = json_decode($result);
?>
<html>
<head>
<link rel="stylesheet" href="jq-mobile/jquery.mobile-1.1.0.min.css" />
<script src="jq-mobile/jquery-1.7.2.min.js"></script>
<script src="jq-mobile/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
<div data-role="header" data-position="fixed" data-position="inline">
<h1>ClassView</h1>
<a href="start.php" data-rel="back" data-icon="back" class="ui-btn-right">Back</a>
</div>
<h2 style="text-align: center"><?php echo $student->name->firstName . ' ' . $student->name->lastSurname ?></h2>
<h3><?php echo $student->gradeLevel ?></h3>
<?php
/*
foreach ($json as $student) {
echo '<li><a href="#">';
echo $student->name->firstName . ' ' . $student->name->lastSurname . '<br/>';
echo '</a></li>';
}
*
*/
?>
<div data-role="footer" data-position="fixed">
<h1></h1>
</div>
</body>
</html>