<% pageTitle ="Course Calendar" %> <% On Error Resume Next %>

Course Calendar

<% Dim oConn, rs, stmt Dim mDate, coursetype,name, language, region, location, prod,partialname Dim ALMOST_FULL_PERCENTAGE ALMOST_FULL_PERCENTAGE = 0.30 ' First convert to an int, then to a str to strip off any non-numeric characters. mDate = CStr(CInt(Request("date"))) coursetype = CStr(CInt(Request("type" ))) name = CStr(Request("name")) partialname = CStr(Replace(Request("partialname"),"'","""")) language = CStr(CInt(Request("language"))) region = CStr(CInt(Request("region"))) location = CStr(CInt(Request("location"))) prod = CStr(CInt(Request("prod"))) Set oConn = Server.CreateObject( "ADODB.Connection" ) oConn.Open "DSN=TRAINING" stmt = "select a.date, CONVERT(varchar,a.date,107) AS PrettyDate, a.CourseID, a.id, c.ProductID , c.CourseName as name,t.CourseType as type, l.locationname as location, l.DescriptionLink as locationurl, " _ & "(SELECT COUNT(*) FROM ECommerce..OEItems IT INNER JOIN ECommerce..OETransactions TR ON (IT.WEB_ORD_CTRL_INT = TR.WEB_ORD_CTRL_INT " _ & "AND TR.PaymentMethod <> '4' AND TR.EcommerceType = 2 AND TR.SOPType = 3 AND IT.Cancelled = 0) WHERE IT.ItemID = a.ID) AS StudentCount, " _ & "a.MaxEnrollment, " _ & "p.Price, a.LanguageID as language , isnull(Products.isWaitList,0) as isWaitList " _ & "from calendar a, Courses c, CourseTypes t, locations l,Price p , [General].[dbo].[Products] Products " _ & "where a.Web_Hidden = 0 AND c.Web_Hidden = 0 AND a.Archived = 0 AND c.id = a.CourseID and Products.id = c.ProductID " _ & "AND (a.[Date] > getdate() or a.[Date] is null) AND c.CourseTypeID = t.ID " _ & "AND a.locationid = l.locationid AND p.CourseID = c.ID AND a.CurrencyID = p.CurrencyID AND NOT p.locationtypeid=2 AND isNULL(l.locationtypeid, 0) in (3,0)" if not ( location = "0" ) then stmt = stmt & " AND a.locationid=" & location end if if not ( region = "0" ) then stmt = stmt & " AND a.regionid=" & region end if if not ( language = "0" ) then stmt = stmt & " AND a.languageid=" & language end if if ( Trim(partialname) <> "" ) then stmt = stmt & " AND c.CourseName LIKE '%" & partialname & "%'" end if if not ( name = "0" ) then if (Request("name").count > 1) then stmt = stmt & " AND (a.courseid=" & Split(Request("name")(1),":")(1) for i=2 to Request("name").count stmt = stmt & " OR a.courseid=" & Split(Request("name")(i),":")(1) next stmt = stmt & ")" else if (UBound(Split(name,":")) >= 1) then stmt = stmt & " AND a.courseid=" & Split(name,":")(1) end if end if end if if not ( prod = "0" ) then stmt = stmt & " AND c.ProductID=" & prod end if if not ( mDate = "0" ) then stmt = stmt & " AND MONTH( a.[DATE] )=" & mDate end if stmt = stmt & " ORDER BY a.date" 'Response.Write(stmt) Set rs = oConn.Execute( stmt ) If rs.EOF Then %>

Currently, there are no training dates scheduled for this course, workshop or product at this time.

Please contact us at training@opentext.com to schedule an on site course or workshop at your location.

<% Else %>

Refine or expand your search

<% Dim oConnection, rsloc, sSqlStmt Dim iLocId, sLocName Set oConnection = Server.CreateObject( "ADODB.Connection" ) oConnection.Open "DSN=TRAINING" sSqlStmt = "SELECT l.LOCATIONID as id, l.LocationName as name, 'location' as argument FROM Locations l (NOLOCK) LEFT JOIN LocTypes t (NOLOCK) ON l.LocationTypeID = t.ID WHERE WebHidden = 0 AND ISNULL(t.LocationType, '') IN ('OpenText','') ORDER BY LocationName" Set rsloc = oConnection.Execute(sSqlStmt) %>
<% Set oConnection = Server.CreateObject( "ADODB.Connection" ) oConnection.Open "DSN=GENERAL" sSqlStmt = "Select ID,Product_Name FROM Products WHERE DisplayOrder <> 99 OR DisplayOrder IS NULL ORDER BY Product_Name" Set rsloc = oConnection.Execute(sSqlStmt) %>
<% Set oConnection = Server.CreateObject( "ADODB.Connection" ) oConnection.Open "DSN=TRAINING" sSqlStmt = "SELECT ID as id, ProductID as product, CourseName as name, 'name' as argument FROM Courses WHERE Web_Hidden = 0 and CourseName <> '' ORDER BY CourseName" Set rsloc = oConnection.Execute(sSqlStmt) %>
OR


<% Function IIF(blnCondition, strTrue, strFalse) If blnCondition Then IIF = strTrue Else IIF = strFalse End If End Function %>

Search results

<% Response.Write("
") Response.Write(" ") Response.Write(" ") Response.Write(" ") Response.Write(" ") Response.Write(" ") Response.Write(" ") Response.write("
") Response.Write(" ") Response.Write("
") Response.Write("
") %>
<% ' ' [ What's This? ] ' ' ' %>
<% do while not rs.EOF ID = rs("ID") CourseID = rs("CourseID") mDate = rs("PrettyDate") %> <% rs.MoveNext loop %>
Date Course name Language Location Price Add
<% If Not IsNull(rs("PrettyDate")) Then Response.Write(mDate) End If %> <%Response.Write("" & rs("name") & "")%> <% select case rs("language") case 11 Response.Write "Deutsch" case 10 Response.Write "English" case 12 Response.Write "Francais" case 14 Response.Write "Italiano" end select %> <% sLocation = rs("location") sLocationUrl = rs("locationurl") if CStr(sLocationUrl) = "" then Response.Write sLocation else Response.Write("" & sLocation & "") end if %> <%=rs("price")%> <% If rs("MaxEnrollment") <= rs("StudentCount") Then if rs("isWaitList") <> True then Response.write "FULL" else Response.write "Wait list" End if ElseIf (1 - (rs("StudentCount") / IIF(rs("MaxEnrollment") = 0, 1, rs("MaxEnrollment")))) <= ALMOST_FULL_PERCENTAGE Then Response.write "

Almost Full

" Response.write "Add to cart" Else Response.write "Add to cart" End If %>
<% End If rs.Close oConn.Close %>

Refine or expand your search

<% Set oConnection = Server.CreateObject( "ADODB.Connection" ) oConnection.Open "DSN=TRAINING" sSqlStmt = "SELECT LOCATIONID as id, LocationName as name, 'location' as argument FROM Locations WHERE WebHidden = 0 ORDER BY LocationName" Set rsloc = oConnection.Execute(sSqlStmt) %>
<% Set oConnection = Server.CreateObject( "ADODB.Connection" ) oConnection.Open "DSN=GENERAL" sSqlStmt = "Select ID,Product_Name FROM Products WHERE DisplayOrder <> 99 OR DisplayOrder IS NULL ORDER BY Product_Name" Set rsloc = oConnection.Execute(sSqlStmt) %>
<% Set oConnection = Server.CreateObject( "ADODB.Connection" ) oConnection.Open "DSN=TRAINING" sSqlStmt = "SELECT ID as id, ProductID as product, CourseName as name, 'name' as argument FROM Courses WHERE Web_Hidden = 0 and CourseName <> '' ORDER BY CourseName" Set rsloc = oConnection.Execute(sSqlStmt) %>
OR

<% Function IIF(blnCondition, strTrue, strFalse) If blnCondition Then IIF = strTrue Else IIF = strFalse End If End Function %>