6 Replies - 8208 Views - Last Post: 25 September 2012 - 04:38 PM Rate Topic: -----

#1 sacpadre  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-September 12

Variable THESESSION is undefined.

Posted 25 September 2012 - 11:49 AM

Hi all,

Our department has recently inherited a Coldfusion server and application from another department that has started exhibiting an error message after logging in to the application.
Namely upon login, the error, "Variable THESESSION is undefined." appears along with some more info:
1844 : cts_End > '#myStart#') and
1845 : dayOfWeek like '%Mon%' and
1846 : cs_id = #theSession# and
1847 : cl_id = #theLocation#
1848 :

On the error screen, line 1846 is highlighted bold. I tried commenting out the line and the error just skips to the next instance.
To the best of my knowledge, no one has touched the code since we've received the application (about 4 weeks ago) and this error message started appearing in just the past two weeks. Full disclaimer, no one in our department has any ColdFusion experience so forgive me if this is an obvious error. I've googled this error and have found nothing that appears to be helpful in resolving this issue.

Any help would be appreciated.

I've included the code to the page that seems to be generating all of the errors (I think some of the formatting was lost pasting it into this):



<cfoutput>

<cfif myInc is "Classes">

        <cfif step is 1>


                <form method="post" action="internal.cfm">

                        <input type="hidden" name="inc" value="Classes">

                        <div class="sectionHead">Add</div>

                        <table class="editTable">
                                <tr style="background-color:##DDDDDD">

                                        <th>Name</th>
                                        <th>Type</th>
                                        <th>Default max</th>

                                        <cfif session.cu_id is 3 or session.cu_id is 12>
                                                <th>Group Ex?</th>
                                        </cfif>

                                        <cfif session.cu_id is 12>
                                                <th>Unit</th>
                                        </cfif>

                                        <th><!---&nbsp;---></th>

                                </tr>
                                <tr>

                                        <td>
                                                <input type="text" name="cc_name" id="cc_name" size="45"
onkeyup="vCheck()">
                                        </td>

                                        <td align="center">
                                                <select  name="ct_id">
                                                        <cfloop query="getClassType">
                                                                        <option value="#ct_id#">#ct_name#</option>
                                                        </cfloop>
                                                </select>

        <a href="internal.cfm?inc=Class Types">add/edit</a>

                                        </td>

                                        <td align="center">
                                                <input type="text" name="cc_ma" id="cc_ma" size="1" onkeyup="vCheck()">
                                        </td>

                                        <cfif session.cu_id is 3 or session.cu_id is 12>

                                                <td align="center">
                                                        <input type="checkbox" name="gx" value="1" checked>
                                                </td>

                                        </cfif>

                                        <cfif session.cu_id is 12>

                                                <td align="center">

                                                                <select name="cu_id">
                                                                        <cfloop query="getUnit">
                                                                                <option value="#cu_id#">#cu_name#</option>
                                                                        </cfloop>
                                                                </select>
                                                </td>

                                        <cfelse>

                                                <input type="hidden" name="cu_id" value="#session.cu_id#">

                                        </cfif>

                                        <td align="right">
                                                <input type="submit" value="New Class" id="newClass" disabled>
                                        </td>

                                </tr>

                        </table>

                        <input type="hidden" name="step" value="3">

                </form>



                <div class="sectionHead">Edit</div>

                <cfif getClass.recordcount gt 0>


                        <table class="editTable">

                                <tr style="background-color:##DDDDDD">

                                        <th>Name</th>
                                        <th>Type</th>
                                        <th>Default Max</th>

                                        <cfif session.cu_id is 3 or session.cu_id is 12>
                                                <th>Group Ex?</th>
                                        </cfif>

                                        <th>Status</th>

                                        <cfif session.cu_id is 12>
                                                <th>Unit</th>
                                                <th>Created</th>
                                                <th>Updated</th>
                                        </cfif>

                                        <th><!---&nbsp;---></th>

                                </tr>

                                <cfset i=1>

                                <cfloop query="getClass">

                                        <cfset i++>

                                        <form name="update#i#" action="internal.cfm" method="post">



                                                <tr class="myTR2"
                                                        <cfif currentRow mod 2>
                                                                style="background-color:##eeeeee;"
                                                        </cfif>
                                                >




                                                <td>
                                                                <input type="hidden" name="inc" value="Classes">
                                                                <input type="hidden" id="cc_id" name="cc_id" value="#cc_id#">
                                                                <input type="text" id="cc_name" name="cc_name" value="#cc_name#">
                                                </td>

                                                <td align="center">
                                                                <cfset myTypeId = ct_id>

                                                                <select  name="ct_id">
                                                                        <cfloop query="getClassType">
                                                                                        <option value="#ct_id#" <cfif myTypeId is
ct_id>selected</cfif> >#ct_name#</option>
                                                                        </cfloop>
                                                                </select>

                                                </td>

                                                <td align="center">
                                                        <input type="text" id="cc_max" name="cc_max" value="#cc_max#" size="2">
                                                </td>

                                                <cfif session.cu_id is 3 or session.cu_id is 12>

                                                        <td align="center">
                                                                        <input type="checkbox" id="gx" name="gx" value="1" <cfif gx
gt 0 >checked</cfif>>
                                                        </td>

                                                </cfif>

                                                        <td align="center">
                                                                <select name="status" id="status">
                                                                        <option value="1" <cfif #status# is 1>selected</cfif>>Active</option>
                                                                        <option value="0" <cfif #status# is 0>selected</cfif>>Inactive</option>
                                                                </select>
                                                        </td>

                                                        <cfif session.cu_id is 12>

                                                                <td align="center">
                                                                                <select name="cu_id">
                                                                                        <cfloop query="getUnit">
                                                                                                <option value="#cu_id#" <cfif getUnit.cu_id is
getClass.cu_id>selected</cfif>>#cu_name#</option>
                                                                                        </cfloop>
                                                                                </select>
                                                                </td>

                                                                <td align="center">
                                                                        #created#
                                                                </td>

                                                                <td align="center">
                                                                        #updated#
                                                                </td>

                                                        <cfelse>

                                                                <input type="hidden" name="cu_id" value="#session.cu_id#">

                                                        </cfif>

                                                        <td align="right">
                                                                <input type="hidden" name="step" value="2">
                                                                <input type="submit" value="Save">
                                                        </td>

                                                </tr>

                                        </form>

                                </cfloop>

                        </table>


                <cfelse>

                        No Classes Found

                </cfif>

        </cfif>

        <cfif step is 2>

                <cfquery name="nameCheck" dbtype="query">
                        select *
                        from getClass
                        where
                                upper(cc_name) = '#ucase(form.cc_name)#'
                                and cc_id <> #form.cc_id#
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.cc_name# class already in system">

                <cfelse>

                        <cfif not isdefined("form.gx")>
                                <cfset form.gx=0>
                        </cfif>

                        <cfset form.cc_name = replace(form.cc_name, "'", "", "ALL")>

                        <cfinvoke component="checkin" method="editClass">
                                <cfinvokeargument name="cc_name" value="#form.cc_name#">
                                <cfinvokeargument name="ct_id" value="#form.ct_id#">
                                <cfif session.cu_id is 3 or session.cu_id is 12>
                                        <cfinvokeargument name="gx" value="#form.gx#">
                                </cfif>
                                <cfinvokeargument name="cc_max" value="#form.cc_max#">
                                <cfinvokeargument name="cc_id" value="#form.cc_id#">
                                <cfinvokeargument name="status" value="#form.status#">
                                <cfinvokeargument name="cu_id" value="#form.cu_id#">
                        </cfinvoke>


                </cfif>

                <cflocation url = "internal.cfm?inc=Classes">

        </cfif>

        <cfif step is 3>

                <cfquery name="nameCheck" dbtype="query">
                        select * from getClass where upper(cc_name) = '#ucase(form.cc_name)#'
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.cc_name# class already in system">
                        <cflocation url = "internal.cfm?inc=Classes">



                <cfelse>

                        <cfif not isdefined("form.gx")>
                                <cfset form.gx=0>
                        </cfif>

                        <cfset form.cc_name = replace(form.cc_name, "'", "", "ALL")>

                        <cfinvoke component="checkin" method="addClass">
                                <cfinvokeargument name="cc_name" value="#form.cc_name#">
                                <cfinvokeargument name="cc_ma" value="#form.cc_ma#">
                                <cfinvokeargument name="ct_id" value="#form.ct_id#">
                                <cfif session.cu_id is 3 or session.cu_id is 12>
                                        <cfinvokeargument name="gx" value="#form.gx#">
                                </cfif>
                                <cfinvokeargument name="cu_id" value="#form.cu_id#">
                        </cfinvoke>

                </cfif>

                <cflocation url = "internal.cfm?inc=Classes">

        </cfif>

<cfelseif myInc is"Class Types">

        <cfif step is 1>

                <form method="post" action="internal.cfm">
                        <input type="hidden" name="inc" value="Class Types">

                        <div class="sectionHead">Add</div>

                        <table class="editTable">

                                <tr style="background-color:##DDDDDD">

                                        <th>Name</th>

                                        <cfif session.cu_id is 12>
                                                        <th>Unit</th>
                                        </cfif>

                                        <th><!---&nbsp;---></th>

                                </tr>
                                <tr>

                                        <td width="300">
                                                <input type="text" size="50" name="ct_name" id="ct_name"
onkeyup="vCheckb(this.id)">
                                        </td>

                                        <cfif session.cu_id is 12>

                                                <td align="center" width="100">
                                                                <select name="cu_id">
                                                                        <cfloop query="getUnit">
                                                                                <option value="#cu_id#">#cu_name#</option>
                                                                        </cfloop>
                                                                </select>
                                                </td>

                                        <cfelse>

                                                <input type="hidden" name="cu_id" value="#session.cu_id#">

                                        </cfif>

                                        <td align="right">
                                                <input type="submit" value="New Class Type" id="mySubmit" disabled>
                                        </td>

                                </tr>

                        </table>

                        <input type="hidden" name="step" value="3">

                </form>

                <div class="sectionHead">Edit</div>

                <cfif getClassType.recordcount gt 0>

                        <table class="editTable">
                                <tr style="background-color:##DDDDDD">

                                        <th>Name</th>
                                        <th>Status</th>

                                        <cfif session.cu_id is 12>
                                                <th>Unit</th>
                                                <th>Created</th>
                                                <th>Updated</th>
                                        </cfif>

                                        <th><!---&nbsp;---></th>

                                </tr>

                                <cfset i=1>

                                <cfloop query="getClassType">

                                        <cfset i++>

                                        <form name="update#i#" action="internal.cfm" method="post">

                                                <tr class="myTR2"
                                                        <cfif currentRow mod 2>
                                                                style="background-color:##eeeeee;"
                                                        </cfif>
                                                >



                                                        <td >
                                                                <input type="hidden" id="ct_id" name="ct_id" value="#ct_id#">
                                                                <input type="hidden" name="inc" value="Class Types">
                                                                <input type="text" id="ct_name" name="ct_name" value="#ct_name#">
                                                        </td>

                                                        <td align="center">
                                                                <select name="status" id="status">
                                                                        <option value="1" <cfif #status# is 1>selected</cfif>>Active</option>
                                                                        <option value="0" <cfif #status# is 0>selected</cfif>>Inactive</option>
                                                                </select>
                                                        </td>

                                                        <cfif session.cu_id is 12>

                                                                <td align="center">
                                                                                <select name="cu_id">
                                                                                        <cfloop query="getUnit">
                                                                                                <option value="#cu_id#" <cfif getUnit.cu_id is
getClassType.cu_id>selected</cfif>>#cu_name#</option>
                                                                                        </cfloop>
                                                                                </select>
                                                                </td>

                                                                <td align="center">
                                                                        #created#
                                                                </td>

                                                                <td align="center">
                                                                        #updated#
                                                                </td>

                                                        <cfelse>

                                                                <input type="hidden" name="cu_id" value="#session.cu_id#">

                                                        </cfif>

                                                        <td align="right">
                                                                <input type="hidden" name="step" value="2">
                                                                <input type="submit" value="Save">
                                                        </td>

                                                </tr>

                                        </form>

                                </cfloop>

                        </table>

                <cfelse>

                        No Class Types Found

                </cfif>

        </cfif>

        <cfif step is 2>

                <cfquery name="nameCheck" dbtype="query">
                        select * from getClassType where upper(ct_name) = '#ucase(form.ct_name)#'
                        and ct_id <> #form.ct_id#
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.ct_name# class type already in system">

                <cfelse>

                        <cfset form.cc_name = replace(form.ct_name, "'", "", "ALL")>

                        <cfinvoke component="checkin" method="cTypesEdit">
                          <cfinvokeargument name="ct_name" value="#form.ct_name#">
                          <cfinvokeargument name="status" value="#form.status#">
                          <cfinvokeargument name="ct_id" value="#form.ct_id#">
                          <cfinvokeargument name="cu_id" value="#form.cu_id#">
                        </cfinvoke>

                </cfif>

                <cflocation url = "internal.cfm?inc=Class Types">

        </cfif>

        <cfif step is 3>

                <cfquery name="nameCheck" dbtype="query">
                        select * from getClassType where upper(ct_name) = '#ucase(form.ct_name)#'
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.ct_name# class type already in system">

                <cfelse>

                        <cfset form.cc_name = replace(form.ct_name, "'", "", "ALL")>

                        <cfinvoke component="checkin" method="cTypesAdd">
                          <cfinvokeargument name="ct_name" value="#form.ct_name#">
                          <cfinvokeargument name="cu_id" value="#form.cu_id#">
                        </cfinvoke>


                </cfif>


                <cflocation url = "internal.cfm?inc=Class Types">

        </cfif>


<cfelseif myInc is "Locations">

        <cfif step is 1>


                <form method="post" action="internal.cfm">

                        <input type="hidden" name="inc" value="Locations">


                        <div class="sectionHead">Add</div>


                        <table class="editTable">

                                <tr style="background-color:##DDDDDD">

                                        <th>Name</th>

                                        <cfif session.cu_id is 12>
                                                <th>Unit</th>
                                        </cfif>

                                        <th><!---&nbsp;---></th>

                                </tr>
                                <tr>

                                        <td width="300">

                                                <input type="text" name="cl_name" id="clname" size="50"
onkeyup="vCheckb(this.id)">
                                        </td>

                                        <cfif session.cu_id is 12>

                                                <td align="center" width="100">
                                                                <select name="cu_id">
                                                                        <cfloop query="getUnit">
                                                                                <option value="#cu_id#">#cu_name#</option>
                                                                        </cfloop>
                                                                </select>
                                                </td>

                                        <cfelse>

                                                <input type="hidden" name="cu_id" value="#session.cu_id#">

                                        </cfif>

                                        <td align="right">
                                                <input type="submit" value="New Location" id="mySubmit" disabled>
                                        </td>

                                </tr>

                        </table>

                        <input type="hidden" name="step" value="3">

                </form>

                <div class="sectionHead">Edit</div>

                <cfif getLocation.recordcount gt 0>

                        <table class="editTable">

                                <tr style="background-color:##DDDDDD">

                                        <th>Name</th>
                                        <th>Status</th>

                                        <cfif session.cu_id is 12>
                                                <th>Unit</th>
                                                <th>Created</th>
                                                <th>Updated</th>
                                        </cfif>

                                        <th><!---&nbsp;---></th>

                                </tr>

                                <cfset i=1>

                                <cfloop query="getLocation">
                                        <cfset i++>

                                        <form name="update#i#" action="internal.cfm" method="post">

                                                <tr class="myTR2"
                                                        <cfif currentRow mod 2>
                                                                style="background-color:##eeeeee;"
                                                        </cfif>
                                                >


                                                        <td>
                                                                <input type="hidden" name="inc" value="Locations">
                                                                <input type="hidden" id="cl_id" name="cl_id" value="#cl_id#">
                                                                <input type="text" id="cl_name" name="cl_name" value="#cl_name#">
                                                        </td>

                                                        <td align="center">
                                                                <select name="status" id="status">
                                                                        <option value="1" <cfif #status# is 1>selected</cfif>>Active</option>
                                                                        <option value="0" <cfif #status# is 0>selected</cfif>>Inactive</option>
                                                                </select>
                                                        </td>

                                                        <cfif session.cu_id is 12>

                                                                <td align="center">
                                                                                <select name="cu_id">
                                                                                        <cfloop query="getUnit">
                                                                                                <option value="#cu_id#" <cfif getUnit.cu_id is
getLocation.cu_id>selected</cfif>>#cu_name#</option>
                                                                                        </cfloop>
                                                                                </select>
                                                                </td>

                                                                <td align="center">
                                                                        #created#
                                                                </td>

                                                                <td align="center">
                                                                        #updated#
                                                                </td>

                                                        <cfelse>

                                                                <input type="hidden" name="cu_id" value="#session.cu_id#">

                                                        </cfif>

                                                        <td align="right">
                                                                <input type="hidden" name="step" value="2">
                                                                <input type="submit" value="save">
                                                        </td>

                                                </tr>

                                        </form>

                                </cfloop>

                        </table>

                <cfelse>

                        No Locations Found

                </cfif>

        </cfif>

        <cfif step is 2>

                <cfquery name="nameCheck" dbtype="query">
                        select * from getLocation where upper(cl_name) = '#ucase(form.cl_name)#'
                        and cl_id <> #form.cl_id#
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.cl_name# location already in system">

                <cfelse>

                        <cfset form.cc_name = replace(form.cl_name, "'", "", "ALL")>

                        <cfinvoke component="checkin" method="locationEdit">
                          <cfinvokeargument name="cl_name" value="#form.cl_name#">
                          <cfinvokeargument name="status" value="#form.status#">
                          <cfinvokeargument name="cl_id" value="#form.cl_id#">
                          <cfinvokeargument name="cu_id" value="#form.cu_id#">
                        </cfinvoke>

                </cfif>

                <cflocation url = "internal.cfm?inc=Locations">

        </cfif>

        <cfif step is 3>

                <cfquery name="nameCheck" dbtype="query">
                        select * from getLocation where upper(cl_name) = '#ucase(form.cl_name)#'
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.cl_name# location already in system">

                <cfelse>

                        <cfset form.cc_name = replace(form.cl_name, "'", "", "ALL")>

                        <cfinvoke component="checkin" method="locationAdd">
                          <cfinvokeargument name="cl_name" value="#form.cl_name#">
                          <cfinvokeargument name="cu_id" value="#form.cu_id#">
                        </cfinvoke>


                </cfif>


                <cflocation url = "internal.cfm?inc=Locations">

        </cfif>

<cfelseif myInc is "User Security">


        <cfif step is 1>


                <form method="post" action="internal.cfm">

                        <input type="hidden" name="inc" value="User Security">

<!---
                        <div class="sectionHead">Add - NOTE: Please do not use special
characters, single or double quotes in the fields below.</div>
--->

                        <table class="editTable">

                                <tr style="background-color:##DDDDDD">

                                        <th>First</th>
                                        <th>Last</th>
                                        <th>Username</th>
                                        <th>Passphrase</th>
                                        <th>Sec Level</th>

                                        <cfif session.cu_id is 12>
                                                <th>Unit</th>
                                        </cfif>

                                        <th><!---&nbsp;---></th>

                                </tr>

                                <tr>

                                                <td align="center">
                                                        <input type="text" id="sec_first" name="sec_first">
                                                </td>

                                                <td align="center">
                                                        <input type="text" id="sec_last" name="sec_last">
                                                </td>

                                                <td align="center">
                                                        <input type="text" id="sec_memberid" name="sec_memberid">
                                                </td>

                                                <td align="center">
                                                        <input type="password" id="sec_passphrase" name="sec_passphrase">
                                                </td>

                                                <td align="center">
                                                        <select name="sec_level" id="sec_level">
                                                                <option value="1"<cfif session.validated lt
1>disabled</cfif>>Student</option>
                                                                <option value="2"<cfif session.validated lt
2>disabled</cfif>>Supervisor</option>
                                                                <option value="3"<cfif session.validated lt
3>disabled</cfif>>Manager</option>
                                                                <option value="4"<cfif session.validated lt
4>disabled</cfif>>Admin</option>
                                                </select>
                                        </td>

                                        <cfif session.cu_id is 12>

                                                <td align="center">
                                                                <select name="cu_id">
                                                                        <cfloop query="getUnit">
                                                                                <option value="#cu_id#">#cu_name#</option>
                                                                        </cfloop>
                                                                </select>
                                                </td>

                                        <cfelse>

                                                <input type="hidden" name="cu_id" value="#session.cu_id#">
                                        </cfif>

                                        <td align="center">
                                                <input type="submit" value="Add">
                                        </td>

                                </tr>

                        </table>

                        <input type="hidden" name="step" value="3">

                </form>

                <div class="sectionHead">Edit</div>


                <cfif getSec.recordcount gt 0>

                        <table class="editTable">

                                <tr style="background-color:##DDDDDD">

                                        <th>First</th>
                                        <th>Last</th>
                                        <th>Username</th>
                                        <th>Passphrase</th>
                                        <th>Sec Level</th>
                                        <th>Status</th>

                                        <cfif session.cu_id is 12>
                                                <th>Unit</th>
                                                <th>Created</th>
                                                <th>Updated</th>
                                        </cfif>

                                        <th><!---&nbsp;---></th>

                                </tr>

                                <cfset i=1>

                                <cfloop query="getSec">

                                        <cfset i++>

                                        <form name="update#i#" action="internal.cfm" method="post">

                                                <tr class="myTR2"
                                                        <cfif currentRow mod 2>
                                                                style="background-color:##eeeeee;"
                                                        </cfif>
                                                >

                                                        <td>
                                                                <input type="hidden" name="inc" value="User Security">
                                                                <input type="hidden" id="sec_id" name="sec_id" value="#sec_id#">
                                                                <input type="text" id="sec_first" name="sec_first"
value="#sec_first#" size="10">
                                                        </td>

                                                        <td>
                                                                <input type="text" id="sec_last" name="sec_last"
value="#sec_last#" size="12">
                                                        </td>

                                                        <td>
                                                                <input type="text" id="sec_memberid" name="sec_memberid"
value="#sec_memberid#" size="10">
                                                        </td>

                                                        <td>
                                                                <input type="password" id="sec_passphrase"
name="sec_passphrase" value="#sec_passphrase#" size="10">
                                                        </td>

                                                        <td align="center">
                                                                <select name="sec_level" id="sec_level">
                                                                        <option value="1" <cfif sec_level is "1">selected</cfif>
<cfif session.validated lt 1>disabled</cfif>>Student</option>
                                                                        <option value="2" <cfif sec_level is "2">selected</cfif>
<cfif session.validated lt 2>disabled</cfif>>Supervisor</option>
                                                                        <option value="3" <cfif sec_level is "3">selected</cfif>
<cfif session.validated lt 3>disabled</cfif>>Manager</option>
                                                                        <option value="4" <cfif sec_level is "4">selected</cfif>
<cfif session.validated lt 4>disabled</cfif>>Admin</option>
                                                                </select>
                                                        </td>

                                                        <td align="center">
                                                                <select name="status" id="status">
                                                                        <option value="0" <cfif status is 0>selected</cfif>>Inactive</option>
                                                                        <option value="1" <cfif status is 1>selected</cfif>>Active</option>
                                                                </select>
                                                        </td>

                                                        <cfif session.cu_id is 12>

                                                                <td>
                                                                        <select name="cu_id">
                                                                                <cfloop query="getUnit">
                                                                                        <option value="#cu_id#" <cfif getUnit.cu_id is
getSec.cu_id>selected</cfif>>#cu_name#</option>
                                                                                </cfloop>
                                                                        </select>
                                                                </td>

                                                                <td align="center">
                                                                        #created#
                                                                </td>

                                                                <td align="center">
                                                                        #updated#
                                                                </td>

                                                        <cfelse>

                                                                <input type="hidden" name="cu_id" value="#session.cu_id#">

                                                        </cfif>


                                                        <td>
                                                                <input type="hidden" name="step" value="2">
                                                                <input type="submit" value="save" <cfif session.validated lt
sec_level>disabled</cfif>>
                                                        </td>

                                                </tr>

                                        </form>

                                </cfloop>

                        </table>

                <cfelse>

                        No Users Found

                </cfif>

        </cfif>

        <cfif step is 2>

                <cfquery name="nameCheck" dbtype="query">
                        select * from getSec where upper(sec_memberid) = '#ucase(form.sec_memberid)#'
                        and sec_id <> #form.sec_id#
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.sec_memberid# already in system">

                <cfelse>



                        <cfinvoke component="checkin" method="secUpdate">
                                <cfinvokeargument name="sec_id" value="#form.sec_id#">
                                <cfinvokeargument name="sec_level" value="#form.sec_level#">
                                <cfinvokeargument name="sec_memberid" value="#form.sec_memberid#">
                                <cfinvokeargument name="sec_passphrase" value="#form.sec_passphrase#">
                                <cfinvokeargument name="sec_first" value="#form.sec_first#">
                                <cfinvokeargument name="sec_last" value="#form.sec_last#">
                                <cfinvokeargument name="status" value="#form.status#">
                                <cfinvokeargument name="cu_id" value="#form.cu_id#">
                        </cfinvoke>

                </cfif>

                <cflocation url = "internal.cfm?inc=User Security">

        </cfif>

        <cfif step is 3>

                <cfquery name="nameCheck" dbtype="query">
                        select * from getSec where upper(sec_memberid) = '#ucase(form.sec_memberid)#'
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.sec_memberid# already in system">

                <cfelse>

                        <cfinvoke component="checkin" method="secAdd">
                                <cfinvokeargument name="sec_level" value="#form.sec_level#">
                                <cfinvokeargument name="sec_memberid" value="#form.sec_memberid#">
                                <cfinvokeargument name="sec_passphrase" value="#form.sec_passphrase#">
                                <cfinvokeargument name="sec_first" value="#form.sec_first#">
                                <cfinvokeargument name="sec_last" value="#form.sec_last#">
                                <cfinvokeargument name="cu_id" value="#form.cu_id#">
                        </cfinvoke>

                </cfif>

                <cflocation url = "internal.cfm?inc=User Security">

        </cfif>

<cfelseif myInc is "Sessions">

        <cfif step is 1>


                <form method="post" action="internal.cfm" name="newSession">

                        <input type="hidden" name="inc" value="Sessions">

                        <div class="sectionHead">Add</div>

                        <table class="editTable">

                                <tr style="background-color:##DDDDDD">
                                        <th>Name</th>
                                        <th>Start</th>
                                        <th>End</th>
                                        <th><!---&nbsp;---></th>
                                </tr>

                                <tr>
                                        <td align="center">
                                                <select name="cs_name" id="cs_name" onchange="spCheck(this,
'sp0', 'cs0')">
                                                        <option value="Fall">Fall</option>
                                                        <option value="Winter">Winter</option>
                                                        <option value="Spring">Spring</option>
                                                        <option value="SS I">SS I</option>
                                                        <option value="SS II">SS II</option>
                                                        <option value="Special">Special</option>
                                                </select>
                                                <span id="sp0" style="display:none">
                                                        <input type="text" name="cs_name" id="cs0">
                                                </span>
                                        </td>
                                        <td align="center">
                                                <input type="text" name="cs_start" id="cs_start" size="8">
                                                <script language="Javascript">
                                                new tcal ({
                                                        // form name
                                                        'formname': 'newSession',
                                                        // input name
                                                        'controlname': 'cs_start'
                                                });
                                                </script>
                                        </td>
                                        <td align="center">
                                                <input type="text" name="cs_end" size="8">
                                                <script language="Javascript">
                                                new tcal ({
                                                        // form name
                                                        'formname': 'newSession',
                                                        // input name
                                                        'controlname': 'cs_end'
                                                });
                                                </script>
                                        </td>

                                        <td align="right"><input type="submit" value="New Session"></td>
                                </tr>

                        </table>

                        <input type="hidden" name="step" value="3">

                </form>

                <div class="sectionHead">Edit</div>

                <cfif getSession.recordcount gt 0>

                        <table class="editTable">

                                <tr style="background-color:##DDDDDD">
                                        <th>Name</th>
                                        <th>Start</th>
                                        <th>End</th>
                                        <th>Status</th>

                                        <th>Created</th>
                                        <th>Updated</th>

                                        <th><!---&nbsp;---></th>
                                </tr>



                                <cfset i=1>

                                <cfloop query="getSession">

                                        <cfset i++>

                                        <form name="update#i#" action="internal.cfm" method="post">

                                                <tr class="myTR2"
                                                        <tr class="myTR2"
                                                                <cfif currentRow mod 2>
                                                                        style="background-color:##eeeeee;"
                                                                </cfif>
                                                        >



                                                        <td align="center">
                                                                <input type="hidden" id="cc_id" name="cs_id" value="#cs_id#">
                                                                <input type="hidden" name="inc" value="Sessions">

                                                                <select name="cs_name" id="cs_name" onchange="spCheck(this,
'sp#i#', 'cs#i#')">
                                                                        <option value="Fall" <cfif cs_name is
"Fall">selected</cfif>>Fall</option>
                                                                        <option value="Winter" <cfif cs_name is
"Winter">selected</cfif>>Winter</option>
                                                                        <option value="Spring" <cfif cs_name is
"Spring">selected</cfif>>Spring</option>
                                                                        <option value="SS I" <cfif cs_name is "SS
I">selected</cfif>>SS I</option>
                                                                        <option value="SS II" <cfif cs_name is "SS
II">selected</cfif>>SS II</option>
                                                                        <option value="Special" <cfif left(cs_name, 7) is
"Special">selected</cfif>>Special</option>
                                                                </select>
                                                                <span id="sp#i#" style="display:<cfif left(cs_name, 7) is
"Special">block<cfelse>none</cfif>">
                                                                <cfif left(cs_name, 7) is "Special">
                                                                        <input type="text" name="cs_name" value="#listlast(cs_name)#"
id="cs#i#">
                                                                </cfif>
                                                                </span>
                                                        </td>

                                                        <td align="center" width="100">

                                                                <input type="text" name="cs_start" id="cs_start" size="8"
value="#dateformat(cs_start, "mm/dd/yyyy")#">
                                                                <script language="Javascript">
                                                                new tcal ({
                                                                        // form name
                                                                        'formname': 'update#i#',
                                                                        // input name
                                                                        'controlname': 'cs_start'
                                                                });
                                                                </script>
                                                        </td>

                                                        <td align="center" width="100">
                                                                <input type="text" name="cs_end" id="cs_end" size="8"
value="#dateformat(cs_end, "mm/dd/yyyy")#">
                                                                <script language="Javascript">
                                                                new tcal ({
                                                                        // form name
                                                                        'formname': 'update#i#',
                                                                        // input name
                                                                        'controlname': 'cs_end'
                                                                });
                                                                </script>
                                                        </td>

                                                        <td align="center">
                                                                <select name="status" id="status">
                                                                        <option value="1" <cfif #status# is 1>selected</cfif>>Active</option>
                                                                        <option value="0" <cfif #status# is 0>selected</cfif>>Inactive</option>
                                                                </select>
                                                        </td>

                                                        <td align="center">
                                                                #created#
                                                        </td>

                                                        <td align="center">
                                                                #updated#
                                                        </td>

                                                        <td align="right">
                                                                <input type="hidden" name="step" value="2">
                                                                <input type="submit" value="save">
                                                        </td>

                                                </tr>

                                        </form>

                                </cfloop>

                        </table>

                <cfelse>

                        No Sessions Found

                </cfif>

        </cfif>

        <cfif step is 2>

                <cfquery name="nameCheck" dbtype="query">
                        select *
                        from getSession
                        where
                                upper(cs_name) = '#ucase(form.cs_name)#'
                                and cs_id <> #form.cs_id#
                </cfquery>


#nameCheck.status# #form.status#
                <cfif nameCheck.recordcount gt 0 and nameCheck.status is form.status>

                        <cfset session.error="#form.cs_name# class already in system">

                <cfelse>

                        <cfset form.cc_name = replace(form.cs_name, "'", "", "ALL")>

                        <cfinvoke component="checkin" method="editSession">
                          <cfinvokeargument name="cs_name" value="#form.cs_name#">
                          <cfinvokeargument name="cs_id" value="#form.cs_id#">
                          <cfinvokeargument name="cs_start" value="#form.cs_start#">
                          <cfinvokeargument name="cs_end" value="#form.cs_end#">
                          <cfinvokeargument name="status" value="#form.status#">
                        </cfinvoke>


                </cfif>

                <cflocation url = "internal.cfm?inc=Sessions">
<!------>
        </cfif>

        <cfif step is 3>

                <cfquery name="nameCheck" dbtype="query">
                        select * from getSession where upper(cs_name) =
'#ucase(form.cs_name)#' and cs_start = '#cs_start#' and cs_end =
'#cs_end#'
                </cfquery>

                <cfif nameCheck.recordcount gt 0>

                        <cfset session.error="#form.cs_name# class already in system">
                        <cflocation url = "internal.cfm?inc=Sessions">



                <cfelse>

                        <cfset form.cc_name = replace(form.cs_name, "'", "", "ALL")>

                        <cfinvoke component="checkin" method="addSession">
                                <cfinvokeargument name="cs_name" value="#form.cs_name#">
                                <cfinvokeargument name="cs_start" value="#form.cs_start#">
                                <cfinvokeargument name="cs_end" value="#form.cs_end#">
                        </cfinvoke>

                </cfif>

                <cflocation url = "internal.cfm?inc=Sessions">

        </cfif>



<cfelseif myInc is "Schedules">



        <form id="delMe" name="delMe" method="post" action="internal.cfm">
                <input type="hidden" id="my_cts_id" name="cts_id">
                <input type="hidden" id="step" name="step" value="4">
                <input type="hidden" id="inc" name="inc" value="Schedules">
        </form>

        <cfif step is 1>


                <div class="sectionHead">
                        <cfif isdefined("form.editMe")>
                                Update
                        <cfelse>
                                Add
                        </cfif>
                </div>

                <form name="myForm" id="myForm">

                        <table border=1 class="editTable">

                                <tr style="background-color:##DDDDDD">
                                        <th>Session</th>
                                        <th>Class</th>
                                        <th>Location</th>
                                        <th>Day</th>
                                        <th>Start</th>
                                        <th>End</th>
                                </tr>

                                <tr>

                                        <td valign="top">

                                                <a href="internal.cfm?inc=Sessions">add/edit</a><br /><br />

                                                <div style="height:130px;width:140px;overflow:auto">

                                                        <cfloop query="getSessions">

                                                                <cfif status is 1 and (cu_id is session.cu_id or session.cu_id
is 12) and cs_end ge now()>

                                                                        <input type="radio" name="cs_id" id="cs_id"
value="#cs_id#,#cs_name# #year(cs_start)#"

                                                                         onclick="setDetail(this,'mySession','Session')"

                                                                         <cfif isdefined("form.editMe") and form.cs_id is cs_id >
                                                                                checked
                                                                         </cfif>
                                                                         >

                                                                        <cfif left(cs_name, 7) is "Special">
                                                                                #listGetAt(cs_name, 2, ",")#
                                                                        <cfelse>
                                                                                #cs_name#
                                                                        </cfif>

                                                                        #year(cs_start)#

                                                                        <cfif session.cu_id is 12>
                                                                                - #cu_id#
                                                                        </cfif>

                                                                        <br />

                                                                </cfif>

                                                        </cfloop>

                                                </div>

                                        </td>

                                        <td valign="top">

                                                <a href="internal.cfm?inc=Classes">add/edit</a><br /><br />

                                                <div style="height:130px;width:170px;overflow:auto">

                                                        <cfloop query="getClasses">

                                                                <cfif status is 1 and (cu_id is session.cu_id or session.cu_id is 12)>

                                                                        <input type="radio" name="cc_id" id="cc_id"
value="#cc_id#,#cc_name#" onclick="setDetail(this,'myClass','Class')"
                                                                         <cfif isdefined("form.editMe") and form.cc_id is cc_id>
                                                                                checked
                                                                         </cfif>
                                                                        >
                                                                        #cc_name#

                                                                        <cfif session.cu_id is 12>
                                                                                - #cu_id#
                                                                        </cfif>

                                                                        <br />

                                                                </cfif>

                                                        </cfloop>

                                                </div>

                                        </td>

                                        <td valign="top">

                                                <a href="internal.cfm?inc=Locations">add/edit</a><br /><br />

                                                <div style="height:130px;width:120px;overflow:auto">

                                                        <cfloop query="getLocations">

                                                                <cfif status is 1 and (cu_id is session.cu_id or session.cu_id is 12)>
                                                                        <input type="radio" name="cl_id" id="cl_id"
value="#cl_id#,#cl_name#"
onclick="setDetail(this,'myLocation','Location')"
                                                                         <cfif isdefined("form.editMe") and form.cl_id is cl_id>
                                                                                checked
                                                                         </cfif>
                                                                        >
                                                                        #cl_name#

                                                                        <cfif session.cu_id is 12>
                                                                                - #cu_id#
                                                                        </cfif>
                                                                        <br />

                                                                </cfif>

                                                        </cfloop>

                                                </div>

                                        </td>

                                        <td valign="top">

                                                <input type="checkbox" name="sc_day1" id="sc_day1"
value="Sunday" onclick="setDetail(this,'myDay','Day')"
                                                 <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,
"Sunday") neq 0>
                                                        checked
                                                 </cfif>
                                                >Sunday<br />

                                                <input type="checkbox" name="sc_day2" id="sc_day2"
value="Monday" onclick="setDetail(this,'myDay','Day')"
                                                 <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,
"Monday") neq 0>
                                                        checked
                                                 </cfif>
                                                >Monday<br />

                                                <input type="checkbox" name="sc_day3" id="sc_day3"
value="Tuesday" onclick="setDetail(this,'myDay','Day')"
                                                 <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,
"Tuesday") neq 0>
                                                        checked
                                                 </cfif>
                                                >Tuesday<br />

                                                <input type="checkbox" name="sc_day4" id="sc_day4"
value="Wednesday" onclick="setDetail(this,'myDay','Day')"
                                                 <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,
"Wednesday") neq 0>
                                                        checked
                                                 </cfif>
                                                >Wednesday<br />

                                                <input type="checkbox" name="sc_day5" id="sc_day5"
value="Thursday" onclick="setDetail(this,'myDay','Day')"
                                                 <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,
"Thursday") neq 0>
                                                        checked
                                                 </cfif>
                                                >Thursday<br />

                                                <input type="checkbox" name="sc_day6" id="sc_day6"
value="Friday" onclick="setDetail(this,'myDay','Day')"
                                                 <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,
"Friday") neq 0>
                                                        checked
                                                 </cfif>
                                                >Friday<br />

                                                <input type="checkbox" name="sc_day7" id="sc_day7"
value="Saturday" onclick="setDetail(this,'myDay','Day')"
                                                 <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,
"Saturday") neq 0>
                                                        checked
                                                 </cfif>
                                                >Saturday<br />

                                        </td>

                                        <td valign="top">

                                                <div style="height:160px;width:100px;overflow:auto">

                                                        <cfset f=6>
                                                        <cfset t=12>

                                                        <cfloop index="ap" from="1" to="2">

                                                                <cfif ap is 2>

                                                                        <cfset f=1>
                                                                        <cfset t=10>

                                                                </cfif>

                                                                <cfloop index="h" from="#f#" to="#t#">

                                                                        <cfloop index="m" from="0" to="55" step="5">

                                                                                <cfset mytime=numberformat(h, "0_")&":"&numberformat(m, "0_")>

                                                                                <cfif ap is 1 and h neq 12>
                                                                                        <cfset mytime=mytime & " AM">
                                                                                <cfelse>
                                                                                        <cfset mytime=mytime & " PM">
                                                                                </cfif>

                                                                                <input type="radio" name="sc_Start" id="sc_Start"
value="#mytime#"  onclick="setDetail(this,'myStart','Start')"

                                                                                <cfif isdefined("form.editMe") and form.cts_start is mytime>
                                                                                        checked
                                                                                </cfif>

                                                                                >
                                                                                #mytime#
                                                                                <br />

                                                                        </cfloop>

                                                                </cfloop>

                                                        </cfloop>

                                                </div>

                                        </td>

                                        <td valign="top">

                                                <div style="height:160px;width:100px;overflow:auto">

                                                        <cfset f=6>
                                                        <cfset t=12>

                                                        <cfloop index="ap" from="1" to="2">

                                                                <cfif ap is 2>

                                                                        <cfset f=1>
                                                                        <cfset t=11>

                                                                </cfif>

                                                                <cfloop index="h" from="#f#" to="#t#">

                                                                        <cfloop index="m" from="0" to="55" step="5">

                                                                                <cfset mytime=numberformat(h, "0_")&":"&numberformat(m, "0_")>

                                                                                <cfif ap is 1 and h neq 12>
                                                                                        <cfset mytime=mytime & " AM">
                                                                                <cfelse>
                                                                                        <cfset mytime=mytime & " PM">
                                                                                </cfif>

                                                                                <input type="radio" name="sc_End" id="sc_End"
value="#mytime#"  onclick="setDetail(this,'myEnd','End')"

                                                                                <cfif isdefined("form.editMe") and form.cts_end is mytime>
                                                                                        checked
                                                                                </cfif>

                                                                                >

                                                                                #mytime#
                                                                                <br />

                                                                        </cfloop>

                                                                </cfloop>

                                                        </cfloop>

                                                </div>

                                        </td>

                                </tr>

                        </table>

                </form>

                <p>

                <form method="post" action="internal.cfm" name="newSession" id="newSession">

                        <input type="hidden" name="inc" value="Schedules">


                                <table border=1 class="editTable">
                                        <tr style="background-color:##DDDDDD">
                                                <th width="100">Session</th>
                                                <th width="100">Class</th>
                                                <th width="150">Location</th>
                                                <th width="150">Day(s)</th>
                                                <th>Start Time</th>
                                                <th>End Time</th>
                                                <th></th>
                                        </tr>
                                        <tr style="background-color:##EEEEEE">
                                                <td><span id="mySession"></span></td>
                                                <td><span id="myClass"></span></td>
                                                <td>
                                                        <span id="myLocation"></span>
                                                </td>
                                                <td>
                                                        <span id="myDay"></span>
                                                </td>
                                                <td>
                                                        <span id="myStart"></span>
                                                </td>
                                                <td>
                                                        <span id="myEnd"></span>
                                                </td>
                                                <td align="center">

                                                        <input type="hidden" name="step" id="stepX" value="<cfif
isdefined("form.editMe")>2<cfelse>3</cfif>">

                                                        <input type="submit" id="mySubmit" value="<cfif
isdefined("form.editMe")>Update<cfelse>Schedule</cfif> Class"
disabled>

                                                        <cfif isdefined("form.editMe")>
                                                                <input type="hidden" name="cts_id" value="#form.cts_id#">
                                                                <br /><br />
                                                                <input type="button" value="Copy to New" onclick="copy2new()">
                                                        </cfif>


                                                </td>
                                        </tr>
                                </table>

                        <input type="hidden" name="cs_id" id="cs_idx">
                        <input type="hidden" name="cc_id" id="cc_idx">
                        <input type="hidden" name="cl_id" id="cl_idx">
                        <input type="hidden" name="dayOfWeek" id="dayOfWeek">
                        <input type="hidden" name="cts_start" id="cts_start">
                        <input type="hidden" name="cts_end" id="cts_end">

                </form>

                <br /><br />

                <div class="sectionHead">Current Class Listing</div>

<cfif isdefined("url.subInc") is false>
        <cfset subInc = "calView">
<cfelse>
        <cfset subInc = url.subInc>
</cfif>

<cfif isdefined("form.subInc")>
        <cfset subInc = form.subInc>
</cfif>

<cfif subInc is "listView">

                <cfif isdefined("form.cs_id")>
                        <cfset theSession=form.cs_id>
                <cfelse>
                        <cfloop query="getSessions">
                                <cfif getSessions.cs_start lt now() and getSessions.cs_end gt now()>
                                        <cfset theSession=getSessions.cs_id>
                                </cfif>
                        </cfloop>
                </cfif>

                <form id="schedView" name="schedView" action="internal.cfm" method="post">

                        <div class="sectionHead"><A
HREF="internal.cfm?inc=Schedules&subInc=calView">Week View</a> - -
List View</div>

                        <input type="hidden" name="inc" value="Schedules">
                        <input type="hidden" name="subInc" value="#subInc#">

                        <cfloop query="getSessions">
                                <cfif status is 1 and (cu_id is session.cu_id or session.cu_id is
12) and cs_end ge now()>
                                        <input type="radio" name="cs_id" value="#listfirst(cs_id)#" <cfif
listfirst(cs_id) eq theSession>checked="checked"</cfif>
onclick="schedV()" />#cs_name#
                                </cfif>
                        </cfloop>

                        <br />

                        <cfif isdefined("form.cl_id")>
                                <cfset theLocation=form.cl_id>
                        <cfelse>
                                <cfset theLocation=getLocations.cl_id>
                        </cfif>

                        <cfloop query="getLocations">
                                <cfif status is 1>
                                        <input type="radio" name="cl_id" value="#listfirst(cl_id)#"
                                                <cfif cl_id eq theLocation>checked="checked"</cfif>
                                                onclick="schedV()" />#cl_name#
                                </cfif>
                        </cfloop>


                </form>



                <table  class="editTable">
                        <tr style="background-color:##DDDDDD">

                                <th width="200">Class</th>
                                <th width="200">Day</th>
                                <th width="200">Start</th>
                                <th width="200">End</th>
                                <th width="200"><!---&nbsp;---></th>

                        </tr>

                </table>

                <div style="overflow:auto;height:300px;width:817px">


                        <table class="editTable">

                                <cfset i=1>

                                <cfquery name="mySchedules" dbtype="query">
                                        select *
                                        from getSchedules, getClasses
                                        where
                                                cs_id = #theSession# and
                                                cl_id = #theLocation# and
                                                getSchedules.cc_id=getClasses.cc_id
                                        order by cc_name, dayofweek, cts_start
                                </cfquery>

                                <cfloop query="mySchedules">

                                        <cfset i++>

                                        <form name="update#i#" action="internal.cfm" method="post">

                                                <input type="hidden" name="inc" value="Schedules">
                                                <input type="hidden" name="subInc" value="listView">
                                                <input type="hidden" id="cts_id" name="cts_id" value="#cts_id#">
                                                <input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
                                                <input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">

                                                <tr class="myTR2"
                                                        <cfif currentRow mod 2>
                                                                style="background-color:##eeeeee;"
                                                        </cfif>
                                                >

                                                        <td width="200">
                                                                <cfquery name="classDtl" dbtype="query">
                                                                        select * from getClasses where cc_id = #cc_id#
                                                                </cfquery>
                                                                <input type="hidden" id="cc_id" name="cc_id" value="#cc_id#">
                                                                #classDtl.cc_name#
                                                        </td>
                                                        <td align="center" width="200">
                                                                #dayOfWeek#
                                                                <input type="hidden" id="dayOfWeek" name="dayOfWeek"
value="#dayOfWeek#">
                                                        </td>

                                                        <td align="center" width="200">
                                                                #timeformat(cts_start, "hh:mm tt")#
                                                                <input type="hidden" id="cts_start" name="cts_start"
value="#timeformat(cts_start, "hh:mm tt")#">
                                                        </td>

                                                        <td align="center" width="200">
                                                                #timeformat(cts_end, "hh:mm tt")#
                                                                <input type="hidden" id="cts_end" name="cts_end"
value="#timeformat(cts_end, "hh:mm tt")#">
                                                        </td>


                                                        <td align="right" width="200">
                                                                <input type="hidden" name="editMe" value="1">
                                                                <input type="submit" value="Edit">
                                                                <input type="button" value="Delete" onclick="deleteMe('#cts_id#')">
                                                        </td>

                                                </tr>

                                        </form>

                                </cfloop>

                        </table>
                </div>

<cfelseif subInc is "calView">


        <cfif isdefined("form.cs_id")>
                <cfset theSession=form.cs_id>
        <cfelse>
                <cfloop query="getSessions">
                        <cfif getSessions.cs_start lt now() and getSessions.cs_end gt now()>
                                <cfset theSession=getSessions.cs_id>
                        </cfif>
                </cfloop>
        </cfif>

        <form id="calView" name="calView" action="internal.cfm" method="post">

                <div class="sectionHead">Week View - - <A
HREF="internal.cfm?inc=Schedules&subInc=listView">List View</a></div>

                <input type="hidden" name="inc" value="Schedules">
                <input type="hidden" name="subInc" value="calView">

                <cfloop query="getSessions">
                        <cfif status is 1 and (cu_id is session.cu_id or session.cu_id is
12) and cs_end ge now()>
                                <input type="radio" name="cs_id" value="#listfirst(cs_id)#" <cfif
listfirst(cs_id) eq theSession>checked="checked"</cfif>
onclick="calV()" />#cs_name#
                        </cfif>
                </cfloop>

                <br />

                <cfif isdefined("form.cl_id")>
                        <cfset theLocation=form.cl_id>
                <cfelse>
                        <cfset theLocation=getLocations.cl_id>
                </cfif>

                <cfloop query="getLocations">
                        <cfif status is 1>
                                <input type="radio" name="cl_id" value="#listfirst(cl_id)#" <cfif
cl_id eq theLocation>checked="checked"</cfif> onclick="calV()"
/>#cl_name#
                        </cfif>
                </cfloop>
        </form>

        <div style="width:817px">

                <table border="1" class="editTable">

                        <tr style="background-color:##DDDDDD">

                                <th width="100">Sun</th>
                                <th width="100">Mon</th>
                                <th width="100">Tue</th>
                                <th width="100">Wed</th>
                                <th width="100">Thu</th>
                                <th width="100">Fri</th>
                                <th width="100">Sat</th>
                        </tr>


                        <cfset myClass.cc_id="">

                        <cfset cur_cc_id_1 ="">
                        <cfset cur_cc_id_2 ="">
                        <cfset cur_cc_id_3 ="">
                        <cfset cur_cc_id_4 ="">
                        <cfset cur_cc_id_5 ="">
                        <cfset cur_cc_id_6 ="">
                        <cfset cur_cc_id_7 ="">

                        <cfloop index="myH" from="6" to="22">

                                <cfloop index="myMin" from="0" to="45" step="15">

                                        <cfset myTime="#numberformat(myH,"00")#:#numberformat(myMin, "00")#:00">
                                        <cfset myT=timeformat(myTime, "hh:mm:TT")>
                                        <cfset myStart="1970-01-01 #myTime#">

                                        <tr class="myTR">

                                                <td id="su">

                                                <cfquery name="sunClass" dbtype="query">
                                                        select * from getSchedules
                                                        where
                                                                (cts_start <= '#myStart#' and
                                                                cts_End > '#myStart#') and
                                                                dayOfWeek like '%Sun%' and
                                                        <!---   cs_id = #theSession# and --->
                                                                cl_id = #theLocation#
                                                </cfquery>

                                                <cfif sunClass.recordcount gt 0 and cur_cc_id_1 neq sunClass.cts_id>

                                                        <cfquery name="myClass" dbtype="query">
                                                                select * from getClasses
                                                                Where cc_id = #sunClass.cc_id#
                                                        </cfquery>

                                                        <form name="update#myH##myMin##myClass.cc_name#"
action="internal.cfm" method="post">
                                                                <input type="hidden" name="inc" value="Schedules">
                                                                <input type="hidden" id="cts_id" name="cts_id"
value="#sunClass.cts_id#">
                                                                <input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
                                                                <input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
                                                                <input type="hidden" id="cc_id" name="cc_id" value="#sunClass.cc_id#">
                                                                <input type="hidden" id="dayOfWeek" name="dayOfWeek"
value="#sunClass.dayOfWeek#">
                                                                <input type="hidden" id="cts_start" name="cts_start"
value="#timeformat(sunClass.cts_start, "hh:mm tt")#">
                                                                <input type="hidden" id="cts_end" name="cts_end"
value="#timeformat(sunClass.cts_end, "hh:mm tt")#">
                                                                <input type="hidden" name="editMe" value="1">
                                                                <input type="submit" value="#left(myClass.cc_name, 12)# -
#timeformat(sunClass.cts_start, "h:mm")#" class="calView">
                                                        </form>

                                                <cfelse>

                                                        <!---&nbsp;--->

                                                </cfif>

                                                <cfset cur_cc_id_1 = sunClass.cts_id>

                                                </td>

                                                <td id="mo">

                                                        <cfquery name="monClass" dbtype="query">
                                                                select * from getSchedules
                                                                where
                                                                        (cts_start <= '#myStart#' and
                                                                        cts_End > '#myStart#') and
                                                                        dayOfWeek like '%Mon%' and
                                                                        cs_id = #theSession# and
                                                                        cl_id = #theLocation#
                                                        </cfquery>


                                                        <cfif monClass.recordcount gt 0 and cur_cc_id_2 neq
monClass.cts_id and monClass.cc_id neq "">

                                                                <cfquery name="myClass" dbtype="query">
                                                                        select * from getClasses
                                                                        Where cc_id = #monClass.cc_id#
                                                                </cfquery>

                                                                <form name="update#myH##myMin##myClass.cc_name#"
action="internal.cfm" method="post">
                                                                        <input type="hidden" name="inc" value="Schedules">
                                                                        <input type="hidden" id="cts_id" name="cts_id"
value="#monClass.cts_id#">
                                                                        <input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
                                                                        <input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
                                                                        <input type="hidden" id="cc_id" name="cc_id" value="#monClass.cc_id#">
                                                                        <input type="hidden" id="dayOfWeek" name="dayOfWeek"
value="#monClass.dayOfWeek#">
                                                                        <input type="hidden" id="cts_start" name="cts_start"
value="#timeformat(monClass.cts_start, "hh:mm tt")#">
                                                                        <input type="hidden" id="cts_end" name="cts_end"
value="#timeformat(monClass.cts_end, "hh:mm tt")#">
                                                                        <input type="hidden" name="editMe" value="1">
                                                                        <input type="submit" value="#left(myClass.cc_name, 12)# -
#timeformat(monClass.cts_start, "h:mm")#" class="calView">
                                                                </form>


                                                                <cfset cur_cc_id_2 = monClass.cts_id>

                                                        <cfelse>

                                                                <!---&nbsp;--->

                                                        </cfif>


                                                </td>

                                                <td id="tu">

                                                        <cfquery name="tueClass" dbtype="query">
                                                                select * from getSchedules
                                                                where
                                                                        (cts_start <= '#myStart#' and
                                                                        cts_End > '#myStart#') and
                                                                        dayOfWeek like '%Tue%' and
                                                                        cs_id = #theSession# and
                                                                        cl_id = #theLocation#
                                                        </cfquery>

                                                        <cfif tueClass.recordcount gt 0 and cur_cc_id_3 neq tueClass.cts_id>

                                                                <cfquery name="myClass" dbtype="query">
                                                                        select * from getClasses
                                                                        Where cc_id = #tueClass.cc_id#
                                                                </cfquery>


                                                                <form name="update#myH##myMin##myClass.cc_name#"
action="internal.cfm" method="post">
                                                                        <input type="hidden" name="inc" value="Schedules">
                                                                        <input type="hidden" id="cts_id" name="cts_id"
value="#tueClass.cts_id#">
                                                                        <input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
                                                                        <input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
                                                                        <input type="hidden" id="cc_id" name="cc_id" value="#tueClass.cc_id#">
                                                                        <input type="hidden" id="dayOfWeek" name="dayOfWeek"
value="#tueClass.dayOfWeek#">
                                                                        <input type="hidden" id="cts_start" name="cts_start"
value="#timeformat(tueClass.cts_start, "hh:mm tt")#">
                                                                        <input type="hidden" id="cts_end" name="cts_end"
value="#timeformat(tueClass.cts_end, "hh:mm tt")#">
                                                                        <input type="hidden" name="editMe" value="1">
                                                                        <input type="submit" value="#left(myClass.cc_name, 12)# -
#timeformat(tueClass.cts_start, "h:mm")#" class="calView">
                                                                </form>

                                                        <cfelse>

                                                                <!---&nbsp;--->

                                                        </cfif>

                                                        <cfset cur_cc_id_3 = tueClass.cts_id>


                                                </td>

                                                <td id="we">

                                                        <cfquery name="wedClass" dbtype="query">
                                                                select * from getSchedules
                                                                where
                                                                        (cts_start <= '#myStart#' and
                                                                        cts_End > '#myStart#') and

                                                                        dayOfWeek like '%Wed%' and
                                                                        cs_id = #theSession# and
                                                                        cl_id = #theLocation#
                                                        </cfquery>

                                                        <cfif wedClass.recordcount gt 0 and cur_cc_id_4 neq wedClass.cts_id>

                                                                <cfquery name="myClass" dbtype="query">
                                                                        select * from getClasses
                                                                        Where cc_id = #wedClass.cc_id#
                                                                </cfquery>


                                                                <form name="update#myH##myMin##myClass.cc_name#"
action="internal.cfm" method="post">
                                                                        <input type="hidden" name="inc" value="Schedules">
                                                                        <input type="hidden" id="cts_id" name="cts_id"
value="#wedClass.cts_id#">
                                                                        <input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
                                                                        <input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
                                                                        <input type="hidden" id="cc_id" name="cc_id" value="#wedClass.cc_id#">
                                                                        <input type="hidden" id="dayOfWeek" name="dayOfWeek"
value="#wedClass.dayOfWeek#">
                                                                        <input type="hidden" id="cts_start" name="cts_start"
value="#timeformat(wedClass.cts_start, "hh:mm tt")#">
                                                                        <input type="hidden" id="cts_end" name="cts_end"
value="#timeformat(wedClass.cts_end, "hh:mm tt")#">
                                                                        <input type="hidden" name="editMe" value="1">
                                                                        <input type="submit" value="#left(myClass.cc_name, 12)# -
#timeformat(wedClass.cts_start, "h:mm")#" class="calView">
                                                                </form>

                                                        <cfelse>

                                                                <!---&nbsp;--->

                                                        </cfif>

                                                        <cfset cur_cc_id_4 = wedClass.cts_id>

                                                </td>

                                                <td id="th">

                                                        <cfquery name="thuClass" dbtype="query">
                                                                select * from getSchedules
                                                                where
                                                                        (cts_start <= '#myStart#' and
                                                                        cts_End > '#myStart#') and

                                                                        dayOfWeek like '%Thu%' and
                                                                        cs_id = #theSession# and
                                                                        cl_id = #theLocation#
                                                        </cfquery>

                                                        <cfif thuClass.recordcount gt 0 and cur_cc_id_5 neq thuClass.cts_id>

                                                                <cfquery name="myClass" dbtype="query">
                                                                        select * from getClasses
                                                                        Where cc_id = #thuClass.cc_id#
                                                                </cfquery>

                                                                <form name="update#myH##myMin##myClass.cc_name#"
action="internal.cfm" method="post">
                                                                        <input type="hidden" name="inc" value="Schedules">
                                                                        <input type="hidden" id="cts_id" name="cts_id"
value="#thuClass.cts_id#">
                                                                        <input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
                                                                        <input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
                                                                        <input type="hidden" id="cc_id" name="cc_id" value="#thuClass.cc_id#">
                                                                        <input type="hidden" id="dayOfWeek" name="dayOfWeek"
value="#thuClass.dayOfWeek#">
                                                                        <input type="hidden" id="cts_start" name="cts_start"
value="#timeformat(thuClass.cts_start, "hh:mm tt")#">
                                                                        <input type="hidden" id="cts_end" name="cts_end"
value="#timeformat(thuClass.cts_end, "hh:mm tt")#">
                                                                        <input type="hidden" name="editMe" value="1">
                                                                        <input type="submit" value="#left(myClass.cc_name, 12)# -
#timeformat(thuClass.cts_start, "h:mm")#" class="calView">
                                                                </form>

                                                        <cfelse>

                                                                <!---&nbsp;--->

                                                        </cfif>

                                                        <cfset cur_cc_id_5 = thuClass.cts_id>

                                                </td>

                                                <td id="fr">

                                                        <cfquery name="friClass" dbtype="query">
                                                                select * from getSchedules
                                                                where
                                                                        (cts_start <= '#myStart#' and
                                                                        cts_End > '#myStart#') and

                                                                        dayOfWeek like '%Fri%' and
                                                                        cs_id = #theSession# and
                                                                        cl_id = #theLocation#
                                                        </cfquery>


                                                        <cfif friClass.recordcount gt 0 and cur_cc_id_6 neq friClass.cts_id>

                                                                <cfquery name="myClass" dbtype="query">
                                                                        select * from getClasses
                                                                        Where cc_id = #friClass.cc_id#
                                                                </cfquery>

                                                                <form name="update#myH##myMin##myClass.cc_name#"
action="internal.cfm" method="post">
                                                                        <input type="hidden" name="inc" value="Schedules">
                                                                        <input type="hidden" id="cts_id" name="cts_id"
value="#friClass.cts_id#">
                                                                        <input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
                                                                        <input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
                                                                        <input type="hidden" id="cc_id" name="cc_id" value="#friClass.cc_id#">
                                                                        <input type="hidden" id="dayOfWeek" name="dayOfWeek"
value="#friClass.dayOfWeek#">
                                                                        <input type="hidden" id="cts_start" name="cts_start"
value="#timeformat(friClass.cts_start, "hh:mm tt")#">
                                                                        <input type="hidden" id="cts_end" name="cts_end"
value="#timeformat(friClass.cts_end, "hh:mm tt")#">
                                                                        <input type="hidden" name="editMe" value="1">
                                                                        <input type="submit" value="#left(myClass.cc_name, 12)# -
#timeformat(friClass.cts_start, "h:mm")#" class="calView">
                                                                </form>

                                                        <cfelse>

                                                                <!---&nbsp;--->

                                                        </cfif>

                                                        <cfset cur_cc_id_6 = friClass.cts_id>

                                                </td>

                                                <td id="sa">

                                                        <cfquery name="satClass" dbtype="query">
                                                                select * from getSchedules
                                                                where
                                                                        (cts_start <= '#myStart#' and
                                                                        cts_End > '#myStart#') and

                                                                        dayOfWeek like '%Sat%' and
                                                                        cs_id = #theSession# and
                                                                        cl_id = #theLocation#
                                                        </cfquery>

                                                        <cfif satClass.recordcount gt 0 and cur_cc_id_7 neq satClass.cts_id>

                                                                <cfquery name="myClass" dbtype="query">
                                                                        select * from getClasses
                                                                        Where cc_id = #satClass.cc_id#
                                                                </cfquery>

                                                                <form name="update#myH##myMin##myClass.cc_name#"
action="internal.cfm" method="post">
                                                                        <input type="hidden" name="inc" value="Schedules">
                                                                        <input type="hidden" id="cts_id" name="cts_id"
value="#satClass.cts_id#">
                                                                        <input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
                                                                        <input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
                                                                        <input type="hidden" id="cc_id" name="cc_id" value="#satClass.cc_id#">
                                                                        <input type="hidden" id="dayOfWeek" name="dayOfWeek"
value="#satClass.dayOfWeek#">
                                                                        <input type="hidden" id="cts_start" name="cts_start"
value="#timeformat(satClass.cts_start, "hh:mm tt")#">
                                                                        <input type="hidden" id="cts_end" name="cts_end"
value="#timeformat(satClass.cts_end, "hh:mm tt")#">
                                                                        <input type="hidden" name="editMe" value="1">
                                                                        <input type="submit" value="#left(myClass.cc_name, 12)# -
#timeformat(satClass.cts_start, "h:mm")#" class="calView">
                                                                </form>

                                                        <cfelse>

                                                                <!---&nbsp;--->

                                                        </cfif>

                                                        <cfset cur_cc_id_7 = satClass.cts_id>

                                                </td>

                                        </tr>

                                </cfloop>

                        </cfloop>

                </table>

        </div>


</cfif>
                <br /><br />

        <cfelseif step is 3>

                 <cfset myStart = CreateODBCTime("#form.cts_start#")>
                 <cfset myEnd = CreateODBCTime("#form.cts_end#")>

                <cfinvoke component="checkin" method="cts_Add">
                        <cfinvokeargument name="cs_id" value="#form.cs_id#">
                        <cfinvokeargument name="cc_id" value="#form.cc_id#">
                        <cfinvokeargument name="cl_id" value="#form.cl_id#">
                        <cfinvokeargument name="dayOfWeek" value="#form.dayOfWeek#">
                        <cfinvokeargument name="cts_start" value="#myStart#">
                        <cfinvokeargument name="cts_end" value="#myEnd#">
                </cfinvoke>

                <cflocation url = "internal.cfm?inc=Schedules">

        </cfif>

        <cfif step is 2>
#step#
                 <cfset myStart = CreateODBCTime("#form.cts_start#")>
                 <cfset myEnd = CreateODBCTime("#form.cts_end#")>


                <cfinvoke component="checkin" method="cts_Edit">
                        <cfinvokeargument name="cts_id" value="#form.cts_id#">
                        <cfinvokeargument name="cs_id" value="#form.cs_id#">
                        <cfinvokeargument name="cc_id" value="#form.cc_id#">
                        <cfinvokeargument name="cl_id" value="#form.cl_id#">
                        <cfinvokeargument name="dayOfWeek" value="#form.dayOfWeek#">
                        <cfinvokeargument name="cts_start" value="#myStart#">
                        <cfinvokeargument name="cts_end" value="#myEnd#">
                </cfinvoke>


                <cflocation url = "internal.cfm?inc=Schedules">


        </cfif>

        <cfif step is 4>

                <cfinvoke component="checkin" method="deleteSchedules">
                        <cfinvokeargument name="cts_id" value="#form.cts_id#">
                </cfinvoke>

                <cflocation url = "internal.cfm?inc=Schedules">


        </cfif>

</cfif>

</cfoutput>



Is This A Good Question/Topic? 0
  • +

Replies To: Variable THESESSION is undefined.

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1866
  • View blog
  • Posts: 3,389
  • Joined: 13-January 08

Re: Variable THESESSION is undefined.

Posted 25 September 2012 - 12:14 PM

Welcome to D.I.C. sacpadre!

The issue you're seeing is that your code is referencing a variable that doesn't apparently exist. You mention that nobody there has any CF experience so this may prove to be a situation you'll want to hire a CF dev to resolve.

The short explanation is though that, using the line numbers from the code sample you pasted into your message (which will differ from the line numbers showing in your server error message), there is a query of queries starting at line 1719 that references a variable called THESESSION. Since CF pages execute in a sequential manner following the logic on the page, the place where that variable is set (or should be set) looks to be around line 1680 (last place it's set before the query command executes). The error message says it's not there though.

The trouble is kind of twofold here:

1./ The page is rather long
2./ It's formatted quite poorly (not to mention being coded kinda sloppy)

This makes it tough to follow the logic on the page without reformatting (indenting and culling out unnecessary spaces and such) and doing so to get to the bottom of your issue would take a fair chunk of time. Even if that could be done, you've already mentioned that your team lacks the CF expertise to likely build a fix for it.

Although the issue is likely a simple one from a CF standpoint, it's exceedingly difficult to troubleshoot in a forum like this. Your best bet would be to see if you couldn't seek out a local CF dev resource and get them to have a look for you. It shouldn't take them more than 15-30 minutes (assuming they have the necessary access to the code and the server holding it) to fix it.
Was This Post Helpful? 0
  • +
  • -

#3 sacpadre  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-September 12

Re: Variable THESESSION is undefined.

Posted 25 September 2012 - 12:23 PM

Craig 328,

Thanks for the reply. You've come to the same conclusion that I have and our management finally approved funding for a contractor to look at this and a few other issues. They've just been dragging their feet on the recruiting process and I'm trying to help out the end users who are in a bind. I figured this might be a bit too large of a problem for a forum, but I appreciate you taking a look at it.

Thanks again.
Was This Post Helpful? 0
  • +
  • -

#4 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1866
  • View blog
  • Posts: 3,389
  • Joined: 13-January 08

Re: Variable THESESSION is undefined.

Posted 25 September 2012 - 12:41 PM

Tell you what...give me a few minutes to mess with it and I'll see if there's anything obvious that can be done to hold you over until you get a dev on it.

I'll post back here if/when I have something.
Was This Post Helpful? 0
  • +
  • -

#5 sacpadre  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-September 12

Re: Variable THESESSION is undefined.

Posted 25 September 2012 - 12:58 PM

Thanks Craig328. I appreciate it.
Was This Post Helpful? 0
  • +
  • -

#6 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1866
  • View blog
  • Posts: 3,389
  • Joined: 13-January 08

Re: Variable THESESSION is undefined.

Posted 25 September 2012 - 02:26 PM

Egad...what a mess that was. But, here is a somewhat cleaned up version of your code:
<cfoutput>

<cfif myInc is "Classes">
	<cfif step is 1>
		<form method="post" action="internal.cfm">
		<input type="hidden" name="inc" value="Classes">
		<input type="hidden" name="step" value="3">
		<div class="sectionHead">Add</div>
		<table class="editTable">
			<tr style="background-color:##DDDDDD">
				<th>Name</th>
				<th>Type</th>
				<th>Default max</th>
				<cfif session.cu_id is 3 or session.cu_id is 12>
				<th>Group Ex?</th>
				</cfif>
				<cfif session.cu_id is 12>
				<th>Unit</th>
				</cfif>
				<th><!---&nbsp;---></th>
			</tr>
			<tr>
				<td><input type="text" name="cc_name" id="cc_name" size="45" onkeyup="vCheck()"></td>
				<td align="center"><select  name="ct_id"><cfloop query="getClassType"><option value="#ct_id#">#ct_name#</option></cfloop></select><a href="internal.cfm?inc=Class Types">add/edit</a></td>
				<td align="center"><input type="text" name="cc_ma" id="cc_ma" size="1" onkeyup="vCheck()"></td>
				<cfif session.cu_id is 3 or session.cu_id is 12>
				<td align="center"><input type="checkbox" name="gx" value="1" checked></td>
				</cfif>
				<cfif session.cu_id is 12>
				<td align="center"><select name="cu_id"><cfloop query="getUnit"><option value="#cu_id#">#cu_name#</option></cfloop></select></td>
				<cfelse>
				<input type="hidden" name="cu_id" value="#session.cu_id#">
				</cfif>
				<td align="right"><input type="submit" value="New Class" id="newClass" disabled></td>
			</tr>
		</table>
		</form>
		<div class="sectionHead">Edit</div>
		<cfif getClass.recordcount gt 0>
		<table class="editTable">
			<tr style="background-color:##DDDDDD">
				<th>Name</th>
				<th>Type</th>
				<th>Default Max</th>
				<cfif session.cu_id is 3 or session.cu_id is 12>
				<th>Group Ex?</th>
				</cfif>
				<th>Status</th>
				<cfif session.cu_id is 12>
				<th>Unit</th>
				<th>Created</th>
				<th>Updated</th>
				</cfif>
				<th><!---&nbsp;---></th>
			</tr>
			<cfset i=1>
			<cfloop query="getClass">
				<cfset i++>
				<form name="update#i#" action="internal.cfm" method="post">
				<tr class="myTR2" <cfif currentRow mod 2>style="background-color:##eeeeee;"</cfif>>
				<td>
					<input type="hidden" name="inc" value="Classes">
					<input type="hidden" id="cc_id" name="cc_id" value="#cc_id#">
					<input type="text" id="cc_name" name="cc_name" value="#cc_name#">
				</td>
				<td align="center">
					<cfset myTypeId = ct_id>
					<select  name="ct_id"><cfloop query="getClassType"><option value="#ct_id#" <cfif myTypeId is ct_id>selected</cfif> >#ct_name#</option></cfloop></select>
				</td>
				<td align="center"><input type="text" id="cc_max" name="cc_max" value="#cc_max#" size="2"></td>
				<cfif session.cu_id is 3 or session.cu_id is 12>
				<td align="center"><input type="checkbox" id="gx" name="gx" value="1" <cfif gx gt 0 >checked</cfif>></td>
				</cfif>
				<td align="center"><select name="status" id="status"><option value="1" <cfif #status# is 1>selected</cfif>>Active</option><option value="0" <cfif #status# is 0>selected</cfif>>Inactive</option></select></td>
				<cfif session.cu_id is 12>
				<td align="center">
					<select name="cu_id"><cfloop query="getUnit"><option value="#cu_id#" <cfif getUnit.cu_id is getClass.cu_id>selected</cfif>>#cu_name#</option></cfloop></select>
				</td>
				<td align="center">#created#</td>
				<td align="center">#updated#</td>
				<cfelse>
				<input type="hidden" name="cu_id" value="#session.cu_id#">
				</cfif>
				<td align="right">
					<input type="hidden" name="step" value="2">
					<input type="submit" value="Save">
				</td>
				</tr>
				</form>
			</cfloop>
		</table>
		<cfelse>
			No Classes Found
		</cfif>
	</cfif>

	<cfif step is 2>
		<cfquery name="nameCheck" dbtype="query">
			select *
			from getClass
			where upper(cc_name) = '#ucase(form.cc_name)#'
				and cc_id <> #form.cc_id#
		</cfquery>

		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.cc_name# class already in system">
		<cfelse>
			<cfif not isdefined("form.gx")>
				<cfset form.gx=0>
			</cfif>
			<cfset form.cc_name = replace(form.cc_name, "'", "", "ALL")>

			<cfinvoke component="checkin" method="editClass">
				<cfinvokeargument name="cc_name" value="#form.cc_name#">
				<cfinvokeargument name="ct_id" value="#form.ct_id#">
				<cfif session.cu_id is 3 or session.cu_id is 12>
					<cfinvokeargument name="gx" value="#form.gx#">
				</cfif>
				<cfinvokeargument name="cc_max" value="#form.cc_max#">
				<cfinvokeargument name="cc_id" value="#form.cc_id#">
				<cfinvokeargument name="status" value="#form.status#">
				<cfinvokeargument name="cu_id" value="#form.cu_id#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=Classes">
	</cfif>

	<cfif step is 3>
		<cfquery name="nameCheck" dbtype="query">
			select * 
			from getClass 
			where upper(cc_name) = '#ucase(form.cc_name)#'
		</cfquery>

		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.cc_name# class already in system">
			<cflocation url = "internal.cfm?inc=Classes">
		<cfelse>
			<cfif not isdefined("form.gx")>
				<cfset form.gx=0>
			</cfif>

			<cfset form.cc_name = replace(form.cc_name, "'", "", "ALL")>

			<cfinvoke component="checkin" method="addClass">
				<cfinvokeargument name="cc_name" value="#form.cc_name#">
				<cfinvokeargument name="cc_ma" value="#form.cc_ma#">
				<cfinvokeargument name="ct_id" value="#form.ct_id#">
				<cfif session.cu_id is 3 or session.cu_id is 12>
				<cfinvokeargument name="gx" value="#form.gx#">
				</cfif>
				<cfinvokeargument name="cu_id" value="#form.cu_id#">
			</cfinvoke>
		</cfif>
		
		<cflocation url = "internal.cfm?inc=Classes">
	</cfif>
	
<cfelseif myInc is"Class Types">
	<cfif step is 1>
		<form method="post" action="internal.cfm">
		<input type="hidden" name="inc" value="Class Types">
		<div class="sectionHead">Add</div>
		<table class="editTable">
			<tr style="background-color:##DDDDDD">
				<th>Name</th>
				<cfif session.cu_id is 12>
				<th>Unit</th>
				</cfif>
				<th><!---&nbsp;---></th>
			</tr>
			<tr>
				<td width="300"><input type="text" size="50" name="ct_name" id="ct_name" onkeyup="vCheckb(this.id)"></td>
				<cfif session.cu_id is 12>
				<td align="center" width="100"><select name="cu_id"><cfloop query="getUnit"><option value="#cu_id#">#cu_name#</option></cfloop></select></td>
				<cfelse>
				<input type="hidden" name="cu_id" value="#session.cu_id#">
				</cfif>
				<td align="right"><input type="submit" value="New Class Type" id="mySubmit" disabled></td>
			</tr>
		</table>
		<input type="hidden" name="step" value="3">
		</form>
		<div class="sectionHead">Edit</div>
		<cfif getClassType.recordcount gt 0>
			<table class="editTable">
				<tr style="background-color:##DDDDDD">
					<th>Name</th>
					<th>Status</th>
					<cfif session.cu_id is 12>
					<th>Unit</th>
					<th>Created</th>
					<th>Updated</th>
					</cfif>
					<th><!---&nbsp;---></th>
				</tr>
				<cfset i=1>
				<cfloop query="getClassType">
				<cfset i++>
				<form name="update#i#" action="internal.cfm" method="post">
				<tr class="myTR2" <cfif currentRow mod 2>style="background-color:##eeeeee;"</cfif>>
					<td>
						<input type="hidden" id="ct_id" name="ct_id" value="#ct_id#">
						<input type="hidden" name="inc" value="Class Types">
						<input type="text" id="ct_name" name="ct_name" value="#ct_name#">
					</td>
					<td align="center"><select name="status" id="status"><option value="1" <cfif #status# is 1>selected</cfif>>Active</option><option value="0" <cfif #status# is 0>selected</cfif>>Inactive</option></select></td>
					<cfif session.cu_id is 12>
					<td align="center">
						<select name="cu_id">
						<cfloop query="getUnit">
							<option value="#cu_id#" <cfif getUnit.cu_id is getClassType.cu_id>selected</cfif>>#cu_name#</option>
						</cfloop>
						</select>
					</td>
					<td align="center">#created#</td>
					<td align="center">#updated#</td>
					<cfelse>
						<input type="hidden" name="cu_id" value="#session.cu_id#">
					</cfif>
					<td align="right">
						<input type="hidden" name="step" value="2">
						<input type="submit" value="Save">
					</td>
				</tr>
				</form>
				</cfloop>
			</table>
		<cfelse>
			No Class Types Found
		</cfif>
	</cfif>

	<cfif step is 2>
		<cfquery name="nameCheck" dbtype="query">
			select * 
			from getClassType 
			where upper(ct_name) = '#ucase(form.ct_name)#'
				and ct_id <> #form.ct_id#
		</cfquery>
		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.ct_name# class type already in system">
		<cfelse>
			<cfset form.cc_name = replace(form.ct_name, "'", "", "ALL")>

			<cfinvoke component="checkin" method="cTypesEdit">
				<cfinvokeargument name="ct_name" value="#form.ct_name#">
				<cfinvokeargument name="status" value="#form.status#">
				<cfinvokeargument name="ct_id" value="#form.ct_id#">
				<cfinvokeargument name="cu_id" value="#form.cu_id#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=Class Types">
	</cfif>

	<cfif step is 3>
		<cfquery name="nameCheck" dbtype="query">
			select * 
			from getClassType 
			where upper(ct_name) = '#ucase(form.ct_name)#'
		</cfquery>
		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.ct_name# class type already in system">
		<cfelse>
			<cfset form.cc_name = replace(form.ct_name, "'", "", "ALL")>
			<cfinvoke component="checkin" method="cTypesAdd">
				<cfinvokeargument name="ct_name" value="#form.ct_name#">
				<cfinvokeargument name="cu_id" value="#form.cu_id#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=Class Types">
	</cfif>
	
<cfelseif myInc is "Locations">
	<cfif step is 1>
		<form method="post" action="internal.cfm">
		<input type="hidden" name="step" value="3">
		<input type="hidden" name="inc" value="Locations">
		<div class="sectionHead">Add</div>
		<table class="editTable">
			<tr style="background-color:##DDDDDD">
				<th>Name</th>
				<cfif session.cu_id is 12>
				<th>Unit</th>
				</cfif>
				<th><!---&nbsp;---></th>
			</tr>
			<tr>
				<td width="300"><input type="text" name="cl_name" id="clname" size="50" onkeyup="vCheckb(this.id)"></td>
				<cfif session.cu_id is 12>
				<td align="center" width="100">
					<select name="cu_id"><cfloop query="getUnit"><option value="#cu_id#">#cu_name#</option></cfloop></select>
				</td>
				<cfelse>
					<input type="hidden" name="cu_id" value="#session.cu_id#">
				</cfif>
				<td align="right">
					<input type="submit" value="New Location" id="mySubmit" disabled>
				</td>
			</tr>
		</table>
		</form>
		<div class="sectionHead">Edit</div>
		<cfif getLocation.recordcount gt 0>
		<table class="editTable">
			<tr style="background-color:##DDDDDD">
				<th>Name</th>
				<th>Status</th>
				<cfif session.cu_id is 12>
				<th>Unit</th>
				<th>Created</th>
				<th>Updated</th>
				</cfif>
				<th><!---&nbsp;---></th>
			</tr>
			<cfset i=1>
			<cfloop query="getLocation">
				<cfset i++>
				<form name="update#i#" action="internal.cfm" method="post">
				<tr class="myTR2" <cfif currentRow mod 2>style="background-color:##eeeeee;"</cfif>>
					<td>
						<input type="hidden" name="inc" value="Locations">
						<input type="hidden" id="cl_id" name="cl_id" value="#cl_id#">
						<input type="text" id="cl_name" name="cl_name" value="#cl_name#">
					</td>
					<td align="center">
						<select name="status" id="status">
							<option value="1" <cfif #status# is 1>selected</cfif>>Active</option>
							<option value="0" <cfif #status# is 0>selected</cfif>>Inactive</option>
						</select>
					</td>
					<cfif session.cu_id is 12>
					<td align="center">
						<select name="cu_id"><cfloop query="getUnit"><option value="#cu_id#" <cfif getUnit.cu_id is getLocation.cu_id>selected</cfif>>#cu_name#</option></cfloop></select>
					</td>
					<td align="center">#created#</td>
					<td align="center">#updated#</td>
					<cfelse>
						<input type="hidden" name="cu_id" value="#session.cu_id#">
					</cfif>
					<td align="right">
						<input type="hidden" name="step" value="2">
						<input type="submit" value="save">
					</td>
				</tr>
				</form>
			</cfloop>
		</table>
		<cfelse>
			No Locations Found
		</cfif>
	</cfif>

	<cfif step is 2>
		<cfquery name="nameCheck" dbtype="query">
			select * 
			from getLocation 
			where upper(cl_name) = '#ucase(form.cl_name)#'
				and cl_id <> #form.cl_id#
		</cfquery>
		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.cl_name# location already in system">
		<cfelse>
			<cfset form.cc_name = replace(form.cl_name, "'", "", "ALL")>

			<cfinvoke component="checkin" method="locationEdit">
				<cfinvokeargument name="cl_name" value="#form.cl_name#">
				<cfinvokeargument name="status" value="#form.status#">
				<cfinvokeargument name="cl_id" value="#form.cl_id#">
				<cfinvokeargument name="cu_id" value="#form.cu_id#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=Locations">
	</cfif>

	<cfif step is 3>
		<cfquery name="nameCheck" dbtype="query">
			select * 
			from getLocation 
			where upper(cl_name) = '#ucase(form.cl_name)#'
		</cfquery>
		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.cl_name# location already in system">
		<cfelse>
			<cfset form.cc_name = replace(form.cl_name, "'", "", "ALL")>
			<cfinvoke component="checkin" method="locationAdd">
				<cfinvokeargument name="cl_name" value="#form.cl_name#">
				<cfinvokeargument name="cu_id" value="#form.cu_id#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=Locations">
	</cfif>

<cfelseif myInc is "User Security">
	<cfif step is 1>
		<form method="post" action="internal.cfm">
		<input type="hidden" name="inc" value="User Security">

		<!--- <div class="sectionHead">Add - NOTE: Please do not use special characters, single or double quotes in the fields below.</div> --->
		<table class="editTable">
			<tr style="background-color:##DDDDDD">
				<th>First</th>
				<th>Last</th>
				<th>Username</th>
				<th>Passphrase</th>
				<th>Sec Level</th>
				<cfif session.cu_id is 12>
				<th>Unit</th>
				</cfif>
				<th><!---&nbsp;---></th>
			</tr>
			<tr>
				<td align="center"><input type="text" id="sec_first" name="sec_first"></td>
				<td align="center"><input type="text" id="sec_last" name="sec_last"></td>
				<td align="center"><input type="text" id="sec_memberid" name="sec_memberid"></td>
				<td align="center"><input type="password" id="sec_passphrase" name="sec_passphrase"></td>
				<td align="center">
					<select name="sec_level" id="sec_level">
						<option value="1"<cfif session.validated lt 1>disabled</cfif>>Student</option>
						<option value="2"<cfif session.validated lt 2>disabled</cfif>>Supervisor</option>
						<option value="3"<cfif session.validated lt 3>disabled</cfif>>Manager</option>
						<option value="4"<cfif session.validated lt 4>disabled</cfif>>Admin</option>
					</select>
				</td>
				<cfif session.cu_id is 12>
				<td align="center"><select name="cu_id"><cfloop query="getUnit"><option value="#cu_id#">#cu_name#</option></cfloop></select></td>
				<cfelse>
					<input type="hidden" name="cu_id" value="#session.cu_id#">
				</cfif>
				<td align="center"><input type="submit" value="Add"></td>
			</tr>
		</table>
		<input type="hidden" name="step" value="3">
		</form>
		<div class="sectionHead">Edit</div>
		<cfif getSec.recordcount gt 0>
			<table class="editTable">
				<tr style="background-color:##DDDDDD">
					<th>First</th>
					<th>Last</th>
					<th>Username</th>
					<th>Passphrase</th>
					<th>Sec Level</th>
					<th>Status</th>
					
					<cfif session.cu_id is 12>
					<th>Unit</th>
					<th>Created</th>
					<th>Updated</th>
					</cfif>
					<th><!---&nbsp;---></th>
				</tr>
				<cfset i=1>
				<cfloop query="getSec">
				<cfset i++>
				<form name="update#i#" action="internal.cfm" method="post">
				<tr class="myTR2" <cfif currentRow mod 2>style="background-color:##eeeeee;"</cfif>>
					<td>
						<input type="hidden" name="inc" value="User Security">
						<input type="hidden" id="sec_id" name="sec_id" value="#sec_id#">
						<input type="text" id="sec_first" name="sec_first" value="#sec_first#" size="10">
					</td>
					<td>
						<input type="text" id="sec_last" name="sec_last" value="#sec_last#" size="12">
					</td>
					<td>
						<input type="text" id="sec_memberid" name="sec_memberid" value="#sec_memberid#" size="10">
					</td>
					<td>
						<input type="password" id="sec_passphrase" name="sec_passphrase" value="#sec_passphrase#" size="10">
					</td>
					<td align="center">
						<select name="sec_level" id="sec_level">
							<option value="1" <cfif sec_level is "1">selected</cfif> <cfif session.validated lt 1>disabled</cfif>>Student</option>
							<option value="2" <cfif sec_level is "2">selected</cfif> <cfif session.validated lt 2>disabled</cfif>>Supervisor</option>
							<option value="3" <cfif sec_level is "3">selected</cfif> <cfif session.validated lt 3>disabled</cfif>>Manager</option>
							<option value="4" <cfif sec_level is "4">selected</cfif> <cfif session.validated lt 4>disabled</cfif>>Admin</option>
						</select>
					</td>
					<td align="center">
						<select name="status" id="status">
							<option value="0" <cfif status is 0>selected</cfif>>Inactive</option>
							<option value="1" <cfif status is 1>selected</cfif>>Active</option>
						</select>
					</td>
					<cfif session.cu_id is 12>
					<td>
						<select name="cu_id">
						<cfloop query="getUnit">
							<option value="#cu_id#" <cfif getUnit.cu_id is getSec.cu_id>selected</cfif>>#cu_name#</option>
						</cfloop>
						</select>
					</td>
					<td align="center">#created#</td>
					<td align="center">#updated#</td>
					<cfelse>
						<input type="hidden" name="cu_id" value="#session.cu_id#">
					</cfif>
					<td>
						<input type="hidden" name="step" value="2">
						<input type="submit" value="save" <cfif session.validated lt sec_level>disabled</cfif>>
					</td>
				</tr>
				</form>
				</cfloop>
			</table>
		<cfelse>
			No Users Found
		</cfif>
	</cfif>

	<cfif step is 2>
		<cfquery name="nameCheck" dbtype="query">
			select * 
			from getSec 
			where upper(sec_memberid) = '#ucase(form.sec_memberid)#'
				and sec_id <> #form.sec_id#
		</cfquery>
		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.sec_memberid# already in system">
		<cfelse>
			<cfinvoke component="checkin" method="secUpdate">
				<cfinvokeargument name="sec_id" value="#form.sec_id#">
				<cfinvokeargument name="sec_level" value="#form.sec_level#">
				<cfinvokeargument name="sec_memberid" value="#form.sec_memberid#">
				<cfinvokeargument name="sec_passphrase" value="#form.sec_passphrase#">
				<cfinvokeargument name="sec_first" value="#form.sec_first#">
				<cfinvokeargument name="sec_last" value="#form.sec_last#">
				<cfinvokeargument name="status" value="#form.status#">
				<cfinvokeargument name="cu_id" value="#form.cu_id#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=User Security">
	</cfif>

	<cfif step is 3>
		<cfquery name="nameCheck" dbtype="query">
			select * 
			from getSec 
			where upper(sec_memberid) = '#ucase(form.sec_memberid)#'
		</cfquery>
		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.sec_memberid# already in system">
		<cfelse>
			<cfinvoke component="checkin" method="secAdd">
				<cfinvokeargument name="sec_level" value="#form.sec_level#">
				<cfinvokeargument name="sec_memberid" value="#form.sec_memberid#">
				<cfinvokeargument name="sec_passphrase" value="#form.sec_passphrase#">
				<cfinvokeargument name="sec_first" value="#form.sec_first#">
				<cfinvokeargument name="sec_last" value="#form.sec_last#">
				<cfinvokeargument name="cu_id" value="#form.cu_id#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=User Security">
	</cfif>
	
<cfelseif myInc is "Sessions">
	<cfif step is 1>
		<form method="post" action="internal.cfm" name="newSession">
		<input type="hidden" name="step" value="3">
		<input type="hidden" name="inc" value="Sessions">
		<div class="sectionHead">Add</div>
			<table class="editTable">
				<tr style="background-color:##DDDDDD">
					<th>Name</th>
					<th>Start</th>
					<th>End</th>
					<th><!---&nbsp;---></th>
				</tr>
				<tr>
					<td align="center">
						<select name="cs_name" id="cs_name" onchange="spCheck(this, 'sp0', 'cs0')">
							<option value="Fall">Fall</option>
							<option value="Winter">Winter</option>
							<option value="Spring">Spring</option>
							<option value="SS I">SS I</option>
							<option value="SS II">SS II</option>
							<option value="Special">Special</option>
						</select>
						<span id="sp0" style="display:none">
							<input type="text" name="cs_name" id="cs0">
						</span>
					</td>
					<td align="center">
						<input type="text" name="cs_start" id="cs_start" size="8">
						<script language="Javascript">
						new tcal ({
						        // form name
						        'formname': 'newSession',
						        // input name
						        'controlname': 'cs_start'
						});
						</script>
					</td>
					<td align="center">
						<input type="text" name="cs_end" size="8">
						<script language="Javascript">
						new tcal ({
						        // form name
						        'formname': 'newSession',
						        // input name
						        'controlname': 'cs_end'
						});
						</script>
					</td>
					<td align="right"><input type="submit" value="New Session"></td>
				</tr>
			</table>
		</form>
		<div class="sectionHead">Edit</div>
		<cfif getSession.recordcount gt 0>
			<table class="editTable">
				<tr style="background-color:##DDDDDD">
					<th>Name</th>
					<th>Start</th>
					<th>End</th>
					<th>Status</th>
					<th>Created</th>
					<th>Updated</th>
					<th><!---&nbsp;---></th>
				</tr>
				<cfset i=1>
				<cfloop query="getSession">
				<cfset i++>
				<form name="update#i#" action="internal.cfm" method="post">
				<tr class="myTR2" <cfif currentRow mod 2>style="background-color:##eeeeee;"</cfif>>
					<td align="center">
						<input type="hidden" id="cc_id" name="cs_id" value="#cs_id#">
						<input type="hidden" name="inc" value="Sessions">
						<select name="cs_name" id="cs_name" onchange="spCheck(this, 'sp#i#', 'cs#i#')">
							<option value="Fall" <cfif cs_name is "Fall">selected</cfif>>Fall</option>
							<option value="Winter" <cfif cs_name is "Winter">selected</cfif>>Winter</option>
							<option value="Spring" <cfif cs_name is "Spring">selected</cfif>>Spring</option>
							<option value="SS I" <cfif cs_name is "SS I">selected</cfif>>SS I</option>
							<option value="SS II" <cfif cs_name is "SS II">selected</cfif>>SS II</option>
							<option value="Special" <cfif left(cs_name, 7) is "Special">selected</cfif>>Special</option>
						</select>
						<span id="sp#i#" style="display:<cfif left(cs_name, 7) is "Special">block<cfelse>none</cfif>">
							<cfif left(cs_name, 7) is "Special">
							<input type="text" name="cs_name" value="#listlast(cs_name)#" id="cs#i#">
							</cfif>
						</span>
					</td>
					<td align="center" width="100">
						<input type="text" name="cs_start" id="cs_start" size="8" value="#dateformat(cs_start, "mm/dd/yyyy")#">
						<script language="Javascript">
						new tcal ({
						        // form name
						        'formname': 'update#i#',
						        // input name
						        'controlname': 'cs_start'
						});
						</script>
					</td>
					<td align="center" width="100">
						<input type="text" name="cs_end" id="cs_end" size="8" value="#dateformat(cs_end, "mm/dd/yyyy")#">
						<script language="Javascript">
						new tcal ({
						        // form name
						        'formname': 'update#i#',
						        // input name
						        'controlname': 'cs_end'
						});
						</script>
					</td>
					<td align="center">
						<select name="status" id="status">
							<option value="1" <cfif #status# is 1>selected</cfif>>Active</option>
							<option value="0" <cfif #status# is 0>selected</cfif>>Inactive</option>
						</select>
					</td>
					<td align="center">#created#</td>
					<td align="center">#updated#</td>
					<td align="right">
						<input type="hidden" name="step" value="2">
						<input type="submit" value="save">
					</td>
				</tr>
				</form>
				</cfloop>
			</table>
		<cfelse>
			No Sessions Found
		</cfif>
	</cfif>

	<cfif step is 2>
		<cfquery name="nameCheck" dbtype="query">
			select *
			from getSession
			where upper(cs_name) = '#ucase(form.cs_name)#'
				and cs_id <> #form.cs_id#
		</cfquery>
		#nameCheck.status# #form.status#
		<cfif nameCheck.recordcount gt 0 and nameCheck.status is form.status>
			<cfset session.error="#form.cs_name# class already in system">
		<cfelse>
			<cfset form.cc_name = replace(form.cs_name, "'", "", "ALL")>
	
			<cfinvoke component="checkin" method="editSession">
				<cfinvokeargument name="cs_name" value="#form.cs_name#">
				<cfinvokeargument name="cs_id" value="#form.cs_id#">
				<cfinvokeargument name="cs_start" value="#form.cs_start#">
				<cfinvokeargument name="cs_end" value="#form.cs_end#">
				<cfinvokeargument name="status" value="#form.status#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=Sessions">
	</cfif>
	
	<cfif step is 3>
		<cfquery name="nameCheck" dbtype="query">
			select * 
			from getSession 
			where upper(cs_name) = '#ucase(form.cs_name)#' 
				and cs_start = '#cs_start#' 
				and cs_end = '#cs_end#'
		</cfquery>
	
		<cfif nameCheck.recordcount gt 0>
			<cfset session.error="#form.cs_name# class already in system">
			<cflocation url = "internal.cfm?inc=Sessions">
		<cfelse>
			<cfset form.cc_name = replace(form.cs_name, "'", "", "ALL")>
			<cfinvoke component="checkin" method="addSession">
				<cfinvokeargument name="cs_name" value="#form.cs_name#">
				<cfinvokeargument name="cs_start" value="#form.cs_start#">
				<cfinvokeargument name="cs_end" value="#form.cs_end#">
			</cfinvoke>
		</cfif>
		<cflocation url = "internal.cfm?inc=Sessions">
	</cfif>
	
<cfelseif myInc is "Schedules">
	<form id="delMe" name="delMe" method="post" action="internal.cfm">
		<input type="hidden" id="my_cts_id" name="cts_id">
		<input type="hidden" id="step" name="step" value="4">
		<input type="hidden" id="inc" name="inc" value="Schedules">
	</form>
	<cfif step is 1>
	<div class="sectionHead"><cfif isdefined("form.editMe")>Update<cfelse>Add</cfif></div>
	<form name="myForm" id="myForm">
	<table border=1 class="editTable">
		<tr style="background-color:##DDDDDD">
			<th>Session</th>
			<th>Class</th>
			<th>Location</th>
			<th>Day</th>
			<th>Start</th>
			<th>End</th>
		</tr>
		<tr>
			<td valign="top">
				<a href="internal.cfm?inc=Sessions">add/edit</a><br /><br />
				<div style="height:130px;width:140px;overflow:auto">
				<cfloop query="getSessions">
					<cfif status is 1 and (cu_id is session.cu_id or session.cu_id is 12) and cs_end ge now()>
						<input type="radio" name="cs_id" id="cs_id" value="#cs_id#,#cs_name# #year(cs_start)#" onclick="setDetail(this,'mySession','Session')" <cfif isdefined("form.editMe") and form.cs_id is cs_id >checked</cfif>>
						<cfif left(cs_name, 7) is "Special">#listGetAt(cs_name, 2, ",")#<cfelse>#cs_name#</cfif>
						#year(cs_start)#
						<cfif session.cu_id is 12>- #cu_id#	</cfif>
						<br />
					</cfif>
				</cfloop>
				</div>
			</td>
			<td valign="top">
				<a href="internal.cfm?inc=Classes">add/edit</a><br /><br />
				<div style="height:130px;width:170px;overflow:auto">
				<cfloop query="getClasses">
				<cfif status is 1 and (cu_id is session.cu_id or session.cu_id is 12)>
				<input type="radio" name="cc_id" id="cc_id" value="#cc_id#,#cc_name#" onclick="setDetail(this,'myClass','Class')" <cfif isdefined("form.editMe") and form.cc_id is cc_id>checked</cfif>>
				#cc_name#
				<cfif session.cu_id is 12>
				- #cu_id#
				</cfif>
				<br />
				</cfif>
				</cfloop>
				</div>
			</td>
			<td valign="top">
				<a href="internal.cfm?inc=Locations">add/edit</a><br /><br />
				<div style="height:130px;width:120px;overflow:auto">
				<cfloop query="getLocations">
					<cfif status is 1 and (cu_id is session.cu_id or session.cu_id is 12)>
					<input type="radio" name="cl_id" id="cl_id" value="#cl_id#,#cl_name#" onclick="setDetail(this,'myLocation','Location')" <cfif isdefined("form.editMe") and form.cl_id is cl_id>checked</cfif>>
					#cl_name#
					<cfif session.cu_id is 12>
					- #cu_id#
					</cfif>
					<br />
					</cfif>
				</cfloop>
				</div>
			</td>
			<td valign="top">
				<input type="checkbox" name="sc_day1" id="sc_day1" value="Sunday" onclick="setDetail(this,'myDay','Day')" <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,"Sunday") neq 0>checked</cfif>>Sunday<br />
				<input type="checkbox" name="sc_day2" id="sc_day2" value="Monday" onclick="setDetail(this,'myDay','Day')" <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,"Monday") neq 0>checked</cfif>>Monday<br />
				<input type="checkbox" name="sc_day3" id="sc_day3" value="Tuesday" onclick="setDetail(this,'myDay','Day')" <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek,"Tuesday") neq 0>checked</cfif>>Tuesday<br />
				<input type="checkbox" name="sc_day4" id="sc_day4" value="Wednesday" onclick="setDetail(this,'myDay','Day')" <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek, "Wednesday") neq 0>checked</cfif>>Wednesday<br />
				<input type="checkbox" name="sc_day5" id="sc_day5" value="Thursday" onclick="setDetail(this,'myDay','Day')" <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek, "Thursday") neq 0>checked</cfif>>Thursday<br />
				<input type="checkbox" name="sc_day6" id="sc_day6" value="Friday" onclick="setDetail(this,'myDay','Day')" <cfif isdefined("form.editMe") and ListContains(form.dayOfWeek, "Friday") neq 0>checked</cfif>>Friday<br />
				<input type="checkbox" name="sc_day7" id="sc_day7" value="Saturday" onclick="setDetail(this,'myDay','Day')"	<cfif isdefined("form.editMe") and ListContains(form.dayOfWeek, "Saturday") neq 0>checked</cfif>>Saturday<br />
			</td>
			<td valign="top">
				<div style="height:160px;width:100px;overflow:auto">
				<cfset f=6>
				<cfset t=12>
				<cfloop index="ap" from="1" to="2">
					<cfif ap is 2>
						<cfset f=1>
						<cfset t=10>
					</cfif>
					<cfloop index="h" from="#f#" to="#t#">
						<cfloop index="m" from="0" to="55" step="5">
							<cfset mytime=numberformat(h, "0_")&":"&numberformat(m, "0_")>
							<cfif ap is 1 and h neq 12>
								<cfset mytime=mytime & " AM">
							<cfelse>
								<cfset mytime=mytime & " PM">
							</cfif>
							<input type="radio" name="sc_Start" id="sc_Start" value="#mytime#"  onclick="setDetail(this,'myStart','Start')" <cfif isdefined("form.editMe") and form.cts_start is mytime>checked</cfif>>#mytime#<br />
						</cfloop>
					</cfloop>
				</cfloop>
				</div>
			</td>
			<td valign="top">
				<div style="height:160px;width:100px;overflow:auto">
				<cfset f=6>
				<cfset t=12>
				<cfloop index="ap" from="1" to="2">
					<cfif ap is 2>
						<cfset f=1>
						<cfset t=11>
					</cfif>
					<cfloop index="h" from="#f#" to="#t#">
						<cfloop index="m" from="0" to="55" step="5">
							<cfset mytime=numberformat(h, "0_")&":"&numberformat(m, "0_")>
							<cfif ap is 1 and h neq 12>
								<cfset mytime=mytime & " AM">
							<cfelse>
								<cfset mytime=mytime & " PM">
							</cfif>
							<input type="radio" name="sc_End" id="sc_End" value="#mytime#"  onclick="setDetail(this,'myEnd','End')"	<cfif isdefined("form.editMe") and form.cts_end is mytime>checked</cfif>>#mytime#<br />
						</cfloop>
					</cfloop>
				</cfloop>
				</div>
			</td>
		</tr>
	</table>
	</form>
	<p>
	<form method="post" action="internal.cfm" name="newSession" id="newSession">
	<input type="hidden" name="inc" value="Schedules">
	<table border=1 class="editTable">
		<tr style="background-color:##DDDDDD">
			<th width="100">Session</th>
			<th width="100">Class</th>
			<th width="150">Location</th>
			<th width="150">Day(s)</th>
			<th>Start Time</th>
			<th>End Time</th>
			<th></th>
		</tr>
		<tr style="background-color:##EEEEEE">
			<td><span id="mySession"></span></td>
			<td><span id="myClass"></span></td>
			<td><span id="myLocation"></span></td>
			<td><span id="myDay"></span></td>
			<td><span id="myStart"></span></td>
			<td><span id="myEnd"></span></td>
			<td align="center">
			<input type="hidden" name="step" id="stepX" value="<cfif isdefined("form.editMe")>2<cfelse>3</cfif>">
			<input type="submit" id="mySubmit" value="<cfif isdefined("form.editMe")>Update<cfelse>Schedule</cfif> Class" disabled>
			<cfif isdefined("form.editMe")>
			<input type="hidden" name="cts_id" value="#form.cts_id#">
			<br /><br />
			<input type="button" value="Copy to New" onclick="copy2new()">
			</cfif>
			</td>
		</tr>
	</table>
	<input type="hidden" name="cs_id" id="cs_idx">
	<input type="hidden" name="cc_id" id="cc_idx">
	<input type="hidden" name="cl_id" id="cl_idx">
	<input type="hidden" name="dayOfWeek" id="dayOfWeek">
	<input type="hidden" name="cts_start" id="cts_start">
	<input type="hidden" name="cts_end" id="cts_end">
	</form>
	<br /><br />
	<div class="sectionHead">Current Class Listing</div>
	
	<cfif isdefined("url.subInc") is false>
		<cfset subInc = "calView">
	<cfelse>
		<cfset subInc = url.subInc>
	</cfif>
	
	<cfif isdefined("form.subInc")>
		<cfset subInc = form.subInc>
	</cfif>
	
	<cfif subInc is "listView">
		<cfif isdefined("form.cs_id")>
			<cfset theSession = form.cs_id>
		<cfelse>
			<cfloop query="getSessions">
				<cfif getSessions.cs_start lt now() and getSessions.cs_end gt now()>
					<cfset theSession = getSessions.cs_id>
				</cfif>
			</cfloop>
		</cfif>
		<form id="schedView" name="schedView" action="internal.cfm" method="post">
		<div class="sectionHead"><A HREF="internal.cfm?inc=Schedules&subInc=calView">Week View</a> - - List View</div>
		<input type="hidden" name="inc" value="Schedules">
		<input type="hidden" name="subInc" value="#subInc#">
		<cfloop query="getSessions">
			<cfif status is 1 and (cu_id is session.cu_id or session.cu_id is 12) and cs_end ge now()>
				<input type="radio" name="cs_id" value="#listfirst(cs_id)#" <cfif listfirst(cs_id) eq theSession>checked="checked"</cfif> onclick="schedV()" />#cs_name#
			</cfif>
		</cfloop>
		<br />
		<cfif isdefined("form.cl_id")>
			<cfset theLocation = form.cl_id>
		<cfelse>
			<cfset theLocation = getLocations.cl_id>
		</cfif>
		<cfloop query="getLocations">
			<cfif status is 1>
				<input type="radio" name="cl_id" value="#listfirst(cl_id)#" <cfif cl_id eq theLocation>checked="checked"</cfif> onclick="schedV()" />#cl_name#
			</cfif>
		</cfloop>
		</form>
		<table  class="editTable">
			<tr style="background-color:##DDDDDD">
				<th width="200">Class</th>
				<th width="200">Day</th>
				<th width="200">Start</th>
				<th width="200">End</th>
				<th width="200"><!---&nbsp;---></th>
			</tr>
		</table>
		<div style="overflow:auto;height:300px;width:817px">
		<table class="editTable">
		<cfset i=1>
		<cfquery name="mySchedules" dbtype="query">
			select *
			from getSchedules, getClasses
			where
			        cs_id = #theSession# and
			        cl_id = #theLocation# and
			        getSchedules.cc_id=getClasses.cc_id
			order by cc_name, dayofweek, cts_start
		</cfquery>

		<cfloop query="mySchedules">
		<cfset i++>
		<form name="update#i#" action="internal.cfm" method="post">
		<input type="hidden" name="inc" value="Schedules">
		<input type="hidden" name="subInc" value="listView">
		<input type="hidden" id="cts_id" name="cts_id" value="#cts_id#">
		<input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
		<input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
		
			<tr class="myTR2" <cfif currentRow mod 2>style="background-color:##eeeeee;"</cfif>>
				<td width="200">
					<cfquery name="classDtl" dbtype="query">
						select * 
						from getClasses 
						where cc_id = #cc_id#
					</cfquery>
					<input type="hidden" id="cc_id" name="cc_id" value="#cc_id#">
					#classDtl.cc_name#
				</td>
				<td align="center" width="200">
				#dayOfWeek#
				<input type="hidden" id="dayOfWeek" name="dayOfWeek" value="#dayOfWeek#">
				</td>
				<td align="center" width="200">
				#timeformat(cts_start, "hh:mm tt")#
				<input type="hidden" id="cts_start" name="cts_start" value="#timeformat(cts_start, "hh:mm tt")#">
				</td>
				<td align="center" width="200">
				#timeformat(cts_end, "hh:mm tt")#
				<input type="hidden" id="cts_end" name="cts_end" value="#timeformat(cts_end, "hh:mm tt")#">
				</td>
				<td align="right" width="200">
				<input type="hidden" name="editMe" value="1">
				<input type="submit" value="Edit">
				<input type="button" value="Delete" onclick="deleteMe('#cts_id#')">
				</td>
			</tr>
		</form>
		</cfloop>
		</table>
		</div>
	<cfelseif subInc is "calView">
		<cfif isdefined("form.cs_id")>
			<cfset theSession=form.cs_id>
		<cfelse>
			<cfloop query="getSessions">
				<cfif getSessions.cs_start lt now() and getSessions.cs_end gt now()>
					<cfset theSession = getSessions.cs_id>
				</cfif>
			</cfloop>
		</cfif>

		<form id="calView" name="calView" action="internal.cfm" method="post">
		<div class="sectionHead">Week View - - <A HREF="internal.cfm?inc=Schedules&subInc=listView">List View</a></div>
		<input type="hidden" name="inc" value="Schedules">
		<input type="hidden" name="subInc" value="calView">
		
		<cfloop query="getSessions">
			<cfif status is 1 and (cu_id is session.cu_id or session.cu_id is 12) and cs_end ge now()>
			<input type="radio" name="cs_id" value="#listfirst(cs_id)#" <cfif listfirst(cs_id) eq theSession>checked="checked"</cfif> onclick="calV()" />#cs_name#
			</cfif>
		</cfloop>
		<br />
		<cfif isdefined("form.cl_id")>
			<cfset theLocation=form.cl_id>
		<cfelse>
			<cfset theLocation=getLocations.cl_id>
		</cfif>
		<cfloop query="getLocations">
			<cfif status is 1>
				<input type="radio" name="cl_id" value="#listfirst(cl_id)#" <cfif cl_id eq theLocation>checked="checked"</cfif> onclick="calV()" />#cl_name#
			</cfif>
		</cfloop>
		</form>
		<div style="width:817px">
		<table border="1" class="editTable">
			<tr style="background-color:##DDDDDD">
				<th width="100">Sun</th>
				<th width="100">Mon</th>
				<th width="100">Tue</th>
				<th width="100">Wed</th>
				<th width="100">Thu</th>
				<th width="100">Fri</th>
				<th width="100">Sat</th>
			</tr>
			<cfset myClass.cc_id="">
			<cfset cur_cc_id_1 ="">
			<cfset cur_cc_id_2 ="">
			<cfset cur_cc_id_3 ="">
			<cfset cur_cc_id_4 ="">
			<cfset cur_cc_id_5 ="">
			<cfset cur_cc_id_6 ="">
			<cfset cur_cc_id_7 ="">
			
			<cfloop index="myH" from="6" to="22">
				<cfloop index="myMin" from="0" to="45" step="15">
					<cfset myTime="#numberformat(myH,"00")#:#numberformat(myMin, "00")#:00">
					<cfset myT=timeformat(myTime, "hh:mm:TT")>
					<cfset myStart="1970-01-01 #myTime#">
					<tr class="myTR">
						<td id="su">
						<cfquery name="sunClass" dbtype="query">
							select * 
							from getSchedules
							where
								(cts_start <= '#myStart#' and
								cts_End > '#myStart#') and
								dayOfWeek like '%Sun%' and
								<!---   cs_id = #theSession# and --->
								cl_id = #theLocation#
						</cfquery>

						<cfif sunClass.recordcount gt 0 and cur_cc_id_1 neq sunClass.cts_id>
							<cfquery name="myClass" dbtype="query">
								select * 
								from getClasses
								Where cc_id = #sunClass.cc_id#
							</cfquery>
							
							<form name="update#myH##myMin##myClass.cc_name#" action="internal.cfm" method="post">
								<input type="hidden" name="inc" value="Schedules">
								<input type="hidden" id="cts_id" name="cts_id" value="#sunClass.cts_id#">
								<input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
								<input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
								<input type="hidden" id="cc_id" name="cc_id" value="#sunClass.cc_id#">
								<input type="hidden" id="dayOfWeek" name="dayOfWeek" value="#sunClass.dayOfWeek#">
								<input type="hidden" id="cts_start" name="cts_start" value="#timeformat(sunClass.cts_start, "hh:mm tt")#">
								<input type="hidden" id="cts_end" name="cts_end" value="#timeformat(sunClass.cts_end, "hh:mm tt")#">
								<input type="hidden" name="editMe" value="1">
								<input type="submit" value="#left(myClass.cc_name, 12)# - #timeformat(sunClass.cts_start, "h:mm")#" class="calView">
							</form>
						<cfelse>
							<!---&nbsp;--->
						</cfif>
						<cfset cur_cc_id_1 = sunClass.cts_id>
						</td>
						<td id="mo">
							<cfquery name="monClass" dbtype="query">
								select * 
								from getSchedules
								where
									(cts_start <= '#myStart#' and
									cts_End > '#myStart#') and
									dayOfWeek like '%Mon%' and
									cs_id = #theSession# and
									cl_id = #theLocation#
							</cfquery>
							<cfif monClass.recordcount gt 0 and cur_cc_id_2 neq monClass.cts_id and monClass.cc_id neq "">
								<cfquery name="myClass" dbtype="query">
									select * 
									from getClasses
									Where cc_id = #monClass.cc_id#
								</cfquery>
								<form name="update#myH##myMin##myClass.cc_name#" action="internal.cfm" method="post">
								<input type="hidden" name="inc" value="Schedules">
								<input type="hidden" id="cts_id" name="cts_id" value="#monClass.cts_id#">
								<input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
								<input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
								<input type="hidden" id="cc_id" name="cc_id" value="#monClass.cc_id#">
								<input type="hidden" id="dayOfWeek" name="dayOfWeek" value="#monClass.dayOfWeek#">
								<input type="hidden" id="cts_start" name="cts_start" value="#timeformat(monClass.cts_start, "hh:mm tt")#">
								<input type="hidden" id="cts_end" name="cts_end" value="#timeformat(monClass.cts_end, "hh:mm tt")#">
								<input type="hidden" name="editMe" value="1">
								<input type="submit" value="#left(myClass.cc_name, 12)# - #timeformat(monClass.cts_start, "h:mm")#" class="calView">
								</form>
								<cfset cur_cc_id_2 = monClass.cts_id>
							<cfelse>
								<!---&nbsp;--->
							</cfif>
						</td>
						<td id="tu">
							<cfquery name="tueClass" dbtype="query">
							select * from getSchedules
							where
							        (cts_start <= '#myStart#' and
							        cts_End > '#myStart#') and
							        dayOfWeek like '%Tue%' and
							        cs_id = #theSession# and
							        cl_id = #theLocation#
							</cfquery>
						
							<cfif tueClass.recordcount gt 0 and cur_cc_id_3 neq tueClass.cts_id>
								<cfquery name="myClass" dbtype="query">
									select * 
									from getClasses
									Where cc_id = #tueClass.cc_id#
								</cfquery>
								<form name="update#myH##myMin##myClass.cc_name#" action="internal.cfm" method="post">
								<input type="hidden" name="inc" value="Schedules">
								<input type="hidden" id="cts_id" name="cts_id" value="#tueClass.cts_id#">
								<input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
								<input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
								<input type="hidden" id="cc_id" name="cc_id" value="#tueClass.cc_id#">
								<input type="hidden" id="dayOfWeek" name="dayOfWeek" value="#tueClass.dayOfWeek#">
								<input type="hidden" id="cts_start" name="cts_start" value="#timeformat(tueClass.cts_start, "hh:mm tt")#">
								<input type="hidden" id="cts_end" name="cts_end" value="#timeformat(tueClass.cts_end, "hh:mm tt")#">
								<input type="hidden" name="editMe" value="1">
								<input type="submit" value="#left(myClass.cc_name, 12)# - #timeformat(tueClass.cts_start, "h:mm")#" class="calView">
								</form>
							<cfelse>
								<!---&nbsp;--->
							</cfif>
							
							<cfset cur_cc_id_3 = tueClass.cts_id>
						</td>
						<td id="we">
							<cfquery name="wedClass" dbtype="query">
								select * 
								from getSchedules
								where (cts_start <= '#myStart#' and
									cts_End > '#myStart#') and
									dayOfWeek like '%Wed%' and
									cs_id = #theSession# and
									cl_id = #theLocation#
							</cfquery>
							
							<cfif wedClass.recordcount gt 0 and cur_cc_id_4 neq wedClass.cts_id>
								<cfquery name="myClass" dbtype="query">
									select * 
									from getClasses
									Where cc_id = #wedClass.cc_id#
								</cfquery>
								<form name="update#myH##myMin##myClass.cc_name#" action="internal.cfm" method="post">
								<input type="hidden" name="inc" value="Schedules">
								<input type="hidden" id="cts_id" name="cts_id" value="#wedClass.cts_id#">
								<input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
								<input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
								<input type="hidden" id="cc_id" name="cc_id" value="#wedClass.cc_id#">
								<input type="hidden" id="dayOfWeek" name="dayOfWeek" value="#wedClass.dayOfWeek#">
								<input type="hidden" id="cts_start" name="cts_start" value="#timeformat(wedClass.cts_start, "hh:mm tt")#">
								<input type="hidden" id="cts_end" name="cts_end" value="#timeformat(wedClass.cts_end, "hh:mm tt")#">
								<input type="hidden" name="editMe" value="1">
								<input type="submit" value="#left(myClass.cc_name, 12)# - #timeformat(wedClass.cts_start, "h:mm")#" class="calView">
								</form>
							<cfelse>
								<!---&nbsp;--->
							</cfif>
							
							<cfset cur_cc_id_4 = wedClass.cts_id>
						</td>
						<td id="th">
							<cfquery name="thuClass" dbtype="query">
								select * from getSchedules
								where
								        (cts_start <= '#myStart#' and
								        cts_End > '#myStart#') and
								        dayOfWeek like '%Thu%' and
								        cs_id = #theSession# and
								        cl_id = #theLocation#
							</cfquery>
							
							<cfif thuClass.recordcount gt 0 and cur_cc_id_5 neq thuClass.cts_id>
								<cfquery name="myClass" dbtype="query">
									select * from getClasses
									Where cc_id = #thuClass.cc_id#
								</cfquery>
								<form name="update#myH##myMin##myClass.cc_name#" action="internal.cfm" method="post">
								<input type="hidden" name="inc" value="Schedules">
								<input type="hidden" id="cts_id" name="cts_id" value="#thuClass.cts_id#">
								<input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
								<input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
								<input type="hidden" id="cc_id" name="cc_id" value="#thuClass.cc_id#">
								<input type="hidden" id="dayOfWeek" name="dayOfWeek" value="#thuClass.dayOfWeek#">
								<input type="hidden" id="cts_start" name="cts_start" value="#timeformat(thuClass.cts_start, "hh:mm tt")#">
								<input type="hidden" id="cts_end" name="cts_end" value="#timeformat(thuClass.cts_end, "hh:mm tt")#">
								<input type="hidden" name="editMe" value="1">
								<input type="submit" value="#left(myClass.cc_name, 12)# - #timeformat(thuClass.cts_start, "h:mm")#" class="calView">
								</form>
							<cfelse>
								<!---&nbsp;--->
							</cfif>
							
							<cfset cur_cc_id_5 = thuClass.cts_id>
						</td>

						<td id="fr">
							<cfquery name="friClass" dbtype="query">
							select * from getSchedules
							where
							        (cts_start <= '#myStart#' and
							        cts_End > '#myStart#') and
							        dayOfWeek like '%Fri%' and
							        cs_id = #theSession# and
							        cl_id = #theLocation#
							</cfquery>
							
							<cfif friClass.recordcount gt 0 and cur_cc_id_6 neq friClass.cts_id>
							<cfquery name="myClass" dbtype="query">
							select * from getClasses
							Where cc_id = #friClass.cc_id#
							</cfquery>
							
							<form name="update#myH##myMin##myClass.cc_name#" action="internal.cfm" method="post">
							<input type="hidden" name="inc" value="Schedules">
							<input type="hidden" id="cts_id" name="cts_id" value="#friClass.cts_id#">
							<input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
							<input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
							<input type="hidden" id="cc_id" name="cc_id" value="#friClass.cc_id#">
							<input type="hidden" id="dayOfWeek" name="dayOfWeek" value="#friClass.dayOfWeek#">
							<input type="hidden" id="cts_start" name="cts_start" value="#timeformat(friClass.cts_start, "hh:mm tt")#">
							<input type="hidden" id="cts_end" name="cts_end" value="#timeformat(friClass.cts_end, "hh:mm tt")#">
							<input type="hidden" name="editMe" value="1">
							<input type="submit" value="#left(myClass.cc_name, 12)# - #timeformat(friClass.cts_start, "h:mm")#" class="calView">
							</form>
							<cfelse>
							<!---&nbsp;--->
							</cfif>
							
							<cfset cur_cc_id_6 = friClass.cts_id>
						</td>
						<td id="sa">
							<cfquery name="satClass" dbtype="query">
							select * from getSchedules
							where
							        (cts_start <= '#myStart#' and
							        cts_End > '#myStart#') and
							        dayOfWeek like '%Sat%' and
							        cs_id = #theSession# and
							        cl_id = #theLocation#
							</cfquery>
							
							<cfif satClass.recordcount gt 0 and cur_cc_id_7 neq satClass.cts_id>
							<cfquery name="myClass" dbtype="query">
							select * from getClasses
							Where cc_id = #satClass.cc_id#
							</cfquery>
							
							<form name="update#myH##myMin##myClass.cc_name#" action="internal.cfm" method="post">
							<input type="hidden" name="inc" value="Schedules">
							<input type="hidden" id="cts_id" name="cts_id" value="#satClass.cts_id#">
							<input type="hidden" id="cs_id" name="cs_id" value="#theSession#">
							<input type="hidden" id="cl_id" name="cl_id" value="#theLocation#">
							<input type="hidden" id="cc_id" name="cc_id" value="#satClass.cc_id#">
							<input type="hidden" id="dayOfWeek" name="dayOfWeek" value="#satClass.dayOfWeek#">
							<input type="hidden" id="cts_start" name="cts_start" value="#timeformat(satClass.cts_start, "hh:mm tt")#">
							<input type="hidden" id="cts_end" name="cts_end" value="#timeformat(satClass.cts_end, "hh:mm tt")#">
							<input type="hidden" name="editMe" value="1">
							<input type="submit" value="#left(myClass.cc_name, 12)# - #timeformat(satClass.cts_start, "h:mm")#" class="calView">
							</form>
							<cfelse>
							<!---&nbsp;--->
							</cfif>
							
							<cfset cur_cc_id_7 = satClass.cts_id>
						</td>
					</tr>
				</cfloop>
			</cfloop>
		</table>
		</div>
	</cfif>
	<br /><br />
	<cfelseif step is 3>
		<cfset myStart = CreateODBCTime("#form.cts_start#")>
		<cfset myEnd = CreateODBCTime("#form.cts_end#")>
		
		<cfinvoke component="checkin" method="cts_Add">
			<cfinvokeargument name="cs_id" value="#form.cs_id#">
			<cfinvokeargument name="cc_id" value="#form.cc_id#">
			<cfinvokeargument name="cl_id" value="#form.cl_id#">
			<cfinvokeargument name="dayOfWeek" value="#form.dayOfWeek#">
			<cfinvokeargument name="cts_start" value="#myStart#">
			<cfinvokeargument name="cts_end" value="#myEnd#">
		</cfinvoke>
		
		<cflocation url = "internal.cfm?inc=Schedules">
	</cfif>

	<cfif step is 2>
		#step#
		<cfset myStart = CreateODBCTime("#form.cts_start#")>
		<cfset myEnd = CreateODBCTime("#form.cts_end#")>
		
		<cfinvoke component="checkin" method="cts_Edit">
			<cfinvokeargument name="cts_id" value="#form.cts_id#">
			<cfinvokeargument name="cs_id" value="#form.cs_id#">
			<cfinvokeargument name="cc_id" value="#form.cc_id#">
			<cfinvokeargument name="cl_id" value="#form.cl_id#">
			<cfinvokeargument name="dayOfWeek" value="#form.dayOfWeek#">
			<cfinvokeargument name="cts_start" value="#myStart#">
			<cfinvokeargument name="cts_end" value="#myEnd#">
		</cfinvoke>
		
		<cflocation url = "internal.cfm?inc=Schedules">
	</cfif>
	
	<cfif step is 4>
		<cfinvoke component="checkin" method="deleteSchedules">
			<cfinvokeargument name="cts_id" value="#form.cts_id#">
		</cfinvoke>
	
		<cflocation url = "internal.cfm?inc=Schedules">
	</cfif>
</cfif>

</cfoutput>



Okay...so after having looked at it some, I have to say that I can't really fix it for you. The reason for that, however, is actually kind of okay (I think). The issue devolves down to where the code goes about setting THESESSION. The applicable part (insofar as your error goes...this may not be the only case where this code errors however) is right here:
<cfelseif subInc is "calView">
		<cfif isdefined("form.cs_id")>
			<cfset theSession=form.cs_id>
		<cfelse>
			<cfloop query="getSessions">
				<cfif getSessions.cs_start lt now() and getSessions.cs_end gt now()>
					<cfset theSession = getSessions.cs_id>
				</cfif>
			</cfloop>
		</cfif>


Basically, what this is doing is conditionally setting theSession (CF isn't case sensitive for these kinds of operations). In one case, if there is a form variable called cs_id, it's setting theSession equal to the value of that form variable. That's fairly straightforward. However, in the absence of that form variable, what the code is doing is looping over a query resultset called getSessions and it presumably via the conditional code comparing the current date and time to values called cs_start and cs_end from the database query, is setting theSession equivalent to a cs_id value from that returned recordset. That may not make a whole lot of sense and unfortunately, the code doesn't contain the query and we don't have access to your database to see what that query (getSessions) actually returns. The good news though is that you problem pretty much has to reside here and can be from only a couple of likely reasons:

1./ The getSessions query doesn't end up returning any records at all. If that happened then the cfloop wouldn't execute and there wouldn't be a theSession variable set at all. This is actually my best guess which I only suggest via picking up some of what it looks like the page is trying to build/display. This then would be a data issue and not necessarily a code issue...which matches with your description of the timeline for the issue.

2./ It could also be that the getSessions query did return records but that none of them matched the conditional logic matching the current date and time against the cs_start and cs_end values and, because it never achieves a positive condition during the loop, never ends up creating theSession. Again, this could also likely be a data issue...it really depends on what the getSessions query is doing.

Now, there are ways to handle such incidents but without knowing more about how your application functions, I can only suggest a bland fix which is to catch the erroring code and throw a "you've encountered an error" message...which is pretty much what the server is doing...except that your error message could be prettier and less obnoxious.

In order to cover the specific erroring code, you'd replace the query code for monClass which is this:
<cfquery name="monClass" dbtype="query">
								select * 
								from getSchedules
								where
									(cts_start <= '#myStart#' and
									cts_End > '#myStart#') and
									dayOfWeek like '%Mon%' and
									cs_id = #theSession# and
									cl_id = #theLocation#
							</cfquery>


...with something like this:
<cftry>
							<cfquery name="monClass" dbtype="query">
								select * 
								from getSchedules
								where
									(cts_start <= '#myStart#' and
									cts_End > '#myStart#') and
									dayOfWeek like '%Mon%' and
									cs_id = #theSession# and
									cl_id = #theLocation#
							</cfquery>
							<cfcatch type="any">
								<script language="javascript">
									alert("We apologize but you have encountered an unexpected error.\n\n Please advise a system admin.");
								</script>
								<cfabort>
							</cfcatch>
							</cftry>



What that will do is to catch the erroring query, throw up a Javascript popup telling the user that an error has occurred and stop further processing of the page. That is a simple and ugly error catch but it will work. It will only catch errors that happen in that query. For a larger error catching net, you'd probably want to build in something more comprehensive (which is one of the tasks for a CF dev).

Hope that helped some. If you have further questions or comments, feel free to post them here.

Good luck!
Was This Post Helpful? 1
  • +
  • -

#7 sacpadre  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 25-September 12

Re: Variable THESESSION is undefined.

Posted 25 September 2012 - 04:38 PM

Thanks Craig328. This at least gives me a workaround to suppress the previous error.
You've been very helpful and I appreciate it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1