Hola Esta es la parte donde contruyo el formulario
Código PHP:
Ver original<table cellpadding="0" cellspacing="0" border="0" width="568">
<?
$sw="1";
for($i=0;$i<$num2;$i++){
if($sw=="1")
// $sql=insert into permisos(,)values ('','','','');
{
?>
<tr onmouseover="fila(this)" bgcolor="#F2F2F2">
<td align="center" valign="middle" height="20" width="20" ><div align="center">
<input name="id_ingredientes[]" type="checkbox" value="
<? echo mysql_result($rsU2,$i,("id_ingredientes"))?>" onclick="setPointer('#F2F9FF',this);" />
</div></td>
<td align="left" valign="middle" height="20" width="171" class="mantenimiento" >
<? echo mysql_result($rsU2,$i,("nombre"))?></td>
<td align="left" valign="middle" width="57" class="mantenimiento" ><div align="center">
<SELECT name="um[]" size="1" class="select" style="WIDTH: 50px">
<option value="">->> </option>
<option value="Kg" >Kg</option>
<option value="Uni" >Uni</option>
<option value="Lt" >Lt</option>
</SELECT>
</div></td>
<td align="left" valign="middle" width="50" class="mantenimiento" ><div align="center">
<input name="cant[]" type="text" class="input" id="cant[]" style="width:40px" value="0" />
</div></td>
<td align="left" valign="middle" width="50" class="mantenimiento" ><div align="center">
<input name="cu[]" type="text" class="input" id="cu" style="width:40px" value="0" />
</div></td>
<td align="left" valign="middle" width="51" class="mantenimiento" ><div align="center"></div></td>
<td width="30" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="sm[]" type="text" class="input" id="sm" style="width:25px" />
</div></td>
<td width="33" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="fau[]" type="text" class="input" id="fau" style="width:25px" />
</div></td>
<td width="33" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="per[]" type="text" class="input" id="per" style="width:25px" />
</div></td>
<td width="39" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="pro[]" type="text" class="input" id="pro" style="width:25px" />
</div></td>
<td width="34" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="ate[]" type="text" class="input" id="ate" style="width:25px" />
</div></td>
</tr>
<?
$sw="0";
}elseif($sw=="0")
{
?>
<tr onmouseover="fila(this)" bgcolor="#FDFDFD">
<td align="center" valign="middle" height="20" width="20" ><div align="center">
<input name="id_ingredientes[]" type="checkbox" value="
<? echo mysql_result($rsU2,$i,("id_ingredientes"))?>" onclick="setPointer('#F2F9FF',this);" />
</div></td>
<td width="171" height="20" align="left" valign="middle" class="mantenimiento" >
<? echo mysql_result($rsU2,$i,("nombre"))?> </td>
<td width="57" height="20" align="left" valign="middle" class="mantenimiento" ><div align="center">
<SELECT name="um[]" size="1" class="select" style="WIDTH: 50px">
<option value="">->> </option>
<option value="Kg" >Kg</option>
<option value="Uni" >Uni</option>
<option value="Lt" >Lt</option>
</SELECT>
</div></td>
<td width="50" height="20" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="cant[]" type="text" class="input" id="cant[]" style="width:40px" value="0" />
</div></td>
<td width="50" height="20" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="cu[]" type="text" class="input" id="cu" style="width:40px" value="0" />
</div></td>
<td width="51" height="20" align="left" valign="middle" class="mantenimiento" ><div align="center"></div></td>
<td height="20" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="sm[]" type="text" class="input" id="sm" style="width:25px" />
</div></td>
<td height="20" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="fau[]" type="text" class="input" id="fau" style="width:25px" />
</div></td>
<td height="20" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="per[]" type="text" class="input" id="per" style="width:25px" />
</div></td>
<td height="20" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="pro[]" type="text" class="input" id="pro" style="width:25px" />
</div></td>
<td height="20" align="left" valign="middle" class="mantenimiento" ><div align="center">
<input name="ate[]" type="text" class="input" id="ate" style="width:25px" />
</div></td>
</tr>
<?
$sw="1";
}
?>
<?
}
?>
</table>