-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
47 lines (36 loc) · 1 KB
/
index.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
<?php
include 'include/class.ZabbixAPI.php';
$zabbix = new ZabbixAPI();
if (isset($_POST['json'])) {
$result = $zabbix->getData($_POST['method'], $_POST['json']);
}
?>
<html>
<head>
<title>Zabbix API Tester</title>
<link rel="stylesheet" type="text/css" href="include/css.css">
</head>
<body>
<span class="error">
<?php foreach ($zabbix->errors as $error) {
echo "{$error}<br />";
} ?>
</span>
<div id="container">
<div class="left">
<form action="index.php" method="POST">
<span class="top"><input type="text" name="method" placeholder="API Method" value="<?php echo (isset($_POST['method'])) ? $_POST['method'] : ""; ?>" /></span>
<textarea name="json"><?php echo (isset($_POST['json'])) ? $_POST['json'] : ""; ?></textarea><br />
<input type="submit" value="Submit" />
</form>
</div>
<div class="right">
<span class="top">Result:</span>
<pre><?php if (isset($result)) { echo json_encode($result, JSON_PRETTY_PRINT); } ?></pre>
</div>
</div>
</body>
<?php
// Don't forget to log out
unset($zabbix);
?>