<%
Option Explicit
%>
<%
Session.LCID = 2058
%>
<!--#include file="User.asp"-->
<!--#include file="general.asp"-->
<html>
<head>
<title>Grupo MIM</title>
<link rel=stylesheet href="vista.css">
<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>
<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("Seleccione por lo menos un Almacen")
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>
</script>
</head>
<BODY>
<!--#INCLUDE FILE="BARRA.asp"-->
<div class="normalw" style="position:absolute; top:1px">
<center>
<!--#include file="empresa.asp"--><br>
<hr>
</center>
</div>
<div class="normalw" style="position:absolute; top:1px;">
Bienvenido: <%= nombre %>. <br>
Hora Actual: <%= time %>
</div>
<div class="normalw" style="position:absolute; top:34px; left:1">
<!--#include file="mpro.asp"-->
</div>
<div class="normal" style="position:absolute; top:60px; left:1">
<b>Distribución de Almacenes</b>
</div>
<div class="normal" style="position:absolute; top:80px; left:1">
<center>
Distribuir en Almacenes el producto:<br><br>
<%
Dim rs11, sql11
Dim Prod, Descri
prod =Request("prod")
Descri =Request("descri")
set rs11 = server.CreateObject("ADODB.Recordset")
sql11="select * from almacenes where staalm = 'A'"
rs11.open sql11,cn1,1,2
Response.write(prod)
%>
<br><br>
<table border="0" cellspacing="0" cellpadding="0">
<form name="frm" action="Invaal.asp" method="get">
<tr bgcolor="#336699">
<td width="35" align="center"><input type="checkbox" name="chkMain" onClick="JavaScript:chk_all(document.frm,<%=rs11.recordcount%>)"></td>
<td width="150"><font class="n_verdana">Almacen</font></td>
<td width="15ag0"><font class="n_verdana">Descripcion</font></td>
<td width=""><font class="n_verdana">Codigo</font></td>
</tr>
<%
dim count,bg_color
count = 0
For i = 0 to rs11.RecordCount - 1
if (count Mod 2= 0) then bg_color="#ffffff" else bg_color="#EFF5F3" end if
%>
<tr bgcolor="<%=bg_color%>" >
<td align="center" ><input type="checkbox" name="chk" value="<%=i%>" onClick="JavaScript:en_dis(document.frm,<%=rs11.recordcount%>,'txt_<%=i%>')">
<input type="Hidden" name=<%=i%> value="<% =rs11("claalm")%>" >
<input type="Hidden" name="txt1_<%=i%>" value="<%= prod %>" >
<input type="Hidden" name="txtdes_<%=i%>" value="<%= descri %>" >
<input type="Hidden" name="txt2_<%=i%>" value="A" >
</td>
<td width="50" ><font class="n_verdana_simple"><% =rs11("claalm")%></font></td>
<td width="150" ><font class="n_verdana_simple"><% =rs11("desalm")%></font></td>
<td width="150" ><font class="n_verdana_simple"><%= prod %></font></td>
<td ><input type="hidden" name="txt_<%=i%>" value="<% =rs11("claalm")%>" disabled style="border:1px solid:#000000;background:<%=bg_color%>" class="n_verdana_simple"></td>
</tr>
<%
rs11.MoveNext
count=count+1
Next
%>
<tr>
<td align="center">
</td>
<td><input value="Continuar" type="button" onclick="frm_submit(document.frm,<%=rs11.recordcount%>)" id=bt name=bt></td>
<td></td>
<td></td>
</tr>
</form>
</table>
<hr>
</div>
</body>
</html>
<%
End Sub
'Add the chosen course to the cart
Call AddUsuario()
'Display contents of electronic shopping cart
Call DisplayUsuario()
%>