Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][PHP]Form w Formie?
krzesik
post 21.10.2023, 17:57:45
Post #1





Grupa: Zarejestrowani
Postów: 478
Pomógł: 1
Dołączył: 25.08.2012

Ostrzeżenie: (0%)
-----


Witajcie,
mam potrzebę włączania i wyłączania różnych funkcjonalności w samej tabeli. Mam tam również szereg checkboxów, zaznaczamy jakie rekordy powinny nam się wydrukować.
I się nagle okazało, że powinienem wpakować forma do forma......ale tak się chyba nie robi... podpowiedzcie jak to wykonać.
Okrojony mój kod do rzeczy najważniejszych:

  1. ......
  2. echo '<table class="table table-striped table-hover" border="1">';
  3. echo '<thead><tr>';
  4. echo "<th>L.p.</th>";
  5. .......
  6. ?>
  7. <form name="pozycje" id="pozycje" action="hurt_pdf.php" target="_blank" method="post">
  8. <input type="image" style="width: 22px; height: 22px" src="../../../global/img/ikony/printer.png" alt="Drukuj zaznaczone" title="Drukuj zaznaczone" /></th>
  9. <?
  10. echo "<th width=70 align=center>Udostępnij</th>";
  11. echo "<th width=70 align=center>Zablokuj</th>";
  12. echo "<th width=70 align=center>Wydruk</th>";
  13. echo "<th width=100 align=center>Opcje</th>";
  14. echo "</tr></thead>";
  15.  
  16. while($r = mysql_fetch_array($wynik))
  17. {
  18. $i++;
  19. $k++;
  20. echo "<tr>";
  21. echo "<td width=30 align=center>".$k." <a name=".$r[id]." id=".$r[id]."></a></td>";
  22. echo '<td align="center" width="10px">';
  23. echo '<input type="checkbox" name="drukuj[]" value="'.$r[id].'|'.$r[nr].'" onclick="all=deaktywacja();pokaz();return all;"/></input>';
  24. echo '</td>';
  25.  
  26.  
  27.  
  28. if ($r['udostepnij'] == 0)
  29. {
  30. echo "<td width=40 align=center >";
  31. echo "<form method="POST" action="">
  32. <input type=hidden name=id_odst id={$r[id]} value={$r[id]}>
  33. <input type=hidden name=a value=udostepnij_on>
  34. <input type=hidden name=nr value={$r[nr]}>
  35. <input type=hidden name=nr_obw value={$r[nr_obw]}>
  36. <button class=\"unstyled-button\" type=submit value=Zatwierdź>
  37. <a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"\">
  38. <span class=\"glyphicon glyphicon-eye-close\"></span></a></button></form></td>";
  39. }
  40. else
  41. {
  42. echo "<td width=40 align=center >";
  43. echo "<form method="POST" action="">
  44. <input type=hidden name=id_odst id={$r[id]} value={$r[id]}>
  45. <input type=hidden name=a value=udostepnij_off>
  46. <input type=hidden name=nr value={$r[nr]}>
  47. <input type=hidden name=nr_obw value={$r[nr_obw]}>
  48. <button class=\"unstyled-button\" type=submit value=Zatwierdź>
  49. <a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"\">
  50. <span class=\"glyphicon glyphicon-eye-open\"></span>
  51. </a></button></form></td>";
  52. }
  53.  
  54.  
  55. //zawieszenie odstrzału
  56. if ($r['zawieszony'] != 1)
  57. {
  58. echo '<td align="center" width="10px">';
  59. echo "<form method="POST" action="">
  60. <input type=hidden name=id_odst id={$r[id]} value={$r[id]}>
  61. <input type=hidden name=a value=zawies_on>
  62. <input type=hidden name=nr value={$r[nr]}>
  63. <input type=hidden name=nr_obw value={$r[nr_obw]}>
  64. <button class=\"unstyled-button\" type=submit value=Zatwierdź>
  65. <a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"\">
  66. <img src=../../../global/img/ikony/ok.png style=width:15px;height:15px;border:5px; />
  67. </a></button></form></td>";
  68. }
  69. if ($r['zawieszony'] == 1)
  70. {
  71. echo '<td align="center" width="10px">';
  72. echo "<form method="POST" action="">
  73. <input type=hidden name=id_odst id={$r[id]} value={$r[id]}>
  74. <input type=hidden name=a value=zawies_off>
  75. <input type=hidden name=nr value={$r[nr]}>
  76. <input type=hidden name=nr_obw value={$r[nr_obw]}>
  77. <button class=\"unstyled-button\" type=submit value=Zatwierdź>
  78. <a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"\">
  79. <img src=../../../global/img/ikony/no.png style=width:15px;height:15px;border:5px; />
  80. </a></button></form></td>";
  81. }
  82.  
  83.  
  84. if($r['wydruk']=='1') {
  85. echo "<td width=50 align=center><font color=\"black\"><small>Tak</small></font></td>";
  86. }
  87. if($r['wydruk']!='1') {
  88. echo "<td width=50 align=center><font color=\"red\"><small>Nie</small></font></td>";
  89. }
  90.  
  91. ?>
  92.  
  93. <td width="100px" align="center">
  94. <div class="dropdown dropstart text-end">
  95. <button type="button" class="btn btn-success dropdown-toggle" data-bs-toggle="dropdown">
  96. Wybierz opcje
  97. </button>
  98. ........
  99.  
  100. </tr></form>
  101. .............
  102.  


Ten post edytował krzesik 21.10.2023, 17:59:35
Go to the top of the page
+Quote Post
trueblue
post 21.10.2023, 18:58:49
Post #2





Grupa: Zarejestrowani
Postów: 6 765
Pomógł: 1823
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Tak się robi: https://anto.online/code/html-form-submit-a...array-with-php/


--------------------
Go to the top of the page
+Quote Post
krzesik
post 21.10.2023, 21:57:17
Post #3





Grupa: Zarejestrowani
Postów: 478
Pomógł: 1
Dołączył: 25.08.2012

Ostrzeżenie: (0%)
-----


Czyli utworzyć jeden formularz z wieloma tablicami?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 29.05.2024 - 10:31