o to kod z wyborem checkboxa oraz selecta.
Kod
<?php
echo "<table border=1 align=center><tr class=srodek>
<td width=35 align=center>$lp</td>
<td width=70 align=center><input type=\"checkbox\" name=\"wybierz[]\" value=\"$licz[1]\" />$licz[1] </td>
<td width=400 align=left>$licz[2]</td><BR><td width=90 align=center> <select name=\"ile[]\">
<option value=\"0\"> ----</option>
<option value=\"1\">1</option>
<option value=\"2\">2</option>
<option value=\"3\">3</option>
<option value=\"4\">4</option>
<option value=\"5\">5</option>
</select>
</td></tr></table>";
?>
a tutaj zczytuje wartości z checkboxa oraz selecta:
Kod
<?php
if(count($wybierz)>0)
{
foreach($wybierz as $licz['1'])
{
$zapytanie = "select id, nazwa, opis from `paragraf` where nazwa='".$licz['1']."'";
$wykonaj = mysql_query($zapytanie);
while ($opis=mysql_fetch_array($wykonaj))
{
echo "<table border=1 align=center><tr class=nagl_m>
<td width=743 align=center>Paragraf: $licz[1] </br> $opis[2]</td>
</tr></table>";
echo "<table border=1 align=center><tr class=gora>
<td width=35 align=center>Lp</td>
<td width=70 align=center>Pozycja</td>
<td width=497 align=center>Opis</td>
<td width=125 align=center>Wartosc /</br>Zaangazowanie</td>
</tr></table>";
foreach($ile as $poz)
{
for($i=0; $i<$poz; ++$i)
{
$lp1=$i+1;
echo "<table border=1 align=center><tr class=gora>
<td width=35 align=center>$lp1</td>
<td width=70 align=center>
<select name=pozycja>
<option value=000>000
<option value=010>010
<option value=020>020
<option value=030>030
<option value=040>040
<option value=050>050
<option value=060>060
<option value=070>070
<option value=080>080
<option value=090>090
<option value=100>100
<option value=110>110
<option value=120>120
</option>
</select></td>
<td width=250 align=center><input type=text name=opis tabindex=1 maxlength=255 size=77></td>
<td width=100 align=center><input type=text name=kwota tabindex=1 maxlength=9,2 size=15></td>
</tr></table>";
}
}
}
}
}
if(count($wybierz)>0)
{
foreach($wybierz as $licz['1'])
{
$zapytanie = "select id, nazwa, opis from `paragraf` where nazwa='".$licz['1']."'";
$wykonaj = mysql_query($zapytanie);
while ($opis=mysql_fetch_array($wykonaj))
{
echo "<table border=1 align=center><tr class=nagl_m>
<td width=743 align=center>Paragraf: $licz[1] </br> $opis[2]</td>
</tr></table>";
echo "<table border=1 align=center><tr class=gora>
<td width=35 align=center>Lp</td>
<td width=70 align=center>Pozycja</td>
<td width=497 align=center>Opis</td>
<td width=125 align=center>Wartosc /</br>Zaangazowanie</td>
</tr></table>";
foreach($ile as $poz)
{
for($i=0; $i<$poz; ++$i)
{
$lp1=$i+1;
echo "<table border=1 align=center><tr class=gora>
<td width=35 align=center>$lp1</td>
<td width=70 align=center>
<select name=pozycja>
<option value=000>000
<option value=010>010
<option value=020>020
<option value=030>030
<option value=040>040
<option value=050>050
<option value=060>060
<option value=070>070
<option value=080>080
<option value=090>090
<option value=100>100
<option value=110>110
<option value=120>120
</option>
</select></td>
<td width=250 align=center><input type=text name=opis tabindex=1 maxlength=255 size=77></td>
<td width=100 align=center><input type=text name=kwota tabindex=1 maxlength=9,2 size=15></td>
</tr></table>";
}
}
}
}
}
kombinowałem już na różne sposoby i nie moge sobie z tym proadzić. Proszę o pomoc.