%@ Language=VBScript %>
<%
dim iGroupID
if len(Request.Item("GroupID")) > 0 then
Session("GroupID") = Request.Item("GroupID")
end if
%>
<%
dim oConn
dim oCmd
dim oRs
dim i
dim bAnnouncements
dim bEvents
dim bContacts
dim bLinks
dim bGallery
dim sHeaderImage
dim sSubGroupName
dim sGroupName
dim sAnnouncements
dim sEvents
dim sLinks
dim sContacts
dim sPortal
dim sParentName
dim sParentID
dim bShowImages
dim nNumberSubGroups
nNumberSubGroups = 8
redim aImages(2)
redim aImageWidths(2)
redim aImageHeights(2)
redim aImageCaptions(2)
redim aImageLinks(2)
aImages(0) = "picture_02.jpg"
aImageWidths(0) = 90
aImageHeights(0) = 130
aImageCaptions(0) = null
aImageLinks(0) = null
aImages(1) = "picture_05.jpg"
aImageWidths(1) = 90
aImageHeights(1) = 130
aImageCaptions(1) = null
aImageLinks(1) = null
aImages(2) = "picture_08.jpg"
aImageWidths(2) = 90
aImageHeights(2) = 130
aImageCaptions(2) = null
aImageLinks(2) = null
set oConn = Server.CreateObject("ADODB.Connection")
with oConn
.ConnectionString = Application("ConnString")
.Open
end with
set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = oConn
oCmd.CommandType = adCmdStoredProc
oCmd.CommandText = "p_SelectGroup"
oCmd.Parameters.Append oCmd.CreateParameter("@GroupID", adInteger, adParamInput, 4, iGroupID)
oCmd.Execute
set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open oCmd, , adOpenStatic, adLockReadOnly
bShowImages = oRs.Fields("ShowSideImages").Value
sGroupName = oRs.Fields("GroupName").Value
sParentName = oRs.Fields("ParentName").Value
sParentID = oRs.Fields("ParentID").Value
sSubGroupName = oRs.Fields("SubGroupName").Value
sShortDescription = oRs.Fields("ShortDescription").Value
sLongDescription = oRs.Fields("LongDescription").Value
sHeaderImage = oRs.Fields("HeaderImage").Value
sPortal = oRs.Fields("Portal").Value
Session("Portal") = sPortal
Session("FromGroup") = true
if len(oRs.Fields("Image1").Value) > 0 then
aImages(0) = oRs.Fields("Image1").Value
end if
if len(oRs.Fields("Image2").Value) > 0 then
aImages(1) = oRs.Fields("Image2").Value
end if
if len(oRs.Fields("Image3").Value) > 0 then
aImages(2) = oRs.Fields("Image3").Value
end if
if oRs.Fields("Announcements").Value = true then
bAnnouncements = true
end if
if oRs.Fields("Events").Value = true then
bEvents = true
end if
if oRs.Fields("Contacts").Value = true then
bContacts = true
end if
if oRs.Fields("Links").Value = true then
bLinks = true
end if
if oRs.Fields("Gallery").Value = true then
bGallery = true
end if
oRs.Close
set oRs = nothing
set oCmd = nothing
dim pageTitle : pageTitle = sHeaderImage
dim colorScheme : colorScheme = "sage"
'below is hard-coding to check if "group" or "learning"
'later we should recursively change all data changes to parent to recursively tricke down
'to child sections; i.e. "Portal" but for now be sure to set "portal" for all child groups in admin.
if sPortal = "2" then
colorScheme = "beige"
'pageTitle = "title_learning.gif"
end if
%>
<%
Call getAnnouncements
Call getEvents
Call getLinks
Call getContacts
%>
<%if bShowImages=true then %>
<%
for i = 0 to UBound(aImages)
%> <%=aImageLinks(i)%>%>)
<% if len(aImageCaptions(i)) > 0 then %>
<%=aImageLinks(i)%><%=aImageCaptions(i)%>
<% end if %>
<%
next
%>
|
|
<%end if%>
<%if not isnull(sParentID) and len(sParentID)>0 then%>
| <%=sParentName%> |
| Back to <%=sParentName%> |
<% end if %>
<% if bAnnouncements or bEvents or bGallery or bContacts or bLinks then %>
| Content |
|
<% if bAnnouncements then %>
Announcements
<% end if %>
<% if bEvents then %>
Events
<% end if %>
<% if bGallery then %>
Photo Gallery
<% end if %>
<% if bLinks then %>
Links
<% end if %>
<% if bContacts then %>
Contacts
<% end if %>
|
<% end if %>
<%
dim sSubGroups
sSubGroups = ""
set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = oConn
oCmd.CommandType = adCmdStoredProc
oCmd.CommandText = "p_SelectSubGroupsTop6"
oCmd.Parameters.Append oCmd.CreateParameter("@GroupID", adInteger, adParamInput, 4, iGroupID)
oCmd.Execute
set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open oCmd, , adOpenStatic, adLockReadOnly
i = 0
while not oRs.EOF
i = i + 1
if i <= nNumberSubGroups then
sSubGroups = sSubGroups & "" & oRs.Fields("GroupName").Value & " " & vbcrlf
end if
oRs.MoveNext
wend
oRs.close
set oRs = nothing
set oCmd = nothing
if len(sSubGroupName) = 0 or isnull(sSubGroupName) then
sSubGroupName = "SubGroups"
end if
if len(sSubGroups) > 0 then
%>
| <%=sSubGroupName%> |
|
<%=sSubGroups%>
<% if i > nNumberSubGroups then %>
» more...
<% end if %>
|
<% end if %>
<%
if bAnnouncements then%>
<%
Response.Write sAnnouncements
%>

<%
end if
%>
<%=sLongDescription%>
<%
if bEvents then%>
<%
Response.Write sEvents
end if
if bLinks then%>
<%
Response.Write sLinks
end if
if bContacts then%>
<%
Response.Write sContacts
end if
if not bAnnouncements and not bEvents and not bContacts and not bLinks and not bGallery then %>
<% end if %>
|
<%
oConn.Close
set oConn = nothing
%>
<%
sub getAnnouncements()
if bAnnouncements then
set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = oConn
oCmd.CommandType = adCmdStoredProc
oCmd.CommandText = "p_SelectGroupAnnouncementsTop6"
oCmd.Parameters.Append oCmd.CreateParameter("@GroupID", adInteger, adParamInput, 4, iGroupID)
oCmd.Execute
set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open oCmd, , adOpenStatic, adLockReadOnly
i = 0
iImages = 0
while not oRs.EOF
sAnchor = ""
i = i + 1
if i <= 5 then
if oRs.Fields("ContentType") = "CONTENT" then
'sAnnouncements = sAnnouncements & ""
if oRs.Fields("Priority") = 1 then
sAnnouncements = sAnnouncements & ">" & oRs.Fields("ContentTitle").Value & "
"
else
sAnnouncements = sAnnouncements & ">" & oRs.Fields("ContentTitle").Value & "
"
end if
if len(oRs.Fields("ShortDescription").Value) > 0 then
sAnnouncements = sAnnouncements & oRs.Fields("ShortDescription").Value & "
"
end if
if len(oRs.Fields("ImageFile").Value) > 0 and iImages < 5 then
if iImages > 2 then
redim preserve aImages(iImages)
redim preserve aImageWidths(iImages)
redim preserve aImageHeights(iImages)
redim preserve aImageCaptions(iImages)
redim preserve aImageLinks(iImages)
end if
aImages(iImages) = oRs.Fields("ImageFile").Value
if len(oRs.Fields("ImageWidth").Value) > 0 then
aImageWidths(iImages) = oRs.Fields("ImageWidth").Value
else
aImageWidths(iImages) = 90
end if
if len(oRs.Fields("ImageHeight").Value) > 0 then
aImageHeights(iImages) = oRs.Fields("ImageHeight").Value
else
aImageHeights(iImages) = 130
end if
if len(oRs.Fields("ImageCaption").Value) > 0 then
aImageCaptions(iImages) = oRs.Fields("ImageCaption").Value
else
aImageCaptions(iImages) = null
end if
aImageLinks(iImages) = sAnchor
iImages = iImages + 1
end if
sAnnouncements = sAnnouncements & ""
end if
oRs.MoveNext
wend
oRs.close
set oRs = nothing
set oCmd = nothing
'if i > 0 then
' sAnnouncements = "Announcements
" & vbcrlf & "" & vbcrlf & sAnnouncements
' sAnnouncements = sAnnouncements & "
"
'else
' bAnnouncements = false
'end if
if i <= 0 then
bAnnouncements = false
end if
if i > 5 then
sAnnouncements = sAnnouncements & "» more...
"
end if
end if
end sub
sub getEvents()
if bEvents = true then
dim iYear: iYear = Year(dDate)
dim iMonth: iMonth = Month(dDate)
dim iDay: iDay = Day(dDate)
set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = oConn
oCmd.CommandType = adCmdStoredProc
oCmd.CommandText = "p_SelectGroupEventsTop6"
oCmd.Parameters.Append oCmd.CreateParameter("@GroupID", adInteger, adParamInput, 4, iGroupID)
oCmd.Parameters.Append oCmd.CreateParameter("@Begin", adInteger, adParamInput, 4, iYear & iMonth & iDay)
oCmd.Execute
set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open oCmd, , adOpenStatic, adLockReadOnly
i = 0
while not oRs.EOF
i = i + 1
if i <= 5 then
sEvents = sEvents & ""
if not isnull(oRs.Fields("IconFileName").Value) then
sEvents = sEvents & "
"
end if
sEvents = sEvents & "" & oRs.Fields("ShortDescription").Value & "
"
sEvents = sEvents & oRs.Fields("StartTime").Value & ""
end if
oRs.MoveNext
wend
oRs.close
set oRs = nothing
set oCmd = nothing
if i > 0 then
sEvents = "Events
" & vbcrlf & "" & vbcrlf & sEvents
sEvents = sEvents & "
"
else
bEvents = false
end if
if i > 5 then
sEvents = sEvents & "» more...
"
end if
end if
end sub
sub getLinks()
if bLinks then
set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = oConn
oCmd.CommandType = adCmdStoredProc
oCmd.CommandText = "p_SelectGroupLinksTop6"
oCmd.Parameters.Append oCmd.CreateParameter("@GroupID", adInteger, adParamInput, 4, iGroupID)
oCmd.Execute
set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open oCmd, , adOpenStatic, adLockReadOnly
i = 0
while not oRs.EOF
i = i + 1
'sLinks = sLinks & "start=" & oRs.Fields("StartDate")
'sLinks = sLinks & " & end=" & oRs.Fields("EndDate") & "
"
if i <= 5 then
if oRs.Fields("ContentType") = "CONTENT" then
sLinks = sLinks & "" & oRs.Fields("ContentTitle").Value & "
"
else
sLinks = sLinks & ">" & oRs.Fields("ContentTitle").Value & "
"
end if
if len(oRs.Fields("ShortDescription").Value) > 0 then
sLinks = sLinks & oRs.Fields("ShortDescription").Value & "
"
end if
end if
oRs.MoveNext
wend
oRs.close
set oRs = nothing
set oCmd = nothing
if i > 0 then
sLinks = "Links
" & vbcrlf & "" & vbcrlf & sLinks
sLinks = sLinks & "
"
else
bLinks = false
end if
if i > 5 then
sLinks = sLinks & "» more...
"
end if
end if
end sub
sub getContacts()
if bContacts then
set oCmd = Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection = oConn
oCmd.CommandType = adCmdStoredProc
oCmd.CommandText = "p_SelectGroupContacts"
oCmd.Parameters.Append oCmd.CreateParameter("@GroupID", adInteger, adParamInput, 4, iGroupID)
oCmd.Execute
set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open oCmd, , adOpenStatic, adLockReadOnly
i = 0
while not oRs.EOF
if oRs.Fields("Active").Value then
sContacts = sContacts & "" & oRs.Fields("FirstName").Value & " " & oRs.Fields("LastName").Value & "
"
if len(oRs.Fields("Title").Value) > 0 then
sContacts = sContacts & oRs.Fields("Title").Value & "
"
end if
if len(oRs.Fields("Email").Value) > 0 then
sContacts = sContacts & "" & oRs.Fields("Email").Value & "
"
end if
if len(oRs.Fields("Phone").Value) > 0 then
sContacts = sContacts & oRs.Fields("Phone").Value & ""
end if
i = i + 1
end if
oRs.MoveNext
wend
oRs.close
set oRs = nothing
set oCmd = nothing
if i > 0 then
sContacts = "Contacts
" & "" & sContacts
sContacts = sContacts & "
"
else
bContacts = false
end if
end if
end sub
%>