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:
......
echo '<table class="table table-striped table-hover" border="1">';
echo '<thead><tr>';
echo "<th>L.p.</th>";
.......
?>
<form name="pozycje" id="pozycje" action="hurt_pdf.php" target="_blank" method="post">
<input type="image" style="width: 22px; height: 22px" src="../../../global/img/ikony/printer.png" alt="Drukuj zaznaczone" title="Drukuj zaznaczone" /></th>
<?
echo "<th width=70 align=center>Udostępnij</th>"; echo "<th width=70 align=center>Zablokuj</th>"; echo "<th width=70 align=center>Wydruk</th>"; echo "<th width=100 align=center>Opcje</th>";
{
$i++;
$k++;
echo "<td width=30 align=center>".$k." <a name=".$r[id
]." id=".$r[id
]."></a></td>"; echo '<td align="center" width="10px">'; echo '<input type="checkbox" name="drukuj[]" value="'.$r[id
].'|'.$r[nr
].'" onclick="all=deaktywacja();pokaz();return all;"/></input>';
if ($r['udostepnij'] == 0)
{
echo "<td width=40 align=center >"; echo "<form method="POST
" action=""> <input type=hidden name=id_odst id={$r[id]} value={$r[id]}>
<input type=hidden name=a value=udostepnij_on>
<input type=hidden name=nr value={$r[nr]}>
<input type=hidden name=nr_obw value={$r[nr_obw]}>
<button class=\"unstyled-button\" type=submit value=Zatwierdź>
<a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"\">
<span class=\"glyphicon glyphicon-eye-close\"></span></a></button></form></td>";
}
else
{
echo "<td width=40 align=center >"; echo "<form method="POST
" action=""> <input type=hidden name=id_odst id={$r[id]} value={$r[id]}>
<input type=hidden name=a value=udostepnij_off>
<input type=hidden name=nr value={$r[nr]}>
<input type=hidden name=nr_obw value={$r[nr_obw]}>
<button class=\"unstyled-button\" type=submit value=Zatwierdź>
<a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"\">
<span class=\"glyphicon glyphicon-eye-open\"></span>
</a></button></form></td>";
}
//zawieszenie odstrzału
if ($r['zawieszony'] != 1)
{
echo '<td align="center" width="10px">'; echo "<form method="POST
" action=""> <input type=hidden name=id_odst id={$r[id]} value={$r[id]}>
<input type=hidden name=a value=zawies_on>
<input type=hidden name=nr value={$r[nr]}>
<input type=hidden name=nr_obw value={$r[nr_obw]}>
<button class=\"unstyled-button\" type=submit value=Zatwierdź>
<a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"\">
<img src=../../../global/img/ikony/ok.png style=width:15px;height:15px;border:5px; />
</a></button></form></td>";
}
if ($r['zawieszony'] == 1)
{
echo '<td align="center" width="10px">'; echo "<form method="POST
" action=""> <input type=hidden name=id_odst id={$r[id]} value={$r[id]}>
<input type=hidden name=a value=zawies_off>
<input type=hidden name=nr value={$r[nr]}>
<input type=hidden name=nr_obw value={$r[nr_obw]}>
<button class=\"unstyled-button\" type=submit value=Zatwierdź>
<a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"\">
<img src=../../../global/img/ikony/no.png style=width:15px;height:15px;border:5px; />
</a></button></form></td>";
}
if($r['wydruk']=='1') {
echo "<td width=50 align=center><font color=\"black\"><small>Tak</small></font></td>"; }
if($r['wydruk']!='1') {
echo "<td width=50 align=center><font color=\"red\"><small>Nie</small></font></td>"; }
?>
<td width="100px" align="center">
<div class="dropdown dropstart text-end">
<button type="button" class="btn btn-success dropdown-toggle" data-bs-toggle="dropdown">
Wybierz opcje
</button>
........
</tr></form>
.............
Ten post edytował krzesik 21.10.2023, 17:59:35