Ver Mensaje Individual
  #3 (permalink)  
Antiguo 02/04/2012, 11:07
rascabuchitos
 
Fecha de Ingreso: abril-2011
Ubicación: Peru
Mensajes: 486
Antigüedad: 13 años
Puntos: 9
Respuesta: repeticion de contenidos en insertar registros

<form id="insertar" name="insertar" method="post" action="">
<p>
<input name="comprobante" onfocus="if(this.value==this.defaultValue)this.val ue='';" onblur="if(this.value=='')this.value=this.defaultV alue;" type="text" id="comprobante" value="Comprobante" size="20" />
</p>
<?php
if ($totEmp> 0) {
$queEmp = "SELECT * FROM empresa ORDER BY comprobante ASC";
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);
while ($rowEmp = mysql_fetch_assoc($resEmp)) {
echo " ".$rowEmp['comprobante']."<br>";
}
}
?>
<p>
<input name="ruc" onfocus="if(this.value==this.defaultValue)this.val ue='';" onblur="if(this.value=='')this.value=this.defaultV alue;" type="text" id="ruc" value="RUC" size="20" />
</p>
<?php
if ($totEmp> 0) {
$queEmp = "SELECT * FROM empresa ORDER BY comprobante ASC";
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);
while ($rowEmp = mysql_fetch_assoc($resEmp)) {
echo " ".$rowEmp['ruc']."<br>";
}
}
?>
<p>
<input name="razon" onfocus="if(this.value==this.defaultValue)this.val ue='';" onblur="if(this.value=='')this.value=this.defaultV alue;" type="text" id="razon" value="Razon Social" size="20" />
</p>
<?php
if ($totEmp> 0) {
$queEmp = "SELECT * FROM empresa ORDER BY comprobante ASC";
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);
while ($rowEmp = mysql_fetch_assoc($resEmp)) {
echo " ".$rowEmp['razon']."<br>";
}
}
?>
<input type="submit" name="Submit" value="Insertar Registro" />
<input type="hidden" name="action" value="add" />
</form>

<?php if ($state) { ?>
<p><em>Registro insertado correctamente</em></p>
<?php } ?>