<?
session_start();
$us= $HTTP_SESSION_VARS['uid'];
//echo "user=$us<br>";
?>
<HTML>
<LINK REL="stylesheet" TYPE="text/css" HREF="menu.css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Menu - to db</title>
</head>
<body class="body1">
<?
include("menu.ini");
if ($_POST[tag]=='ÐонеделÑник'){ $tag=1;}
if ($_POST[tag]=='ÐÑоÑник'){ $tag=2;}
if ($_POST[tag]=='СÑеда'){ $tag=3;}
if ($_POST[tag]=='ЧеÑвеÑг'){ $tag=4;}
if ($_POST[tag]=='ÐÑÑниÑа'){ $tag=5;}
if ($_POST[tag]=='СÑббоÑа'){ $tag=6;}
if ($_POST[tag]=='ÐоÑкÑеÑенÑе'){ $tag=7;}
foreach ($_POST[speise_name] as $v)
{
$strsql = "insert into menu (tag, speise_id, user_id) VALUES ('$tag','$v', '$us');";
$result = mysql_query($strsql, $connection);
}
echo "<TABLE BORDER=1 class=menu cellpadding=4 cellspacing=4 align=center>";
$strsql_5 = "select distinct tag from menu order by tag;";
$result_5 = mysql_query($strsql_5, $connection);
$r=0;
while ( $row_5 = mysql_fetch_row($result_5) )
{
$r+=1;
echo "<TR ><TD valign=top><B>";
if ($row_5[0] =='1'){ echo "ÐонеделÑник";}
if ($row_5[0] =='2') { echo "ÐÑоÑник";}
if ($row_5[0] =='3'){ echo "СÑеда";}
if ($row_5[0] =='4'){ echo "ЧеÑвеÑг";}
if ($row_5[0] =='5'){ echo "ÐÑÑниÑа";}
if ($row_5[0] =='6'){ echo "СÑббоÑа";}
if ($row_5[0] =='7'){ echo "ÐоÑкÑеÑенÑе";}
echo "</td><td>";
$strsql_6 = "select p.speise_name, p.speise_id from speise p, menu t where ( (t.tag='$row_5[0]') and (p.speise_id=t.speise_id) and (p.user_id='$us') and (t.user_id='$us') );";
//echo "str=$strsql_6<br>";
$result_6 = mysql_query($strsql_6, $connection);
$y=0;
while ( $row_6 = mysql_fetch_row($result_6) )
{
$y+=1;
echo "<a href=speise.php?speise_id=$row_6[1] target=blank>$row_6[0]</a> <a href=speise_aus_menu.php?speise_id=$row_6[1]&tag=$row_5[0]><font size=-2>ÑдалиÑÑ Ð¸Ð· менÑ</font></a><BR> ";
}
echo "</TD></TR>";
}
$strsql_7 = "select distinct speise_id from menu;";
$result_7 = mysql_query($strsql_7, $connection);
$p=0;
while ( $row_7 = mysql_fetch_row($result_7) )
{
$p+=1;
$strsql_8 = "select distinct prod_id from teil where (speise_id='$row_7[0]');";
//echo "str=$strsql_8<br>";
$result_8 = mysql_query($strsql_8, $connection);
$q=0;
while ( $row_8 = mysql_fetch_row($result_8) )
{
$q+=1;
$strsql_9 = "UPDATE product set sel='Yes' where (prod_id='$row_8[0]');";
//echo "str_9=$strsql_9<br>";
$result_9 = mysql_query($strsql_9, $connection);
}
}
?>
</TABLE>
<center><A HREF=input_menu.php>ÐÑбÑаÑÑ Ð¼ÐµÐ½Ñ</a> <A HREF=start.php>Ðа пеÑвÑÑ ÑÑÑаниÑÑ</a></center>
</HTML>