Guest User

eM

a guest
Feb 25th, 2012
31
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <title></title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <script type="text/javascript" src="calendar.js"></script>
  7.  
  8. </head>
  9. <body>
  10.  
  11. <?php
  12. if(isset($_POST['odeslat'])){
  13. foreach($_POST['interpret'] as $key=>$value){                                             //výpis pole
  14. echo $key."+".$value.$_POST['cas_ood'][$key].$_POST['cas_doo'][$key]."<br>";
  15. }
  16. //$cilovy_adresar= $_SERVER['DOCUMENT_ROOT']."/vos09/vos09zapletam/databaze/party/images/";
  17. //$cilovy_soubor= $cilovy_adresar. $_FILES['soubor']['name'];
  18. //$adresa="images/".$_FILES['soubor']['name'];
  19. //move_uploaded_file($_FILES['soubor']['tmp_name'], $cilovy_soubor);
  20.  
  21.  
  22. //include("../../mysql_connect.php");
  23. //$datum1=$_POST['datum_od']." ".$_POST['hh1'].":".$_POST['mm1'].":00";
  24. //$datum2=$_POST['datum_do']." ".$_POST['hh2'].":".$_POST['mm2'].":00";
  25. //mysql_query("INSERT INTO list_akce(nazev,misto,mesto,id_kraje,id_zanru,datum_a_cas_od,datum_a_cas_do,popis,vstupne,letak,mapa)
  26. //VALUES('$_POST[nazev]','$_POST[misto]','$_POST[mesto]','$_POST[kraj]','$_POST[zanr]','$datum1','$datum2','$_POST[popis]','$_POST[vstupne]','$adresa','$_POST[mapa]')");
  27. }
  28. ?>
  29.  
  30. <table>
  31. <form action="akce.php" name="insertForm" method="post" enctype="multipart/form-data">
  32. <tr><td>Název:</td><td><input type="text" name="nazev"></td></tr>
  33. <tr><td>Místo:</td><td><input type="text" name="misto"></td></tr>
  34. <tr><td>Město:</td><td><input type="text" name="mesto"></td></tr>
  35. <tr><td>Žánr:</td>
  36. <td>
  37. <select name="zanr">
  38. <?php
  39. include("../../mysql_connect.php");
  40. $sql1="SELECT*FROM list_zanry";
  41. if($vys = mysql_query("$sql1")){
  42. while ($zanr = mysql_fetch_array($vys)){
  43. echo "<option value='".$zanr['id_zanru']."'>".$zanr['nazev']."</option>";
  44. }
  45. }else echo mysql_error();
  46. ?>
  47. </select>
  48. </td>
  49. </tr>
  50. <tr><td>Kraj:</td>
  51. <td>
  52. <select name="kraj">
  53. <?php
  54. $sql="SELECT*FROM list_kraje";
  55. if($vysledek = mysql_query("$sql")){
  56. while ($kraj = mysql_fetch_array($vysledek)){
  57. echo "<option value='".$kraj['id_kraje']."'>".$kraj['nazev']."</option>";
  58. }
  59. }
  60. ?>
  61. </select>
  62. </td>
  63. </tr>
  64. <tr><td>Datum od:</td><td><input type="text" name='datum_od' value='0000-00-00'>  
  65.   <script type="text/javascript">
  66.                     <!--
  67.    document.write('<a title="Kalendář" href="javascript:openCalendar(\'lang=cs-utf-8&amp;server=1&amp;collation_connection=utf8_general_ci\', \'insertForm\', \'datum_od\', \'date\')"><img border="0" class="calendar" src="kalendar/kalendar.png" alt="Kalendář"/></a>')
  68.                     //-->
  69.     </script>
  70. <select name="hh1">
  71. <?php
  72. for($h=1;$h<=23;$h++){
  73. $hod=($h<10) ? "0".$h : $h;
  74. echo "<option value='".$hod."'>$hod</option>\n";
  75. }
  76.  
  77. ?>
  78.  
  79. </select>
  80. :
  81. <select name="mm1">
  82. <?php
  83. for($m=1;$m<=23;$m++){
  84. $min=($m<10) ? "0".$m : $m;
  85. echo "<option value='".$min."'>$min</option>\n";
  86. }
  87.  
  88. ?>
  89.  
  90. </select>
  91.  
  92. </tr>
  93.    
  94. <tr><td>Datum do:</td><td><input type="text" name='datum_do' value='0000-00-00'>  
  95.   <script type="text/javascript">
  96.                     <!--
  97.    document.write('<a title="Kalendář" href="javascript:openCalendar(\'lang=cs-utf-8&amp;server=1&amp;collation_connection=utf8_general_ci\', \'insertForm\', \'datum_do\', \'date\')"><img border="0" class="calendar" src="kalendar/kalendar.png" alt="Kalendář"/></a>')
  98.                     //-->
  99.     </script>
  100. <select name="hh2">
  101. <?php
  102. for($h2=1;$h2<=23;$h2++){
  103. $hod2=($h2<10) ? "0".$h2 : $h2;
  104. echo "<option value='".$hod2."'>$hod2</option>\n";
  105. }
  106.  
  107. ?>
  108.  
  109. </select>
  110. :
  111. <select name="mm2">
  112. <?php
  113. for($m2=1;$m2<=23;$m2++){
  114. $min2=($m2<10) ? "0".$m2 : $m2;
  115. echo "<option value='".$min2."'>$min2</option>\n";
  116. }
  117.  
  118. ?>
  119.  
  120. </select>
  121.  
  122. </tr>
  123. </tr>
  124. <tr><td>Vstupné:<td><input type="text" name="vstupne"></td></td></tr>
  125. <tr><td>Leták</td><td><input type="file" name="soubor"></td></tr>
  126. <tr><td>Mapa:</td><td><input type="text" name="mapa"></td></tr>
  127. <tr><td>Popis:</td><td><textarea name="popis"></textarea></td></tr>
  128. </table>
  129.  
  130. <?php
  131. $sql2="SELECT*FROM list_interpreti";
  132. if($vys2 = mysql_query("$sql2")){
  133. $option="";
  134. while($list = mysql_fetch_array($vys2)){
  135. $option.="<option value='".$list['id_interpreta']."'>".$list['jmeno']."</option>";
  136. }
  137. }else echo mysql_error();
  138. ?>
  139. <script>
  140.  function rozbal() {//javascript na přidání selectu
  141.   var txt = "<select name=\"interpret[]\"> <?php echo $option;?></select> od <input type=\"text\" size=\"2\" name=\"cas_ood[]\"> do <input type=\"text\" size=\"2\" name=\"cas_doo[]\"><br><br>";
  142.   document.getElementById("dvFile").innerHTML += txt;
  143. }
  144. </script>
  145. <input type="button" value="Přidej odpověď" name="rozbalit" onClick="rozbal();"><br><br>
  146. <?php
  147.  
  148. echo '<div id="dvFile">' ;
  149. echo "<select name='interpret[]'>";//problematická část
  150. echo $option;
  151. echo "</select> od <input type=\"text\" size=\"2\" name=\"cas_ood[]\"> do <input type=\"text\" size=\"2\" name=\"cas_doo[]\"><br><br>";
  152. echo '</div>';
  153.  
  154. ?>
  155.  
  156. <input type="submit" name="odeslat" value="Přidat akci">
  157.  
  158. </form>
  159.  
  160.  
  161. </body>
  162. </html>
RAW Paste Data