<%
Option Explicit
Session.LCID = 2058
'***** SI NO HA INICIADO SESION ***
If Session("Mybussiness") = "" then
Response.redirect("default.asp")
Else
Session.Timeout = 1200
'******* EN CASO DE ERROR ****
Err.Clear
On Error Resume Next
'*** REMPLAZA
Function Sanea(Texto)
Sanea = Replace(Texto, "'", "''")
End Function
%>
<!DOCTYPE html>
<HTML>
<HEAD>
<meta charset="ISO-8859-1" />
<TITLE>SISTEMA MIM <%= Session("Mybussiness") %> USUARIO: <%= Session("MyName") %></TITLE>
<link href="css/Modulo5.css" rel="stylesheet" />
<link href="css/Buscador.css" rel="stylesheet" />
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// End -->
</script>
</HEAD>
<BODY>
<%
'***** Variables a la base de datos ****
Dim Cn1
Dim Rs11, Rs12, Rs13, Rs14
Dim Sql11, Sql12, Sql13, Sql14
'***** Conexion a la Base de Datos
Set Cn1 = Server.CreateObject( "ADODB.Connection" )
Cn1.Open "DRIVER={SQL Server};SERVER=172.17.0.5;UID="& Session("MyName") &";PWD="& Session("MyPass") &";Database="& Session("Mybussiness") &""
'***** Conexion A la Tabla Empresa ****
Set Rs11 = Server.CreateObject("ADODB.Recordset")
Sql11="Select * from Empresa;"
Rs11.Open Sql11,Cn1,1,2
%>
<Header>
<%= Rs11("Nombre") %><br>
<%= Rs11("Direccion") %>, <%= Rs11("colonia") %><br>
<%= Rs11("Poblacion") %>
</header>
<nav>
<!--#INCLUDE FILE="menuh.asp"-->
<br>
<!--#INCLUDE FILE="MenuCat.asp"-->
</nav>
<SECTION>
<CENTER>
<b>*** LOGISTICA ***</B>
<br>
<%
Dim FechaCal, Mescal, AnioCal, dif, Mescali, Messig, Diasmes
Dim UltimoDiaDeMes, TotalDias
Dim FechaMes
FechaCal = Request("FechaCal")
If FechaCal = "" or Isnull(FechaCal) Then
FechaCal = date()
Else
FechaCal = FechaCal
End If
MesCal = Month(Fechacal)
If (mescal) < 10 then
Mescali = 0 & Mescal
else
Mescali = MesCal
end If
Messig = Mescali + 1
If Messig < 10 then
Messig = 0 & Messig
Else
Messig = Messig
End If
AnioCal = Year(Fechacal)
UltimoDiaDeMes = Day(DateAdd("d", 0, DateAdd("m", 1, FechaCal)))
If Mescali = 12 Then
dif = ("01/" & "01" & "/" & (AnioCal + 1))
Else
dif = ("01/" & Messig & "/" & AnioCal )
End If
DiasMes = DateDiff("d", Fechacal, dif) - 1
TotalDias = UltimoDiaDeMes + DiasMes
%>
<Form action="Logistica.asp?Modulo=Logistica&Linea=1" name="Logistica" method="post">
<Table Id="TablaOpc">
<Tr>
<Td>
<input tabindex="1" type="text" placeholder="Fecha" Title="Fecha" name="Fecha" Size="15" id="TablaOpc" value="<%= FechaCal %>" Size="7px" onChange="javascript:this.value=this.value.toUpperCase();">
</Td>
<Td>
<button tabindex="4" type="submit" name="Buscar" id="Buscar"/>Buscar</button>
</td>
</Tr>
</Table>
</Form>
<br><br>
<Table Id="Resultados" Border="1">
<Tr>
<Td>Dia</td>
<Td>Peso</td>
<Td>Plataformas</td>
</Tr>
<%
FechaMes = 1
while FechaMes < TotalDias + 1
%>
<Tr>
<TD align="Right"> <%= FechaMes %></td>
<TD align="Right">
<%
Set Rs12 = server.CreateObject("ADODB.Recordset")
Sql12 = "Select Numlog, Peslog " &_
"From Logistica " &_
"where Year(FTLLog) = "& AnioCal &" and Month(FTLLog) = "& Mescali &" and Day(FTLLog) = "& FechaMes &" " &_
"Order By FTLLog;"
Rs12.Open Sql12,Cn1,1,2
If Rs12.EOF Then
Else
Do While Not Rs12.Eof
%>
<Table border="0" cellspacing="2" cellpadding="2" Id="TablaOpc">
<Tr>
<TD align="Right">
<a href="Logimp.asp?FolioL=<%= Rs12("Numlog") %>" onclick="NewWindow(this.href,'Logimp','790','470','yes');return false;">
<%= Formatnumber(Rs12("Peslog")) %></a>
</TD>
</Tr>
</Table>
<%
Rs12.Movenext
Loop
End If
%>
</Td>
<TD align="Right" class="Normaln">
<%
Set Rs13 = server.CreateObject("ADODB.Recordset")
Sql13 = "Select Numlog, Plalog " &_
"From Logistica " &_
"where Year(FTLLog) = "& AnioCal &" and Month(FTLLog) = "& Mescali &" and Day(FTLLog) = "& FechaMes &" " &_
"Order By FTLLog;"
Rs13.Open Sql13,Cn1,1,2
If Rs13.EOF Then
Else
Do While Not Rs13.Eof
%>
<Table border="0" cellspacing="2" cellpadding="2">
<Tr>
<TD align="Right" class="Normaln">
<a href="Logimp.asp?FolioL=<%= Rs13("Numlog")%>" onclick="NewWindow(this.href,'Logimp','790','470','yes');return false;">
<%= Rs13("Plalog") %> </a></TD>
</Tr>
</Table>
<%
Rs13.Movenext
Loop
End If
%>
</Tr>
<%
FechaMes = FechaMes + 1
wend
%>
</Table>
</SECTION>
<%
If Err.Number <> 0 Then
%>
<br><br>
Número de Error: <%= Err.Number %><BR>
Descripción: <%= Err.Description %><BR>
Origen: <%= Err.Source %><BR>
Linea: <%= Err.Line %><BR>
<br>
<%
Else
'****** FIN DE LOS ERRORES ***
End If
%>
</BODY>
</HTML>
<%
'FIN DE SESION
End If
%>