<%response.expires=0%>


<!--#include file="seguridad.asp"-->
<!--#include file="../library/configuracion.asp"-->
<!--#include file="../library/cmc_coneccion.asp"-->
<!--#include file="../library/funciones.asp"-->

<html>
<head>
<title>::: Backend <%=c_empresa%> ::: </title>
<head>

<script LANGUAGE="javascript">
<!--
function Salir()
	{
		 if (confirm("¿Desea salir del sistema?"))
			{
				window.location.href = "adm_logout.asp"
			}
	}

function Editar(x)
	{
		document.formulario.accion.value = 'Editar';
		document.formulario.action = x;
		document.formulario.submit();
	}

function Nuevo(x,xid_aplicacion)
	{
		document.formulario.id_aplicacion.value = xid_aplicacion;
		document.formulario.accion.value = 'Nuevo';
		document.formulario.action = x;
		document.formulario.submit();
	}

function Nueva(x,xid_aplicacion)
	{
		document.formulario.id_aplicacion.value = xid_aplicacion;
		document.formulario.accion.value = 'Nueva';
		document.formulario.action = x;
		document.formulario.submit();
	}

function Listar(x,xid_aplicacion)
	{
		document.formulario.id_aplicacion.value = xid_aplicacion;
		document.formulario.accion.value = 'Listar';
		document.formulario.action = x;
		document.formulario.submit();
	}

function Buscar(x,xid_aplicacion)
	{
		document.formulario.id_aplicacion.value = xid_aplicacion;
		document.formulario.accion.value = 'Buscar';
		document.formulario.action = x;
		document.formulario.submit();
	}

function Ver(x)
	{
		document.formulario.accion.value = 'Ver';
		document.formulario.action = x;
		document.formulario.submit();
	}

function Enviar(x)
	{
		document.formulario.accion.value = 'Enviar';
		document.formulario.action = x;
		document.formulario.submit();
	}
	
function PopUp()
{
	window.open("vencimiento_contratos.asp",'Vence','width=550,height=400,scrollbars=yes,top=100,left=100');
}
	
//-->
</script>
</head>
<%
dim tabla
function Ftotal(tabla)
		 query = "select count(*) as total from " & tabla
       	set rs=GetRs(query,con)
       	total = 0
       	if not rs.eof then 
       		total = rs("total")
       	end if
			Ftotal =  total
       	rs.close
       	set rs=nothing
end function			
 
%>

<body bgcolor="<%=c_color_fondo%>" link="<%=c_color_link%>" text="<%=c_color_texto%>" vlink="<%=c_color_vlink%>" alink="<%=c_color_alink%>"  leftmargin="0" topmargin="1" marginwidth="0" marginheight="0">
<form action method="post" name="formulario" ENCTYPE="multipart/form-data">
<input type="hidden" name="accion" value="">
<input type="hidden" name="id_aplicacion" value="">
<center>


<!--#include file="adm_header.asp"-->

<%
'*****************************************************************************************
'*************************************MANTENEDOR******************************************
'*****************************************************************************************
	query = " select a.id_aplicacion, a.nombre, a.nombre_programa, a.menu, a.tipo_aplicacion, a.upload, a.accion, a.tabla, pa.permiso " &_
			" from TE_aplicacion a, TE_perfil_aplicacion pa " &_
			" where a.id_aplicacion = pa.id_aplicacion and pa.id_perfil = '"  & trim(session("id_perfil")) & "' and a.menu = 'M' and pa.permiso <> 'NNNN' " &_
			" order by a.id_aplicacion"
	set rsM = getrs(query,con)
	if not rsM.eof then
		do while not rsM.eof
				id_aplicacion	= rsM("id_aplicacion")
				nombre			= rsM("nombre")
				nombre_programa = rsM("nombre_programa")
				menu			= rsM("menu")
				tipo_aplicacion = rsM("tipo_aplicacion")
				upload			= rsM("upload")
				accion			= rsM("accion")
				tabla			= rsM("tabla")

				contador = contador + 1
				if contador = 1 then%>
					<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#<%=c_color_border%>">
					<tr>	
					<td colspan="4" valign="top" align="center" bgcolor="<%=c_color_border%>">
					<font size="2" color="FFFFFF" face="verdana"><b>MANTENEDORES</b></font></TD>
					</tr>
					<tr>
					<td width="25%" valign="top" bgcolor="<%=c_color_celda%>"><font size="1" face="verdana">
				<%end if%>
				
				<%if trim(tipo_aplicacion) = "T" then
						contador_titulo = contador_titulo + 1
						if contador_titulo = 4 then
								contador_titulo = 1%>
								</td>
								<td width="25%" valign="top" bgcolor="<%=c_color_celda%>"><font size="1" face="verdana">
						<%end if%>
							</ul>
							<ul>
							<img src="flecha.gif" border="0">&nbsp;<b><%=ucase(nombre)%>&nbsp;<%if trim(tabla) <> "" then%>(<%=Ftotal(c_tabla & tabla)%>)<%end if%></b><br>					
				<%end if%>			
				
				<%if trim(tipo_aplicacion) = "P" then%>
					<%if trim(accion) = "I" then%>
						<a href="<%=nombre_programa%>"></a>
						<%else
							if trim(upload) = "S" then
								xurl = "javascript:" & accion & "('" & nombre_programa & "','" & id_aplicacion & "');"
							else
								xurl = nombre_programa & "?accion=" & accion & "&id_aplicacion=" & id_aplicacion
							end if%>
							&nbsp;<a href="<%=xurl%>"><%=nombre%></a><br>
					<%end if%>	
				<%end if
		rsM.movenext
	loop
	end if
	
	set rsM = nothing%>
	<%if contador > 1 then%>
			<br>&nbsp;
			</td>
			</tr>
	<%end if%>			
			

			    <tr> 
			    <td colspan="4" valign="top"  bgcolor="<%=c_color_celda_pagina%>">
			    <ul>
					<font size="1" face="verdana"><br>
					<img src="flecha.gif" border="0">&nbsp;<b><a href="javascript:Salir()">SALIR</a></b>
					</font>
				</ul>
			    </td>	
				</tr>
			</table>
			
</center>
</div>
</form>
</body>
</html>
