PHP - porq no corre!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 
Vista:

porq no corre!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Publicado por mjrr (6 intervenciones) el 30/08/2006 14:29:06
no entiendo la verdad porq el siguiente codigo no corre, en la programacion q muestro mas abajo lo q quiero es que al insertar la cedula del empleado me refresque el mismo formulario pero trayendo el nombre y el apellido que pertenecen a dicha cedula en la base de datos cargandolo a sus respectivos txt,?????????????? ahi va necesito alguien q me ayude tengo q entregar esa nomina en unos dias y no lo logro aca esta mi mejor intento ah no hace nada solo carga el formulario pero en blanco ni siquiera refresca la cedula...

<?php
//variables a mostrar en el formulario
$nombre="";
$apellido="";
$sueldoquinc="";
$fechaing="";
$accion=$_REQUEST['accion'];
$ci=$_REQUEST['ci'];

if ($accion=="Buscar"){
//consulta en la bd
//realizar la conexion a la base de datos
$con=mysql_connect("localhost", "root", "");
$basedato=mysql_select_db("nómina");
$SqL="Select * from empleado where ci='$ci'";
$query=mysql_query($sql);
$numero_de_registros=mysql_num_rows($query);
for ($i=0;$i<$numero_de_registros;$i++){
//traer los registros de la base de datos
$row=mysql_fetch_row($query);
$nombre=$row['nombre'];
$apellido=$row['apellido'];
$sueldoquinc=$row['sueldoquinc'];
$fechaing=$row['fechaing'];

}
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Nómina Empleados</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body,td,th {
color: #0000A0;
}
body {
background-color: #C7E1F8;
}
.Estilo2 {font-size: 18px}
-->
</style></head>

<body>
<p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="320" height="50">
<param name="movie" value="PERLAM.swf">
<param name="quality" value="high">

<embed src="PERLAM.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="320" height="50"></embed>
</object>
</p>
<p> </p>
<input type="hidden" name="accion" value="buscar">
<form name="form1" method="post" >
<p align="center" class="Estilo2">Nómina de Empleados</p>
<p align="center"> </p>
<p align="justify">Código de la Nómina
<input type="text" name="codnom">

</p>
<table width="779" border="4">
<tr bgcolor="#9DB5E1">
<td colspan="6"><div align="center"><strong>Datos del Empleado </strong></div></td>
</tr>
<tr>
<td colspan="6"><div align="center">Cédula del Empleado
<!--Si realizo la busqueda deberia mostrar el nombre del empleado si no lo muestra en blanc-->
<input type="text" name="ci" value="<?=$ci?>">
<input type="submit" name="buscar" value="Buscar">

</div></td>
</tr>
<tr>
<td colspan="6"> </td>
</tr>
<tr>
<td width="59">Nombre</td>
<td width="173"><input type="text" name="nombre" value="<?php echo $nombre;?>"> </td>

<td width="61">Apellido</td>
<td width="163"><input type="text" name="apellido" value="<?=$apellido?>"></td>
<td width="105">Fecha Ingreso</td>
<td width="172"><input type="text" name="fechaing" value="<?=$fechaing?>"></td>
</tr>
</table>
<table width="779" border="4">
<tr bgcolor="#9DB5E1">

<td colspan="6"><div align="center"><strong>Asignaciones</strong></div></td>
</tr>
<tr>
<td width="114">Sueldo Quincenal</td>
<td width="144"><input type="text" name="sueldoquinc" value="<?=$sueldoquinc?>"></td>
<td width="105">Sueldo Mensual</td>
<td width="144"><input type="text" name="sueldomens"></td>

<td width="82">Horas Extra</td>
<td width="144"><input type="text" name="horaext"></td>
</tr>
<tr>
<td colspan="6"> </td>
</tr>
<tr>
<td colspan="6"><div align="center">Total de Asignaciones
<input type="text" name="tasig">

<input type="submit" name="tasig" value="C">
</div></td>
</tr>


</table>
<table width="779" border="4">
<tr bgcolor="#9DB5E1">
<td colspan="6"><div align="center"><strong>Deducciones</strong></div></td>
</tr>

<tr>
<td width="99">Paro Forzoso</td>
<td width="148"><input type="text" name="parof"></td>
<td width="93">Ley P. H.</td>
<td width="170"><input type="text" name="leyph"></td>
<td width="79">Inasistencia</td>
<td width="144"><input type="text" name="inasist"></td>

</tr>
<tr>
<td colspan="6"> </td>
</tr>
<tr>
<td colspan="6"><div align="center">Total de Deducciones
<input type="text" name="tdeduc">
<input type="submit" name="tded" value="C">
</div></td>

</tr>
</table>
<p align="center"> </p>
<div align="center">
<table width="409" border="0">
<tr>
<td width="101"><strong>Total a Pagar </strong></td>
<td width="147"><input type="text" name="netopag"></td>

<td width="147"><input type="submit" name="total" value="Calcular"></td>
</tr>
</table>
</div>
<p align="center">
<input type="submit" name="guardar" value="Guardar">
</p>
<div align="center">
<table width="363" border="0">

<tr>
<td><div align="center"><a href="index.html">Menú Principal</a></div></td>
</tr>
</table>
</div>
<p align="center"> </p>
</form>
<p align="center">  </p>

</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:porq no corre!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Publicado por The Emulator (24 intervenciones) el 30/08/2006 17:39:44
Hola

Ya ensayaste asi:

<input type=text name=txtNombre value="<?php echo $Nombre;?>">

Lo que hace falta es que escribas en el html el valor de $Nombre si no colocas el echo no estarias haceindo nada.

saludos
http://www.theemulator.tk
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

ya lo intente!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Publicado por mjrr (6 intervenciones) el 30/08/2006 17:51:46
ya lo intente y no hace??????????? no me muestra nada en absoluto solo me vuelve a mostrar el formulario sin ningun dato cargado ya no se como hacerlo de verdad esa fue mi mejor idea.....
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar