ok, este pertenece al select donde selccionamos el numero de despliegue de grupo de campos (por llamarlo asi)
Código PHP:
<form id="form1" name="form1" method="get" action="<? echo $PHP_SELF; ?>">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="54%" bgcolor="#E4E4E4"><h3> <img src="../images/transferencia_datt_para_mar.jpg" width="157" height="25" />Afiliación -- Pagos </h3></td>
<td width="9%" bgcolor="#E4E4E4"><img src="../imagenes/paso-1.gif" width="50" height="50" /></td>
<td width="9%" bgcolor="#E4E4E4"><img src="../imagenes/paso-2.gif" width="50" height="50" /></td>
<td width="9%" bgcolor="#E4E4E4"><img src="../imagenes/paso-3-1.gif" width="50" height="50" /></td>
<td width="9%" bgcolor="#E4E4E4"><img src="../imagenes/paso-4.gif" width="50" height="50" /></td>
<td width="10%" bgcolor="#E4E4E4"><img src="../imagenes/paso-5.gif" width="50" height="50" /></td>
</tr>
</table>
<table width="90%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="38%">Número de Tarjeta para afiliar al cliente </td>
<td width="10%"><select name="cantidad" id="cantidad">
<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>
<option value="6">6</option>
</select></td>
<td width="52%"><input type="submit" name="Submit" value="Enviar" /></td>
</tr>
</table>
</form>
este otro esta en la misma pagina cuando se recibe un numero para desplegar
Código PHP:
<form action="funcion_cliente.php" method="post">
<?
include ("funcion_pagos.php");
for ($i=1; $i<=$cantidad; $i++){
echo $i;
form_pagos();
}
?>
<table width="80%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="right">
<? if ($_GET['cantidad']){
?>
<input name="pagos" type="submit" id="pagos" value="Continuar >>" />
<? } ?>
</td>
</tr>
</table>
<input name="id_cliente" type="hidden" id="id_cliente" value="<? echo $ident; ?>" />
<input name="id_cedula" type="hidden" id="id_cedula" value="<? echo $id_cedula; ?>" />
<input name="c_cantidad" type="hidden" id="c_cantidad" value="<? echo $cantidad; ?>" />
</form>
Ahora insertamos en la BD
Código PHP:
if ($_POST['pagos']){
for ($i=1; $i<=$c_cantidad ; $i++){
mysql_query ("INSERT INTO dato_pagos SET forma_pago='$p_pago', tc='$tarjeta', banco='$p_banco', nombre_tarjeta='$nombre_tarjeta', ci_tarjeta='$cedula', monto='$monto', n_operador='$operador', observaciones='$observaciones', id_cliente='$id_cliente'")
or die(mysql_error());
}
header ("location: form_pagos.php?id_cedula=$c_cedula&error=1 ");
mysql_close();
exit;
}
Graba el numero de despliegue pero repite solo el ultimo del grupo