Uploaded door sensor #15
|
@ -3,3 +3,4 @@ $dbDsn = 'sqlite:'.__DIR__.DIRECTORY_SEPARATOR.'pvv.sqlite';
|
|||
$dbUser = null;
|
||||
$dbPass = null;
|
||||
|
||||
$doorSensorSecret = "OGJiZTdjZDctMmFkNy00ZjZjLTk3OGItOTA3NzU3ZDM2Yjlm";
|
|
@ -18,8 +18,8 @@ class Door{
|
|||
|
||||
$doorEvents = [];
|
||||
foreach($statement->fetchAll() as $row){
|
||||
$doorEvents[] = [
|
||||
'time' => $row['time'],
|
||||
Why no cast to int and bool here? Why no cast to int and bool here?
|
||||
'open' => $row['open']
|
||||
Why no cast to int and bool here? Why no cast to int and bool here?
|
||||
'time' => (int)$row['time'],
|
||||
Why no cast to int and bool here? Why no cast to int and bool here?
|
||||
'open' => (bool)$row['open']
|
||||
Why no cast to int and bool here? Why no cast to int and bool here?
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|||
Why no cast to int and bool here? Why no cast to int and bool here?
Why no cast to int and bool here? Why no cast to int and bool here?
|
|
@ -153,6 +153,16 @@ nav #usermenu li:first-child:hover {
|
|||
background: transparent;
|
||||
}
|
||||
|
||||
#doorIndicator {
|
||||
border-radius: 5px;
|
||||
padding: 8px 8px;
|
||||
margin: 4px 4px;
|
||||
}
|
||||
#doorIndicator > p > abbr[title] { text-decoration: none; border-bottom: none; cursor: inherit; }
|
||||
.doorIndicator_OPEN { border: 2px solid green; }
|
||||
.doorIndicator_CLOSED { border: 2px dotted red; }
|
||||
.doorStateMobileOnly { display: none; }
|
||||
|
||||
@media(max-width: 800px){
|
||||
nav #menu, nav #menu li.active, nav #menu_toggle, nav #login {
|
||||
position: absolute;
|
||||
|
@ -226,6 +236,9 @@ nav #usermenu li:first-child:hover {
|
|||
margin-left: 1em !important;
|
||||
margin-right: 1em !important;
|
||||
}
|
||||
.doorStateMobileOnly {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
|
@ -347,11 +360,3 @@ textarea.boxinput {
|
|||
resize: vertical;
|
||||
}
|
||||
|
||||
#doorIndicator {
|
||||
border-radius: 5px;
|
||||
padding: 8px 8px;
|
||||
margin: 4px 4px;
|
||||
}
|
||||
#doorIndicator > p { display: inline; }
|
||||
.doorIndicator_OPEN { border: 2px solid green; }
|
||||
.doorIndicator_CLOSED { border: 2px dotted red; }
|
|
@ -70,8 +70,8 @@ if (date("Y-m-d") == date("Y-m-d", $doorEntry->time)) { $doorTime = date("H:i",
|
|||
<a class="btn focus" href="paamelding/"><li>Bli medlem!</li></a>
|
||||
<a class="btn" href="https://use.mazemap.com/#config=ntnu&v=1&zlevel=2¢er=10.406281,63.417093&zoom=19.5&campuses=ntnu&campusid=1&sharepoitype=poi&sharepoi=38159&utm_medium=longurl">Veibeskrivelse</li></a>
|
||||
<div id="doorIndicator" class="<?php echo($isDoorOpen ? "doorIndicator_OPEN" : "doorIndicator_CLOSED"); ?>">
|
||||
<p class="doorStateText">Døren er <b><?php echo($isDoorOpen ? "" : "ikke") ?> åpen</b>.</p>
|
||||
<p class="doorStateTime">(Oppdatert <?php echo($doorTime) ?>)</p>
|
||||
<p class="doorStateText"><abbr title="Oppdatert <?php echo($doorTime) ?>">Døren er <b><?php echo($isDoorOpen ? "" : "ikke") ?> åpen</b>.</abbr></p>
|
||||
<p class="doorStateTime doorStateMobileOnly">(Oppdatert <?php echo($doorTime) ?>)</p>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Why no cast to int and bool here?
Why no cast to int and bool here?