<!--#include virtual="/includes/topofpage.asp"-->
<%
Option Explicit
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
	Conn.Open "DRIVER={SQL Server};SERVER=WEBSRV01;UID=web;pwd=w3bs1t3;DATABASE=AVANTE"

If (UCase(Request.ServerVariables("REQUEST_METHOD")) = "POST" And Request.Form("page") = "0") Then
	If Request.Form("Admin_Group_ID") <> "" Then
		Session("Admin_Group_ID") = Request.Form("Admin_Group_ID")
	End If
	
	If Session("Admin_Group_ID") = "" Then
		Session("Admin_Group_ID") = "0"
	End If
End If
session("admin_group_id") ="17746"
Dim SQLName, RSName
SQLName = "get_entity_from_group @Group_ID='" & Session("Admin_Group_ID") & "'"
Set RSName=Conn.Execute(SQLName)

	Dim SQLContact, SQLEntity
	Dim RSContact, RSEntity
	
	SQLContact = "Select C.*, G.[Group_ID] ""Group_ID"", U.[User_ID], U.[User_Name], U.[User_PWD], U.[Last_Logon]," & _
	" U.[CreateDate] ""User_CreateDate"", K.[Key_ID], K.[Name], K.[Description] from [Contact_Detail] C" & _
	" Inner Join [Group_Contact_Map] G On C.[Contact_ID] = G.[Contact_ID]" & _
	" Left Outer Join ([Users] U Left Outer Join ([Key_Map] KM Inner Join [Keys] K" & _
	" On K.[Key_ID] = KM.[Key_ID]) On KM.[User_ID] = U.[User_ID]) On C.[Contact_ID] = U.[Contact_ID]" & _
	" Where G.[Group_ID]='" & Session("Admin_Group_ID") & "' ORDER BY C.[Name_Last]"
		
	SQLEntity = "Select * from Entity E inner join Group_Entity_Map GEM on E.Entity_ID = GEM.Entity_ID Where GEM.Group_ID = '" & Session("Admin_Group_ID") & "'"
	
	Set RSContact = Conn.Execute(SQLContact)	
	Set RSEntity = Conn.Execute(SQLEntity)
		
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
<link rel="stylesheet" href="/arrivares.css" type="text/css">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<link rel="stylesheet" href="../Style-sheets/standard-input-form.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/headline.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/galley-text-indent.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="jsClockTimeZonecst(); jsClockTimeZonepst(); jsClockTimeZoneest();MM_preloadImages('images/icon-return-to-main-2.gif','images/icon-submit-changes-2.gif','images/icon-continue-wizard-2.gif')">
<div id="bckgrnd" style="position:absolute; width:200px; height:366px; z-index:1; left: 0px; top: 270px; overflow: visible; background-image: url(/images/bckgrnd.jpg); layer-background-image: url(/images/bckgrnd.jpg); border: 1px none #000000; visibility: visible"></div>
<!--#include virtual="/includes/toolbar-partner.asp" -->
<div id="adminMenu" style="position:absolute; width:100px; height:102px; z-index:9; top: 139px; left: 670px; visibility: hidden"> 
  <a href="#" class="form-objects" onClick="MM_showHideLayers('staff','','hide','events','','show')"></a>
  <!--#include virtual="/includes/partner-admin-menu.asp" -->
</div>
</body>
</html>
