<%
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/Modulos.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, Rs15, Rs16, Rs17
Dim Sql11, Sql12, Sql13, Sql14, Sql15, Sql16, Sql17
'***** 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
%>
<SECTION Class="HeaderGes">
<div Id="DivHeadGes">
<%= Rs11("Nombre") %><br>
<%= Rs11("Direccion") %>, <%= Rs11("colonia") %><br>
<%= Rs11("Poblacion") %>
</div>
</SECTION>
<SECTION>
<!--#include file="Cordm.asp"-->
</SECTION>
<SECTION>
<center>
<br>
<B>***** SELECCION REQUISICIONES PENDIENTES *****</B>
<BR><BR>
<Form action="Ordenadd.asp" name="FindPrv" method='post'>
<Table Class="Pedido">
<Tr>
<Td Align="center">Clave</td>
<Td Align="center">Nombre</td>
<Td Align="center"></td>
</Tr>
<Tr>
<Td Align="center"><input Type="Text" tabindex="1" name="Claprv" Size="14" onChange="javascript:this.value=this.value.toUpperCase();"></td>
<Td Align="center"><input type="text" tabindex="2" name="Nomprv" Size="40" onChange="javascript:this.value=this.value.toUpperCase();"></td>
<Td Align="center"><button tabindex="3" type="submit" name="Buscar" id="BuscarCli"/>Buscar</button></td>
</Tr>
<Table>
</form>
</SECTION>
<SECTION>
<br><br>
<b>
***** Agregar Una Orden de Compra: *****
</b>
<br><br>
<FORM action="Ordentip.asp" name="tiped" method='post'>
<Table Class="Pedido">
<Tr>
<Td Align="Left">Tipo</td>
<Td>
<select Name="Tipo">
<option value="1">Requision Nacional</Option>
<option value="2">Requision Importacion</Option>
<option value="3">Directo</Option>
</Select>
</Td>
</Tr>
<Tr>
<Td Align="center">Proveedor</td>
<Td>
<%
Dim Claprv, Nomprv
Claprv = Request("Claprv")
Nomprv = Request("Nomprv")
If (Claprv = "" or Isnull(Claprv)) and (Nomprv = "" or Isnull(Nomprv)) Then
Claprv = "00000000"
Else
'***** Conexion A la Tabla Proveedores ****
Set Rs13 = Server.CreateObject("ADODB.Recordset")
Sql13= "Select cveprv, nomprv From Proveedores " &_
"Where staprv = 'A' AND Nomprv LIKE '%" & UCase(Request("Nomprv")) & "%' " &_
"and cveprv Like '%" & UCase(Request("Claprv")) & "%' ORDER BY nomprv ASC;"
Rs13.Open Sql13,Cn1,1,2
If Rs13.Eof Then
Else
%>
<SELECT Name="Provee">
<%
Do While Not Rs13.Eof
%>
<option value="<%= Rs13("Cveprv") %>">( <%= Rs13("Cveprv") %> ) <%= Rs13("nomprv") %></Option>
<%
Rs13.Movenext
Loop
%>
</Select>
<%
End If
End If
%>
</Td>
</Tr>
<Tr>
<Td>Moneda</Td>
<Td>
<%
'***** Conexion A la Tabla Monedas ****
Set Rs14 = Server.CreateObject("ADODB.Recordset")
Sql14 = "Select Cladiv, desdiv from monedas order by cladiv;"
Rs14.Open Sql14,Cn1,1,2
If Rs14.Eof Then
Else
%>
<SELECT Name="Mone">
<%
Do While Not Rs14.Eof
%>
<option value="<%= Rs14("Cladiv") %>">( <%= Rs14("Cladiv") %> ) <%= Rs14("desdiv") %></Option>
<%
Rs14.Movenext
Loop
%>
</Select>
<%
End If
%>
</Td>
</Tr>
<Tr>
<Td>Iva</td>
<Td>
<%
'***** Conexion A la Tabla Monedas ****
Set Rs15 = Server.CreateObject("ADODB.Recordset")
Sql15 = "Select * from EsquemaIVA;"
Rs15.Open Sql15,Cn1,1,2
If Rs15.Eof Then
Else
%>
<SELECT Name="Iva">
<%
Do While Not Rs15.Eof
%>
<option value="<%= Rs15("Iva") %>"><%= Rs15("iva") %></Option>
<%
Rs15.Movenext
Loop
%>
</Select>
<%
End If
%>
</Td>
</Tr>
<Tr>
<Td Colspan="2" Align="Center"><button tabindex="7" type="submit" name="Buscar" id="BuscarCli"/>Grabar</button></td>
</Tr>
</Table>
</Form>
</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
%>