Subversion Repositories portal2

Rev

Rev 668 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
/*  emg - Energy Monitoring & Graphing
*  Copyright (C) 2006-2012 Romain Lievin
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 3 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software Foundation,
*  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

?>

<?php
/*
* List available trackers
*
* Called from: anywhere
*
* Input args (GET): none
*
* Inputs args (POST): none
*
* Output args:
* - device_name
* - sensor_name
* - var_name
* - tracker_name
*
* Call: form_cost_list.php
*
*/

?>

<?php
include_once('auth_check.php');
?>

<div id="page_list_data">
        <h1>
                <?php echo _('Cost'); ?>
        </h1>

        <fieldset>
                <legend>
                        <?php echo _('List'); ?>
                </legend>

                <?php
                if(isset($_SESSION['data']))
                {
                        $data = $_SESSION['data'];
                        $data->sortItems('name', true);

                        if($data)
                        {
                                $list = "\n";
                                $list .= "<ul>\n";

                                foreach($data as $key => $datum)
                                {
                                        //echo $key; echo " < br />";
                                        $datum_key = $key;
                                        $datum_name= $datum->getName();
                                        //$datum_name_ = str_replace('_', ' ', $datum_name);

                                        $list .= '  <li>';
                                        $id = link_get_id_from_filename("form_cost_list.php");
                                        $list .= "<a href=\"index.php?id_page=$id&datum_key=$datum_key\">" . $datum_name . '</a>' . "\n";
                                        $list .= '</li>';
                                        $list .= "\n";
                                }

                                $list .= "</ul>\n";
                                echo $list;
                        }
                }
                else
                {
                        echo "<p>No data yet. </p>";
                }
                ?>

        </fieldset>
        </form>
</div>