LNG
This commit is contained in:
		
							
								
								
									
										4
									
								
								api.php
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								api.php
									
									
									
									
									
								
							@@ -79,8 +79,8 @@ try {
 | 
				
			|||||||
	RecordManager::clean(RECORDTIMOUT);
 | 
						RecordManager::clean(RECORDTIMOUT);
 | 
				
			||||||
} catch (\Exception $e) {
 | 
					} catch (\Exception $e) {
 | 
				
			||||||
	$logManager->write("[Record] cleaning record older that " . RECORDTIMOUT , LogRecordType::ERROR);
 | 
						$logManager->write("[Record] cleaning record older that " . RECORDTIMOUT , LogRecordType::ERROR);
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//Variables
 | 
					//Variables
 | 
				
			||||||
$token = $obj['token'];
 | 
					$token = $obj['token'];
 | 
				
			||||||
$values = null;
 | 
					$values = null;
 | 
				
			||||||
@@ -158,7 +158,7 @@ if ($values != null || $values != "") {
 | 
				
			|||||||
		if (!SubDeviceManager::getSubDeviceByMaster($deviceId, $key)) {
 | 
							if (!SubDeviceManager::getSubDeviceByMaster($deviceId, $key)) {
 | 
				
			||||||
			SubDeviceManager::create($deviceId, $key, UNITS[$key]);
 | 
								SubDeviceManager::create($deviceId, $key, UNITS[$key]);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		RecordManager::create($deviceId, $key, round($value['value'],2));
 | 
							RecordManager::create($deviceId, $key, round($value['value'],3));
 | 
				
			||||||
		$logManager->write("[API] Device_ID " . $deviceId . " writed value " . $key . ' ' . $value['value'], LogRecordType::INFO);
 | 
							$logManager->write("[API] Device_ID " . $deviceId . " writed value " . $key . ' ' . $value['value'], LogRecordType::INFO);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//notification
 | 
							//notification
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,7 +15,7 @@
 | 
				
			|||||||
            <?php
 | 
					            <?php
 | 
				
			||||||
            $partial = new Partial('menu');
 | 
					            $partial = new Partial('menu');
 | 
				
			||||||
            $partial->prepare('item', 'rooms');
 | 
					            $partial->prepare('item', 'rooms');
 | 
				
			||||||
            $partial->prepare('lang',$LANG);
 | 
					            $partial->prepare('langMng',$LANGMNG);
 | 
				
			||||||
            $partial->prepare('debugMod',$DEBUGMOD);
 | 
					            $partial->prepare('debugMod',$DEBUGMOD);
 | 
				
			||||||
            $partial->render();
 | 
					            $partial->render();
 | 
				
			||||||
            ?>
 | 
					            ?>
 | 
				
			||||||
@@ -30,7 +30,7 @@
 | 
				
			|||||||
                        <div class="">
 | 
					                        <div class="">
 | 
				
			||||||
                            <h1><?php echo $room['name']; ?></h1>
 | 
					                            <h1><?php echo $room['name']; ?></h1>
 | 
				
			||||||
                            <?php foreach ($room['reading'] as $key => $value) { ?>
 | 
					                            <?php foreach ($room['reading'] as $key => $value) { ?>
 | 
				
			||||||
                                <?php echo $LANG[$key] .": ".  $value; ?></br>
 | 
					                                <?php echo $LANGMNG->get($key) .": ".  $value; ?></br>
 | 
				
			||||||
                            <?php } ?>
 | 
					                            <?php } ?>
 | 
				
			||||||
                            <?php if (DEBUGMOD == 1) { ?>
 | 
					                            <?php if (DEBUGMOD == 1) { ?>
 | 
				
			||||||
                                <pre>
 | 
					                                <pre>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,7 @@ class Rooms extends Template
 | 
				
			|||||||
	function __construct()
 | 
						function __construct()
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		global $userManager;
 | 
							global $userManager;
 | 
				
			||||||
		global $lang;
 | 
							global $langMng;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!$userManager->isLogin()){
 | 
							if (!$userManager->isLogin()){
 | 
				
			||||||
			header('Location: ' . BASEDIR . 'login');
 | 
								header('Location: ' . BASEDIR . 'login');
 | 
				
			||||||
@@ -15,9 +15,9 @@ class Rooms extends Template
 | 
				
			|||||||
		$template = new Template('rooms');
 | 
							$template = new Template('rooms');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$template->prepare('baseDir', BASEDIR);
 | 
							$template->prepare('baseDir', BASEDIR);
 | 
				
			||||||
			$template->prepare('debugMod', DEBUGMOD);
 | 
							$template->prepare('debugMod', DEBUGMOD);
 | 
				
			||||||
		$template->prepare('title', 'Rooms');
 | 
							$template->prepare('title', 'Rooms');
 | 
				
			||||||
		$template->prepare('lang', $lang);
 | 
							$template->prepare('langMng', $langMng);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$roomsItems = [];
 | 
							$roomsItems = [];
 | 
				
			||||||
		$roomsData = RoomManager::getAllRooms();
 | 
							$roomsData = RoomManager::getAllRooms();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user