-
Notifications
You must be signed in to change notification settings - Fork 1
/
aule.php
executable file
·155 lines (141 loc) · 6.21 KB
/
aule.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
include "php/api.php";
logged_or_die();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Aule | AulAPP</title>
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Latest compiled and minified CSS -->
<!-- Optional theme -->
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">-->
<link rel="stylesheet" href="./css/styles.css">
<link rel="shortcut icon" type="image/png" href="img/favicon.ico"/>
</head>
<body>
<div class="container">
<div class="header">
<h2 class="text-muted brand" style="text-align: center">AulAPP</h2>
<nav class="padLeft">
<button type="button" class="btn btn-default btnLeft visible-xs pull-left"><a href="home.php"><span class="glyphicon bianco glyphicon-home"></a>
</button>
<button type="button" class="btn btn-default btnLeft visible-xs pull-right"><a href="php/logout.php"><span class="glyphicon bianco glyphicon-log-out"></a>
</button>
<ul class="nav nav-pills pull-right">
<li role="presentation" class="hidden-xs"><a href="home.php"><span class="glyphicon bianco glyphicon-home"></span>
<p class="bianco">Home</p>
</a>
</li>
<li role="presentation" class="hidden-xs"><a href="php/logout.php"><span class="glyphicon bianco glyphicon-log-out"></span><p class="bianco"> Logout</p> </a>
</li>
</ul>
</nav>
</div>
<?php
if (!isset ($_POST['edificio']))
{
?>
<div class="row-marketing">
<div class="alert alert-info" role="alert">
<strong>Start</strong> your search, by <strong>pressing</strong>... mmm... <strong>search!</strong>
</div>
</div>
<?php
}
?>
<form class="form-inline" method="post" action="">
<div class="form-group">
<select class="form-control" name="edificio">
<?php
$arrrgh = get_edifici();
$s = "";
foreach ($arrrgh as &$value)
{
$selected = "";
if ( $_POST['edificio'] == $value)
{
$selected = "selected";
}
$s = $s."<option value='$value' $selected>$value</option>";
}
echo $s;
?>
</select>
</div>
<div class="form-group">
<button type="submit" class="btn btn-default" id="btnsearch">
<span class="glyphicon glyphicon-search"></span> Search
</button>
</div>
</form>
<?php
if( isset($_POST['edificio']) )
{
$arrrgh = get_stanze_adesso();
$s = "";
foreach ($arrrgh as &$value)
{
$testo = "Non ci sono commenti disponibili";
$like = 0;
$dislike = 0;
$quantepersone = 0;
$time = "N/A";
if (sizeof($value->commenti) > 0)
{
$testo = $value->commenti[0]->testo;
$like = $value->commenti[0]->likes;
$dislike = $value->commenti[0]->dislike;
$quantepersone = $value->commenti[0]->quante_persone;
$time = date("H:i", $value->commenti[0]->timestamp);
}
$s = $s."<div class='clearfix'>
<hr>
<h2>$value->nome <small>Ultimo commento alle $time</small></h2>
<div class='col-sm-4'>
<p>$quantepersone / $value->capienza <span class='glyphicon glyphicon-user' aria-hidden='true'></span>
</p>
</div>
<div class=col-sm-4>
<cite>$testo</cite>
</div>
<div class=col-sm-4>
<p>$like <span class='glyphicon glyphicon-thumbs-up' aria-hidden='true'></span>
$dislike <span class='glyphicon glyphicon-thumbs-down' aria-hidden='true'></span>
</p>
</div>
</div>";
}
echo $s;
}
?>
<footer class="footer">
<p>Brunella © Company 2014</p>
</footer>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js "></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js "></script>
<script src="js/bootstrapValidator.min.js "></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
<script src="js/bootstrap-datetimepicker.min.js "></script>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
useMinutes: false,
useCurrent: true,
pickDate: false,
});
$(".html5Form").bootstrapValidator();
$(".help-block").remove();
});
</script>
</body>
</html>