¿Tienes algo encontra de la identación?
Código PHP:
<?php
if ($estado == '1' or empty($estado)) {
} else {
// hacemos la consulta en la base de datos
$consulta = "SELECT * FROM OM_Oportunidad WHERE estado ='$estado'";
$corre_consulta = mysql_query($consulta) or die(mysql_error());
$numero_filas = mysql_num_rows($corre_consulta);
if ($numero_filas == '0') {
echo "En el momento No existen OPM registradas para el Estado indicado, por favor intente de nuevo";
} else {
while ($res = mysql_fetch_array($corre_consulta)) {
//formateamos las fechas
//Fecha Inicial
$fecha_inicial = $res['3'];
$explotado = explode("-", $fecha_inicial);
$dia_inicial = $explotado[2];
$mes_inicial = $explotado[1];
$anno_inicial = $explotado[0];
$meses = array(
"Enero ",
"Febrero ",
"Marzo ",
"Abril ",
"Mayo ",
"Junio ",
"Julio ",
"Agosto ",
"Septiembre ",
"Octubre ",
"Noviembre ",
"Diciembre "
);
$mact = $meses[$mes_inicial - 1];
$fecha_inicio = $mact;
$fecha_inicio .= $dia_inicial;
$fecha_inicio .= " de ";
$fecha_inicio .= $anno_inicial;
//Fecha Entrega Plan de Accion
$fecha_entrega = $res['14'];
$explotado2 = explode("-", $fecha_entrega);
$dia_entrega = $explotado2[2];
$mes_entrega = $explotado2[1];
$anno_entrega = $explotado2[0];
$meses2 = array(
"Enero ",
"Febrero ",
"Marzo ",
"Abril ",
"Mayo ",
"Junio ",
"Julio ",
"Agosto ",
"Septiembre ",
"Octubre ",
"Noviembre ",
"Diciembre "
);
$ment = $meses2[$mes_entrega - 1];
$fecha_entrega = $ment;
$fecha_entrega .= $dia_entrega;
$fecha_entrega .= " de ";
$fecha_entrega .= $anno_entrega;
echo "
";
//Calculamos fecha pendiente o atrasada
//Traemos Fecha de Hoy
$ano_hoy = date('Y');
$mes_hoy = date('m');
$dia_hoy = date('d');
//Hacemos el timestamp para cada fecha
$timestamp_entrega = mktime(0, 0, 0, $mes_entrega, $dia_entrega, $anno_entrega);
$timestamp_hoy = mktime(0, 0, 0, $mes_hoy, $dia_hoy, $ano_hoy);
//Restamos las fechas
$faltan_segundos = $timestamp_entrega - $timestamp_hoy;
//Convertimos el resultado a dias
$faltan_dias = $faltan_segundos / (60 * 60 * 24);
if ($faltan_dias < 0) {
$respuesta = "
<div style='color: red; font-weight: bold;'>Está atrasado " . abs($faltan_dias) . " dias.</div>
";
} else {
$respuesta = "
<div style='font-weight: bold;'>Faltan " . $faltan_dias . " dia(s) para la entrega.</div>
";
}
include('consulta/cliente.php');
}
"
";
}
}
if ($tipo_accion == '1' or empty($tipo_accion)) {
} else {
// hacemos la consulta en la base de datos
$consulta = "SELECT * FROM OM_Oportunidad WHERE tipo_accion ='$tipo_accion'";
$corre_consulta = mysql_query($consulta) or die(mysql_error());
$numero_filas = mysql_num_rows($corre_consulta);
if ($numero_filas == '0') {
echo "En el momento No existen OPM registradas para el Tipo de Accion indicado, por favor intente de nuevo";
} else {
while ($res = mysql_fetch_array($corre_consulta)) {
//formateamos las fechas
//Fecha Inicial
$fecha_inicial = $res['3'];
$explotado = explode("-", $fecha_inicial);
$dia_inicial = $explotado[2];
$mes_inicial = $explotado[1];
$anno_inicial = $explotado[0];
$meses = array(
"Enero ",
"Febrero ",
"Marzo ",
"Abril ",
"Mayo ",
"Junio ",
"Julio ",
"Agosto ",
"Septiembre ",
"Octubre ",
"Noviembre ",
"Diciembre "
);
$mact = $meses[$mes_inicial - 1];
$fecha_inicio = $mact;
$fecha_inicio .= $dia_inicial;
$fecha_inicio .= " de ";
$fecha_inicio .= $anno_inicial;
//Fecha Entrega Plan de Accion
$fecha_entrega = $res['14'];
$explotado2 = explode("-", $fecha_entrega);
$dia_entrega = $explotado2[2];
$mes_entrega = $explotado2[1];
$anno_entrega = $explotado2[0];
$meses2 = array(
"Enero ",
"Febrero ",
"Marzo ",
"Abril ",
"Mayo ",
"Junio ",
"Julio ",
"Agosto ",
"Septiembre ",
"Octubre ",
"Noviembre ",
"Diciembre "
);
$ment = $meses2[$mes_entrega - 1];
$fecha_entrega = $ment;
$fecha_entrega .= $dia_entrega;
$fecha_entrega .= " de ";
$fecha_entrega .= $anno_entrega;
echo "
";
//Calculamos fecha pendiente o atrasada
//Traemos Fecha de Hoy
$ano_hoy = date('Y');
$mes_hoy = date('m');
$dia_hoy = date('d');
//Hacemos el timestamp para cada fecha
$timestamp_entrega = mktime(0, 0, 0, $mes_entrega, $dia_entrega, $anno_entrega);
$timestamp_hoy = mktime(0, 0, 0, $mes_hoy, $dia_hoy, $ano_hoy);
//Restamos las fechas
$faltan_segundos = $timestamp_entrega - $timestamp_hoy;
//Convertimos el resultado a dias
$faltan_dias = $faltan_segundos / (60 * 60 * 24);
if ($faltan_dias < 0) {
$respuesta = "
<div style='color: red; font-weight: bold;'>Está atrasado " . abs($faltan_dias) . " dias.</div>
";
} else {
$respuesta = "
<div style='font-weight: bold;'>Faltan " . $faltan_dias . " dia(s) para la entrega.</div>
";
}
include('consulta/cliente.php');
}
"
";
}
}
PD: Aparte de que falta una } (No se donde, la puse al final... xD)
Así es más leible!
Y... pq hay " "; por ahi? O.O