PHP_SMART_HOME_V3/app/templates/part/deviceButton.phtml
JonatanRek e74d2095c6 Some Big Changes
Co-Authored-By: Xinatorus <patrik@steelants.cz>
2019-09-23 21:11:06 +02:00

30 lines
1.1 KiB
PHTML

<?php
$action = "";
if ($SUBDEVICE['type'] == 'on/off') {
$action = 'onClick="ajaxPost(\'ajax\',{subDevice_id:\'' . $SUBDEVICEID . '\'}, this);"';
}
//neaktivní zařízení is-inactive
?>
<div class="device-button col-4 col-sm-3 col-xl-2 square-wrap" <?php echo $action; ?> data-room-id="<?php echo $ROOMID; ?>">
<div class="square">
<div class="square-content <?php echo (($SUBDEVICE['comError'] == 1 || $DEVICE['approved'] == 0) ? "is-inactive" : "") ;?>" id="device-<?php echo $DEVICEID ?>" data-sub-device-id="<?php echo $SUBDEVICEID;?>">
<div class="content">
<div class="row no-gutters">
<div class="col">
<h5 unselectable="on" class="fa">&#x<?php echo $DEVICE['icon'] ?></h5>
</div>
<div class="col">
<h5 unselectable="on" class="device-button-value text-right" title="<?php echo $SUBDEVICE['lastRecort']['time']; ?>"><?php echo $SUBDEVICE['lastRecort']['value'] . $SUBDEVICE['unit']?></h5>
</div>
</div>
<div class="row">
<div class="col button-text" unselectable="on" >
<?php echo $DEVICE['name']; ?>
</div>
</div>
</div>
</div>
</div>
</div>