"; $Fecha2 = "GeneralFecha2".$rowLIS[LISValor]; $Fecha2 = $_POST[$Fecha2]; $FechaPre = explode("/",$Fecha1); $Fecha1 =$FechaPre[2]."-".$FechaPre[1]."-".$FechaPre[0]; if ($Fecha1 == '--') $Fecha1 = ''; $FechaPre = explode("/",$Fecha2); $Fecha2 =$FechaPre[2]."-".$FechaPre[1]."-".$FechaPre[0]; if ($Fecha2 == '--') $Fecha2 = ''; $Monto = "General".$rowLIS[LISValor]; $Monto = $$Monto; echo "esta es la fecha 1 ".$Fecha1." y la 2 ".$Fecha2; if($Fecha1 != $rowAR8[AR8Fecha1] OR $Fecha2 != $rowAR8[AR8Fecha2]){ if($Fecha1 < $FechaHoy AND $Fecha1 != '' AND $Fecha1 != "0000-00-00"){ ?> $FechaHoy){ if((date("Y-m-d", strtotime("$rowAR8[AR8Fecha2] +1 day"))) < $FechaHoy){ $rowAR8[AR8Fecha2] = $FechaAyer; $Fecha1 = $FechaHoy; }else { $rowAR8[AR8Fecha2] = date("Y-m-d", strtotime("$Fecha1 -1 day")); } } if($Fecha1 != $rowAR8[AR8Fecha1] AND $Fecha2 != $rowAR8[AR8Fecha2]){ //Actualizar Impuestos existentes $queryAR8 = "UPDATE 410AR8 SET AR8CodAgente = '$AGECodigo', AR8Fecha1 = '$rowAR8[AR8Fecha1]', AR8Fecha2 = '$rowAR8[AR8Fecha2]' WHERE AR8Codigo='$rowAR8[AR8Codigo]'"; $resultAR8 = mysql_query($queryAR8); $AR8Lista6 = "General"; //Insertar cambios de Impuestos existentes $queryAR82= "INSERT INTO 410AR8 (AR8CodAgente, AR8Lista4, AR8Lista6, AR8Monto1, AR8Lista5, AR8Fecha1, AR8Fecha2) VALUES ('$AGECodigo', '$rowLIS[LISValor]', '$AR8Lista6', '$Monto', '$AR8Lista5', '$Fecha1', '$Fecha2')"; mysql_query($queryAR82); } } }else{ $Fecha1 = "GeneralFecha1".$rowLIS[LISValor]; $Fecha1 = $$Fecha1; $Fecha2 = "GeneralFecha2".$rowLIS[LISValor]; $Fecha2 = $$Fecha2; $FechaPre = explode("/",$Fecha1); $Fecha1 =$FechaPre[2]."-".$FechaPre[1]."-".$FechaPre[0]; if ($Fecha1 == '--') $Fecha1 = ''; $FechaPre = explode("/",$Fecha2); $Fecha2 =$FechaPre[2]."-".$FechaPre[1]."-".$FechaPre[0]; if ($Fecha2 == '--') $Fecha2 = ''; $Monto = "General".$rowLIS[LISValor]; $Monto = $$Monto; if($Fecha1 < $FechaHoy AND $Fecha1 != '' AND $Fecha1 != "0000-00-00"){ ?> 0){ $Fecha1S = "S".$rowAR4[AR4Codigo]."Fecha1".$rowLIS[LISValor]; $Fecha1S = $$Fecha1S; $Fecha2S = "S".$rowAR4[AR4Codigo]."Fecha2".$rowLIS[LISValor]; $Fecha2S = $$Fecha2S; $FechaPre = explode("/",$Fecha1S); $Fecha1S =$FechaPre[2]."-".$FechaPre[1]."-".$FechaPre[0]; if ($Fecha1S == '--') $Fecha1S = ''; $FechaPre = explode("/",$Fecha2S); $Fecha2S =$FechaPre[2]."-".$FechaPre[1]."-".$FechaPre[0]; if ($Fecha2S == '--') $Fecha2S= ''; $MontoS = "S".$rowAR4[AR4Codigo]."".$rowLIS[LISValor]; $Monto = $$MontoS; if($Fecha1S != $rowAR82[AR8Fecha1] OR $Fecha2S != $rowAR82[AR8Fecha2]){ if($Fecha1S < $FechaHoy AND $Fecha1S != '' AND $Fecha1S != "0000-00-00"){ ?> $FechaHoy){ $FechaMasUno = date("Y-m-d", strtotime("$rowAR82[AR8Fecha2] +1 day")); if($FechaMasUno < $FechaHoy){ $rowAR82[AR8Fecha2] = $FechaAyer; $Fecha1S = $FechaHoy; }else { $rowAR82[AR8Fecha2] = date("Y-m-d", strtotime("$Fecha1S -1 day")); } } if($Fecha1S != $rowAR82[AR8Fecha1] AND $rowAR82[AR8Fecha2] != $Fecha2S){ //Actualizar Impuestos existentes $queryAR8 = "UPDATE 410AR8 SET AR8CodAgente = '$AGECodigo', AR8Enlace4 = '$rowAR4[AR4Codigo]', AR8Fecha1 = '$rowAR82[AR8Fecha1]', AR8Fecha2 = '$rowAR82[AR8Fecha2]' WHERE AR8Codigo='$rowAR82[AR8Codigo]'"; $resultAR8 = mysql_query($queryAR8); $AR8Lista6 = "Servicio"; //Insertar cambios de Impuestos existentes $queryAR80= "INSERT INTO 410AR8 (AR8CodAgente, AR8Lista4, AR8Enlace4, AR8Lista6, AR8Monto1, AR8Lista5, AR8Fecha1, AR8Fecha2) VALUES ('$AGECodigo', '$rowLIS[LISValor]', '$rowAR4[AR4Codigo]', '$AR8Lista6', '$Monto', '$AR8Lista5', '$Fecha1S', '$Fecha2S')"; mysql_query($queryAR80); } } } else { $Fecha1S = "S".$rowAR4[AR4Codigo]."Fecha1".$rowLIS[LISValor]; $Fecha1S = $$Fecha1S; $Fecha2S = "S".$rowAR4[AR4Codigo]."Fecha2".$rowLIS[LISValor]; $Fecha2S = $$Fecha2S; $FechaPre = explode("/",$Fecha1S); $Fecha1S =$FechaPre[2]."-".$FechaPre[1]."-".$FechaPre[0]; if ($Fecha1S == '--') $Fecha1S = ''; $FechaPre = explode("/",$Fecha2S); $Fecha2S =$FechaPre[2]."-".$FechaPre[1]."-".$FechaPre[0]; if ($Fecha2S == '--') $Fecha2S = ''; $MontoS = "S".$rowAR4[AR4Codigo]."".$rowLIS[LISValor]; $Monto = $$MontoS; if($Fecha1S < $FechaHoy AND $Fecha1S != '' AND $Fecha1S != "0000-00-00"){ ?>