示例#1
0
<?php

Output::set_title("Location Configuration");
MainTemplate::set_subtitle("View and edit configuration settings for each location");
$locations = Locations::get_all();
echo "<div class=\"panel-group\" id=\"accordion\">";
foreach ($locations as $location) {
    echo "\n\t<div class=\"panel panel-default\">\n\t\t<div class=\"panel-heading\" data-toggle=\"collapse\" href=\"#location-" . $location->get_id() . "\">\n\t\t\t<h4 class=\"panel-title\">\n\t\t\t\tLocation " . $location->get_id() . "\n\t\t\t</h4>\n\t\t</div>\n\t\t<div id=\"location-" . $location->get_id() . "\" class=\"panel-collapse collapse\">\n\t\t\t<table class=\"table table-striped table-hover\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class=\"title\">Setting</th>\n\t\t\t\t\t\t<th class=\"icon\">Value</th>\n\t\t\t\t\t\t<th class=\"icon\"></th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>";
    $settings = Configs::get_by_location($location);
    foreach ($settings as $setting) {
        echo "<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $setting->get_parameter() . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<strong>" . $setting->get_val() . "</strong> <br />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"icon\">\n\t\t\t\t\t\t\t<span class='glyphicon glyphicon-edit'></span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
    }
    echo "\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t</div>";
}
echo "</div>";