Location: PHPKode > projects > Einkaufszettelgenerator > EZettel0.1/menu_to_db.php
$us= $HTTP_SESSION_VARS['uid'];
//echo "user=$us<br>"; 

<LINK REL="stylesheet" TYPE="text/css" HREF="menu.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Menu - to db</title>

<body class="body1">

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);
  while ( $row_5 = mysql_fetch_row($result_5) )
 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);
 while ( $row_6 = mysql_fetch_row($result_6) )
 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);
  while ( $row_7 = mysql_fetch_row($result_7) )
  $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);
  while ( $row_8 = mysql_fetch_row($result_8) )
$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);    

<center><A HREF=input_menu.php>Выбрать меню</a>&nbsp;&nbsp;<A HREF=start.php>На первую страницу</a></center>      

Return current item: Einkaufszettelgenerator