Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
        $self=basename($PHP_SELF);
        $DB="Aktionen";
        define ("modul_name", "online_shop");
        define ("tool_name", "aktion");
        
        require_once "connect2.php";
        session_start();
        /* show_primary, show_fallback und sort falls nötig definieren */
        $_SESSION["tree.php"][output]=array
                                                                (
                                                                        'directory_show_primary'        =>      'Name',
                                                                        'directory_show_fallback'       =>      'Kennung',
                                                                        'artikel_show_primary'          =>      'kurzbezeichnung',
                                                                        'artikel_show_fallback'         =>      'kennung',
                                                                        'directory_sort'                        =>      'Kennung',
                                                                        'artikel_sort'                          =>      'Rang, kennung'
                                                                );
        foreach(array_keys($_SESSION["tree.php"][output]) as $elem)
        {
                if ($user_rechte[modul_name][tool_name][$elem])
                {
                        $_SESSION[$self][output][$elem]=$web_rechte[modul_name][tool_name][$elem];
                }
        }

        if ($add)
        {
                $query="insert into shop_link_table (Father,ID,Verwendung) values ($artikel,$add,'a2a')";
                $result = mysql_query ($query);
        }
        if ($delete)
        {
                $query="delete from shop_link_table where Father = $artikel and ID = $delete and Verwendung = 'a2a'";
                $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>$query<hr>");
        }


        if ($_POST["massEdit"])
        {
                $query="delete from shop_link_table where Father = '$artikel';";
                $result = mysql_query ($query);
                $liste=explode(",",$_POST["massEdit"]["liste"]);
                
                foreach($liste as $elem)
                {
                        $query="insert into shop_link_table (Father,ID,Verwendung) values ($artikel,$elem,'a2a')";
                        $result = mysql_query ($query);
                }
        }

        $query="SELECT * FROM artikel where ID = '$artikel'";
        $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>$query<hr>");
        $zeile=mysql_fetch_array($result);
?>
<html>
<head>
<title><? echo $webs[kunde_bezeichnung] ?>: Redaktionssystem</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<link rel=stylesheet type="text/css" href="redaktion.css">
<style type="text/css">
A:link {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000}
A:visited {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #333333}
A:active {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #CC0000}
A:hover {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #669933}
p {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000096}
p.error {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000; font-weight: bold}
span {font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
span.blue {font-family: Arial, Helvetica, sans-serif; color: #FFFFFF; background-color:#0000A0; font-size: 10pt}
span.small {font-family: Arial, Helvetica, sans-serif; font-size: 8pt; text-decoration: none}
td {font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
td.timeout {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #FF0000;}
td.small {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
td.headline {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #FFFFFF; font-weight: bold}
td.haupt {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold}
td.selectet_language {border: 1px outset; border-color: #CCCCCC #999999 #999999 #CCCCCC}
input {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
select {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
.button {  border-style: outset; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; cursor: auto; width: 100%}
</style>

<body leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" bgcolor="#<? echo $webs[bgcolor_seite] ?>" text="#<? echo $webs[font_color_seite] ?>">
<form name="menge" method="post" action="<? echo $self ?>">
<table width="500" border="1" cellspacing="0" cellpadding="2">
  <tr bgcolor="#<? echo $webs[bgcolor_links] ?>"> 
    <td colspan="2"><font color="#<? echo $webs[font_color_links] ?>">  
      <strong>Zubeh&ouml;r f&uuml;r den Artikel <? echo $zeile[kurzbezeichnung] ?>
      bearbeiten.</strong></font></td>
  </tr>
  <?
        $query="
                SELECT
                        *
                FROM
                        artikel,
                        shop_link_table
                where
                (
                        artikel.ID=shop_link_table.ID
                        and
                        shop_link_table.Father=$artikel
                )
                and
                (
                        artikel.Language='".$_SESSION['language']."'
                )";

        $itemList=array();
        $result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>$query<hr>");
        while($zeile=mysql_fetch_array($result))
        {
                $itemList[]=$zeile[ID];
?>
  <tr> 
      <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>" width="100%"><font color="#<? echo $webs[font_color_rechts] ?>"> 
                <?=$zeile[hersteller];?> <? if ($zeile[$_SESSION["tree.php"][output][artikel_show_primary]]) {echo $zeile[$_SESSION["tree.php"][output][artikel_show_primary]];} else {echo $zeile[$_SESSION["tree.php"][output][artikel_show_fallback]];} ?>
                <? echo $zeile[kennung] ?>
        </font> </td>
      <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>" align="center"><a href="<? echo $self ?>?artikel=<? echo $artikel ?>&delete=<? echo $zeile[ID] ?>"><img src="../images/Icons/delete.gif" width="12" height="12" border="0" alt="Diesen Artikel aus der Aktion l&ouml;schen"></a></td>
  </tr>
  <?
        }
?>
  <tr>
    <td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">Hinweis:<br>
      Zubeh&ouml;r(-Artikel)
      bitte links ausw&auml;hlen und durch anklicken dem Artikel zuordnen.</td>
</tr>


<tr>
    <td colspan="2" bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
        <input type="text"   name="massEdit[liste]" value="<? echo implode(", ", $itemList); ?>" style="width:520px;">
        <input type="hidden" name="artikel"         value="<?=$artikel;?>">
        <input type="submit" name="massEdit[ok]"    value="Auswahl übernehmen" style="width:520px;">
        </td>
</tr>






</table>
  <input type="hidden" name="Aktion" value="<? echo $Aktion ?>">
  <br>
  <input type="submit" name="Submit" value="zur&uuml;ck" onClick="parent.location='waren_tool.php?artikel=<? echo $artikel ?>'">
</form>
</body>
</html>