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

New Message Reply Date view Thread view Subject view Author view
PowerNet (psc5@powersupply.net)
Fri, 06 Jul 2001 12:27:42 -0400



Message-ID: <200107061227420537.00939D4C@mail.powersupply.net>
Date: Fri, 06 Jul 2001 12:27:42 -0400
From: "PowerNet" <psc5@powersupply.net>
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!

.



New Message Reply Date view Thread view Subject view Author view
This archive was generated on Fri Jul 06 2001 - 09:20:29 Pacific Daylight Time