-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
128 lines (112 loc) · 4.14 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
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
<?php
//require_once("vendor/autoload.php");
require_once('src/autoload.php');
$Config = new Config;
$config = $Config->read();
$folder = str_replace(basename($_SERVER['SCRIPT_NAME']),'',$_SERVER['SCRIPT_NAME']);
$Xajax = new xajax();
//include('backend.php');
$Backend = new Backend($Xajax,$Config);
//$Xajax->register(XAJAX_FUNCTION, new xajaxUserFunction('refresh', $Backend, 'refresh'));
$Xajax->processRequest();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>FSAPI - Remote</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- css -->
<link rel="stylesheet" href="vendor/components/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="vendor/components/bootstrap/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/style.css">
<!-- js -->
<script src="vendor/components/jquery/jquery.min.js"></script>
<script src="vendor/components/bootstrap/js/bootstrap.min.js"></script>
<script src="js/script.js"></script>
<!-- start xajax-js-->
<?php
//die($_SERVER["REQUEST_URI"].'vendor/xajax/');
$Xajax->configure('javascript URI',$folder .'vendor/xajax/xajax/');
$Xajax->printJavascript();
?>
<!-- end xajax-js-->
</head>
<body>
<!-- start content/home.php -->
<nav class="navbar navbar-default">
<!--start container-fluid -->
<div class="container-fluid">
<!-- start navbar-header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<?php
echo '<a class="navbar-brand" href="'.((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "") ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'" class="btn btn-default">FSAPI-Remote</a>';
?>
</div>
<!-- end navbar-header -->
<!-- start navbar-collapse -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<!-- start left navbar -->
<ul class="nav navbar-nav navbar-left">
<li>
<?php
if(!isset($_REQUEST['setup']) || $_REQUEST['setup'] != true){
?>
<form class="form-inline" style="margin-top: 7px;">
<select class="form-control" id="devicesel">
<?php
foreach($config as $index => $config){
$selected = '';
if($Backend->getActiveDevice() == $index){
$selected = 'selected="selected"';
}
echo '<option value="'.$index.'" '.$selected.' >'.$config['friendlyname'].'</option>';
}
?>
</select>
<?php
echo '<a href="'.((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "") ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?setup=true" class="btn btn-default">setup</a>';
?>
</form>
<?php
}
?>
</li>
</ul>
<!-- end left navbar -->
<!-- end right navbar -->
<ul class="nav navbar-nav navbar-right">
<li>
<button type="button" id="power" class="btn btn-sm btn-default netRemote_sys_power"><span class="glyphicon glyphicon-off" aria-label="Left Align" aria-hidden="true"></span> ON</button>
</li>
</ul>
<!-- end right navbar -->
</div>
<!-- end navbar-collapse -->
</div>
<!--end container-fluid -->
</nav>
<div id="alert-success" class="alert alert-success" role="alert" style="display: none;"></div>
<div id="alert-info" class="alert alert-info" role="alert" style="display: none;"></div>
<div id="alert-warning" class="alert alert-warning" role="alert" style="display: none;"></div>
<div id="alert-danger" class="alert alert-danger" role="alert" style="display: none;"></div>
<?php
if(isset($_REQUEST['setup']) && $_REQUEST['setup'] == true){
include('content/setup.php');
}else{
include('content/home.php');
}
?>
<script type="text/javascript">
$('#devicesel').change( function() {
xajax_devicesel($(this).val());
});
</script>
</body>
</html>