Exemple #1
0
		<div class="cat_container">
			<table class='transparent clear_table' width="100%" align='center' >
				<tr>
					<td class='noborder' width='20%' valign='top'>
						
						<div id="first" class="category-section">
							<div id='location_list'>
								<table class='noborder locations' width='100%' align="center">
									<tbody>
									<?php 
$locations = is_array($locations) ? $locations : array();
foreach ($locations as $l) {
    $id = $l->get_id();
    $name = $l->get_name();
    $icon = file_exists("../pixmaps/flags/" . $l->get_country() . ".png") ? '<img src="../pixmaps/flags/' . $l->get_country() . '.png" border="0" class="flag">' : '';
    $total_n = Locations::count_related_networks($conn, $id);
    $class = $total_n > 0 ? colorize_location($conn, $id) : 'l_error';
    $sensors = Locations::get_related_sensors($conn, $id);
    if (count($sensors) == 0) {
        $tooltip = "0 " . _('Sensors') . "<br> {$total_n} " . _('Networks');
    } else {
        $tooltip = count($sensors) . " " . (count($sensors) == 1 ? _('Sensor') : _('Sensors')) . ":<br> ";
        $tooltip .= "<ul>";
        foreach ($sensors as $s) {
            $tooltip .= "<li>" . $s[1] . " (" . $s[2] . ")</li>";
        }
        $tooltip .= "</ul>";
        $tooltip .= "{$total_n} " . ($total_n == 1 ? _('Network') : _('Networks'));
    }
    ?>