Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
        $self=basename($PHP_SELF);
        $tab="Branche2Firma";
        require_once "../Online-Shop/connect2.php";

        if ($action)
        {
                $query = "delete from $tab where Firma = $Firma";
                $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>".$query."<hr>");

                if ($Branchen)
                {
                        foreach($Branchen as $Branche)
                        {
                                $query = "insert into $tab VALUES ($Branche,$Firma)";
                                $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>".$query."<hr>");
                        }
                }
?>
<script language="Javascript">
location.hash = '#<? echo $hash ?>';
</script>
<?
        }

        unset($Branche);
        $query="select * from $tab where Firma = $Firma";
        $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>".$query);
        while($zeile=mysql_fetch_array($result))
        {
                $Branche[$zeile[Branche]]=$zeile[Branche];
        }
?>
<html>
<head>
<title>Branchenf&uuml;hrer <? echo $site ?>: Redaktionssystem</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel=stylesheet type="text/css" href="../Online-Shop/redaktion.css">
<meta name="description" content="Redaktionssystem">
<meta name="author" content="Webagentur Niewerth">
<meta name="robots" content="noindex">
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" text="#000096">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
<form method="post" action="<? echo $self ?>?Firma=<? echo $Firma ?>" name="formname">
  <?
        function show_Kats_delete($root,$level)
        {
                $level++;
                global $Branche;
                $query="select * from Branche where Father = $root order by Rang";
                $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>".$query);
                while($zeile=mysql_fetch_array($result))
                {
                        $query_count="select * from Branche where Father = $zeile[ID] order by Rang";
                        $result_count = mysql_query ($query_count) or die (mysql_errno().": ".mysql_error()."<hr>".$query_count);
                        $count=mysql_num_rows($result_count);

                        for ($a = 0; $a < $level; $a++)
                        {
                                echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                        }
                        ?><input type="checkbox" name="Branchen[]" value="<? echo $zeile[ID]; ?>" onClick="this.form.hash.value=this.value;this.form.submit();" <? if ($Branche[$zeile[ID]]) { ?>checked<? } ?>><?
                        ?><a name="<? echo $zeile[ID] ?>" href="#<? echo $zeile[ID] ?>"><? echo $zeile[Name]; ?></a><br><?
                        show_Kats_delete($zeile[ID],$level);
                }
        }
        show_Kats_delete(-1,-1);
?>
<input type="hidden" name="action" value="true"><input type="hidden" name="<? echo $Firma ?>" value="<? echo $Firma ?>">
<input type="hidden" name="hash" value="">
</form>
        </td>
  </tr>
</table>
</body>