<%
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>
<!-- 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>
<script language="javascript">
stat=1
function frm_submit(frm,rec)
{
var msgDel,check
check = 0
msgDel = "Desea continuar ?"
if (rec == 1)
{
if(frm.chk.checked == false){
check = 0
}
else{
check= 1
}
}
else if(rec > 1 )
{
for(i=0;i<frm.chk.length;i++)
{
if(frm.chk[i].checked == true)
{
check = 1;
break;
}
}
}
if (check == 0)
{
alert("Debe Seleccionar por lo menos una partida")
return;
}
else if(check == 1)
{
ok = confirm(msgDel)
if (ok == false)
{
return;
}
else
{
frm.submit()
}
}
}
function en_dis(frm,RecCount,val){
var chkLength
// tg= document.getElementById(tag_id1).className
//if (tg =='slected'){
//for (i=1;i<5;i++){
//eval("document.getElementById(tag_id"+i+").className=''")
//}}
//else{
//for (i=1;i<5;i++){
//eval("document.getElementById(tag_id"+i+").className='slected'")
//}
//}
//tg_id.className='slected'
if (RecCount>1){
chkLength=frm.chk.length
}
else
{
chkLength=1
frm.chkMain.checked=frm.chk.checked
if (stat==1){
eval("document.frm."+val+".disabled=false")
stat=0
}
else{
eval("document.frm."+val+".disabled=true")
stat=1
}
return;
}
for(i=0;i<=chkLength-1;i++){
if(frm.chk[i].checked==false){
frm.chkMain.checked=false
break;
}
else{
frm.chkMain.checked=true
}
}
tt= eval("document.frm."+val+".disabled")
if (tt== true){
eval("document.frm."+val+".disabled=false")
}
else
eval("document.frm."+val+".disabled=true")
}
function chk_all(frm,RecCount){
var chkLength
if (RecCount>1)
{
chkLength=frm.chk.length
}
else if (RecCount==1)
{
chkLength=1
frm.chk.checked=frm.chkMain.checked
if (stat==1){
document.frm.txt_0.disabled=false
stat=0
}
else{
document.frm.txt_0.disabled=true
stat=1
}
return;
}
if(frm.chkMain.checked==true){
for (i=0;i<=chkLength-1;i++){
frm.chk[i].checked=true
//frm.txt[i].disabled= false
eval("frm.txt_"+i+".disabled= false")
}
}
else
{
for (i=0;i<=chkLength-1;i++){
frm.chk[i].checked=false
//frm.txt[i].disabled= true
eval("frm.txt_"+i+".disabled= true")
}
}
return;
}
</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="Fpedm.asp"-->
</SECTION>
<SECTION>
<center>
<br>
<B>***** BUSQUEDA DE REMISION ETIQUETAS PROYECTOS *****</B>
<BR><BR>
<Form action="EtiquetasP.asp" method="post" name="EtiquetasP" id="PedidnoNuevo">
<Table Class="Pedido">
<Tr>
<Td>Remision:</Td>
</Tr>
<Tr>
<Td>
<input tabindex="1" type="text" placeholder="Remision" Title="Número Remision" name="Remision" id="Remision" Size="7" value="<%= Remision %>">
</td>
<Td>
<button tabindex="4" type="submit" name="Buscar" id="BuscarCli"/>Buscar</button>
</td>
</Tr>
</table>
</form>
<br><br>
<%
Dim Remision
Dim count, bg_color, i
Remision = Request("Remision")
If Remision = "" Or Isnull(Remision) Then
Else
Set Rs15 = server.CreateObject("ADODB.Recordset")
Sql15 = "Select Regfremd, Nrefremd, Secfremd, Labfreme, IdCEtiT, OriEtiT, Coladas " &_
"From Fremdet left join Fremenc on Numfreme = Nrefremd " &_
"left join Etiquetas on regAetiT = regfremd " &_
"Where Nrefremd = "& Remision &" " &_
"Order by Secfremd asc;"
Rs15.Open Sql15,Cn1,1,2
If Rs15.EOF then
Else
%>
<FORM action="EtiquetasPg.asp" name="frm" method='post'>
<input type="Hidden" name="Remision" value="<%= Remision %>" >
<Table Class="TABLAREQ">
<Tr>
<Td Align="center">
<input type="checkbox" name="chkMain" onClick="JavaScript:chk_all(document.frm,<%=Rs15.recordcount%>)">
</Td>
<Td>Remision</Td>
<Td>Item</Td>
<Td>Pedido</Td>
<Td>Id</Td>
<Td>Origen</Td>
<Td>Coladas</Td>
</Tr>
<%
count = 0
For i = 0 to Rs15.RecordCount - 1
%>
<Tr>
<Td bgcolor="<%= bg_color %>">
<input type="checkbox" name="chk" value="<%= i %>" onClick="JavaScript:en_dis(document.frm,<%= Rs15.recordcount %>,'txt_<%= i %>')">
</Td>
<Td Align="Right"><%= Rs15("Nrefremd") %> </Td>
<Td Align="Right"><%= Rs15("Secfremd") %> </Td>
<Td Align="Right"><%= Rs15("Labfreme") %> </Td>
<Td>
<input type="TEXT" name="txt_<%=i%>" value="<% = Rs15("IdCEtiT")%>" disabled style="border:1px solid:#000000;background:<%=bg_color%>">
</Td>
<td>
<input type="Text" size=9 name="Ori_<%=i%>" value="<%= Rs15("OriEtiT") %>" disabled style="border:1px solid:#000000; Text-align:Right">
<input type="Hidden" size=9 name="Reg_<%=i%>" value="<%= Rs15("Regfremd") %>" style="border:1px solid:#000000; Text-align:Right">
<input type="Hidden" size=9 name="Rem_<%=i%>" value="<%= Rs15("Nrefremd") %>" style="border:1px solid:#000000; Text-align:Right">
</Td>
<Td Align="Right"><%= Rs15("Coladas") %> </Td>
</Tr>
<%
Rs15.Movenext
count = count + 1
Next
%>
<Tr>
<Td Colspan="15" Align="Center">
<button Type="button" name="Buscar" onclick="frm_submit(document.frm,<%=Rs15.recordcount%>)" id="BuscarCli"/>Actualizar</button>
</td>
</Tr>
</Table>
</Form>
<%
End If
End If
%>
</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
%>