AND1
Commander
- Registriert
- Feb. 2002
- Beiträge
- 2.381
Hiho Jungs, was stimmt an diesem Script nicht? Er bringt mir jeden Datensatz 15x *crazy*
Die DB:
PHP:
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td bgcolor=\"#336699\" height="20px" colspan="2"> </td>
</tr>
<?php
#################################################
# this code generates the main menue
#################################################
# every menue item in one row
# $mysql_query = "select * from VM_MODULE, VM_MODGRUPPE where VM_MODGRUPPE_SUBMOD_ID IS NULL AND VM_MOD_AKTIV = '1' AND VM_MOD_ID = VM_MODGRUPPE_MOD_ID AND VM_MODGRUPPE_GRUPPEN_ID = ".$s_groupid." ORDER BY `VM_MOD_ID` ASC ";
$mysql_query = "select * from VM_MODULE, VM_MODGRUPPE where VM_MOD_AKTIV = '1' ORDER BY `VM_MOD_ID` ASC ";
$queryresults = array();
$colnames = array();
$result = mysql_query($mysql_query);
#foreach ($queryresults as $row)
while ($row = mysql_fetch_assoc($result))
{
$selected_main = 0;
$mainmenue_style = "menue";
$menue_pic = "";
# mark selected main menue and change the style
if (isset($_GET["modul"]) && $row['VM_MOD_ID'] == $_GET["modul"] )
{
$selected_main = 1;
$menue_pic = "./images/dotsub.gif";
$mainmenue_style = "menue_aktiv";
}
else
{
$menue_pic = "./images/dotmain.gif";
}
echo "<tr>\n";
echo "<td bgcolor=\"#336699\" width=\"20px\" style=\"padding-top : 1px; padding-left : 4px;\"><img src=\"".$menue_pic."\" alt=\"\" border=\"0\"></td>\n";
echo "<td style=\"padding-left : 2px;\" bgcolor=\"#336699\">\n";
echo " <a href=\"".$_SERVER['PHP_SELF']."?modul=".$row['VM_MOD_ID']."&nav=2\" class=\"".$mainmenue_style."\">".$row['VM_MOD_BESCHREIBUNG']."</a>\n";
echo "</td>\n";
echo "</tr>\n";
# sub menue for the selected main menue item
if($selected_main == 1)
{
# select statement for the sub menue
$submenue_sql = "select * from VM_SUBMODULE, VM_MODGRUPPE where VM_MODGRUPPE_GRUPPEN_ID = ".$s_groupid." AND VM_SUBMOD_ID = VM_MODGRUPPE_SUBMOD_ID AND VM_MODGRUPPE_MOD_ID = VM_SUBMOD_MOD_ID AND VM_SUBMOD_MOD_ID = '".$_GET["modul"]."' and VM_SUBMOD_AKTIV = '1' order by VM_SUBMOD_ID";
$submod_queryresults = array();
$submod_colnames = array();
$mysql_obj->dbget($submenue_sql,&$submod_queryresults,&$submod_colnames);
foreach ($submod_queryresults as $row2)
{
//$selected_sub = 0;
$submenue_style = "sub";
# change the style of the selected sub menue
if ( $row2['VM_SUBMOD_ID'] == $untermenue_ID )
{
$submenue_style = "sub_aktiv";
}
echo "<tr>\n";
echo " <td bgcolor=\"#336699\"> </td>\n";
echo " <td bgcolor=\"#336699\" valign=\"middle\" style=\"padding-top : 2px;\"><img src=\"./images/dotmain.gif\" alt=\"\" border=\"0\">\n";
echo " <a href=\"".$PHP_SELF."?untermenue_ID=".$row2['VM_SUBMOD_ID']."&modul=".$modul."&nav=3\" class=\"".$submenue_style."\">".$row2['VM_SUBMOD_BESCHREIBUNG']."</a>\n";
echo " </td>\n";
echo "</tr>\n";
}
}
}
?>
<tr>
<td bgcolor=\"#336699\" height="20px" colspan="2"> </td>
</tr>
<tr>
<td bgcolor=\"#336699\" height="20px" colspan="2"> </td>
</tr>
<tr>
<td bgcolor=\"#336699\" height="20px" colspan="2"> </td>
</tr>
<tr>
<td bgcolor=\"#336699\" height="20px" colspan="2"> </td>
</tr>
<tr>
<td bgcolor=\"#336699\" valign="middle" ><a href="./logincontrol/logout.php"><img src="./images/logout.gif" border="0"></a></td>
<td bgcolor=\"#336699\" ><a class="menue_aktiv" href="./logincontrol/logout.php"> Logout</a></td>
</tr>
<tr>
<td bgcolor=\"#336699\" valign="middle" ><a href="./VM_Struktur/VM_Grundstruktur.htm" target="_struktur"><img src="./images/help.gif" border="0"></a></td>
<td bgcolor=\"#336699\" ><a class="menue_aktiv" href="./VM_Struktur/VM_Grundstruktur.htm" target="_struktur"> Struktur</a></td>
</tr>
</table>
Die DB:
VM_MOD_ID VM_MOD_NAME VM_MOD_BESCHREIBUNG VM_MOD_SCRIPT VM_MOD_ICON VM_MOD_KATEGORIE VM_MOD_UNTERMOD VM_MOD_SORT VM_MOD_AKTIV
6 LAYOUT Layout NULL NULL A 0 0 1
16 MODULE Modulverwaltung NULL NULL A 0 0 1
1 USER Benutzerverwaltung emloyees.php NULL A 1 0 1