-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtest.php
More file actions
79 lines (57 loc) · 2.33 KB
/
Copy pathtest.php
File metadata and controls
79 lines (57 loc) · 2.33 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
79
<?php
?>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>TEST</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div>
<h1>Testing</h1>
<p>Enter your user name and password for Booked.</p>
<form action="test.php" method="post" name="test">
<span><input type="text" name="username" value="" placeholder="User Name"/><label for="username">User Name </label></span><br>
<span><input type="password" name="password" value="" placeholder="Password"/><label for="password"> Password </label></span>
<br>
<input type="submit" name="go" value="Go!"/>
</form>
<?PHP
echo '<div>';
if(isset($_POST['username'])){
require_once('booked-api-config.php');
require_once('booked-api.php');
new \BookedAPI\config();
$password = filter_var($_POST['password']);
$username = filter_var($_POST['username']);
$api = new \BookedAPI\Client($username,$password);
$s = $api->getAllSchedules();
$sid = $s['schedules'][0]['id'];
$test = array(
'getAllSchedules' => $s,
'getAllUsers' => $api->getAllUsers(),
'getSchedule' => $api-> getSchedule($sid),
'getAllReservations' => $api->getAllReservations(),
'getAllResources' => $api->getAllResources(),
'getResourceStatuses' => $api->getResourceStatuses(),
'getAllGroups' => $api->getAllGroups(),
'getAllAccessories' => $api->getAllAccessories(),
);
echo '<p>Authenticated: ' . ($api->isAuthenticated() ? 'Yes':'No') . '<br>';
foreach($test as $key => $value){
echo '<br>'. $key . '<br>';
print_r($value );
}
echo '</p>';
}
echo '<br>';
echo '</div>';
?>
</body>
</html>