$FechaHoy=date('d-m-Y');
$FechaHoy2=date('Y-m-d');
$Hora= date(" H:i",time());
$FechaAyer = date("Y-m-d", strtotime("$FechaHoy2 -1 day"));
$FechaAntier = date("Y-m-d", strtotime("$FechaHoy2 -2 day"));
?>
 |
Alarmas |
Fecha: echo $FechaHoy ?> - Hora: echo $Hora ?> |
//Parámetros
$CantPRM=LeerStd($LecturaPRM,"410PRM","*","PRMFecha1=''","","","","");
for ($i=0; $i<$CantPRM; $i++){
$rowPRM= mysql_fetch_array($LecturaPRM);
if ($rowPRM[PRMNombre] == 'DDV') {$dias= $rowPRM[PRMLinea2]; $unidad= $rowPRM[PRMLista1];}
if ($rowPRM[PRMNombre] == 'DRM') {$dia1= $rowPRM[PRMLinea2]; $unidad1= $rowPRM[PRMLista1];}
if ($rowPRM[PRMNombre] == 'TMP') {$dia2= $rowPRM[PRMLinea2]; $unidad2= $rowPRM[PRMLista1];}
if ($rowPRM[PRMNombre] == 'DOLC') {$dia3= $rowPRM[PRMLinea2]; $unidad3= $rowPRM[PRMLista1];}
if ($rowPRM[PRMNombre] == 'DOTA') {$dia4= $rowPRM[PRMLinea2]; $unidad4= $rowPRM[PRMLista1];}
if ($rowPRM[PRMNombre] == 'CVD') {$dia5= $rowPRM[PRMLinea2];}
if ($rowPRM[PRMNombre] == 'KME') {$dia6= $rowPRM[PRMLinea2]; $unidad6= $rowPRM[PRMLista1];}
if ($rowPRM[PRMNombre] == 'DEF') {$dia7= $rowPRM[PRMLinea2]; $unidad7= $rowPRM[PRMLista1];}
if ($rowPRM[PRMNombre] == 'DCAS') {$dia8= $rowPRM[PRMLinea2]; $unidad8= $rowPRM[PRMLista1];}
if ($rowPRM[PRMNombre] == 'PUF') {$dia9= $rowPRM[PRMLinea2]; $unidad9= $rowPRM[PRMLista1];}
};
//Contratos Vencidos
$CantFCT=LeerStd($LecturaFCT,"410FCT","*","","","","","");
for ($i=0; $i<$CantFCT; $i++){
$rowFCT= mysql_fetch_array($LecturaFCT);
$CantCTR=LeerStd($LecturaCTR,"410CTR","*","CTRFecha2<'$FechaHoy2' AND CTRCant2!=$rowFCT[FCTLink1_CTR]","CTRFecha2 DESC","","","");
for ($j=0; $j<$CantCTR; $j++){
$rowCTR= mysql_fetch_array($LecturaCTR);
if ($NumCTR != $rowCTR[CTRCant2]) {
if ($rowCTR[CTRLink1_AR1] != ''){
$CantAR1=LeerStd($LecturaAR1,"410AR1","*","AR1Codigo=$rowCTR[CTRLink1_AR1]","","","","");
for ($y=0; $y<$CantAR1; $y++){
$rowAR1= mysql_fetch_array($LecturaAR1);
//echo " Nombre Cliente Juridico: ".$rowAR1[AR1Nombre];
//echo " Email Cliente Juridico: ".$rowAR1[AR1Email1];
$EmailCtrJur .= ",".$rowAR1[AR1Email1];
}
}
if ($rowCTR[CTRLink1_PER] != ''){
$CantPER=LeerStd($LecturaPER,"410PER","*","PERCodigo=$rowCTR[CTRLink1_PER]","","","","");
for ($y=0; $y<$CantPER; $y++){
$rowPER= mysql_fetch_array($LecturaPER);
//echo "
Nombre Cliente Natural: ".$rowPER[PERNombre];
//echo " Email Cliente Natural: ".$rowPER[PEREmail1];
$EmailCtrNat .= ",".$rowPER[PEREmail1];
}
}
$CTRvencidos++;
} $NumCTR = $rowCTR[CTRCant2];
};
}; if ($CTRvencidos=='') $CTRvencidos=0;
// Unidad con más de 2 dias disponibles
$FechaPasada = date("Y-m-d", strtotime("$FechaHoy2 -$dias day"));
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDLista8='Disponible' AND UNDCodigo!=''","UNDCodigo DESC","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantTRK=LeerStd($LecturaTRK,"410TRK","*","TRKLink1_UND='$rowUND[UNDCodigo]' AND TRKFecha1<'$FechaPasada'","TRKFecha1 DESC","","","");
for ($j=0; $j<$CantTRK; $j++){
if ($Unidades != $rowUND[UNDCodigo]){
$rowTRK= mysql_fetch_array($LecturaTRK);
if ($rowTRK[TRKLista2]=='Disponible') {
//echo "Unidad En TRK;".$rowTRK[TRKLink1_UND]; echo " ";
//echo "Fecha en TRK:".$rowTRK[TRKFecha1]; echo " ";
$CantDisp++;
}
} $Unidades = $rowUND[UNDCodigo];
};
}; if ($CantDisp=='') $CantDisp=0;
//Siniestros
$CantSIN=LeerStd($LecturaSIN,"410SIN","*","SINFecha2='$FechaHoy2'","","","","");
for ($i=0; $i<$CantSIN; $i++){
$rowSIN= mysql_fetch_array($LecturaSIN);
//Esto es para el correo de Siniestros
if ($rowSIN[SINLink1_CTR]!=0){
$CantCTR=LeerStd($LecturaCTR,"410CTR","*","CTRCodigo=$rowSIN[SINLink1_CTR]","","","","");
for ($j=0; $j<$CantCTR; $j++){
$rowCTR= mysql_fetch_array($LecturaCTR);
$CantAR1=LeerStd($LecturaAR1,"410AR1","*","AR1Codigo=$rowCTR[CTRLink1_AR1]","","","","");
for ($y=0; $y<$CantAR1; $y++){
$rowAR1= mysql_fetch_array($LecturaAR1);
//echo " Nombre Cliente Juridico: ".$rowAR1[AR1Nombre];
//echo " Email Cliente Juridico: ".$rowAR1[AR1Email1];
$EmailSinCtrJur .= ",".$rowAR1[AR1Email1];
}
$CantPER=LeerStd($LecturaPER,"410PER","*","PERCodigo=$rowCTR[CTRLink1_PER]","","","","");
for ($y=0; $y<$CantPER; $y++){
$rowPER= mysql_fetch_array($LecturaPER);
//echo "
Nombre Cliente Natural: ".$rowPER[PERNombre];
//echo " Email Cliente Natural: ".$rowPER[PEREmail1];
$EmailSinCtrNat .= ",".$rowPER[PEREmail1];
}
}
}; $ContarSinietros++;
}; if ($ContarSinietros=='')$ContarSinietros=0;
//Ordenes Uso de Vehículos Vencidas
$CantOAS=LeerStd($LecturaOAS,"410OAS","*","OASFecha2<'$FechaHoy2' AND OASFecha3 is Null AND OASLink1_UND!='0'","OASLink1_UND ASC","","","");
for ($i=0; $i<$CantOAS; $i++){
$rowOAS= mysql_fetch_array($LecturaOAS); //OASFecha2<'$FechaHoy2' AND OASFecha3='' AND OASLink1_UND!='0'
//echo " UNIDAD: ".$rowOAS[OASLink1_UND];
//echo " FECHA FIN ACORDADA: ".$rowOAS[OASFecha2];
//echo " ASIGNADO A: ".$rowOAS[OASLink1_AGE];
//echo "
";
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo='$rowOAS[OASLink1_UND]'","","","","");
for ($j=0; $j<$CantUND; $j++){
$rowUND= mysql_fetch_array($LecturaUND);
$ContarOAS++;
}
}if ($ContarOAS=='') $ContarOAS=0;
//Unidades con Placa Perdida
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo!=''","","","","");
for ($j=0; $j<$CantUND; $j++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantSIN=LeerStd($LecturaSIN,"410SIN","*","SINFecha2='$FechaHoy2' AND SINLista1='Pérdida de Placa' AND SINLink1_UND='$rowUND[UNDCodigo]'","","","","");
for ($i=0; $i<$CantSIN; $i++){
$rowSIN= mysql_fetch_array($LecturaSIN);
$ContarPlacas++;
}
} if ($ContarPlacas=='')$ContarPlacas=0;
//Unidades con más de xx xxx en reparación Mecánica
$FechaMenos7 = date("Y-m-d", strtotime("$FechaHoy2 -$dia1 day"));
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo!=''","UNDCodigo DESC","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantOTB=LeerStd($LecturaOTB,"410OTB","*","OTBLista2='Reparación Mecánica' AND OTBFecha2<'$FechaMenos7' AND OTBLink1_UND='$rowUND[UNDCodigo]'","OTBFecha2 DESC","","","");
for ($j=0; $j<$CantOTB; $j++){
if ($Unidad != $rowUND[UNDCodigo]){
$rowOTB= mysql_fetch_array($LecturaOTB);
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "FechaMenos7: ".$FechaMenos7; echo " ";
//echo "Tipo Reparación: ".$rowOTB[OTBLista2]; echo " ";
//echo "Fecha recepcion: ".$rowOTB[OTBFecha2]; echo "
";
$CantReparMeca++;
} $Unidad = $rowUND[UNDCodigo];
};
}; if ($CantReparMeca=='') $CantReparMeca=0;
//Unidad con más de xx xxx en Mantenimiento Preventivo
$FechaAyer = date("Y-m-d", strtotime("$FechaHoy2 -1 day"));
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo!=''","UNDCodigo DESC","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantOTB=LeerStd($LecturaOTB,"410OTB","*","OTBLista2='Mantenimiento Preventivo' AND OTBFecha2<'$FechaHoy2' AND OTBFecha5 is Null AND OTBLink1_UND='$rowUND[UNDCodigo]'","OTBFecha2 DESC","","","");
for ($j=0; $j<$CantOTB; $j++){
if ($UnidadOTB != $rowUND[UNDCodigo]){
$rowOTB= mysql_fetch_array($LecturaOTB);
$Suma = $Hora+$rowOTB[OTBHora1];
if (($Suma>$dia2) AND ($rowOTB[OTBFecha2] == $FechaAyer)) {
//echo "Hora: ".$Hora; echo " ";
//echo "Resta: ".$Resta; echo " ";
//echo "Hora OTB: ".$rowOTB[OTBHora1]; echo " ";
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "Tipo Reparación: ".$rowOTB[OTBLista2]; echo " ";
//echo "Fecha recepcion: ".$rowOTB[OTBFecha2]; echo "
";
$CantMantPrev++;
}
if ($rowOTB[OTBFecha2] < $FechaAyer){
//echo "Hora: ".$Hora; echo " ";
//echo "Resta: ".$Resta; echo " ";
//echo "Hora OTB: ".$rowOTB[OTBHora1]; echo " ";
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "Tipo Reparación: ".$rowOTB[OTBLista2]; echo " ";
//echo "Fecha recepcion: ".$rowOTB[OTBFecha2]; echo "
";
$CantMantPrev++;
}
} $UnidadOTB = $rowUND[UNDCodigo];
};
}; if ($CantMantPrev=='') $CantMantPrev=0;
//Ordenes de Trabajo por Evaluación
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo!=''","UNDCodigo DESC","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantOTB=LeerStd($LecturaOTB,"410OTB","*","OTBLista2='Evaluación' AND OTBFecha2='$FechaHoy2' AND OTBLink1_UND='$rowUND[UNDCodigo]'","OTBFecha2 DESC","","","");
for ($j=0; $j<$CantOTB; $j++){
if ($UnidadOTB != $rowUND[UNDCodigo]){
$rowOTB= mysql_fetch_array($LecturaOTB);
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "Tipo Reparación: ".$rowOTB[OTBLista2]; echo " ";
//echo "Fecha recepcion: ".$rowOTB[OTBFecha2]; echo "
";
$CantRepEval++;
} $UnidadOTB = $rowUND[UNDCodigo];
};
}; if ($CantRepEval=='') $CantRepEval=0;
//Ordenes Lavado/Combustible con mas de xx xxx abiertas
$FechaAyerLC = date("Y-m-d", strtotime("$FechaHoy2 -$dia3 day"));
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo!=''","UNDCodigo DESC","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantOAS=LeerStd($LecturaOAS,"410OAS","*","(OASLista1='Lavado' OR OASLista1='Combustible' OR OASLista1='Lavado y Combustible') AND OASFecha3 is Null AND OASFecha1<'$FechaHoy2' AND OASLink1_UND='$rowUND[UNDCodigo]'","OASFecha1 DESC","","","");
for ($j=0; $j<$CantOAS; $j++){
if ($UnidadOAS != $rowUND[UNDCodigo]){
$rowOAS= mysql_fetch_array($LecturaOAS);
$Resta2 = $Hora-$rowOAS[OASHora1];
if (($Resta2>0) AND ($rowOAS[OASFecha1] == $FechaAyerLC)) {
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "Fecha de Cierre: ".$rowOTB[OTBLista2]; echo " ";
//echo "Fecha Apertura: ".$rowOLC[OLCFecha1]; echo "
";
$CantLavCom++;
}
if ($rowOAS[OASFecha1] < $FechaAyerLC){
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "Fecha de Cierre: ".$rowOTB[OTBLista2]; echo " ";
//echo "Fecha Apertura: ".$rowOLC[OLCFecha1]; echo "
";
$CantLavCom++;
}
} $UnidadOAS = $rowUND[UNDCodigo];
};
}; if ($CantLavCom=='') $CantLavCom=0;
//Unidades Robadas
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo!=''","UNDCodigo DESC","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantSIN=LeerStd($LecturaSIN,"410SIN","*","SINLista1='Extravío o Robo' AND SINFecha2='$FechaHoy2' AND SINLink1_UND=$rowUND[UNDCodigo]","","","","");
for ($j=0; $j<$CantSIN; $j++){
$rowSIN= mysql_fetch_array($LecturaSIN);
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "Tipo Siniestro: ".$rowSIN[SINLista1]; echo " ";
//echo "Fecha Siniestro: ".$rowSIN[SINFecha2]; echo "
";
$ContarSinExtRobo++;
};
}; if ($ContarSinExtRobo=='')$ContarSinExtRobo=0;
//Ordenes de Trabajo con mas de xx xxx abiertas
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo!=''","UNDCodigo DESC","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantOTB=LeerStd($LecturaOTB,"410OTB","*","OTBFecha5 is Null AND OTBLink1_UND='$rowUND[UNDCodigo]'","OTBFecha2 DESC","","","");
for ($j=0; $j<$CantOTB; $j++){
if ($UnidadOTB2 != $rowUND[UNDCodigo]){
$rowOTB= mysql_fetch_array($LecturaOTB);
$FechaOtbAbiertas = date("Y-m-d", strtotime("$FechaHoy2 -$dia4 day"));
if ($rowOTB[OTBFecha2]<$FechaOtbAbiertas) {
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "Fecha recepcion: ".$rowOTB[OTBFecha2]; echo "
";
$CantOtbAbiertas++;
}
} $UnidadOTB2 = $rowUND[UNDCodigo];
};
}; if ($CantOtbAbiertas=='') $CantOtbAbiertas=0;
//Unidades Disponible con combustible < xxx
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDLista8='Disponible' AND UNDLista7>'$dia5' OR UNDLista7='Vacío' AND UNDCodigo!=''","","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
//echo "Unidad: ".$rowUND[UNDCodigo]; echo " ";
//echo "Combustible: ".$rowUND[UNDLista7]; echo " ";
$ContarCombust++;
};
//Unidades del Grupo F usadas por Gerentes
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDLista1='F'","UNDCodigo DESC","","","");
for ($j=0; $j<$CantUND; $j++){
$rowUND= mysql_fetch_array($LecturaUND);
$CantOAS=LeerStd($LecturaOAS,"410OAS","*","OASLink1_UND='$rowUND[UNDCodigo]'","OASFecha1 ASC","","","");
for ($i=0; $i<$CantOAS; $i++){
$rowOAS= mysql_fetch_array($LecturaOAS);
if ($UnidadGF != $rowUND[UNDCodigo]){
$CantAGE=LeerStd($LecturaAGE,"410AGE","*","AGECodigo='$rowOAS[OASLink1_AGE]' AND AGELinea4 LIKE 'Gerente%'","","","","");
for ($s=0; $s<$CantAGE; $s++){
$rowAGE= mysql_fetch_array($LecturaAGE);
$ContarGF++;
};
}$UnidadGF = $rowUND[UNDCodigo];
}
} if ($ContarGF=='') $ContarGF=0;
//Autorizaciones Pagos Vencidas en Contratos
$CantPAG=LeerStd($LecturaPAG,"410PAG","*","PAGFecha2='$FechaHoy2'","","","","");
for ($i=0; $i<$CantPAG; $i++){
$rowPAG= mysql_fetch_array($LecturaPAG);
$ContarPAG++;
} if ($ContarPAG=='')$ContarPAG=0;
//Autorizaciones Pagos por Vencerse en Contratos
$CantPAG=LeerStd($LecturaPAG,"410PAG","*","PAGFecha2<'$FechaHoy2' AND PAGFecha2>='$FechaAntier'","","","","");
for ($i=0; $i<$CantPAG; $i++){
$rowPAG= mysql_fetch_array($LecturaPAG);
$ContarPAGv++;
} if ($ContarPAGv=='')$ContarPAGv=0;
//Traslados Pendientes por Cierre
$CantOTS=LeerStd($LecturaOTS,"410OTS","*","OTSFecha2 is Null OR OTSFecha2='0000-00-00'","","","","");
for ($i=0; $i<$CantOTS; $i++){
$rowOTS= mysql_fetch_array($LecturaOTS);
//echo "Fecha: ".$rowOTS[OTSFecha2]; echo "
";
$ContarOTSPend++;
}
if ($ContarOTSPend=='')$ContarOTSPend=0;
//Unidades por Confirmar en Lista de Espera
$CantAR7=LeerStd($LecturaAR7,"410AR7","*","AR7Lista3 LIKE 'LNP -%' OR AR7Lista3 LIKE 'LN -%' AND AR7Fecha4='$FechaHoy2'","AR7Fecha4 ASC","","","");
for ($j=0; $j<$CantAR7; $j++){
$rowAR7= mysql_fetch_array($LecturaAR7);
//echo "Nombre Natural: ".$rowAR7[AR7Linea5]; echo " ";
//echo "Nombre Empresa: ".$rowAR7[AR7Linea1]; echo "
";
$CantListEsp++;
}; if ($CantListEsp=='') $CantListEsp=0;
//Empresas con Recorrido Mayor a xxxx
$FechaMesPasado = date("Y-m-d", strtotime("$FechaHoy2 -31 day"));
$CantCTR=LeerStd($LecturaCTR,"410CTR","*,Sum(CTRMonto7-CTRMonto1) as Total","CTRFecha2='$FechaHoy2' AND CTRFecha1>'$FechaMesPasado' AND CTRLink1_AR1!='' GROUP BY CTRLink1_AR1","CTRLink1_AR1 ASC","","","");
for ($i=0; $i<$CantCTR; $i++){
$rowCTR= mysql_fetch_array($LecturaCTR);
if ($rowCTR[Total]>=$dia6){
//echo "Nombre Empresa: ".$rowCTR[CTRLink1_AR1]; echo " ";
//echo "Total: ".$rowCTR[Total]; echo "
";
$ContarKmtsMay++;
}
} if ($ContarKmtsMay=='')$ContarKmtsMay=0;
//Facturas Crédito con más de xx xxx y No Entregadas
$FechaFCT = date("Y-m-d", strtotime("$FechaHoy2 -$dia7 day"));
$CantFCT=LeerStd($LecturaFCT,"410FCT","*","FCTLista1='Crédito' AND FCTFecha2<='$FechaFCT' AND FCTFecha1='0000-00-00' OR FCTFecha1=''","FCTFecha2 ASC","","","");
for ($i=0; $i<$CantFCT; $i++){
$rowFCT= mysql_fetch_array($LecturaFCT);
$ContarFctNoEnt++;
} if ($ContarFctNoEnt=='')$ContarFctNoEnt=0;
//Facturas Pendientes por Siniestralidad con más de xx xxx
$FechaFPS = date("Y-m-d", strtotime("$FechaHoy2 -$dia8 day"));
$CantSIN=LeerStd($LecturaSIN,"410SIN","*","","","","","");
for ($y=0; $y<$CantSIN; $y++){
$rowSIN= mysql_fetch_array($LecturaSIN);
$CantCTR=LeerStd($LecturaCTR,"410CTR","*","CTRFecha2<='$FechaFPS' AND CTRLink1_SIN=$rowSIN[SINCodigo]","","","","");
for ($i=0; $i<$CantCTR; $i++){
$rowCTR= mysql_fetch_array($LecturaCTR);
$CantFCT=LeerStd($LecturaFCT,"410FCT","*","FCTLista2='Alquiler' AND FCTLink1_CTR=$rowCTR[CTRCodigo]","","","","");
for ($j=0; $j<$CantFCT; $j++){
$rowFCT= mysql_fetch_array($LecturaFCT);
$ContarFacPenSin++;
}
}
} if ($ContarFacPenSin=='')$ContarFacPenSin=0;
//Estaciones con % de Utilización de flota menor al xxx
$CantUND=LeerStd($LecturaUND,"410UND","*","UNDCodigo!='' GROUP BY UNDLink1_EST","UNDLink1_EST ASC","","","");
for ($i=0; $i<$CantUND; $i++){
$rowUND= mysql_fetch_array($LecturaUND);
$e=$rowUND[UNDLink1_EST];
$CantUND2=LeerStd($LecturaUND2,"410UND","*","UNDLink1_EST=$rowUND[UNDLink1_EST]","UNDLink1_SUB ASC","","","");
for ($j=0; $j<$CantUND2; $j++){
$rowUND2= mysql_fetch_array($LecturaUND2);
$CantCTR=LeerStd($LecturaCTR,"410CTR","*","CTRFecha2='$FechaHoy2' AND CTRLink1_UND=$rowUND2[UNDCodigo]","","","","");
for ($y=0; $y<$CantCTR; $y++){
$rowCTR= mysql_fetch_array($LecturaCTR);
if ($PreSubGrupo==$rowUND2[UNDLink1_SUB]){
$ReporteFlota[$e][1] = $rowUND2[UNDLink1_SUB];
$s=RestarFechas($rowCTR[CTRFecha1], $FechaHoy2);
$ReporteFlota[$e][2] = $ReporteFlota[$e][2]+$s;
$ReporteFlota[$e][3] = $FechaHoy2;
}else {
$ReporteFlota[$e][1] = $rowUND2[UNDLink1_SUB];
$s=RestarFechas($rowCTR[CTRFecha1], $FechaHoy2);
$ReporteFlota[$e][2] = $s;
$ReporteFlota[$e][3] = $FechaHoy2;
}
$PreSubGrupo = $rowUND2[UNDLink1_SUB];
}
}
}
for ($e=0; $e<$CantUND; $e++){
$Porcenta = ($ReporteFlota[$e][2]/30)*100;
if (($Porcenta<=$dia9) AND ($ReporteFlota[$e][1]=!'') AND ($ReporteFlota[$e][3]==$FechaHoy2)) {
//echo "Porcentaje: ".$Porcenta;
//echo " Estación: ".$e;
//echo " Subgrupo: ".$ReporteFlota[$e][1];
//echo " Paso de 50 y su monto es: ".$ReporteFlota[$e][2];
//echo " Fecha: ".$ReporteFlota[$e][3];
//echo "
";
$ContarEstFlot++;
}
}if ($ContarEstFlot=='')$ContarEstFlot=0;
/*$CantAGE=LeerStd($LecturaAGE,"4AGE","*","AGEMacroPerfil='Admin'","","","","ECHO");
if ($CantAGE==0) die("No se consiguió el sitio ");
for ($i=0; $i<$CantAGE; $i++){
$rowAGE= mysql_fetch_array($LecturaAGE);
}; */
//Leer permisos
$PerfilCompleto = $cok[COKAutorizacion];
$MatrizPerfiles = explode("-", $PerfilCompleto);
$Perfil = $MatrizPerfiles[0];
$CantALR=LeerStd($LecturaALR,"410ALR","*","ALRLinea1 LIKE '%$Perfil%'","","","","");
?>
|