Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/04/2004, 01:45
chari
 
Fecha de Ingreso: diciembre-2002
Mensajes: 130
Antigüedad: 21 años, 4 meses
Puntos: 0
Esto no deberia de aparecer pq no sirve para nada:

$tabla = mysql_query("SELECT fecha_ultimo_apunte FROM PERSONAL WHERE CODIGO= '$codigo'");
$rows = mysql_fetch_array($tabla);


El codigo cambiado es el siguiente:

Código PHP:
<? 
ob_start
();

include_once (
"../auth.php");
include_once (
"../authconfig.php");
include_once (
"../check.php");
include (
"../nivel.php");

$codigo $check["CODIGO"];
$fecha $check["fecha_ultimo_apunte"];

    
$dia=substr($fecha,8,2);
    
$mes=substr($fecha,5,2);
    
$anio=substr($fecha,0,4);
    
$fechagraba=$dia.'/'.$mes.'/'.$anio;
    
    if(
substr($fecha1,1,1) == '/')
{
    
$dia1='0'.substr($fecha1,0,1);    
    if(
substr($fecha1,3,1) == '/')
    {
    
$mes1='0'.substr($fecha1,2,1);
    }
    else
    {
    
$mes1=substr($fecha1,2,2);
    }
}
    else
{
    
$dia1=substr($fecha1,0,2);    
    
    if(
substr($fecha1,4,1) == '/')
    {
    
$mes1='0'.substr($fecha1,3,1);
    }
    else
    {
    
$mes1=substr($fecha1,3,2);
    }
}
    
    
$anio1=substr($fecha1,-4);
    
    
$fechagraba1=$dia1.'/'.$mes1.'/'.$anio1;
    
$fecha_cal=$anio1.'-'.$mes1.'-'.$dia1;
    
    
?>
<html>
<head>
<title>Proyectos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php

if ($fecha $fecha_cal)
{
    echo 
"&nbsp;<img src=\"../Itsmo.gif\" width=\"50\" height=\"25\">";
    echo 
"La fecha introducida es anterior al ultimo apunte introducido.\n";
}
if (
$fecha <= $fecha_cal)
{
    
$Update=mysql_query("UPDATE PERSONAL SET fecha_ultimo_apunte ='$fecha_cal' WHERE CODIGO ='$codigo'");
    
$result1 mysql_query($Update); 
        
$sql "INSERT INTO HORAS (PERSONA, FECHA, PROYECTO, HORAS, COMENTARIO, COSTE) VALUES ('$codigo', '$fecha_cal', '$proyecto', '$horas', '$comentario', '$coste')";
$result mysql_query($sql);
echo 
"&nbsp;<img src=\"../Itsmo.gif\" width=\"50\" height=\"25\">";
echo 
"Sus datos han sido introducidos.\n";
header ("Location: horas2.php");
}
echo 
"<a href=horas2.php>volver</a>";
?>

</body>
</html>
<?
ob_end_flush
();
?>