login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Checkbox : gewijzigde waarde word niet doorgegeven of opgeslagen

Offline Schokkie - 07/01/2008 09:45
Avatar van SchokkieNieuw lid Hallo,

Na het wijzigen van de CheckBox worden de gewijzigde waarden niet opgeslagen of genoteerd.

  1. <html>
  2. <head>
  3. <title>EQCB Team-Fehlermeldung </title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <META HTTP-EQUIV="pragma" CONTENT="no-cache">
  6. <link href="../stylesheet_ie.css" rel="stylesheet" type="text/css">
  7. </head>
  8. <body bgcolor="#CCCCCC">
  9. <?php
  10. include("../taal.php");
  11.  
  12.  
  13. function Weergeven_team(){
  14.  
  15. // defignieren van de Array
  16. $teams = array();
  17.  
  18. include ("../config.inc.php");
  19. $query = "SELECT *FROM eqcb_rk WHERE Rk_View ='1' ORDER BY Volgorde_Rk ASC ";
  20. $resultaat = mysql_query($query) or die (mysql_error());
  21. while ($rij = mysql_fetch_object($resultaat)){
  22. $teams[] = stripslashes(nl2br($rij->Rk_rk ));
  23. }
  24. }
  25.  
  26. ?>
  27. <form name="<?php echo $_SERVER['PHP_SELF']?>" method="post" action="">
  28.  
  29. <?php
  30. include "../uren_automatic.php";
  31. //echo "<strong> EQCB Kalender<br>Working EQ : $Ploeg ($Werkuren)</strong>";
  32. include ("../admin/header_admin.php");
  33.  
  34.  
  35. echo "knop : " .$_POST['Submit'] . "<br>";
  36. if(isset($_POST['Submit'])) {
  37. //**************************
  38. if ($_POST['Submit'] == "Back") {
  39. echo "<meta http-equiv='refresh' content='0;URL=" . $_SERVER["PHP_SELF"] . "'";
  40. }
  41.  
  42. if ($_POST['Submit'] == "Reset") {
  43. echo "<meta http-equiv='refresh' content='0;URL=" . $_SERVER["PHP_SELF"] . "'";
  44. }
  45.  
  46. //****************************************************************************************
  47. if ($_POST['Submit'] == "Save") {
  48.  
  49.  
  50.  
  51. include ("../config.inc.php");
  52. $query = "SELECT * from eqcb_rk ORDER BY Volgorde_Rk ASC ";
  53. $resultaat = mysql_query($query) or die (mysql_error());
  54. while ($rij = mysql_fetch_object($resultaat)){
  55. //echo stripslashes(nl2br($rij->Rk_rk )) ."<br>";
  56. $Rk_rk_array[] = stripslashes(nl2br($rij->Rk_rk )); // unique
  57. }
  58. //mysql_query($query) or die (mysql_error());
  59. $array_counter = 0;
  60. foreach( $Rk_rk_array as $key => $value ) {
  61. //ophalen van de info uit de pagina
  62. $Rk_rk = $value;
  63. echo $_POST['Rk_input_'. $array_counter .''] . "*";
  64. echo "(". $_POST['Rk_input_'. $array_counter .''] . ")";
  65. $Rk_input = $_POST['Rk_input_'. $array_counter .''];
  66. if ($Rk_input != "1") {
  67. $Rk_input = "0";
  68. }
  69.  
  70. echo "(". $_POST['Rk_View_'. $array_counter .''] . ")";
  71. $Rk_View = $_POST['Rk_View_'. $array_counter .''];
  72. if ($Rk_View != "1") {
  73. $Rk_View = "0";
  74. }
  75.  
  76. $query = "UPDATE eqcb_rk SET Rk_input = '$Rk_input' , Rk_View='$Rk_View' WHERE Rk_rk='$Rk_rk' ";
  77. echo "$query<br>";
  78. $array_counter++;
  79. mysql_query($query) or die (mysql_error());
  80. }
  81. //mysql_query($query) or die (mysql_error());
  82.  
  83.  
  84. }
  85.  
  86. } ?>
  87.  
  88. <table width="750" border="0" align="center" cellpadding="1" cellspacing="1">
  89. <tr>
  90. <td><div align="center">
  91.  
  92.  
  93.  
  94. <table width="403" border="1" align="center" bgcolor="#CCCCCC" bordercolor="#FFFFFF">
  95. <tr>
  96. <td> <div align="center"><strong> Team </strong> </div>
  97. <div align="center">
  98. <?php
  99.  
  100. $Rk_rk_array = array();
  101. $Rk_input_array = array();
  102. $Rk_View_array = array();
  103. $Rk_Atelier_array = array();
  104. $Rk_Afdeling_array = array();
  105. $Volgorde_Rk_array = array();
  106. $IpNr_array = array();
  107.  
  108. include ("../config.inc.php");
  109. $query = "SELECT * from eqcb_rk ORDER BY Volgorde_Rk ASC ";
  110. $resultaat = mysql_query($query) or die (mysql_error());
  111. while ($rij = mysql_fetch_object($resultaat)){
  112. //echo stripslashes(nl2br($rij->Rk_rk )) ."<br>";
  113. $Rk_rk_array[] = stripslashes(nl2br($rij->Rk_rk )); // unique
  114. $Rk_input_array[] = stripslashes(nl2br($rij->Rk_input));
  115. $Rk_View_array[] = stripslashes(nl2br($rij->Rk_View));
  116. $Rk_Atelier_array[] = stripslashes(nl2br($rij->Rk_Atelier ));
  117. $Rk_Afdeling_array[] = stripslashes(nl2br($rij->Rk_Afdeling ));
  118. $Volgorde_Rk_array[] = stripslashes(nl2br($rij->Volgorde_Rk ));
  119. $IpNr_array[] = stripslashes(nl2br($rij->IpNr ));
  120.  
  121. }
  122.  
  123.  
  124. echo "<table width='600' border='1' bordercolor='#FFFFFF'>";
  125. echo "<tr>";
  126. echo "<td width ='100'>Team</td>";
  127. echo "<td width ='100'><div align='center'>Feed Forward</div></td>";
  128. echo "<td width ='100'><div align='center'>Aktief</div></td>";
  129. echo "<td width ='100'><div align='center'>Atelier</div></td>";
  130. echo "<td width ='100'><div align='center'>PM</div></td>";
  131. echo "<td width ='100'><div align='center'>IpNr</div></td>";
  132. echo "</tr>";
  133. echo "</table>";
  134.  
  135. echo "<table width='600' border='1'>";
  136. $array_counter = 0;
  137. foreach( $Rk_rk_array as $key => $value ) {
  138. //echo $array_counter . "- ";
  139. if (($value) != "SB29") {
  140. echo "<tr>";
  141.  
  142. echo "<td width ='100'>";
  143. echo "$value";
  144. echo "</td>";
  145.  
  146. //Rk_input_array
  147. echo "<td width ='100'>";
  148. echo "<div align='center'>";
  149. if ($Rk_input_array[$array_counter] == "1") {
  150. echo "<input name=\"Rk_input_$array_counter\" type=\"checkbox\" value=\"1\" CHECKED>";
  151. } else {
  152. echo "<input name=\"Rk_input_$array_counter\" type=\"checkbox\" value=\"0\" UNCHECKED>";
  153. }
  154. echo "</div>";
  155. echo "</td >";
  156.  
  157. //Rk_View_array
  158. echo "<td width ='100'>";
  159. echo "<div align='center'>";
  160. if ($Rk_View_array[$array_counter] == "1") {
  161. echo "<input name=\"Rk_View_$array_counter\" type=\"checkbox\" value=\"1\" CHECKED >";
  162. } else {
  163. echo "<input name=\"Rk_View_$array_counter\" type=\"checkbox\" value=\"0\" UNCHECKED>";
  164. echo "</div>";
  165. }
  166.  
  167. echo "</td >";
  168.  
  169. //Rk_Atelier_array
  170. echo "<td width ='100'>";
  171. echo "<div align='center'>";
  172. echo "$Rk_Atelier_array[$array_counter]";
  173. echo "</div>";
  174. echo "</td>";
  175.  
  176. //Rk_Afdeling_array
  177. echo "<td width ='100'>";
  178. echo "<div align='center'>";
  179. echo "$Rk_Afdeling_array[$array_counter]";
  180. echo "</div>";
  181. echo "</td>";
  182.  
  183. //IpNr
  184. echo "<td width ='100'>";
  185. echo "<div align='center'>";
  186. echo "$IpNr_array[$array_counter]";
  187. echo "</div>";
  188. echo "</td>";
  189.  
  190. echo "</tr>";
  191. }
  192. $array_counter++;
  193. }
  194. echo "</table>";
  195. ?>
  196. </div></td>
  197. </tr>
  198. </table>
  199.  
  200.  
  201.  
  202. <div align="center">
  203. <input type="submit" name="Submit" value="Save" >
  204. <input type="submit" name="Submit" value="Reset" >
  205. </div>
  206.  
  207.  
  208. </div></td>
  209. </tr>
  210. </table>
  211. </form>
  212. </body>
  213. </html>

2 antwoorden

Gesponsorde links
Offline Bart - 07/01/2008 11:20
Avatar van Bart PHP expert Plaatscode.be AUB. En even specifieker aangeven om welk stuk code het gaat.
Offline Schokkie - 07/01/2008 11:48
Avatar van Schokkie Nieuw lid http://www.plaatscode.be/4839/

Het gaat hem op het stuk waar hij de waarde van de checkbos ophaald uit de webpagina en dan in de db moet terug steken.

vanaf lijn 47.
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.183s