Location: PHPKode > projects > Einkaufszettelgenerator > EZettel0.1/speise_edit.php
<?
session_start();
$us= $HTTP_SESSION_VARS['uid'];
//echo "user=$us<br>"; 
?>
<LINK REL="stylesheet" TYPE="text/css" HREF="menu.css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Menu - list</title>

</head>
<body class="speise">
<TABLE BORDER=1 align=center class="table">
<?

include("menu.ini");
echo "<form name=edit_speise method=POST  action=speise_rezult.php>";
echo "<input type=hidden name=speise_id value=$_GET[speise_id]>";
 $strsql_5 = "select p.speise_name,p.speise_id, t.type_name ,p.speise_recept from  speise p, speise_type t where ( (p.speise_id='$_GET[speise_id]') and(p.speise_type=t.type_id) and t.user_id='$us');"; 
 
// echo "speise=$strsql_5 <br>";
 
  $result_5 = mysql_query($strsql_5, $connection);
   $r=0;
  while ( $row_5 = mysql_fetch_row($result_5) )
   {
 $r+=1;

echo "<TR><TD>Название</TD><TD><input type=text name=speise_name size=50 class=field value=$row_5[0]></TD></TR> ";
echo "<TR><TD>Тип блюда</TD><TD> <SELECT name=speise_type >";  
echo "<option selected class=field>$row_5[2]";
$strsql_typ = "select type_name,type_id from speise_type where user_id='$us' ORDER BY type_id;";
$result_typ = mysql_query($strsql_typ, $connection);
   $i=0;
	    while ( $row_typ = mysql_fetch_row($result_typ) )
	       {
		$i+=1;                                                                
		echo "<OPTION class=field>$row_typ[0]</OPTION><BR>";
		}
echo "</select>";
echo "</TD></TR> "; 
echo "<TR><TD>Рецепт</TD><TD><textarea name=speise_recept rows=6 cols=41 class=field>$row_5[3]</textarea></TD></TR>";		
  
 // for ($k = 1; $k <= 10; $k++)
//{

$strsql_6 = "select p.prod_name from  product p,  teil t where ( (t.speise_id='$_GET[speise_id]')   and (p.prod_id=t.prod_id));";
 
//echo "teil = $strsql_6<br>";
 
  $result_6 = mysql_query($strsql_6, $connection);
   $y=0;
  while ( $row_6 = mysql_fetch_row($result_6) )
   {
   
 $y+=1;
 
 echo "<TR><TD>Состав</TD><TD> <SELECT name=prod_id_$y class=field>";
//if ($row_6[0] !='')
 echo "<OPTION selected>  $row_6[0] </OPTION>";
//else  
 //  echo "<OPTION> </OPTION>";


 // }


   
$strsql2 = "select prod_name,prod_id from product where user_id='$us' ORDER BY prod_type;";
$result2 = mysql_query($strsql2, $connection);
   $i=0;
            while ( $row2 = mysql_fetch_row($result2) )
               {
                $i+=1;
                echo "<OPTION class=field>$row2[0]</OPTION>";
                }
        
       
    }
  echo "<OPTION> </OPTION>";
   echo "</SELECT></TD></TR>";
   
 // }
		
    }      
    
  for ($k=$y+1;$k <= 10; $k++)
  {
  echo "<TR><TD>Продукты</TD><TD> <SELECT name=prod_id_$k class=field>";
echo "<OPTION> </OPTION><BR>";   
$strsql22 = "select prod_name,prod_id from product where user_id='$us' ORDER BY prod_type;";
$result22 = mysql_query($strsql22, $connection);
   $i=0;
            while ( $row22 = mysql_fetch_row($result22) )
               {
                $i+=1;
                echo "<OPTION class=field>$row22[0]</OPTION><BR>";
                }
       echo "</SELECT></TD></TR>";
  
  }
           
?>
<TR><TD COLSPAN=7 align=center><INPUT type=submit value=Edit name=Edit><TD></TR>
</form>
</TABLE>         
Return current item: Einkaufszettelgenerator