CleanUp After Docker Try
This commit is contained in:
		
							
								
								
									
										66
									
								
								app/views/templates/automation.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								app/views/templates/automation.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,66 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
	<?php
 | 
			
		||||
	$partial = new Partial('head');
 | 
			
		||||
	$partial->prepare('baseDir', $BASEDIR);
 | 
			
		||||
	$partial->render();
 | 
			
		||||
	?>
 | 
			
		||||
	<title><?php echo $TITLE ?></title>
 | 
			
		||||
</head>
 | 
			
		||||
<body class="no-transitions">
 | 
			
		||||
	<div class="row no-gutters main">
 | 
			
		||||
		<div class="col-md-3 d-sm-none"></div>
 | 
			
		||||
		<div class="col-md-3 nav-container">
 | 
			
		||||
			<?php
 | 
			
		||||
			$partial = new Partial('menu');
 | 
			
		||||
			$partial->prepare('item','automation');
 | 
			
		||||
			$partial->prepare('langMng',$LANGMNG);
 | 
			
		||||
			$partial->prepare('debugMod',$DEBUGMOD);
 | 
			
		||||
			$partial->render();
 | 
			
		||||
			?>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="col-md-9 main-body">
 | 
			
		||||
			<a class="button is-primary m-1" onClick="$('#modal').removeClass('modal-container-hiden').show();"><?php $LANGMNG->echo('t_createAutomation'); ?></a>
 | 
			
		||||
			<div class="row no-gutters">
 | 
			
		||||
				<?php foreach ($AUTOMATIONS as $automationId => $automationData) {
 | 
			
		||||
					//BUTTON
 | 
			
		||||
					$partial = new Partial('automationButton');
 | 
			
		||||
					$partial->prepare('langMng',$LANGMNG);
 | 
			
		||||
					$partial->prepare('automationId',$automationId);
 | 
			
		||||
					$partial->prepare('automationData',$automationData);
 | 
			
		||||
					$partial->render();
 | 
			
		||||
 | 
			
		||||
					//EDIT
 | 
			
		||||
					$partial = new Partial('automationEdit');
 | 
			
		||||
					$partial->prepare('langMng',$LANGMNG);
 | 
			
		||||
					$partial->prepare('userManager',$USERMANAGER);
 | 
			
		||||
					$partial->prepare('automationId',$automationId);
 | 
			
		||||
					$partial->prepare('automation',$automationData);
 | 
			
		||||
					$partial->prepare('subDevices',$SUBDEVICES);
 | 
			
		||||
					$partial->render();
 | 
			
		||||
				} ?>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
	<?php
 | 
			
		||||
	if (isset($_POST['modalNext'])) {
 | 
			
		||||
		$partial = new Partial('automationCreateFinal');
 | 
			
		||||
		$partial->prepare('langMng',$LANGMNG);
 | 
			
		||||
		$partial->prepare('userManager',$USERMANAGER);
 | 
			
		||||
		$partial->prepare('subDevices',$SUBDEVICES);
 | 
			
		||||
		$partial->render();
 | 
			
		||||
	} else {
 | 
			
		||||
		$partial = new Partial('automationCreate');
 | 
			
		||||
		$partial->prepare('langMng',$LANGMNG);
 | 
			
		||||
 | 
			
		||||
		$partial->prepare('subDevices',$SUBDEVICES);
 | 
			
		||||
		$partial->render();
 | 
			
		||||
	}?>
 | 
			
		||||
	<script src="./app/templates/js/automation.js"></script>
 | 
			
		||||
	<?php
 | 
			
		||||
	$partial = new Partial('footer');
 | 
			
		||||
	$partial->render();
 | 
			
		||||
	?>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										1
									
								
								app/views/templates/example.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/views/templates/example.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
Example template
 | 
			
		||||
							
								
								
									
										20
									
								
								app/views/templates/loading.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								app/views/templates/loading.css
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
.loader {
 | 
			
		||||
  border: 16px solid #f3f3f3;
 | 
			
		||||
  border-radius: 50%;
 | 
			
		||||
  border-top: 16px solid #3498db;
 | 
			
		||||
  width: 120px;
 | 
			
		||||
  height: 120px;
 | 
			
		||||
  -webkit-animation: spin 2s linear infinite; /* Safari */
 | 
			
		||||
  animation: spin 2s linear infinite;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Safari */
 | 
			
		||||
@-webkit-keyframes spin {
 | 
			
		||||
  0% { -webkit-transform: rotate(0deg); }
 | 
			
		||||
  100% { -webkit-transform: rotate(360deg); }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@keyframes spin {
 | 
			
		||||
  0% { transform: rotate(0deg); }
 | 
			
		||||
  100% { transform: rotate(360deg); }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										70
									
								
								app/views/templates/log.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								app/views/templates/log.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,70 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
    <?php
 | 
			
		||||
    $partial = new Partial('head');
 | 
			
		||||
    $partial->prepare('baseDir', $BASEDIR);
 | 
			
		||||
    $partial->render();
 | 
			
		||||
    ?>
 | 
			
		||||
    <title><?php echo $TITLE ?></title>
 | 
			
		||||
</head>
 | 
			
		||||
<body class="no-transitions">
 | 
			
		||||
    <div class="row no-gutters main">
 | 
			
		||||
        <div class="col-md-3 d-sm-none"></div>
 | 
			
		||||
        <div class="col-md-3 nav-container">
 | 
			
		||||
            <?php
 | 
			
		||||
            $partial = new Partial('menu');
 | 
			
		||||
            $partial->prepare('item', 'log');
 | 
			
		||||
            $partial->prepare('langMng',$LANGMNG);
 | 
			
		||||
            $partial->prepare('debugMod',$DEBUGMOD);
 | 
			
		||||
            $partial->render();
 | 
			
		||||
            ?>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="col-md-9 main-body">
 | 
			
		||||
            <div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
                <label><?php echo $LANGMNG->get('l_logMaxLiveTime') . " " . $LOGTOLIVETIME . " days";?></label></br>
 | 
			
		||||
 | 
			
		||||
                <label>CPU: <?php echo $CPU;?></label></br>
 | 
			
		||||
					 <progress value="<?php echo $CPU;?>" max="1"> <?php echo $RAMFREE;?> </progress></br>
 | 
			
		||||
                <label>UPTIME: <?php echo $UPTIME;?></label></br>
 | 
			
		||||
                <label>RAM TOTAL: <?php echo $RAMTOTAL;?></label></br>
 | 
			
		||||
                <label>RAM FREE: <?php echo $RAMFREE;?></label></br>
 | 
			
		||||
					 <progress value="<?php echo explode(" ", $RAMFREE)[0];?>" max="<?php echo explode(" ", $RAMTOTAL)[0];?>"> <?php echo $RAMFREE;?> </progress></br>
 | 
			
		||||
 | 
			
		||||
                <label>DISKTOTAL: <?php echo $DISKTOTAL;?> bytes available</label></br>
 | 
			
		||||
                 <label>SERVER TIME: <?php echo $SERVERTIME;?></label></br>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                <form method="post" action="">
 | 
			
		||||
                    <div class="field">
 | 
			
		||||
                        <select class="input" name="LogFile">
 | 
			
		||||
                            <?php foreach ($LOGSFILES as $key => $value) { ?>
 | 
			
		||||
                                <option value="<?php echo $value; ?>"><?php echo $value; ?></option>
 | 
			
		||||
                            <?php } ?>
 | 
			
		||||
                        </select>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="field">
 | 
			
		||||
                        <input type="submit" class="button" name="selectFile" value="<?php $LANGMNG->echo('b_select');?>"/>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </form>
 | 
			
		||||
                <?php
 | 
			
		||||
                if (isset($_POST['LogFile'])) {
 | 
			
		||||
                    $file_lines = file('./app/logs/' . $_POST['LogFile']);
 | 
			
		||||
                    echo '<pre style="overflow: auto;">';
 | 
			
		||||
                    foreach ($file_lines as $line) {
 | 
			
		||||
                        echo $line;
 | 
			
		||||
                    }
 | 
			
		||||
                    echo '</pre>';
 | 
			
		||||
                }
 | 
			
		||||
                ?>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <?php
 | 
			
		||||
        $partial = new Partial('footer');
 | 
			
		||||
        $partial->render();
 | 
			
		||||
        //TODO js do main.js
 | 
			
		||||
        ?>
 | 
			
		||||
    </body>
 | 
			
		||||
    </html>
 | 
			
		||||
							
								
								
									
										27
									
								
								app/views/templates/login.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								app/views/templates/login.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
	<?php
 | 
			
		||||
	$partial = new Partial('head');
 | 
			
		||||
	$partial->render();
 | 
			
		||||
	?>
 | 
			
		||||
	<title><?php echo $TITLE ?></title>
 | 
			
		||||
</head>
 | 
			
		||||
<body class="no-transitions">
 | 
			
		||||
	<?php
 | 
			
		||||
	if (isset($ota) && $ota != '') {	
 | 
			
		||||
		$partial = new Partial('loginOta');
 | 
			
		||||
		$partial->prepare('ota',$ota);
 | 
			
		||||
		$partial->render();
 | 
			
		||||
	} else {
 | 
			
		||||
		$partial = new Partial('loginForm');
 | 
			
		||||
		$partial->render();
 | 
			
		||||
	}
 | 
			
		||||
	?>
 | 
			
		||||
	
 | 
			
		||||
	<?php
 | 
			
		||||
	$partial = new Partial('footer');
 | 
			
		||||
	$partial->render();
 | 
			
		||||
	?>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										70
									
								
								app/views/templates/part/automationButton.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								app/views/templates/part/automationButton.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,70 @@
 | 
			
		||||
<div class="col-12 col-md-6 col-xl-4 square-wrap">
 | 
			
		||||
    <div class="rectangle-2">
 | 
			
		||||
        <div class="square-content double <?php echo ($AUTOMATIONDATA['active'] == 0 ? 'is-inactive' : ''); ?>" id="automation-<?php echo $AUTOMATIONID; ?>">
 | 
			
		||||
            <div class="row">
 | 
			
		||||
                <div class="col-1">
 | 
			
		||||
                    <h5 class="fa">
 | 
			
		||||
                        <?php
 | 
			
		||||
                        //echo $AUTOMATIONDATA['ifSomething'];
 | 
			
		||||
                        $ifCode = json_decode($AUTOMATIONDATA['ifSomething']);
 | 
			
		||||
                        switch ($ifCode->type) {
 | 
			
		||||
                            case 'sunSet':
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
 | 
			
		||||
                            case 'sunRise':
 | 
			
		||||
                            echo' ';
 | 
			
		||||
                            break;
 | 
			
		||||
 | 
			
		||||
                            case 'inHome':
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
 | 
			
		||||
                            case 'outHome':
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
 | 
			
		||||
                            case 'outDevice':
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
 | 
			
		||||
                            default:
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
                        }
 | 
			
		||||
                        ?>
 | 
			
		||||
                    </h5>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <h5 class="text-right break-all">
 | 
			
		||||
                        <?php
 | 
			
		||||
                        /*if (!in_array($AUTOMATIONDATA['ifSomething'], ["sunRise", "sunSet"])) {
 | 
			
		||||
                            echo $AUTOMATIONDATA['ifSomething'];
 | 
			
		||||
                        }*/
 | 
			
		||||
                        echo $AUTOMATIONDATA['name'];
 | 
			
		||||
                        ?>
 | 
			
		||||
                    </h5>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="row">
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <?php echo implode(', ',$AUTOMATIONDATA['onDays']);?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <?php echo $AUTOMATIONDATA['owner_name'];?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <?php echo $AUTOMATIONDATA['execution_time'];?>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="row">
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <a class="button is-primary m-1" onClick="restartAutomation(<?php echo $AUTOMATIONID; ?>);"><?php $LANGMNG->echo('b_restart')?></a>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <a class="button is-primary m-1" onClick="toggleAutomation(<?php echo $AUTOMATIONID; ?>);"><?php $LANGMNG->echo('b_disable')?></a>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
							
								
								
									
										69
									
								
								app/views/templates/part/automationCreate.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								app/views/templates/part/automationCreate.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,69 @@
 | 
			
		||||
<div class="modal-container modal-container-hiden" id="modal">
 | 
			
		||||
    <div class="modal">
 | 
			
		||||
        <a href=""><i class="fa fa-times close"></i></a>
 | 
			
		||||
        <h4 class="mb-4"><?php $LANGMNG->echo('t_createAutomation')?></h4>
 | 
			
		||||
        <form method="post"  action="" >
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <div class="label"><?php $LANGMNG->echo('l_nameAt')?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input class="input" type="text" name="name" required/>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="label"><?php $LANGMNG->echo('l_runAt')?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <select class="input" name="atSelector" id="valueSelector" required>
 | 
			
		||||
                        <option	value="sunSet"><?php $LANGMNG->echo('l_sunSet')?></option>
 | 
			
		||||
                        <option	value="sunRise"><?php $LANGMNG->echo('l_sunRice')?></option>
 | 
			
		||||
                        <option	value="inHome"><?php $LANGMNG->echo('l_inHome')?></option>
 | 
			
		||||
                        <option	value="outHome"><?php $LANGMNG->echo('l_outHome')?></option>
 | 
			
		||||
                        <option	value="time"><?php $LANGMNG->echo('l_time')?></option>
 | 
			
		||||
                        <option	value="atDeviceValue"><?php $LANGMNG->echo('l_deviceValue');?></option>
 | 
			
		||||
                        <option	value="noOneHome"><?php $LANGMNG->echo('w_noOne') . ' ' . $LANGMNG->get('w_neni') . ' ' . $LANGMNG->get('w_home');?></option>
 | 
			
		||||
                        <option	value="someOneHome"><?php $LANGMNG->echo('w_someOne') . ' ' . $LANGMNG->get('w_is') . ' ' . $LANGMNG->get('w_home');?></option>
 | 
			
		||||
                    </select>
 | 
			
		||||
                    <input class="input" type="time" name="atTime" id="atTime" disabled/>
 | 
			
		||||
                    <select class="input" name="atDeviceValue" id="atDeviceValue" disabled>
 | 
			
		||||
                        <?php foreach ($SUBDEVICES as $subDeviceKey => $subDeviceValue){ ?>
 | 
			
		||||
                            <option value="<?php echo $subDeviceKey; ?>"><?php echo $subDeviceValue['name']; ?>[<?php echo $subDeviceValue['type'];  ?>]</option>
 | 
			
		||||
                        <?php } ?>
 | 
			
		||||
                    </select>
 | 
			
		||||
                    =
 | 
			
		||||
                    <input class="input" type="num" name="atDeviceValueInt" id="atDeviceValueInt" required disabled/>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div class="label"><?php $LANGMNG->echo('l_affectedDevices')?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <select class="input" name="devices[]" multiple>
 | 
			
		||||
                        <?php foreach ($SUBDEVICES as $subDeviceKey => $subDeviceValue){
 | 
			
		||||
                            if ($subDeviceValue['type'] != 'on/off') continue;?>
 | 
			
		||||
                            <option value="<?php echo $subDeviceValue['masterDevice']; ?>"><?php echo $subDeviceValue['name']; ?></option>
 | 
			
		||||
                        <?php } ?>
 | 
			
		||||
                    </select>
 | 
			
		||||
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="label"><?php $LANGMNG->echo('l_atDays')?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="mon"/> <?php $LANGMNG->echo('d_monday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="tue"/> <?php $LANGMNG->echo('d_tuesday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="wed"/> <?php $LANGMNG->echo('d_wednesday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="thu"/> <?php $LANGMNG->echo('d_thursday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="fri"/> <?php $LANGMNG->echo('d_friday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="sat"/> <?php $LANGMNG->echo('d_saturday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="sun"/> <?php $LANGMNG->echo('d_sunday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <input type="submit" class="button" name="modalNext" value="<?php $LANGMNG->echo('b_next')?>"/>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
							
								
								
									
										44
									
								
								app/views/templates/part/automationCreateFinal.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								app/views/templates/part/automationCreateFinal.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
			
		||||
<div class="modal-container" id="modal">
 | 
			
		||||
    <div class="modal" action="" >
 | 
			
		||||
        <a href=""><i class="fa fa-times close"></i></a>
 | 
			
		||||
        <h4 class="mb-4"><?php $LANGMNG->echo('t_createAutomation'); ?></h4>
 | 
			
		||||
        <form method="post">
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <input type="hidden" name="action" value="add" required/>
 | 
			
		||||
                <input type="hidden" name="atSelector" value="<?php echo $_POST['atSelector']; ?>" required/>
 | 
			
		||||
                <input type="hidden" name="name" value="<?php echo $_POST['name']; ?>" required/>
 | 
			
		||||
                <input type="hidden" name="atSelectorValue" value="<?php if (isset($_POST['atTime'])) {
 | 
			
		||||
                    echo $_POST['atTime'];
 | 
			
		||||
                } else if (isset($_POST['atDeviceValue'])) {
 | 
			
		||||
                    $subDeviceId = $_POST['atDeviceValue'];
 | 
			
		||||
                    $subDeviceValue = $_POST['atDeviceValueInt'];
 | 
			
		||||
                    $subDevice = SubDeviceManager::getSubDevice($subDeviceId);
 | 
			
		||||
                    $subDeviceMaster = SubDeviceManager::getSubDeviceMaster($subDeviceId,$subDevice['type']);
 | 
			
		||||
 | 
			
		||||
                    $json = json_encode([
 | 
			
		||||
                        'deviceID' => $subDeviceMaster['device_id'],
 | 
			
		||||
                        'type'=> htmlspecialchars($subDevice['type']),
 | 
			
		||||
                        'value'=> $subDeviceValue,
 | 
			
		||||
                    ]);
 | 
			
		||||
                    echo  htmlspecialchars($json);
 | 
			
		||||
                } else {
 | 
			
		||||
                    if ($_POST['atSelector'] == "inHome" || $_POST['atSelector'] == "outHome") {
 | 
			
		||||
                       echo $USERMANAGER->getUserData('user_id');
 | 
			
		||||
                    } else {
 | 
			
		||||
                        echo $_POST['atSelector'];
 | 
			
		||||
                    }
 | 
			
		||||
                } ?>" required/>
 | 
			
		||||
                <input type="hidden" name="atDays" value="<?php echo htmlspecialchars(($_POST['day'] != '' ? json_encode($_POST['day']) : '')); ?>" required/>
 | 
			
		||||
                <?php foreach ($_POST['devices'] as $value) { ?>
 | 
			
		||||
                    <?php $deviceData = DeviceManager::getDeviceById($value); ?>
 | 
			
		||||
                    <div class="label"><?php echo $deviceData['name'];?></div>
 | 
			
		||||
                    <select class="input" name="device[<?php echo $deviceData['device_id'];?>]">
 | 
			
		||||
                        <option	value="1">ON</option>
 | 
			
		||||
                        <option	value="0">OFF</option>
 | 
			
		||||
                    </select>
 | 
			
		||||
                <?php } ?>
 | 
			
		||||
            </div>
 | 
			
		||||
            <input type="submit" class="button" name="modalFinal" value="<?php $LANGMNG->echo('b_finish'); ?>"/>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
							
								
								
									
										85
									
								
								app/views/templates/part/automationEdit.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								app/views/templates/part/automationEdit.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,85 @@
 | 
			
		||||
<div class="modal-container modal-container-hiden" id="modal-setting-<?php echo $AUTOMATIONID; ?>">
 | 
			
		||||
    <div class="modal">
 | 
			
		||||
        <div class="close">
 | 
			
		||||
            <i class="fa fa-times"></i>
 | 
			
		||||
        </div>
 | 
			
		||||
        <h4 class="mb-4"><?php $LANGMNG->echo('t_createAutomation');?></h4>
 | 
			
		||||
        <form method="post">
 | 
			
		||||
            <input type="hidden" name="action" value="edit" required/>
 | 
			
		||||
            <input name="automation_id" type="hidden" value="<?php echo $AUTOMATIONID; ?>">
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <div class="label"><?php $LANGMNG->echo('l_nameAt');?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input class="input" type="text" name="name" value="<?php echo (isset ($AUTOMATION['name']) ? $AUTOMATION['name'] : ""); ?>" required/>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="label"><?php $LANGMNG->echo('l_runAt');?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <?php //TODO Dodělat identifikaci pro Selctor události a selector času zařízení hodnoty ?>
 | 
			
		||||
                    <select class="input" name="atSelector" id="valueSelector" required>
 | 
			
		||||
                        <option	value="sunSet" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "sunSet" ? 'selected="selected"' : ''); ?>><?php $LANGMNG->echo('l_sunSet');?></option>
 | 
			
		||||
                        <option	value="sunRise" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "sunRise" ? 'selected="selected"' : ''); ?>><?php $LANGMNG->echo('l_sunRice');?></option>
 | 
			
		||||
                        <option	value="inHome" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "inHome" ? 'selected="selected"' : ''); ?>><?php $LANGMNG->echo('l_inHome');?></option>
 | 
			
		||||
                        <option	value="outHome" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "outHome" ? 'selected="selected"' : ''); ?>><?php $LANGMNG->echo('l_outHome');?></option>
 | 
			
		||||
                        <option	value="time" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "time" ? 'selected="selected"' : ''); ?>><?php $LANGMNG->echo('l_time');?></option>
 | 
			
		||||
                        <option	value="atDeviceValue" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "atDeviceValue" ? 'selected="selected"' : ''); ?>><?php $LANGMNG->echo('l_deviceValue');;?></option>
 | 
			
		||||
                        <option	value="noOneHome" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "noOneHome" ? 'selected="selected"' : ''); ?>><?php $LANGMNG->echo('w_noOne'); echo ' ' . $LANGMNG->get('w_neni') . ' ' . $LANGMNG->get('w_home');?></option>
 | 
			
		||||
                        <option	value="someOneHome" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "someOneHome" ? 'selected="selected"' : ''); ?>><?php $LANGMNG->echo('w_someOne'); echo ' ' . $LANGMNG->get('w_is') . ' ' . $LANGMNG->get('w_home');?></option>
 | 
			
		||||
                    </select>
 | 
			
		||||
                    <input class="input" type="time" name="atTime" id="atTime" value="<?php echo (json_decode($AUTOMATION['ifSomething'], true)['type'] == "time" ? json_decode($AUTOMATION['ifSomething'], true)['value'] : ""); ?>" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "time" ? '' : 'disabled'); ?>/>
 | 
			
		||||
                    <select class="input" name="atDeviceValue" id="atDeviceValue" <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "atDeviceValue" ? '' : 'disabled'); ?>>
 | 
			
		||||
                        <?php foreach ($SUBDEVICES as $subDeviceKey => $subDeviceValue){ ?>
 | 
			
		||||
                            <option value="<?php echo $subDeviceKey; ?>"><?php echo $subDeviceValue['name']; ?>[<?php echo $subDeviceValue['type'];  ?>]</option>
 | 
			
		||||
                        <?php } ?>
 | 
			
		||||
                    </select>
 | 
			
		||||
                    =
 | 
			
		||||
                    <input class="input" type="text" name="atDeviceValueInt" id="atDeviceValueInt" required <?php ECHO (json_decode($AUTOMATION['ifSomething'], true)['type'] == "atDeviceValue" ? '' : 'disabled'); ?>/>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div class="label"><?php $LANGMNG->echo('l_affectedDevices'); ?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <div class="field px-2">
 | 
			
		||||
                        <?php
 | 
			
		||||
                        $i = 0;
 | 
			
		||||
                        foreach($AUTOMATION['doSomething'] as $subDeviceId => $subDeviceData){ ?>
 | 
			
		||||
                            <div id="automation-<?php echo $AUTOMATIONID; ?>-content">
 | 
			
		||||
                                <div class="label"><?php echo $subDeviceData['name']; ?></div>
 | 
			
		||||
                                <select class="input" name="device[<?php echo $subDeviceId; ?>]">
 | 
			
		||||
                                    <option value="0" <?php echo ($subDeviceData['state'] == "0" ? 'selected="selected"' : ''); ?>>off</option>
 | 
			
		||||
                                    <option value="1" <?php echo ($subDeviceData['state'] == "1" ? 'selected="selected"' : ''); ?>>on</option>
 | 
			
		||||
                                </select>
 | 
			
		||||
                                <button name="remove" type="button" class="button is-danger fa" data-automation-id="<?php echo $AUTOMATIONID; ?>"></button>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <?php
 | 
			
		||||
                            $i++;
 | 
			
		||||
                        } ?>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="label"><?php $LANGMNG->echo('l_atDays');?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="mon" <?php ECHO (in_array("mon", $AUTOMATION['onDays']) ? 'checked' : ''); ?>/> <?php $LANGMNG->echo('d_monday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="tue" <?php ECHO (in_array("tue", $AUTOMATION['onDays']) ? 'checked' : ''); ?>/> <?php $LANGMNG->echo('d_tuesday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="wed" <?php ECHO (in_array("wed", $AUTOMATION['onDays']) ? 'checked' : ''); ?>/> <?php $LANGMNG->echo('d_wednesday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="thu" <?php ECHO (in_array("thu", $AUTOMATION['onDays']) ? 'checked' : ''); ?>/> <?php $LANGMNG->echo('d_thursday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="fri" <?php ECHO (in_array("fri", $AUTOMATION['onDays']) ? 'checked' : ''); ?>/> <?php $LANGMNG->echo('d_friday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="sat" <?php ECHO (in_array("sat", $AUTOMATION['onDays']) ? 'checked' : ''); ?>/> <?php $LANGMNG->echo('d_saturday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input type="checkbox" name="day[]" value="sun" <?php ECHO (in_array("sun", $AUTOMATION['onDays']) ? 'checked' : ''); ?>/> <?php $LANGMNG->echo('d_sunday'); ?>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <input type="submit" class="button" name="modalFinal" value="<?php $LANGMNG->echo('b_edit'); ?>"/>
 | 
			
		||||
            <input type="submit" class="button is-danger"  onClick="ajaxPostSimple('ajax',{automation_id:  '<?php echo $AUTOMATIONID ?>', action:'delete'}, true);"  name="remove" value="<?php $LANGMNG->echo('b_remove');?>"/>
 | 
			
		||||
        </form>
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
							
								
								
									
										5
									
								
								app/views/templates/part/footer.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								app/views/templates/part/footer.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
<script src="./app/templates/js/jquery.js"></script>
 | 
			
		||||
<script src="https://www.gstatic.com/firebasejs/7.1.0/firebase-app.js"></script>
 | 
			
		||||
<script src="https://www.gstatic.com/firebasejs/7.1.0/firebase-messaging.js"></script>
 | 
			
		||||
<script src="./app/templates/js/script.js"></script>
 | 
			
		||||
<script src="./app/templates/js/post.js"></script>
 | 
			
		||||
							
								
								
									
										26
									
								
								app/views/templates/part/head.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								app/views/templates/part/head.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
<link rel="manifest" href="manifest.json">
 | 
			
		||||
 | 
			
		||||
<meta name="mobile-web-app-capable" content="yes">
 | 
			
		||||
<meta name="apple-mobile-web-app-capable" content="yes">
 | 
			
		||||
<meta name="application-name" content="Home">
 | 
			
		||||
<meta name="apple-mobile-web-app-title" content="Home">
 | 
			
		||||
<meta name="theme-color" content="#182239">
 | 
			
		||||
<meta name="msapplication-navbutton-color" content="#182239">
 | 
			
		||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
 | 
			
		||||
<meta name="msapplication-starturl" content="<?php echo $BASEDIR; ?>">
 | 
			
		||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 | 
			
		||||
 | 
			
		||||
<link rel="icon" sizes="192x192" href="<?php echo $BASEDIR; ?>app/templates/images/icon-192x192.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="192x192" href="<?php echo $BASEDIR; ?>app/templates/images/icon-192x192.png">
 | 
			
		||||
<link rel="icon" sizes="512x512" href="<?php echo $BASEDIR; ?>app/templates/images/icon-512x512.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="512x512" href="<?php echo $BASEDIR; ?>app/templates/images/icon-512x512.png">
 | 
			
		||||
 | 
			
		||||
<meta charset="UTF-8">
 | 
			
		||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
 | 
			
		||||
<link rel="stylesheet" href="./css/main.css?v2">
 | 
			
		||||
<link rel="stylesheet" href="./css/font-awesome.min.css">
 | 
			
		||||
<link rel="stylesheet" href="./css/modal.css">
 | 
			
		||||
<link rel="stylesheet" href="./css/pre.css">
 | 
			
		||||
<link rel="stylesheet" href="./css/loading.css">
 | 
			
		||||
<link rel="stylesheet" href="./css/override.css">
 | 
			
		||||
							
								
								
									
										20
									
								
								app/views/templates/part/loginForm.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								app/views/templates/part/loginForm.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
<div class="modal-container">
 | 
			
		||||
    <div class="modal">
 | 
			
		||||
        <h4 class="mb-4">Login</h4>
 | 
			
		||||
        <form method="post">
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <div class="label">Name:</div>
 | 
			
		||||
                <input class="input" type="text" name="username" placeholder="Jméno.."/>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <div class="label">Password:</div>
 | 
			
		||||
                <input class="input" type="password" name="password" placeholder="Heslo.."/>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <div class="label">Remember me:</div>
 | 
			
		||||
                <input class="" type="checkbox" name="remember" value="true"/>
 | 
			
		||||
            </div>
 | 
			
		||||
            <input type="submit" class="button" name="login" value="Login"/>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
							
								
								
									
										13
									
								
								app/views/templates/part/loginOta.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								app/views/templates/part/loginOta.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
<div class="modal-container">
 | 
			
		||||
    <div class="modal">
 | 
			
		||||
        <h4 class="mb-4">OTA</h4>
 | 
			
		||||
        <form method="post">
 | 
			
		||||
            <input type="hidden" name="otaSecret" value="<?php echo $OTA; ?>"/>
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <div class="label">Code:</div>
 | 
			
		||||
                <input class="input" type="text" name="otaCode" placeholder=""/>
 | 
			
		||||
            </div>
 | 
			
		||||
            <input type="submit" class="button" name="login" value="Login"/>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
							
								
								
									
										35
									
								
								app/views/templates/part/menu.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								app/views/templates/part/menu.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
<div class="nav">
 | 
			
		||||
    <?php
 | 
			
		||||
    $menuItems = [
 | 
			
		||||
        'fa-wrench' => [
 | 
			
		||||
            'slug' => 'setting',
 | 
			
		||||
            'lngKey' => 'settings',
 | 
			
		||||
            'path' => 'setting',
 | 
			
		||||
        ],
 | 
			
		||||
        'fa-calendar-o' => [
 | 
			
		||||
            'slug' => 'automation',
 | 
			
		||||
            'lngKey' => 'automatization',
 | 
			
		||||
            'path' => 'automation',
 | 
			
		||||
        ],
 | 
			
		||||
        'fa-bug' =>[
 | 
			
		||||
            'slug' => 'log',
 | 
			
		||||
            'lngKey' => 'log',
 | 
			
		||||
            'path' => '',
 | 
			
		||||
        ],
 | 
			
		||||
    ];
 | 
			
		||||
    foreach ( $menuItems as $key => $value) {
 | 
			
		||||
        if ($DEBUGMOD == 0 && $value['path'] == 'log') {
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
        ?>
 | 
			
		||||
        <div class="nav-item <?php echo ($ITEM == $value ? 'is-active' : ''); ?>">
 | 
			
		||||
            <a href="<?php echo $value['path']?>">
 | 
			
		||||
                <i class="fa <?php echo $key ?>"></i>
 | 
			
		||||
                <span>
 | 
			
		||||
                    <?php $LANGMNG->echo('m_'.$value['lngKey']); ?>
 | 
			
		||||
                </span>
 | 
			
		||||
            </a>
 | 
			
		||||
        </div>
 | 
			
		||||
    <?php }?>
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
							
								
								
									
										3
									
								
								app/views/templates/part/test.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								app/views/templates/part/test.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
<H1>
 | 
			
		||||
    TEST - TEST
 | 
			
		||||
</H1>
 | 
			
		||||
							
								
								
									
										203
									
								
								app/views/templates/setting.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										203
									
								
								app/views/templates/setting.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,203 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
	<?php
 | 
			
		||||
	$partial = new Partial('head');
 | 
			
		||||
	$partial->prepare('baseDir', $BASEDIR);
 | 
			
		||||
	$partial->render();
 | 
			
		||||
	?>
 | 
			
		||||
	<title><?php echo $TITLE ?></title>
 | 
			
		||||
</head>
 | 
			
		||||
<body class="no-transitions">
 | 
			
		||||
	<div class="row no-gutters main">
 | 
			
		||||
		<div class="col-md-3 d-sm-none"></div>
 | 
			
		||||
		<div class="col-md-3 nav-container">
 | 
			
		||||
			<?php
 | 
			
		||||
			$partial = new Partial('menu');
 | 
			
		||||
			$partial->prepare('item', 'setting');
 | 
			
		||||
			$partial->prepare('langMng',$LANGMNG);
 | 
			
		||||
			$partial->prepare('debugMod',$DEBUGMOD);
 | 
			
		||||
			$partial->render();
 | 
			
		||||
			?>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="col-md-9 main-body">
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4">
 | 
			
		||||
 | 
			
		||||
					<?php $LANGMNG->echo('t_pageAfterLogIn') ?>
 | 
			
		||||
				</h4>
 | 
			
		||||
				<form method="post" enctype="multipart/form-data">
 | 
			
		||||
					<div class="">
 | 
			
		||||
						<div class="field">
 | 
			
		||||
							<select class="input" name="loadPage">
 | 
			
		||||
								<option value="0" <?php echo (UserManager::getUserData("startPage") == 0 ? "selected" : ""); ?>>Default</option>
 | 
			
		||||
								<option value="1" <?php echo (UserManager::getUserData("startPage") == 1 ? "selected" : ""); ?>>Dashboard</option>
 | 
			
		||||
							</select>
 | 
			
		||||
						</div>
 | 
			
		||||
						<input type="submit" name="submit" class="button" value="<?php $LANGMNG->echo('b_save') ?>"/>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div>
 | 
			
		||||
			</form>
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_profile') ?></h4>
 | 
			
		||||
				<div class="field">
 | 
			
		||||
					<div class="label"><?php $LANGMNG->echo('l_userAvatar') ?>:</div>
 | 
			
		||||
					<img src="<?php echo $USERAVATARURL; ?>" />
 | 
			
		||||
					<div class="label">* providet by Gavatar</div>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="field">
 | 
			
		||||
					<div class="label"><?php $LANGMNG->echo('l_userName') ?>:</div>
 | 
			
		||||
					<input class="input" value="<?php echo $USERNAME; ?>" disabled>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="field">
 | 
			
		||||
					<div class="label"><?php $LANGMNG->echo('l_userEmail') ?>:</div>
 | 
			
		||||
					<input class="input" value="<?php echo $USEREMAIL; ?>" disabled>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="field">
 | 
			
		||||
					<a href="logout" class="button is-primary"><?php $LANGMNG->echo('b_logOut') ?></a>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_notification') ?></h4>
 | 
			
		||||
				<input id="notifications" type="checkbox" onChange="toggleNotificationPermissions(this);" />
 | 
			
		||||
				<div class="label"><?php $LANGMNG->echo('l_notificationStatus') ?></div>
 | 
			
		||||
				<div class="field">
 | 
			
		||||
					<a onClick="sendTestNotification();" class="button"><?php $LANGMNG->echo('b_sendTestNotification');?></a>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_experimental') ?></h4>
 | 
			
		||||
				<div class="field">
 | 
			
		||||
					<a href="rooms" class="button"><?php $LANGMNG->echo('b_rooms') ?></a>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_changePassword') ?></h4>
 | 
			
		||||
				<form method="post">
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<div class="label"><?php $LANGMNG->echo('l_oldPassword') ?>:</div>
 | 
			
		||||
						<input type="password" class="input" name="oldPassword" value="" data-cip-id="cIPJQ342845639">
 | 
			
		||||
					</div>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<div class="label"><?php $LANGMNG->echo('l_newPassword') ?>:</div>
 | 
			
		||||
						<input type="password" class="input" name="newPassword1" value="">
 | 
			
		||||
					</div>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<div class="label"><?php $LANGMNG->echo('l_newPassword') ?>:</div>
 | 
			
		||||
						<input type="password" class="input" name="newPassword2" value="">
 | 
			
		||||
					</div>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input type="submit" name="submitPasswordChange" class="button" value="Uložit">
 | 
			
		||||
					</div>
 | 
			
		||||
				</form>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_ota') ?></h4>
 | 
			
		||||
				<?php if (!empty($QRURL)) {?>
 | 
			
		||||
					<img src="<?php echo $QRURL;?>" />
 | 
			
		||||
					<?php echo $OTACODE; ?>
 | 
			
		||||
					<form method="post" action="setting">
 | 
			
		||||
						<div class="field">
 | 
			
		||||
							<div class="label"><?php $LANGMNG->echo('l_gooleAutenticatorOtaCode') ?>:</div>
 | 
			
		||||
							<input type="text" class="input" name="otaCode" value="" required>
 | 
			
		||||
							<input type="hidden" class="input" name="otaSecret" value="<?php echo $OTASECRET;?>" required>
 | 
			
		||||
						</div>
 | 
			
		||||
						<div class="field">
 | 
			
		||||
							<input type="submit" name="submitEnableOta" class="button" value="Uložit">
 | 
			
		||||
						</div>
 | 
			
		||||
					</form>
 | 
			
		||||
				<?php } else {?>
 | 
			
		||||
					<button name="deactivateOta" type="button" class="button is-danger fa"><?php $LANGMNG->echo('b_disable');?> <?php $LANGMNG->echo('b_ota'); ?></button>
 | 
			
		||||
				<?php }?>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_listUsers') ?></h4>
 | 
			
		||||
				<table class="table is-fluid">
 | 
			
		||||
					<thead>
 | 
			
		||||
						<tr>
 | 
			
		||||
							<th><?php $LANGMNG->echo('t_avatar');?></th>
 | 
			
		||||
							<th><?php $LANGMNG->echo('t_userName');?></th>
 | 
			
		||||
							<th><?php $LANGMNG->echo('t_ota');?></th>
 | 
			
		||||
							<th><?php $LANGMNG->echo('t_action');?></th>
 | 
			
		||||
						</tr>
 | 
			
		||||
					</thead>
 | 
			
		||||
					<tbody>
 | 
			
		||||
						<?php foreach ($USERS as $key => $user) { ?>
 | 
			
		||||
							<tr>
 | 
			
		||||
								<td><img src="<?php echo $user['gavatar_url']; ?>" /></td>
 | 
			
		||||
								<td><?php echo $user['username']; ?></td>
 | 
			
		||||
								<td><?php echo ($user['ota'] ? '<span class="fa"></span>' : ''); ?></td>
 | 
			
		||||
								<td><button name="deleteUser" type="button" class="button is-danger fa"></button></td>
 | 
			
		||||
							</tr>
 | 
			
		||||
						<?php } ?>
 | 
			
		||||
					</tbody>
 | 
			
		||||
				</table>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_createuser') ?></h4>
 | 
			
		||||
				<form method="post">
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<div class="label"><?php $LANGMNG->echo('l_userName') ?>:</div>
 | 
			
		||||
						<input type="text" class="input" name="userName" value="">
 | 
			
		||||
					</div>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<div class="label"><?php $LANGMNG->echo('l_password') ?>:</div>
 | 
			
		||||
						<input type="password" class="input" name="userPassword" value="">
 | 
			
		||||
					</div>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input type="submit" name="submitCreateUser" class="button" value="Uložit">
 | 
			
		||||
					</div>
 | 
			
		||||
				</form>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<!--Room Managment-->
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_listRooms') ?></h4>
 | 
			
		||||
				<table class="table is-fluid">
 | 
			
		||||
					<thead>
 | 
			
		||||
						<tr>
 | 
			
		||||
							<th><?php $LANGMNG->echo('t_roomName');?></th>
 | 
			
		||||
							<th><?php $LANGMNG->echo('t_action');?></th>
 | 
			
		||||
						</tr>
 | 
			
		||||
					</thead>
 | 
			
		||||
					<tbody>
 | 
			
		||||
						<?php foreach ($ROOMS as $key => $room) { ?>
 | 
			
		||||
							<tr>
 | 
			
		||||
								<td><?php echo $room['name']; ?></td>
 | 
			
		||||
								<td>
 | 
			
		||||
									<button name="deleteRoom" type="button" class="button is-danger fa"></button>
 | 
			
		||||
									<button name="defaultRoom" type="button" class="button fa" <?php echo ($room['default'] ? 'disabled' : ''); ?>></button>
 | 
			
		||||
								</td>
 | 
			
		||||
							</tr>
 | 
			
		||||
						<?php } ?>
 | 
			
		||||
					</tbody>
 | 
			
		||||
				</table>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<!--Room Creation-->
 | 
			
		||||
			<div class="col-12 col-sm-9 mx-auto mt-4">
 | 
			
		||||
				<h4 class="mb-4"><?php $LANGMNG->echo('t_createRoom') ?></h4>
 | 
			
		||||
				<form method="post">
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<div class="label"><?php $LANGMNG->echo('l_roomName') ?>:</div>
 | 
			
		||||
						<input type="text" class="input" name="roomName" value="">
 | 
			
		||||
					</div>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input type="submit" name="submitCreateUser" class="button" value="<?php $LANGMNG->echo('b_create') ?>">
 | 
			
		||||
					</div>
 | 
			
		||||
				</form>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	</div>
 | 
			
		||||
	<?php
 | 
			
		||||
	$partial = new Partial('footer');
 | 
			
		||||
	$partial->render();
 | 
			
		||||
	?>
 | 
			
		||||
	<script src="./app/templates/js/setting.js"></script>
 | 
			
		||||
</script>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										11
									
								
								app/views/templates/template.phtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								app/views/templates/template.phtml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
	<meta charset="UTF-8">
 | 
			
		||||
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
	<title><?php echo $this->title ?></title>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
	<?php echo $this->content(); ?>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user