alert('Este cliente no tiene un email asociado');die();";
}
$conductor = $row[AR7Link2_PER];
if ($conductor !="" AND $conductor !=0){
$cantC1=LeerStd($conductores,"410PER","*","PERCodigo = '$conductor'","","","","");
$rowC1=mysql_fetch_array($conductores);
$conductor=$rowC1[PERNombre];
}
$lugarAlquiler = $row[AR7Link1_EST];
$cantE1=LeerStd($estaciones1,"410EST","*","ESTCodigo = '$lugarAlquiler'","","","","");
$rowE1=mysql_fetch_array($estaciones1);
$lugarAlquiler = $rowE1[ESTNombre];
$ciudadAlquiler = $rowE1[ESTLista3];
$fechaAlquiler = $row[AR7Fecha1];
$horaAlquiler = $row[AR7Hora1];
$lugarDevolucion = $row[AR7Link2_EST];
$cantE2=LeerStd($estaciones2,"410EST","*","ESTCodigo = '$lugarDevolucion'","","","","");
$rowE2=mysql_fetch_array($estaciones2);
$lugarDevolucion = $rowE2[ESTNombre];
$ciudadDevolucion = $rowE2[ESTLista3];
$fechaDevolucion = $row[AR7Fecha2];
$horaDevolucion = $row[AR7Hora2];
$diasAlquiler = $row[AR7Cant1];
$subgrupo = $row[AR7Link1_SUB];
$cantS=LeerStd($subgr,"410SUB, 410MOD","*","SUBCodigo = '$subgrupo' AND SUBLink1_MOD = MODCodigo","","","","");
$rowS=mysql_fetch_array($subgr);
$subgrupoDesc = $rowS[MODNombre];
$grupo = $rowS[SUBLista1];
$precio = $row[AR7Link1_EVE];
$cantP=LeerStd($precios,"410EVE","*","EVECodigo = '$precio'","","","","");
$rowP=mysql_fetch_array($precios);
$precio = $rowP[EVENombre];
$precioFamilia = $rowP[EVELista2];
$codTarifa = $rowP[EVELinea2];
$proyecto = $row[AR7Linea59];
if($proyecto == ''){
$cantTAR=LeerStd($tar,"410AR9","*","AR9Link1_SUB = '$subgrupo' AND AR9Linea1 ='$codTarifa' AND AR9Fecha1<= '$fechaAlquiler' AND (AR9Fecha2 = '0000-00-00' OR AR9Fecha2>='$fechaAlquiler' OR AR9Fecha2= '')","","","","");
$rowTAR = mysql_fetch_array($tar);
}
else{
$cantPRY=LeerStd($pry,"410PYT","*","PYTCodigo = '$proyecto' ","","","","");
$rowPry=mysql_fetch_array($pry);
$cantTAR=LeerStd($tar,"410AR9","*","AR9Link1_SUB = '$subgrupo' AND AR9Linea1 ='$rowPry[PYTLinea2]' AND AR9Fecha1<= '$fechaAlquiler' AND (AR9Fecha2 = '0000-00-00' OR AR9Fecha2>='$fechaAlquiler' OR AR9Fecha2= '')","","","","");
$rowTAR = mysql_fetch_array($tar);
}
$alquiler = $row[AR7Monto4];
$subtotal = $row[AR7Monto5];
$descuento = $row[AR7Cant2];
$fechaReserva = $row[AR7Fecha4];
$horaReserva = $row[AR7Hora4];
$localizador = $row[AR7Linea13];
$fechaauxiliar=explode("-", $fechaAlquiler);
$fechaauxiliar2=explode("-", $fechaDevolucion);
$fechaauxiliar3=explode("-", $fechaReserva);
$fechaAlquiler =$fechaauxiliar[2]."/".$fechaauxiliar[1]."/".$fechaauxiliar[0];
$fechaDevolucion =$fechaauxiliar2[2]."/".$fechaauxiliar2[1]."/".$fechaauxiliar2[0];
$fechaReserva =$fechaauxiliar3[2]."/".$fechaauxiliar3[1]."/".$fechaauxiliar3[0];
$ParamLoc = LeerStd($buscarParam, '410PRM', "*", "PRMNombre='DIA'", "", "", "", "");
$rowParam = mysql_fetch_array($buscarParam);
$horaParaDiaAdicional =$rowParam[PRMLinea2];
if (strtotime($fechaAlquiler) == strtotime($fechaDevolucion)){
$diasAlquiler=1;
$horaAdic=0;
} else {
if (strtotime ($horaDevolucion)> strtotime ($horaAlquiler)){
$horaiHoy=substr($horaDevolucion,0,2);
$miniHoy=substr($horaDevolucion,3,2);
$ini=((($horaiHoy*60)*60)+($miniHoy*60));
$horafAlquiler=substr($horaAlquiler,0,2);
$minfAlquiler=substr($horaAlquiler,3,2);
$fin=((($horafAlquiler*60)*60)+($minfAlquiler*60));
$dif=$ini-$fin;
$cantHoras=floor($dif/3600);
//$cantHoras =$horaDevolucion-$horaAlquiler;
if($cantHoras>=$horaParaDiaAdicional){
$horaAdic=0;
}
else{
$horaAdic=$cantHoras;
}
} else {
$horaAdic=0;
}
}
$alquilerSubTotal = $alquiler + ($horaAdic*$row[AR7Monto10]);
$alquilerDcto=($alquiler+($horaAdic*$row[AR7Monto10]))-((($alquiler+($horaAdic*$row[AR7Monto10]))*$descuento)/100);
$rutaLogo="http://".$_SERVER[HTTP_HOST] ."/".$TOimg.$PRM['NEMP'];
//ilander - Ticket 4263
$mensaje="
 |
";
if($row[AR7Linea8] != '' AND $row[AR7Linea8] != '0'){
$mensaje=$mensaje. "
IATA: |
$row[AR7Linea8] |
";
}
if($row[AR7Linea38] != '' AND $row[AR7Linea38] != '0'){
$mensaje=$mensaje."
VT: |
$row[AR7Linea38] |
";
}
$mensaje=$mensaje."
Cliente: |
$cliente |
";
if($MembGold != ''){
$mensaje=$mensaje."
Gold/Platinum: |
$MembGold |
";
}
if($MembInveru != ''){
$mensaje=$mensaje."
Inverunion: |
$MembInveru |
";
}
if($MembViaje != ''){
$mensaje=$mensaje."
Viajero Frecuente: |
$MembViaje |
";
}
if($MembCPD != ''){
$mensaje=$mensaje."
Nro. CDP: |
$MembCPD |
";
}
if($conductor != '' AND $conductor != '0'){
$mensaje=$mensaje."
Conductor: |
$conductor |
";
}
$mensaje=$mensaje."
Localizador: |
$localizador |
";
if($row[AR7Lista2] == "03 - Reservas Emisivas"){
$mensaje=$mensaje."
Localidad de Alquiler: |
$row[AR7Linea49] |
";
} else {
$mensaje=$mensaje."
Localidad de Alquiler: |
$lugarAlquiler |
Ciudad: |
$ciudadAlquiler |
";
}
$mensaje=$mensaje."
Fecha: |
$fechaAlquiler |
Hora: |
$horaAlquiler |
";
if($row[AR7Lista2] == "03 - Reservas Emisivas"){
$mensaje=$mensaje."
Localidad de Devolución: |
$row[AR7Linea50] |
";
} else {
$mensaje=$mensaje."
Localidad de Devolución: |
$lugarDevolucion |
Ciudad: |
$ciudadDevolucion |
";
}
$mensaje=$mensaje."
Fecha: |
$fechaDevolucion |
Hora: |
$horaDevolucion |
";
if($row[AR7Lista2] == "03 - Reservas Emisivas"){
$mensaje=$mensaje."
Tipo de Vehículo: |
$row[AR7Linea51] o similar grupo '$row[AR7Linea54]' |
Días de Alquiler: |
$diasAlquiler
|
";
} else {
$mensaje=$mensaje."
Tipo de Vehículo: |
$subgrupoDesc. |
";
if($row[AR7Cant8] > 0){
$Basado = "Cálculo en Base a Un Mes";
} else {
$Basado = "";
}
if($row[AR7Cant8] > 0) {
$Tiempo = "$row[AR7Cant8] Mes(es)";
}
if($row[AR7Cant7] > 0) {
$Tiempo .= " $row[AR7Cant7] Semana(s)";
}
if($row[AR7Cant6] > 0) {
$Tiempo .= " $row[AR7Cant6] Día(s)";
}
if($row[AR7Cant8] == 0 AND $row[AR7Cant7] == 0 AND $row[AR7Cant6] == 0) {
$Tiempo = "";
}
$mensaje=$mensaje."
Tiempo de Alquiler: |
$Tiempo $Basado |
";
}
if($row[AR7Lista2] == "03 - Reservas Emisivas"){
$mensaje=$mensaje."
Precio: |
$row[AR7Linea44] |
";
} else {
$mensaje=$mensaje."
Precio: |
Lista de Precio $precioFamilia |
";
$mensaje=$mensaje."
La Lista de Precio Incluye: |
|
Monto de Alquiler: |
".number_format($alquiler, 2, ',','.')." |
";
if($horaAdic != 0){
$mensaje=$mensaje."
$horaAdic Hora(s) Adicional(es): |
".number_format($horaAdic*$row[AR7Monto10], 2, ',','.')." |
";
}
if($alquilerSubTotal != 0){
$mensaje=$mensaje."
|
________________ |
Alquiler sin Dscto: |
".number_format($alquilerSubTotal, 2, ',','.')." |
";
}
if($descuento != 0){
$mensaje=$mensaje."
% Descuento: |
$descuento |
|
________________ |
Alquiler con Dscto: |
".number_format($alquilerDcto, 2, ',','.')." |
";
}
$mensaje=$mensaje."
Sub-Total Alquiler: |
".number_format($alquilerDcto, 2, ',','.')." |
";
$contAdic=0;
$contAdicMenor=0;
$totalCondAdic=0;
$totalCondAdicMenor=0;
$cantS=LeerStd($serviciosS,"410AR4 ","*","","AR4Cant1 ASC","","","");
for ($s=0; $s<$cantS; $s++){
$rowServ=mysql_fetch_array($serviciosS);
//Para Ordenar por Servicios Obligatorio Primero
$cantRDT=LeerStd($detalles,"410RDT ","*","RDTLink1_AR7 = '$ident' AND RDTLink1_AR4 = '$rowServ[AR4Codigo]'","","","","");
for ($i=0; $i<$cantRDT; $i++){
$rowRDT=mysql_fetch_array($detalles);
$cant4=LeerStd($servicios,"410AR4 ","*","AR4Codigo = '$rowRDT[RDTLink1_AR4]'","","","","");
$row4=mysql_fetch_array($servicios);
if ($rowRDT[RDTLink1_AR4]==6){
$contAdic=$contAdic+1;
$nombre=$row4[AR4Nombre];
if($row[AR7Cant8] >= 1) $monto=$rowRDT[RDTMonto1] * $rowTAR[AR9Cant6];
else $monto=$rowRDT[RDTMonto1] * $diasAlquiler;
}
//else if ($rowRDT[RDTLink1_AR4]==7){
else if ($rowRDT[RDTLink1_AR4]==5){
$contAdicMenor=$contAdicMenor+1;
$nombre=$row4[AR4Nombre];
if($row[AR7Cant8] >= 1) $monto2=$rowRDT[RDTMonto1] * $rowTAR[AR9Cant6];
else $monto2=$rowRDT[RDTMonto1] * $diasAlquiler;
}
else{
if ($rowRDT[RDTLink1_AR4]==7){
$nombre='Seguro';
}else{
$nombre=$row4[AR4Nombre];
}
$mensaje=$mensaje."
$nombre: |
".number_format($rowRDT[RDTMonto1], 2, ',','.')." |
";
}
}
}
if ($contAdic> 0 OR $contAdicMenor > 0){
if($contAdic == 0)$monto = 0;
if($contAdicMenor == 0) $monto2 = 0;
if ($contAdic == $contAdicMenor) {
$total= ($contAdicMenor * $monto2) + ($contAdic * $monto);
} elseif ($contAdic > $contAdicMenor){
$total=($contAdic * $monto) + $monto2;
}
else{
$total= $monto + $monto2;
if($contAdicMenor > 1) $contAdic = 1;
$mensaje=$mensaje."
Conductor Principal Menor: |
".number_format($monto2, 2, ',','.')." |
";
}
if($contAdic > 0){
$mensaje=$mensaje."
$contAdic $nombre: |
".number_format($total, 2, ',','.')." |
";
}
}
}//Cierra de PRECIO if($row[AR7Lista2] == "03 - Reservas Emisivas")
$fechaDeHoy = date('Y-m-d');
$CantDMD=LeerStd($DMD,'410PRM',"*","PRMNombre = 'DMD' AND (PRMFecha1 ='' OR PRMFecha1 ='0000-00-00' OR PRMFecha1 >='$fechaDeHoy')","","","","");
$rowDMD=mysql_fetch_array($DMD);
if($lugarAlquiler != $lugarDevolucion && $diasAlquiler < $rowDMD[PRMLinea2]){
$CantDO=LeerStd($DO,'410PRM',"*","PRMNombre = 'DOF' AND (PRMFecha1 ='' OR PRMFecha1 ='0000-00-00' OR PRMFecha1 >='$fechaDeHoy')","","","","");
$rowDO=mysql_fetch_array($DO);
//Costo del Km de DropOff
$costoDO = $rowDO[PRMLinea2];
//Buscando el la tabla Kms entre ciudades
$CantKMS=LeerStd($KMS,'410KMS',"*","(KMSLista1 = '$ciudadAlquiler' OR KMSLista1 = '$ciudadDevolucion') AND (KMSLista2 = '$ciudadAlquiler' OR KMSLista2 = '$ciudadDevolucion')","","","","");
$rowKMS=mysql_fetch_array($KMS);
$cantidadKMS = $rowKMS[KMSCant1];
$dropoff=$costoDO*$cantidadKMS;
$mensaje=$mensaje."
Devolución en Otra Ciudad (".$cantidadKMS." kms) |
".number_format($dropoff, 2, ',','.')." |
";
}
if($row[AR7Lista2] == "03 - Reservas Emisivas"){
$mensaje=$mensaje."
Subtotal sin Impuesto VEB: |
".$Bs."".number_format($subtotal, 2, ',','.')." |
";
} else {
$mensaje=$mensaje."
|
________________ |
Subtotal sin Impuesto VEB: |
".$Bs."".number_format($subtotal, 2, ',','.')." |
";
}
//ilander - Ticket 4263
$cantPAG1=LeerStd($Pagos1,"410PAG","*","PAGLinea13 = '$row[AR7Linea13]'","PAGCodigo","","","");
$mensaje=$mensaje."
";
//Buscar Pagos Realizados
if ($cantPAG1>0){
$mensaje=$mensaje."
Nro.Pago |
Forma Pago |
Monto ".$Bs." |
Fecha Pago |
";
$TotalPagos=0;
for($i =0; $i<$cantPAG1; $i++){
$rowPAG1 = mysql_fetch_array($Pagos1);
$FechaPago=$rowPAG1[PAGFecha6];
$FechaPago1=explode("-", $FechaPago);
$FechaPagoF =$FechaPago1[2]."/".$FechaPago1[1]."/".$FechaPago1[0];
$mensaje=$mensaje."
$rowPAG1[PAGCodigo] |
$rowPAG1[PAGLista2] |
".number_format($rowPAG1[PAGMonto1], 2, ',','.')." |
$FechaPagoF |
";
$TotalPagos=$TotalPagos + $rowPAG1[PAGMonto1];
}
}
else {
$mensaje=$mensaje."
No existen prepagos realizados | ";
}
$mensaje=$mensaje."
|
PREPAGOS |
";
// Fin - ilander - Ticket 4263
$cantPAG=LeerStd($Pagos,"410PAG","*","PAGLink1_AR7 = '$row[AR7Codigo]'","PAGCodigo","","","");
$rowPAG=mysql_fetch_array($Pagos);
if($row[AR7Linea43] != ''){
$NumVauc = $row[AR7Linea43];
}
else if($rowPAG[PAGCant4] != ''){
$NumVauc = $rowPAG[PAGCant4];
}
if($NumVauc == ''){
$cantNV=LeerStd($reservas,"410AR7","*","AR7Linea13 = '$row[AR7Linea13]'","AR7Codigo ASC","","","");
for($r=0; $r < $cantNV; $r++){
$rowNV=mysql_fetch_array($reservas);
$cantPAG=LeerStd($Pagos,"410PAG","*","PAGLink1_AR7 = '$rowNV[AR7Codigo]'","PAGCodigo","","","");
$rowPAG=mysql_fetch_array($Pagos);
if($rowNV[AR7Linea43] != ''){
$NumVauc = $rowNV[AR7Linea43];
}
else if($rowPAG[PAGCant4] != ''){
$NumVauc = $rowPAG[PAGCant4];
}
}
}
//ilander - Ticket 4263
$mensaje=$mensaje.
"
Número de Prepago: |
$NumVauc |
Monto Total del Prepago VEB: |
".$Bs."".number_format($TotalPagos, 2, ',','.')." |
";
if($row[AR7Monto11] > 0){
$fehcaPrepaA=explode("-", $row[AR7Fecha4]);
$fehcaPrepa =$fehcaPrepaA[2]."/".$fehcaPrepaA[1]."/".$fehcaPrepaA[0];
$mensaje=$mensaje.
"
Fecha Emisión Prepago: |
$fehcaPrepa |
";
}
$mensaje=$mensaje.
"
CONDICIONES |
- Recuerde presentar todos sus documentos vigentes: C.I o Pasaporte, Licencia de Conducir, Certificado Médico y Tarjeta de Crédito.
$leyRES
|
|
".$PRM['NEMP']." |
".$PRM['DEMP']." |
|
";
if($email != "" AND $email != "0"){
$vSender=$PRM['NEMP'];
$vMailSender=$PRM['EREMP'];
$vMailTo=$email;
$vMailSubject="Reservación de Vehículo por ".$PRM['NEMP'];
$vMailText=$mensaje;
require_once "$APP->SRVn2c/mss.class.php";
$MSS = new MSS($APP);
$asunto = $vMailSubject;
$cuerpo = $vMailText;
$emailsTo = explode(',',$vMailTo);
$arrayEmail = array(
'nameFrom' => $vSender,
'emailFrom' => $vMailSender,
'emailTo' => $emailsTo,
'subject' => $asunto,
'message' => $cuerpo
);
$MSS->sendMail($arrayEmail);
//Envio Email($vSender,$vMailSender,$vMailTo,$vMailSubject,$vMailText);
echo "";
}
?>