コード例 #1
0
function createDropDown($array, $level = 0)
{
    $_return = '';
    foreach ($array as $elem) {
        if (!empty($elem['kids'])) {
            // Dropdown
            $class = '';
            $caret = '<span class="caret"></span>';
            if ($level > 0) {
                $class = 'dropdown-submenu';
                $caret = '';
            }
            $_return .= '<li class="' . $class . '">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">' . $elem['name'] . $caret . '</a>
                                <ul class="dropdown-menu multi-level" role="menu">';
            $_return .= createDropDown($elem['kids'], $level + 1);
            $_return .= '</ul></li>';
        } else {
            // Nav Element
            if (false) {
                $_return .= '<li class="active"><a href="' . $elem['link'] . '" title="' . $elem['title'] . '">' . $elem['name'] . ' <span class="sr-only">(current)</span></a></li>';
            } else {
                $_return .= '<li><a href="' . $elem['link'] . '" title="' . $elem['title'] . '">' . $elem['name'] . '</a></li>';
            }
        }
    }
    return $_return;
}
コード例 #2
0
{
    #Übergabe der Verbindungsdaten
    include "inc/config.inc.php";
    $dbconn = pg_connect("host=" . $conf["db"]["host"] . " port=" . $conf["db"]["port"] . " dbname=" . $conf["db"]["db"] . " user="******"db"]["user"] . " password="******"db"]["pass"]);
    $query = 'SELECT * FROM eggs WHERE active = true';
    $result = pg_query($dbconn, $query);
    #dropdown menu fuer die Auswahl der Eier
    $dropdown = '<select name="CosmID">
	<option value="">Select...</option>';
    while ($result2 = pg_fetch_assoc($result)) {
        $dropdown .= '<option value="' . $result2['cosmid'] . '">' . $result2["about"] . '</option>';
    }
    $dropdown .= '</select>';
    return $dropdown;
}
$dropped = createDropDown();
print '<p>
<form method="POST" action="export.php">
  <div class="tabledownload" align="left"><h2>Datendownload</h2>
    Von welchem Ei möchen Sie die Daten exportieren?<br>
        ' . $dropped . '<br />
        <br>
    <table>
          <tr>
            <th><div align="left">Was möchten Sie exportieren?</div></th>
            <th><div align="left">Welche Parameter möchten Sie exportieren?</div></th>
          </tr>
          <tr>
            <th><div align="left">
              <input type="radio" name="Parameter" value="1" />
              Ozon<br />