1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Modifier news</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
//connexion bdd
require("params.inc.php");
mysql_connect($hote, $login, $mdp); // Connexion à MySQL
mysql_select_db($bd); // Sélection de la base
//requete sql
$idr = $_GET['id'];
$sql="SELECT * FROM recette WHERE recette.id='$idr'";
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
// on va scanner tous les tuples un par un
while ($data = mysql_fetch_array($req)) {
?>
<form method="post" action="confirmmodif.php">
<table cellpadding="0" cellspacing="O" width="100%">
<tr>
<td>
<table>
<tr>
<td>
<table>
<tr>
<td class="filesharing-item"><strong>Informations</strong></td>
</tr>
<tr>
<td></table>
<tr>
<td><table id="recette">
<tr>
<td>title</td>
<td><input name="title" type="text" value="<?php echo $data[nom];?>"></td>
</tr>
<tr>
<td>description</td>
<td><textarea name="description"><?php echo $data[description];?></textarea></td>
</tr>
<tr>
<td>serv</td>
<td><input name="serv" type="test" value="<?php echo $data[serv];?>"></textarea></td>
</tr>
<tr>
<td>yld</td>
<td><input name="yld" type="text" value="<?php echo $data[yld];?>" /></td>
</tr>
<tr>
<td>yldunit</td>
<td><input name="yldunit" type="text" value="<?php echo $data[yldunit];?>"/></td>
</tr>
<tr>
<td>ptime</td>
<td><input name="ptime" type="text" value="<?php echo $data[ptime];?>" /></td>
</tr>
<tr>
<td>ctime</td>
<td><input name="ctime" type="text" value="<?php echo $data[ctime];?>"/></td>
</tr>
<tr>
<td>ttime</td>
<td><input name="ttime" type="text" value="<?php echo $data[ttime];?>" /></td>
</tr>
<tr>
<td>cuisine</td>
<td><input name="cuisine" type="text" value="<?php echo $data[cuisine];?>"/></td>
</tr>
<tr>
<td>convenience</td>
<td><input name="convenience" type="text" value="<?php echo $data[convenience];?>"/></td>
</tr>
<tr>
<td>occasion</td>
<td><input name="occasion" type="text" value="<?php echo $data[occasion];?>"/></td>
</tr>
<tr>
<td>course</td>
<td><input name="course" type="text" value="<?php echo $data[course];?>"/></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td class="filesharing-item"><strong>Nutrions</strong></td>
</tr>
<tr>
<td> <table id="complement">
<tr>
<td>
</td>
<td>amount
</td>
<td>unit
</td>
</tr>
<tr>
<td>calories</td>
<td><input name="amountcalories" type="text" size="10" value="<?php echo $data[amountcalories];?>"/></td>
<td><input name="unitcalories" type="text" size="10" value="<?php echo $data[unitcalories];?>"/></td>
</tr>
<tr>
<td>total fat</td>
<td><input name="amounttotalfat" type="text" size="10"/></td>
<td><input name="unittotalfat" type="text" size="10"/></td>
</tr>
<tr>
<td>cholesterol</td>
<td><input name="amountcholesterol" type="text" size="10"/></td>
<td><input name="unitcholesterol" type="text" size="10"/></td>
</tr>
<tr>
<td>sodium</td>
<td><input name="amountsodium" type="text" size="10"/></td>
<td><input name="unitsodium" type="text" size="10"/></td>
</tr>
<tr>
<td>carbohydrates</td>
<td><input name="amountcarbohydrates" type="text" size="10"/></td>
<td><input name="unitcarbohydrates" type="text" size="10"/></td>
</tr>
<tr>
<td>fiber</td>
<td><input name="amountfiber" type="text" size="10"/></td>
<td><input name="unitfiber" type="text" size="10"/></td>
</tr>
<tr>
<td>protein</td>
<td><input name="amountprotein" type="text" size="10"/></td>
<td><input name="unitprotein" type="text" size="10"/></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td valign="top">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<table>
<tr>
<td class="filesharing-item"><strong>Ingredients</strong></td>
</tr>
<tr>
<td>
/*<?
$sql2="SELECT * FROM ingredients WHERE ingredients.id_recette='$idr'";
$req2 = mysql_query($sql2) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
//on va scanner tous les tuples un par un
while ($data2 = mysql_fetch_array($req2)) {
?>*/
<table id="ingredients">
<tr>
<td>qty</td>
<td>unit</td>
<td>item</td>
<td><input type="button" value="+" onClick="AddRow()" ></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table class="vallign">
<tr>
<td class="filesharing-item"><strong>Steps</strong></td>
</tr>
<tr>
<td> <table id="step">
<tr>
<td>step</td>
<td>description</td>
<td><input type="button" value="+" onClick="AddRow2()" ></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
<td align="right">
<input name="ok" type="submit" value="ok" />
</td>
</tr>
</table>
</form>
<?php
}
mysql_free_result ($req);
mysql_close(); // Déconnexion de MySQL
?>
</body>
</html> |
Partager