par
ezeccamen » 12 sept. 2013, 21:34
Ca fait maintenant 1 semaine que j'essais 50 000 méthodes de règler mon problème.
En espérant une bonne aide de votre part sur ce truc:
J'ai un fichier menugarderie.php
</head>
<body>
<?php include ('header.php'); ?>
<?php $page = 'menugarderie'; include('navbar.php'); ?>
<?php include ('menugarderie_class.php'); ?>
<h2 class="art-postheader">Menu garderie</h2><HR>
<?php include ('procmd.php'); $requete = "SELECT * FROM garderie1 WHERE id='1'"; $result = mysql_query($requete); $data1 = mysql_fetch_array($result); mysql_close(); ?>
<div class="art-postcontent">
<form method="post" name="modify1">
<input name="id" type="hidden" id="id" value="<?php echo $data1['id']; ?>">
<h5 class="art-postheader">Semaine 1 : <input type="text" name="tisem" id="tisem" style="width:600px;background-color:#A6E0FF;font-size:18px" value="<?php echo $data1['tisem']; ?>" /></h5>
<div id="menus" align="center">
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Journées:</p></td>
<td width="15%"><p align="center">Lundi</p></td>
<td width="15%"><p align="center">Mardi</p></td>
<td width="15%"><p align="center">Mercredi</p></td>
<td width="15%"><p align="center">Jeudi</p></td>
<td width="15%"><p align="center">Vendredi</p></td>
</tr>
</table>
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Dîner:</p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinlun" id="dinlun" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinlun']; ?>" cols="20" datas="10"><?php echo $data1['dinlun']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinmar" id="dinmar" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinmar']; ?>" cols="20" datas="10"><?php echo $data1['dinmar']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinmer" id="dinmer" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinmer']; ?>" cols="20" datas="10"><?php echo $data1['dinmer']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinjeu" id="dinjeu" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinjeu']; ?>" cols="20" datas="10"><?php echo $data1['dinjeu']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinven" id="dinven" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinven']; ?>" cols="20" datas="10"><?php echo $data1['dinven']; ?></textarea></p></td>
</tr>
</table>
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Dessert:</p></td>
<td width="15%"><p align="center"><textarea type="text" name="deslun" id="deslun" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['deslun']; ?>" cols="20" datas="10"><?php echo $data1['deslun']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desmar" id="desmar" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['desmar']; ?>" cols="20" datas="10"><?php echo $data1['desmar']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desmer" id="desmer" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['desmer']; ?>" cols="20" datas="10"><?php echo $data1['desmer']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desjeu" id="desjeu" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['desjeu']; ?>" cols="20" datas="10"><?php echo $data1['desjeu']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desven" id="desven" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['desven']; ?>" cols="20" datas="10"><?php echo $data1['desven']; ?></textarea></p></td>
</tr>
</table>
</div>
<p align="center"><input type="text" name="text" id="text" style="width:920px;background-color:#A6E0FF;font-size:14px" value="<?php echo $data1['text']; ?>" /></p>
<br/>
<p align="center"><span class="art-button-wrapper"><span class="art-button-l"> </span><span class="art-button-r"> </span> <input class="art-button" type="submit" name="submit1" onmouseover="this.style.cursor='pointer';" value="Enregistrer" /></span></p>
</form>
</div><hr/>
<?php include ('procmd.php'); $requete = "SELECT * FROM garderie2 WHERE id='1'"; $result = mysql_query($requete); $data2 = mysql_fetch_array($result); mysql_close(); ?>
<div class="art-postcontent">
<form method="post" name="modify2">
<input name="id" type="hidden" id="id" value="<?php echo $data2['id']; ?>">
<h5 class="art-postheader">Semaine 2 : <input type="text" name="tisem" id="tisem" style="width:600px;background-color:#A6E0FF;font-size:18px" value="<?php echo $data2['tisem']; ?>" /></h5>
<div id="menus" align="center">
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Journées:</p></td>
<td width="15%"><p align="center">Lundi</p></td>
<td width="15%"><p align="center">Mardi</p></td>
<td width="15%"><p align="center">Mercredi</p></td>
<td width="15%"><p align="center">Jeudi</p></td>
<td width="15%"><p align="center">Vendredi</p></td>
</tr>
</table>
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Dîner:</p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinlun" id="dinlun" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinlun']; ?>" cols="20" datas="10"><?php echo $data2['dinlun']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinmar" id="dinmar" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinmar']; ?>" cols="20" datas="10"><?php echo $data2['dinmar']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinmer" id="dinmer" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinmer']; ?>" cols="20" datas="10"><?php echo $data2['dinmer']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinjeu" id="dinjeu" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinjeu']; ?>" cols="20" datas="10"><?php echo $data2['dinjeu']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinven" id="dinven" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinven']; ?>" cols="20" datas="10"><?php echo $data2['dinven']; ?></textarea></p></td>
</tr>
</table>
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Dessert:</p></td>
<td width="15%"><p align="center"><textarea type="text" name="deslun" id="deslun" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['deslun']; ?>" cols="20" datas="10"><?php echo $data2['deslun']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desmar" id="desmar" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['desmar']; ?>" cols="20" datas="10"><?php echo $data2['desmar']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desmer" id="desmer" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['desmer']; ?>" cols="20" datas="10"><?php echo $data2['desmer']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desjeu" id="desjeu" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['desjeu']; ?>" cols="20" datas="10"><?php echo $data2['desjeu']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desven" id="desven" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['desven']; ?>" cols="20" datas="10"><?php echo $data2['desven']; ?></textarea></p></td>
</tr>
</table>
</div>
<p align="center"><input type="text" name="text" id="text" style="width:920px;background-color:#A6E0FF;font-size:14px" value="<?php echo $data2['text']; ?>" /></p>
<br/>
<p align="center"><span class="art-button-wrapper"><span class="art-button-l"> </span><span class="art-button-r"> </span> <input class="art-button" type="submit" name="submit2" onmouseover="this.style.cursor='pointer';" value="Enregistrer" /></span></p>
</form>
</div><hr/>
Et voici mon fichier menugarderie_class.php
<?php
if ($_POST['submit1']){
include ('procmd.php');
$id=$_POST['id'];
$tisem=$_POST['tisem'];
$dinlun=$_POST['dinlun'];
$dinmar=$_POST['dinmar'];
$dinmer=$_POST['dinmer'];
$dinjeu=$_POST['dinjeu'];
$dinven=$_POST['dinven'];
$deslun=$_POST['deslun'];
$desmar=$_POST['desmar'];
$desmer=$_POST['desmer'];
$desjeu=$_POST['desjeu'];
$desven=$_POST['desven'];
$text=$_POST['text'];
mysql_query("UPDATE garderie1 SET tisem='$tisem', dinlun='$dinlun', dinmar='$dinmar', dinmer='$dinmer', dinjeu='$dinjeu', dinven='$dinven', deslun='$deslun', desmar='$desmar', desmer='$desmer', desjeu='$desjeu', desven='$desven', text='$text' WHERE id='$id'");
header("location:http://traiteurpourvous.com/gestionw/index.php?page=menugarderie");
}
if ($_POST['submit2']){
include ('procmd.php');
$id=$_POST['id'];
$tisem=$_POST['tisem'];
$dinlun=$_POST['dinlun'];
$dinmar=$_POST['dinmar'];
$dinmer=$_POST['dinmer'];
$dinjeu=$_POST['dinjeu'];
$dinven=$_POST['dinven'];
$deslun=$_POST['deslun'];
$desmar=$_POST['desmar'];
$desmer=$_POST['desmer'];
$desjeu=$_POST['desjeu'];
$desven=$_POST['desven'];
$text=$_POST['text'];
mysql_query("UPDATE garderie2 SET tisem='$tisem', dinlun='$dinlun', dinmar='$dinmar', dinmer='$dinmer', dinjeu='$dinjeu', dinven='$dinven', deslun='$deslun', desmar='$desmar', desmer='$desmer', desjeu='$desjeu', desven='$desven', text='$text' WHERE id='$id'");
header("location:http://traiteurpourvous.com/gestionw/index.php?page=menugarderie");
}
?>
Mon premier form fonctionne à merveille mais mon deuxieme n'Update pas dutout...
Le SELECT m'affiche toutes mes données.
Ca fait maintenant 1 semaine que j'essais 50 000 méthodes de règler mon problème.
En espérant une bonne aide de votre part sur ce truc:
J'ai un fichier menugarderie.php
[php]</head>
<body>
<?php include ('header.php'); ?>
<?php $page = 'menugarderie'; include('navbar.php'); ?>
<?php include ('menugarderie_class.php'); ?>
<h2 class="art-postheader">Menu garderie</h2><HR>
<?php include ('procmd.php'); $requete = "SELECT * FROM garderie1 WHERE id='1'"; $result = mysql_query($requete); $data1 = mysql_fetch_array($result); mysql_close(); ?>
<div class="art-postcontent">
<form method="post" name="modify1">
<input name="id" type="hidden" id="id" value="<?php echo $data1['id']; ?>">
<h5 class="art-postheader">Semaine 1 : <input type="text" name="tisem" id="tisem" style="width:600px;background-color:#A6E0FF;font-size:18px" value="<?php echo $data1['tisem']; ?>" /></h5>
<div id="menus" align="center">
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Journées:</p></td>
<td width="15%"><p align="center">Lundi</p></td>
<td width="15%"><p align="center">Mardi</p></td>
<td width="15%"><p align="center">Mercredi</p></td>
<td width="15%"><p align="center">Jeudi</p></td>
<td width="15%"><p align="center">Vendredi</p></td>
</tr>
</table>
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Dîner:</p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinlun" id="dinlun" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinlun']; ?>" cols="20" datas="10"><?php echo $data1['dinlun']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinmar" id="dinmar" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinmar']; ?>" cols="20" datas="10"><?php echo $data1['dinmar']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinmer" id="dinmer" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinmer']; ?>" cols="20" datas="10"><?php echo $data1['dinmer']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinjeu" id="dinjeu" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinjeu']; ?>" cols="20" datas="10"><?php echo $data1['dinjeu']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinven" id="dinven" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data1['dinven']; ?>" cols="20" datas="10"><?php echo $data1['dinven']; ?></textarea></p></td>
</tr>
</table>
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Dessert:</p></td>
<td width="15%"><p align="center"><textarea type="text" name="deslun" id="deslun" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['deslun']; ?>" cols="20" datas="10"><?php echo $data1['deslun']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desmar" id="desmar" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['desmar']; ?>" cols="20" datas="10"><?php echo $data1['desmar']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desmer" id="desmer" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['desmer']; ?>" cols="20" datas="10"><?php echo $data1['desmer']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desjeu" id="desjeu" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['desjeu']; ?>" cols="20" datas="10"><?php echo $data1['desjeu']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desven" id="desven" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data1['desven']; ?>" cols="20" datas="10"><?php echo $data1['desven']; ?></textarea></p></td>
</tr>
</table>
</div>
<p align="center"><input type="text" name="text" id="text" style="width:920px;background-color:#A6E0FF;font-size:14px" value="<?php echo $data1['text']; ?>" /></p>
<br/>
<p align="center"><span class="art-button-wrapper"><span class="art-button-l"> </span><span class="art-button-r"> </span> <input class="art-button" type="submit" name="submit1" onmouseover="this.style.cursor='pointer';" value="Enregistrer" /></span></p>
</form>
</div><hr/>
<?php include ('procmd.php'); $requete = "SELECT * FROM garderie2 WHERE id='1'"; $result = mysql_query($requete); $data2 = mysql_fetch_array($result); mysql_close(); ?>
<div class="art-postcontent">
<form method="post" name="modify2">
<input name="id" type="hidden" id="id" value="<?php echo $data2['id']; ?>">
<h5 class="art-postheader">Semaine 2 : <input type="text" name="tisem" id="tisem" style="width:600px;background-color:#A6E0FF;font-size:18px" value="<?php echo $data2['tisem']; ?>" /></h5>
<div id="menus" align="center">
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Journées:</p></td>
<td width="15%"><p align="center">Lundi</p></td>
<td width="15%"><p align="center">Mardi</p></td>
<td width="15%"><p align="center">Mercredi</p></td>
<td width="15%"><p align="center">Jeudi</p></td>
<td width="15%"><p align="center">Vendredi</p></td>
</tr>
</table>
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Dîner:</p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinlun" id="dinlun" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinlun']; ?>" cols="20" datas="10"><?php echo $data2['dinlun']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinmar" id="dinmar" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinmar']; ?>" cols="20" datas="10"><?php echo $data2['dinmar']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinmer" id="dinmer" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinmer']; ?>" cols="20" datas="10"><?php echo $data2['dinmer']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinjeu" id="dinjeu" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinjeu']; ?>" cols="20" datas="10"><?php echo $data2['dinjeu']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="dinven" id="dinven" style="width:125px;background-color:#A6E0FF;height:250px;font-size:16px" value="<?php echo $data2['dinven']; ?>" cols="20" datas="10"><?php echo $data2['dinven']; ?></textarea></p></td>
</tr>
</table>
<table width="100%" class="art-article" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><p align="center">Dessert:</p></td>
<td width="15%"><p align="center"><textarea type="text" name="deslun" id="deslun" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['deslun']; ?>" cols="20" datas="10"><?php echo $data2['deslun']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desmar" id="desmar" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['desmar']; ?>" cols="20" datas="10"><?php echo $data2['desmar']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desmer" id="desmer" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['desmer']; ?>" cols="20" datas="10"><?php echo $data2['desmer']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desjeu" id="desjeu" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['desjeu']; ?>" cols="20" datas="10"><?php echo $data2['desjeu']; ?></textarea></p></td>
<td width="15%"><p align="center"><textarea type="text" name="desven" id="desven" style="width:125px;background-color:#A6E0FF;height:120px;font-size:16px" value="<?php echo $data2['desven']; ?>" cols="20" datas="10"><?php echo $data2['desven']; ?></textarea></p></td>
</tr>
</table>
</div>
<p align="center"><input type="text" name="text" id="text" style="width:920px;background-color:#A6E0FF;font-size:14px" value="<?php echo $data2['text']; ?>" /></p>
<br/>
<p align="center"><span class="art-button-wrapper"><span class="art-button-l"> </span><span class="art-button-r"> </span> <input class="art-button" type="submit" name="submit2" onmouseover="this.style.cursor='pointer';" value="Enregistrer" /></span></p>
</form>
</div><hr/>[/php]
Et voici mon fichier menugarderie_class.php
[php]<?php
if ($_POST['submit1']){
include ('procmd.php');
$id=$_POST['id'];
$tisem=$_POST['tisem'];
$dinlun=$_POST['dinlun'];
$dinmar=$_POST['dinmar'];
$dinmer=$_POST['dinmer'];
$dinjeu=$_POST['dinjeu'];
$dinven=$_POST['dinven'];
$deslun=$_POST['deslun'];
$desmar=$_POST['desmar'];
$desmer=$_POST['desmer'];
$desjeu=$_POST['desjeu'];
$desven=$_POST['desven'];
$text=$_POST['text'];
mysql_query("UPDATE garderie1 SET tisem='$tisem', dinlun='$dinlun', dinmar='$dinmar', dinmer='$dinmer', dinjeu='$dinjeu', dinven='$dinven', deslun='$deslun', desmar='$desmar', desmer='$desmer', desjeu='$desjeu', desven='$desven', text='$text' WHERE id='$id'");
header("location:http://traiteurpourvous.com/gestionw/index.php?page=menugarderie");
}
if ($_POST['submit2']){
include ('procmd.php');
$id=$_POST['id'];
$tisem=$_POST['tisem'];
$dinlun=$_POST['dinlun'];
$dinmar=$_POST['dinmar'];
$dinmer=$_POST['dinmer'];
$dinjeu=$_POST['dinjeu'];
$dinven=$_POST['dinven'];
$deslun=$_POST['deslun'];
$desmar=$_POST['desmar'];
$desmer=$_POST['desmer'];
$desjeu=$_POST['desjeu'];
$desven=$_POST['desven'];
$text=$_POST['text'];
mysql_query("UPDATE garderie2 SET tisem='$tisem', dinlun='$dinlun', dinmar='$dinmar', dinmer='$dinmer', dinjeu='$dinjeu', dinven='$dinven', deslun='$deslun', desmar='$desmar', desmer='$desmer', desjeu='$desjeu', desven='$desven', text='$text' WHERE id='$id'");
header("location:http://traiteurpourvous.com/gestionw/index.php?page=menugarderie");
}
?>[/php]
Mon premier form fonctionne à merveille mais mon deuxieme n'Update pas dutout...
Le SELECT m'affiche toutes mes données.