Re: [Emerald] query for showing user online time?

New Message Reply Date view Thread view Subject view Author view
Craig Hulbert (craig@daytondigital.net)
Fri, 6 Jul 2001 13:17:50 -0400



Message-ID: <000901c1063f$95b68e40$1964a8c0@craig>
From: "Craig Hulbert" <craig@daytondigital.net>
Subject: Re: [Emerald] query for showing user online time?
Date: Fri, 6 Jul 2001 13:17:50 -0400

Well kinda.. you will have two asp pages...as detailed.. (one for display
and one for the function of retrieving the information)
but you also need standard ADO information.. like a udl file and a
global.asa

things to have in your global.asa

<script language="VBScript" runat="Server">
  Sub Application_OnStart()

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' Do not alter any items below here

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Application("Connection_Emerald") = "File Name=" &
Server.MapPath("/_private/") & "\emerald.udl;"
    </script>

----- Original Message -----
From: "PowerNet" <psc5@powersupply.net>
To: <emerald@iea-software.com>
Sent: Friday, July 06, 2001 12:27 PM
Subject: Re: [Emerald] query for showing user online time?

So we can just paste this into an ASP page with passwords and it will work?

Anything else useful that you and are willing to share would be fantastic!

John

*********** REPLY SEPARATOR ***********

On 7/6/2001 at 11:52 AM Craig Hulbert wrote:

>Monica,
>
>I hope this helps.... this is what we built... works great for us.
>Oh, and we use ICverify.. works ok.. not as automated as I would like
>it...but
>it works..
>
>Craig Hulbert
>
>Dayton Digital Networks
>www.daytondigital.net
>
>
>
>Requires emerarld.udl to be setup to connect to your sql server...
>
>
>The display aspcode...
>
><%@ LANGUAGE="VBSCRIPT"%>
><%Option Explicit%>
><!--#include virtual = "admin_toolkit.asp"-->
>
><table border="0" cellpadding="0" cellspacing="0">
> <tr>
> <td class="center" colspan="2">
> <%=DoDialog_Show("Find", DoFind_Form)%>
> </td>
> </tr>
> <tr>
> <td class="center">
> <%=DoDialog_Show("Dial Up", DoWhoIsOn_Show)%>
> </td>
> <td class="center">
> <%'=DoDialog_Show("Clients", DoClient_Stats_Show)%>
> </td>
> <td class="center">
><%If DoRep_Right_Check(DoLogon_User_Get, DoObject_Name_Get, ptFull_Control)
>Then
> 'Response.Write(DoDialog_Show("Domains", DoDomain_Stats_Show("")))
> End If%>
> </td>
> </tr>
> </table>
>
>
>
>Place below in admin_toolkit.asp
>
>Function DoWhoIsOn_Show
> Dim strSQL
> Dim objRst
> Dim objConn_Emerald
> Dim lngRecord_Count
> Dim strOutput
>
> strSQL = "SELECT NASPort, Username, CallDate, FramedAddress "
> strSQL = strSQL & "FROM CallsOnline "
> strSQL = strSQL & "WHERE AcctStatusType = 1 "
> strSQL = strSQL & "ORDER BY Username "
> Set objConn_Emerald = Server.CreateObject("ADODB.Connection")
> objConn_Emerald.Open Application("Connection_Emerald")
> Set objRst = Server.CreateObject("ADODB.RecordSet")
> objRst.Open strSQL, objConn_Emerald
> If objRst.EOF Then
> strOutput = "<p>There are no active calls</p>" & vbCRLF
> Else
> strOutput = "<table border=""0"" cellspacing=""0""
>cellpadding=""4"">"
>& vbCRLF
> strOutput = strOutput & " <tr>" & vbCRLF
> strOutput = strOutput & " <td><b>Port</b></td>" & vbCRLF
> strOutput = strOutput & " <td><b>Username</b></td>" & vbCRLF
> strOutput = strOutput & " <td><b>Date</b></td>" & vbCRLF
> strOutput = strOutput & " <td><b>Framed Address</b></td>" & vbCRLF
> strOutput = strOutput & " </tr>" & vbCRLF
> lngRecord_Count = 0
> While Not objRst.EOF
> strOutput = strOutput & " <tr>" & vbCRLF
>' strOutput = strOutput & " <td><a href=""/user.asp?" &
>Request.QueryString & "&user_id=" & objRst("User_ID") & """>" &
>objRst("User_Name") & " (" & objRst("Full_Name") & ")</a></td>" & vbCRLF
> strOutput = strOutput & " <td align=""right"">" &
>objRst("NASPort") & "</td>" & vbCRLF
> strOutput = strOutput & " <td>" & objRst("Username") & "</td>" &
>vbCRLF
> strOutput = strOutput & " <td>" & objRst("CallDate") & " (" &
>DateDiff("n", objRst("CallDate"), Now()) & " min)</td>" & vbCRLF
> strOutput = strOutput & " <td>" & objRst("FramedAddress") &
>"</td>" & vbCRLF
> strOutput = strOutput & " <td>&nbsp;</td>" & vbCRLF
> strOutput = strOutput & " </tr>" & vbCRLF
> objRst.MoveNext
> lngRecord_Count = lngRecord_Count + 1
> Wend
> strOutput = strOutput & "</table>" & vbCRLF
> If lngRecord_Count > 1 Then
> strOutput = strOutput & "<hr/>" & vbCRLF
> strOutput = strOutput & "There are <b>" & lngRecord_Count & "</b>
>users currently online" & vbCRLF
> End If
> End If
> objRst.Close
> objConn_Emerald.Close
> Set objRst = Nothing
> Set objConn_Emerald = Nothing
>
> DoWhoIsOn_Show = strOutput
> End Function ' DoWhoIsOn_Show%>

Have you seen our New Localized Portal? http://www.powersupply.net
You can find information on Local Businesses. Just click switch cities and
type in your zip code.
Get Local! News, Weather, Stocks, Free Classifieds, Local Movie/TV Guide,
Domain Registration,
Yellow Pages, Free Auction Listings, Online Training, E-Cards and much more!

------------

This is a user supported list. If you require assistance from IEA Software's
Support Engineers, please check out our Support resources at
http://www.iea-software.com/support.

For more information about this list (including removal) go to:
http://www.iea-software.com/support/maillists/liststart

.



New Message Reply Date view Thread view Subject view Author view
This archive was generated on Fri Jul 06 2001 - 10:08:15 Pacific Daylight Time