<section id="mobileUser"><span></span><span>Maya Lis</span></section> </header> <div id="wrapper"> <section id="eShop"> <section id="breadcrumbs"> <a href="#"><span class="thisPageSelected">eShop</span></a> </section> <section> <a href="orders.php"><img src="images/icon-shop2.jpg"></a> <a href="cart.php"><img src="images/icon-shop1.jpg"></a> <span class="counter">(<?php echo $cartCountNumber; ?> )</span> </section> <div class="clear"></div> </section> <main id="mainEshop"> <?php printDevices($result); ?> </main> <div class="clear"></div> </div> </body> </html> <?php mysqli_close($connection); //close DB connection ?>
foreach ($data['devices'] as $device) { //favorites have both "favorite" and "read_only" flag set to true, whereas friends only have read_only if (isset($device['favorite']) && $device['favorite']) { $fav[] = $device; } else { if (isset($device['read_only']) && $device['read_only']) { $friends[] = $device; } else { $users[] = $device; } } } //print first User's device Then friends, then favorite printDevices($users, "User's weather stations"); printDevices($friends, "User's friends weather stations"); printDevices($fav, "User's favorite weather stations"); // now get some daily measurements for the last 30 days $type = "temperature,Co2,humidity,noise,pressure"; //first for the main device try { $measure = $client->getMeasure($device['_id'], NULL, "1day", $type, time() - 24 * 3600 * 30, time(), 30, FALSE, FALSE); printMeasure($measure, $type, $tz, $device['_id'] . "'s daily measurements of the last 30 days"); } catch (Netatmo\Exceptions\NAClientException $ex) { handleError("An error occured while retrieving main device's daily measurements: " . $ex->getMessage() . "\n"); } //Then for its modules foreach ($device['modules'] as $module) { //requested data type depends on the module's type switch ($module['type']) { case "NAModule3": $type = "sum_rain";