<table class="displayTable">
<cfform action="AddTestDetails.cfm" method="post" format="html">
<tr>
<th>Employee</th>
<th>Video</th>
<th>Number of Tests</th>
<th>Score</th>
</tr>
<tr>
<td><select name="employeeID">
<cfoutput query="getAllEmployees">
<option value="#employeeID#">#First_Name##Last_Name#</option>
</cfoutput>
</select></td>
<td width="30"><select name="VideoID" onChange="showNumTests(this.value)">
<cfoutput query="getAllFilms">
<option value="#VideoID#">#VideoID# - #Video_Name#</option>
<cfinput type="hidden" name="employeeID">
</cfoutput>
</select></td>
<td><cfinput type="text" id="NumTests" name="NumTests" size="5"></td>
<td><cfinput type="text" name="Test_Score" size="5"></td>
</tr>
<tr>
<th>Test Status</th>
<th>Credits</th>
<th>Test Date</th>
</tr>
<tr>
<td><select id="status" select name="Test_Status" onChange="updateCredits(this, 'credits');">
<option value='1'#UserPass#>Passed</option>
<option value='0'#UserFail#>Fail</option>
</select></td>
<td><select id="credits" select name="Credits_Earned">
<option value='0'>0</option>
<option value='1'>1</option>
</select></td>
<td><cfinput type="datefield" name="Test_Date"></td>
</tr>
<tr>
<td><input type = "Submit" value = "Submit" name="Submit"></td>
</tr>
</cfform>
<html>
<head>
<title>Add Video</title>
</head>
<cfif not IsDefined('SESSION.EmployeeID')>
<cflocation url="login.cfm">
</cfif>
<cfdump var="#form#">
<cfset strMessage = "">
<cfparam name="form.employeeID" default="">
<cfif structKeyExists(FORM, "Submit")>
<CFSET new_date = #CREATEODBCDATETIME(Test_Date)#>
<cfquery name="AddTestDetails" datasource="#datasource#" result="TestScore">
INSERT INTO Test
(employeeID,VideoID, NumTests, Test_Score, Test_Status, Credits_Earned, Test_Date)
VALUES (<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.employeeID#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.VideoID#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.NumTests#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.Test_Score#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.Test_Status#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.Credits_Earned#">,
<cfqueryparam value="#new_date#" cfsqltype="CF_SQL_TIMESTAMP">
)
</cfquery>
<cfquery name="UpdateEmployeeCredits" datasource="#datasource#">
UPDATE Employees
SET credits = credits + <cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.Credits_Earned#">
WHERE employeeid = <cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.employeeID#">
UPDATE Employees
SET paid_credits = credits
WHERE (Credits % 5 = 0) AND EmployeeID = #val(form.EmployeeID)#
</cfquery>
<cfset strMessage = "Test score recorded">
</cfif>
<cfquery name="getAllEmployees" datasource="#datasource#">
SELECT EmployeeID, First_Name, Last_Name, Email
FROM Employees
WHERE Role < '2'
ORDER BY First_Name, Last_Name
</cfquery>
<cfquery name="getAllFilms" datasource="#datasource#">
<!--- SELECT *
FROM VideoList --->
SELECT Employees.EmployeeID, Detail.VideoID, VideoList.Video_Name, VideoList.NumTests
FROM Employees INNER JOIN
Detail ON Employees.EmployeeID = Detail.EmployeeID INNER JOIN
VideoList ON Detail.VideoID = VideoList.VideoID
WHERE Employees.EmployeeID = #val(form.EmployeeID)#
</cfquery>
<script type="text/javascript">
var arrFilms = [<cfoutput query="getAllFilms">{'videoid':#videoid#, 'NumTests':#NumTests#}<cfif getAllFilms.currentrow LT getAllFilms.recordcount>,</cfif></cfoutput>]; //create an array of objects of video ids and required tests number
var showNumTests = function(vid) {
for (var i=0; i<arrFilms.length; i++) {
if (arrFilms[i].videoid == vid) document.getElementById("NumTests").value = arrFilms[i].NumTests;
}
}
</script>
<script>
//if coldfusion pre-selects an option, this will adjust the credit field when the page loads
window.onload = function(){
var updateThisOnload = document.getElementById("status");
updateCredits(updateThisOnload, "credits");
}
//update credit field based on status field
function updateCredits(obj, creditFieldId){
var selectedValue = obj.options[obj.selectedIndex].value;
var creditField = document.getElementById(creditFieldId);
for(var i = 0; i < creditField.options.length; i++){
creditField.options[i].selected = (creditField.options[i].value == selectedValue) ? true : false;
}
}
</script>
<body class="twoColElsLtHdr">
<div id="container">
<div id="header">
<img src="images/USGI_Masthead.gif" />
</div>
<div id="sidebar1">
<cfif isDefined("SESSION.Role") AND SESSION.Role EQ 0 >
<cfinclude template="sidebar_menuUser.cfm">
<cfelse>
<cfinclude template="sidebar_menuAdmin.cfm">
</cfif>
</div>
<div id="mainContent">
<table class="displayTable">
<cfform action="AddTestDetails.cfm" method="post" format="html">
<tr>
<th>Employee</th>
<th>Video</th>
<th>Number of Tests</th>
<th>Score</th>
</tr>
<tr>
<td><select name="employeeID">
<cfoutput query="getAllEmployees">
<option value="#employeeID#">#First_Name##Last_Name#</option>
</cfoutput>
</select></td>
<td width="30"><select name="VideoID" onChange="showNumTests(this.value)">
<cfoutput query="getAllFilms">
<option value="#VideoID#">#VideoID# - #Video_Name#</option>
</cfoutput>
</select></td>
<td><cfinput type="text" id="NumTests" name="NumTests" size="5"></td>
<td><cfinput type="text" name="Test_Score" size="5"></td>
</tr>
<tr>
<th>Test Status</th>
<th>Credits</th>
<th>Test Date</th>
</tr>
<tr>
<td><select id="status" select name="Test_Status" onChange="updateCredits(this, 'credits');">
<option value='1'#UserPass#>Passed</option>
<option value='0'#UserFail#>Fail</option>
</select></td>
<td><select id="credits" select name="Credits_Earned">
<option value='0'>0</option>
<option value='1'>1</option>
</select></td>
<td><cfinput type="datefield" name="Test_Date"></td>
</tr>
<tr>
<td><input type = "Submit" value = "Submit" name="Submit"></td>
</tr>
</cfform>
<tr><td colspan="2"><cfif len(strMessage)><div style="position:relative;left:5px; top:2px;padding:10px; background-color:#FFFFFF;width:250px;color:maroon;text-align:right;">
<cfoutput>#strMessage#</cfoutput>
</div>
</cfif></td></tr>
</table>
</div>
</div>
</body>
</html>
<!--- check your CF version --->
<cfdump var="#server.coldfusion#">
<tr>
<td><select name="employeeID">
<cfoutput query="getAllEmployees">
<option value="#employeeID#">#First_Name##Last_Name#</option>
</cfoutput>
</select>
</td>
<td width="30"> <cfselect name="VideoID"
bind="cfc:YourComponent.getFilms({employeeID})"
value="VideoID" display="Video_Name"
bindOnLoad="true"
/>
</td>
[code]
[b]YourComponent.cfc[/b]
[code]
<cfcomponent>
<cffunction name="getFilms" access="remote" returntype="query" output="false">
<cfargument name="employeeID" type="any" default="0">
<cfset var getAllFilms = "">
<cfquery name="getAllFilms" datasource="YourDatasourceNameHere">
SELECT Employees.EmployeeID, Detail.VideoID, VideoList.Video_Name, VideoList.NumTests
FROM Employees
INNER JOIN Detail ON Employees.EmployeeID = Detail.EmployeeID
INNER JOIN VideoList ON Detail.VideoID = VideoList.VideoID
WHERE Employees.EmployeeID = <cfqueryparam value="#val(arguments.EmployeeID)#" cfsqltype="cf_sql_integer">
</cfquery>
<cfreturn getAllFilms>
</cffunction>
</cfcomponent>
<!--- check your CF version --->
<cfdump var="#server.coldfusion#">
....
<tr>
<td><select name="employeeID">
<cfoutput query="getAllEmployees">
<option value="#employeeID#">#First_Name##Last_Name#</option>
</cfoutput>
</select>
</td>
<td width="30"> <cfselect name="VideoID"
bind="cfc:YourComponent.getFilms({employeeID})"
value="VideoID" display="Video_Name"
bindOnLoad="true"
/>
</td>
<cfcomponent>
<cffunction name="getFilms" access="remote" returntype="query" output="false">
<cfargument name="employeeID" type="any" default="0">
<cfset var getAllFilms = "">
<cfquery name="getAllFilms" datasource="YourDatasourceNameHere">
SELECT Employees.EmployeeID, Detail.VideoID, VideoList.Video_Name, VideoList.NumTests
FROM Employees
INNER JOIN Detail ON Employees.EmployeeID = Detail.EmployeeID
INNER JOIN VideoList ON Detail.VideoID = VideoList.VideoID
WHERE Employees.EmployeeID = <cfqueryparam value="#val(arguments.EmployeeID)#" cfsqltype="cf_sql_integer">
</cfquery>
<cfreturn getAllFilms>
</cffunction>
</cfcomponent>
form code
<html>
<head>
<title>Add Video</title>
<link href="css/formJBMNew.css" rel="stylesheet" type="text/css" />
</head>
<cfif not IsDefined('SESSION.EmployeeID')>
<cflocation url="login.cfm">
</cfif>
<cfdump var="#form#">
<cfset strMessage = "">
<cfparam name="form.employeeID" default="">
<cfif structKeyExists(FORM, "Submit")>
<CFSET new_date = #CREATEODBCDATETIME(Test_Date)#>
<cfquery name="AddTestDetails" datasource="#datasource#" result="TestScore">
INSERT INTO Test
(employeeID,VideoID, NumTests, Test_Score, Test_Status, Credits_Earned, Test_Date)
VALUES (<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.employeeID#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.VideoID#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.NumTests#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.Test_Score#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.Test_Status#">,
<cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.Credits_Earned#">,
<cfqueryparam value="#new_date#" cfsqltype="CF_SQL_TIMESTAMP">
)
</cfquery>
<cfquery name="UpdateEmployeeCredits" datasource="#datasource#">
UPDATE Employees
SET credits = credits + <cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.Credits_Earned#">
WHERE employeeid = <cfqueryparam cfsqltype="CF_SQL_INteger" value="#FORM.employeeID#">
UPDATE Employees
SET paid_credits = credits
WHERE (Credits % 5 = 0) AND EmployeeID = #val(form.EmployeeID)#
</cfquery>
<cfset strMessage = "Test score recorded">
</cfif>
<cfquery name="getAllEmployees" datasource="#datasource#">
SELECT EmployeeID, First_Name, Last_Name, Email
FROM Employees
WHERE Role < '2'
ORDER BY First_Name, Last_Name
</cfquery>
<cfquery name="getAllFilms" datasource="#datasource#">
SELECT *
FROM VideoList
</cfquery>
<!--- <script type="text/javascript">
var arrFilms = [<cfoutput query="getAllFilms">{'videoid':#videoid#, 'NumTests':#NumTests#}<cfif getAllFilms.currentrow LT getAllFilms.recordcount>,</cfif></cfoutput>]; //create an array of objects of video ids and required tests number
var showNumTests = function(vid) {
for (var i=0; i<arrFilms.length; i++) {
if (arrFilms[i].videoid == vid) document.getElementById("NumTests").value = arrFilms[i].NumTests;
}
}
</script> --->
<script>
//if coldfusion pre-selects an option, this will adjust the credit field when the page loads
window.onload = function(){
var updateThisOnload = document.getElementById("status");
updateCredits(updateThisOnload, "credits");
}
//update credit field based on status field
function updateCredits(obj, creditFieldId){
var selectedValue = obj.options[obj.selectedIndex].value;
var creditField = document.getElementById(creditFieldId);
for(var i = 0; i < creditField.options.length; i++){
creditField.options[i].selected = (creditField.options[i].value == selectedValue) ? true : false;
}
}
</script>
<body class="twoColElsLtHdr">
<div id="container">
<div id="header">
<img src="images/USGI_Masthead.gif" />
</div>
<div id="sidebar1">
<cfif isDefined("SESSION.Role") AND SESSION.Role EQ 0 >
<cfinclude template="sidebar_menuUser.cfm">
<cfelse>
<cfinclude template="sidebar_menuAdmin.cfm">
</cfif>
</div>
<div id="mainContent">
<table class="displayTable">
<cfform action="AddTestDetails.cfm" method="post" format="html">
<tr>
<th>Employee</th>
<th>Video</th>
<th>Number of Tests</th>
<th>Score</th>
</tr>
<tr>
<td><select name="employeeID">
<cfoutput query="getAllEmployees">
<option value="#employeeID#">#First_Name##Last_Name#</option>
</cfoutput>
</select>
</td>
<td width="30"> <cfselect name="VideoID"
bind="YourComponent.getFilms({employeeID})"
value="VideoID" display="Video_Name"
bindOnLoad="true"/>
</td>
<td><cfinput type="text" id="NumTests" name="NumTests" size="5"></td>
<td><cfinput type="text" name="Test_Score" size="5"></td>
</tr>
<tr>
<th>Test Status</th>
<th>Credits</th>
<th>Test Date</th>
</tr>
<tr>
<td><select id="status" select name="Test_Status" onChange="updateCredits(this, 'credits');">
<option value='1'#UserPass#>Passed</option>
<option value='0'#UserFail#>Fail</option>
</select></td>
<td><select id="credits" select name="Credits_Earned">
<option value='0'>0</option>
<option value='1'>1</option>
</select></td>
<td><cfinput type="datefield" name="Test_Date"></td>
</tr>
<tr>
<td><input type = "Submit" value = "Submit" name="Submit"></td>
</tr>
</cfform>
<tr><td colspan="2"><cfif len(strMessage)><div style="position:relative;left:5px; top:2px;padding:10px; background-color:#FFFFFF;width:250px;color:maroon;text-align:right;">
<cfoutput>#strMessage#</cfoutput>
</div>
</cfif></td></tr>
</table>
</div>
</div>
</body>
</html>
component
<cfcomponent>
<cffunction name="getFilms" access="remote" returntype="query" output="false">
<cfargument name="employeeID" type="any" default="0">
<cfset var getAllFilms = "">
<cfquery name="getAllFilms" datasource="librarySQL2008">
SELECT Employees.EmployeeID, Detail.VideoID, VideoList.Video_Name, VideoList.NumTests
FROM Employees
INNER JOIN Detail ON Employees.EmployeeID = Detail.EmployeeID
INNER JOIN VideoList ON Detail.VideoID = VideoList.VideoID
WHERE Employees.EmployeeID = <cfqueryparam value="#val(arguments.EmployeeID)#" cfsqltype="cf_sql_integer">
</cfquery>
<cfreturn getAllFilms>
</cffunction>
</cfcomponent>
<select name="employeeID">
<option value="1">JohnSmith</option>
<option value="2">BobJones</option>
</select>
<cffunction name="getFilms" access="remote" returntype="query" output="false">
<cfargument name="employeeID" type="any" required="false" default="0">
<cfset var getAllFilms = "">
<cflog application="true" text="Selected employeeID [#arguments.employeeID#] at #now()#">
....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/formJBMNew.css" rel="stylesheet" type="text/css" />
<cfif not IsDefined('SESSION.EmployeeID')>
<cflocation url="login.cfm">
</cfif>
<cfset strMessage = "">
<cfparam name="form.employeeID" default="">
<cfquery name="getAllEmployees" datasource="#datasource#">
SELECT Employees.EmployeeID, Employees.Last_name, Employees.First_name, Email
FROM Employees LEFT JOIN
( SELECT EmployeeID, COUNT(*) AS TotalNotCheckedIn
FROM Detail
WHERE out_date IS NOT NULL
AND In_Date IS NULL
GROUP BY EmployeeID
HAVING COUNT(*) > 1
)
mx ON Employees.EmployeeID = mx.EmployeeID
WHERE mx.EmployeeID IS NULL and Role <> '2'
ORDER BY First_Name, Last_Name
</cfquery>
<cfif structKeyExists(FORM, "submitButton")>
<CFSET new_date = #CREATEODBCDATETIME(Out_Date)#>
<cfquery name="enterdetails" datasource="#datasource#">
INSERT INTO Detail (EmployeeID, VideoID, Out_Date)
VALUES
(
<cfqueryparam value="#form.employeeID#" cfsqltype="cf_sql_integer"> ,
<cfqueryparam value="#form.VideoID#" cfsqltype="cf_sql_integer"> ,
<cfqueryparam value="#new_date#" cfsqltype="CF_SQL_TIMESTAMP">
)
</cfquery>
<cfset strMessage = "Video checked out">
<cfquery datasource="#datasource#">
update VideoList
set Availability = '0'
WHERE VideoID = #val(form.VideoID)#
</cfquery>
</cfif>
<cfquery name="getAllFilms" datasource="#datasource#">
SELECT v.VideoID, v.Video_Name, v.Length, v.Production_Company, c.Category_Name, v.Credits, c.Category_ID, v.Availability
FROM Category AS c INNER JOIN
VideoList AS v ON c.Category_ID = v.CategoryID
WHERE (v.VideoID NOT IN
(SELECT VideoID
FROM Detail
WHERE (ISNULL(Watched, 0) = - 1) AND (EmployeeID = '#session.EmployeeID#'))) AND (v.Availability <> 2)
ORDER BY v.VideoID
</cfquery>
<body class="twoColElsLtHdr">
<div id="container">
<div id="header">
<img src="images/USGI_Masthead.gif" />
<!-- end #header -->
</div>
<div id="sidebar1">
<cfif isDefined("SESSION.Role") AND SESSION.Role EQ 0 >
<cfinclude template="sidebar_menuUser.cfm">
<cfelse>
<cfinclude template="sidebar_menuAdmin.cfm">
</cfif>
</div>
<div id="mainContent">
<table class="displayTable">
<caption>Displays employees eligible to check out videos.</caption>
<tr>
<th>Employee</th>
<th>Video</th>
<th>Date</th>
</tr>
<cfform action="videoCheckout.cfm" method="post" format="html">
<tr>
<td>
<cfselect name="employeeID">
<cfoutput query="getAllEmployees">
<option value="#employeeID#">#First_Name##Last_Name#</option>
</cfoutput></cfselect></td>
<td>
<cfselect name="VideoID">
<cfoutput query="getAllFilms">
<option value="#VideoID#">#VideoID# - #Video_Name#</option>
</cfoutput>
</cfselect></td>
<td><cfinput type="datefield" name="Out_Date" required="yes" message="Please enter check-out date"></td></tr>
<tr><td><cfinput type="submit" name="submitButton" value="Submit"></td></tr>
</cfform>
<td colspan="2"><cfif len(strMessage)><div style="position:relative;left:5px; top:2px;padding:10px; background-color:#FFFFFF;width:250px;color:maroon;text-align:right;">
<cfoutput>#strMessage#</cfoutput>
</div>
</cfif></td>
</table>
</div>
</div>
</body>
</html>
"Information","jrpp-33","05/27/11","11:17:34","USGI_VIDEO_LIBRARY","Selected employeeID [145] at {ts '2011-05-27 11:17:34'}"
"Information","jrpp-35","05/27/11","11:55:41","USGI_VIDEO_LIBRARY","Selected employeeID [10] at {ts '2011-05-27 11:55:41'}"
"Information","jrpp-35","05/27/11","11:56:28","USGI_VIDEO_LIBRARY","Selected employeeID [145] at {ts '2011-05-27 11:56:28'}"
<cffunction name="getFilms" access="remote" returntype="query" output="false">
.... etc....
<cfquery ...>
....
</cfquery>
<cflog application="true" text="RecordCount [#getAllFilms.recordCount#] for selected employeeID [#arguments.employeeID#] at #now()#">
<cfreturn getAllFilms>
</cffunction>
</cfcomponent>
<cffunction name="getFilms" access="remote" returntype="query" output="false">
<cfargument name="employeeID" type="any" required="false" default="0">
<cfset var getAllFilms = "">
<cflog application="true" text="Selected employeeID [#arguments.employeeID#] at #now()#">
<cfquery name="getAllFilms" ....> run the query </cfquery>
<cflog application="true" text="RecordCount [#getAllFilms.recordCount#] for selected employeeID [#arguments.employeeID#] at #now()#">
<cfreturn getAllFilms>
</cffunction>
<cflog application="true" text="RecordCount [#getAllFilms.recordCount#] at #now()#">
<cffunction name="getFilms" access="remote" returntype="query" output="false">
<cfargument name="employeeID" type="any" required="false" default="0">
<cfset var getAllFilms = "">
<cflog application="true" text="Selected employeeID [#arguments.employeeID#] at #now()#">
<cfquery name="getAllFilms" ....> run the query </cfquery>
<cflog application="true" text="RecordCount [#getAllFilms.recordCount#] for selected employeeID [#arguments.employeeID#] at #now()#">
<cfreturn getAllFilms>
</cffunction>
"Information","jrpp-38","05/27/11","13:00:03","USGI_VIDEO_LIBRARY","RecordCount [342] for selected employeeID [10] at {ts '2011-05-27 13:00:03'}"
"Information","jrpp-41","05/27/11","14:12:52","USGI_VIDEO_LIBRARY","Selected employeeID [10] at {ts '2011-05-27 14:12:52'}"
"Information","jrpp-41","05/27/11","14:12:52","USGI_VIDEO_LIBRARY","RecordCount [342] for selected employeeID [10] at {ts '2011-05-27 14:12:52'}"
"Information","jrpp-41","05/27/11","14:13:01","USGI_VIDEO_LIBRARY","Selected employeeID [10] at {ts '2011-05-27 14:13:01'}"
"Information","jrpp-41","05/27/11","14:13:01","USGI_VIDEO_LIBRARY","RecordCount [342] for selected employeeID [10] at {ts '2011-05-27 14:13:01'}"
"Information","jrpp-41","05/27/11","14:13:59","USGI_VIDEO_LIBRARY","Selected employeeID [145] at {ts '2011-05-27 14:13:59'}"
"Information","jrpp-41","05/27/11","14:13:59","USGI_VIDEO_LIBRARY","RecordCount [9] for selected employeeID [145] at {ts '2011-05-27 14:13:59'}"
<!--- FAKE query for testing ...--->
<cfquery name="getAllEmployees" datasource="#datasource#">
SELECT 1 AS EmployeeID, 'John' AS First_name, 'Smith' AS Last_Name, 'j1@com.com' AS Email UNION
SELECT 2 AS EmployeeID, 'Bob' AS First_name, 'Jones' AS Last_Name, 'j2@com.com' AS Email
</cfquery>
<body class="twoColElsLtHdr">
<div id="container">
<div id="header">
<img src="images/USGI_Masthead.gif" />
</div>
<div id="sidebar1">
</div>
<div id="mainContent">
<table class="displayTable">
<cfform action="AddTestDetails.cfm" method="post" format="html">
<tr>
<th>Employee</th>
<th>Video</th>
<th>Number of Tests</th>
<th>Score</th>
</tr>
<tr>
<td><select name="employeeID">
<cfoutput query="getAllEmployees">
<option value="#employeeID#">#First_Name##Last_Name#</option>
</cfoutput>
</select>
</td>
<td width="30"> <cfselect name="VideoID"
bind="cfc:MyComponent.getFilms({employeeID})"
value="VideoID" display="Video_Name"
bindOnLoad="true"/>
</td>
<td><cfinput type="text" id="NumTests" name="NumTests" size="5"></td>
<td><cfinput type="text" name="Test_Score" size="5"></td>
</tr>
<tr>
<th>Test Status</th>
<th>Credits</th>
<th>Test Date</th>
</tr>
<tr>
<td><select id="status" select name="Test_Status" onChange="updateCredits(this, 'credits');">
<option value='1'#UserPass#>Passed</option>
<option value='0'#UserFail#>Fail</option>
</select></td>
<td><select id="credits" select name="Credits_Earned">
<option value='0'>0</option>
<option value='1'>1</option>
</select></td>
<td><cfinput type="datefield" name="Test_Date"></td>
</tr>
<tr>
<td><input type = "Submit" value = "Submit" name="Submit"></td>
</tr>
</cfform>
<tr><td colspan="2"><cfif len(strMessage)><div style="position:relative;left:5px; top:2px;padding:10px; background-color:#FFFFFF;width:250px;color:maroon;text-align:right;">
<cfoutput>#strMessage#</cfoutput>
</div>
</cfif></td></tr>
</table>
</div>
</div>
</body>
<cfcomponent>
<cfset datasource = "My Datasource Name Here">
<cffunction name="getFilms" access="remote" returntype="query" output="false">
<cfargument name="employeeID" type="any" required="false" default="0">
<cfset var getAllFilms = "">
<cflog application="true" text="Selected employeeID [#arguments.employeeID#] at #now()#">
<!--- FAKE query for testing ...--->
<cfquery name="getAllFilms" datasource="#datasource#">
SELECT 0 AS EmployeeID, 0 AS VideoID, 'Selected EmployeeID #arguments.employeeID#' AS Video_Name, 0 AS NumTests UNION
SELECT 1 AS EmployeeID, 3 AS VideoID, 'Video 32' AS Video_Name, 0 AS NumTests UNION
SELECT 2 AS EmployeeID, 3 AS VideoID, 'Video 31' AS Video_Name, 0 AS NumTests
</cfquery>
<cflog application="true" text="RecordCount [#getAllFilms.recordCount#] at #now()#">
<cfreturn getAllFilms>
</cffunction>
</cfcomponent>
info:http: CFC invocation response: {"COLUMNS":["EMPLOYEEID","VIDEOID","VIDEO_NAME","NUMTESTS"],"DATA":[]}
window:global: _1d3 is undefined (http://localhost/CFIDE/scripts/ajax/package/cfcalendar.js, line 43)
info:http: HTTP GET /CF_Library_TestSQL/Yourcomponent.cfc?method=getFilms&returnFormat=json&argumentCollection=%7B%22employeeID%22%3Anull%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=2C0237E046853F41B3C576B25A1CF480&_cf_rc=0
info:http: Invoking CFC: /CF_Library_TestSQL/Yourcomponent.cfc , function: getFilms , arguments: {"employeeID":null}
error:bind: Element not found: employeeID
error:bind: Bind failed, element not found: employeeID
info:LogReader: LogReader initialized
info:global: Logger initialized
info:http: CFC invocation response: {"COLUMNS":["EMPLOYEEID","VIDEOID","VIDEO_NAME","NUMTESTS"],"DATA":[[0,0,"Selected EmployeeID null",0],[1,3,"Video 32",0],[2,3,"Video 31",0]]}
window:global: _1d3 is undefined (http://localhost/CFIDE/scripts/ajax/package/cfcalendar.js, line 43)
info:http: HTTP GET /CF_Library_TestSQL/MyComponent.cfc?method=getFilms&returnFormat=json&argumentCollection=%7B%22employeeID%22%3Anull%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=2C0237E046853F41B3C576B25A1CF480&_cf_rc=0
info:http: Invoking CFC: /CF_Library_TestSQL/MyComponent.cfc , function: getFilms , arguments: {"employeeID":null}
error:bind: Element not found: employeeID
error:bind: Bind failed, element not found: employeeID
info:LogReader: LogReader initialized
info:global: Logger initialized
<!-- If index.cfm?logout=1 is clicked then Log The User Out -->
<html>
<head><script type="text/javascript">_cf_loadingtexthtml="<div align='center'><img src='/CFIDE/scripts/ajax/resources/cf/images/loading.gif'/>";
_cf_contextpath="";
_cf_ajaxscriptsrc="/CFIDE/scripts/ajax";
_cf_jsonprefix='//';
_cf_clientid='2C0237E046853F41B3C576B25A1CF480';</script><script type="text/javascript" src="/CFIDE/scripts/ajax/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/yui/dragdrop/dragdrop-min.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/yui/logger/logger-min.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/dump/dump.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/messages/cfmessage.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/package/cfajax.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
<title>Add Video</title>
<link href="css/formJBMNew.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/CFIDE/scripts/ajax/yui/logger/assets/logger.css" />
<style>.yui-log .debug {background-color:brown}
</style>
<script type="text/javascript">
ColdFusion.Ajax.initSelect('VideoID','VIDEOID','VIDEO_NAME');
</script>
<script type="text/javascript">
_cf_bind_init_1306860051204=function()
{
ColdFusion.Bind.register([['employeeID','CFForm_1','change']],{'bindTo':'VideoID','bindToAttr':'value','cfc':'/CF_Library_TestSQL/Yourcomponent.cfc','cfcFunction':'getFilms','bindExpr':[['employeeID','employeeID','CFForm_1','value']]},ColdFusion.Bind.cfcBindHandler,true);
};ColdFusion.Event.registerOnLoad(_cf_bind_init_1306860051204);
</script>
<script type="text/javascript">
<!--
_CF_checkCFForm_1 = function(_CF_this)
{
//reset on submit
_CF_error_exists = false;
_CF_error_messages = new Array();
_CF_error_fields = new Object();
_CF_FirstErrorField = null;
//display error messages and return success
if( _CF_error_exists )
{
if( _CF_error_messages.length > 0 )
{
// show alert() message
_CF_onErrorAlert(_CF_error_messages);
// set focus to first form error, if the field supports js focus().
if( _CF_this[_CF_FirstErrorField].type == "text" )
{ _CF_this[_CF_FirstErrorField].focus(); }
}
return false;
}else {
return true;
}
}
//-->
</script>
</head>
<style>
table.cfdump_wddx,
table.cfdump_xml,
table.cfdump_struct,
table.cfdump_array,
table.cfdump_query,
table.cfdump_cfc,
table.cfdump_object,
table.cfdump_binary,
table.cfdump_udf,
table.cfdump_udfbody,
table.cfdump_udfarguments {
font-size: xx-small;
font-family: verdana, arial, helvetica, sans-serif;
cell-spacing: 2px;
}
table.cfdump_wddx th,
table.cfdump_xml th,
table.cfdump_struct th,
table.cfdump_array th,
table.cfdump_query th,
table.cfdump_cfc th,
table.cfdump_object th,
table.cfdump_binary th,
table.cfdump_udf th,
table.cfdump_udfbody th,
table.cfdump_udfarguments th {
text-align: left;
color: white;
padding: 5px;
}
table.cfdump_wddx td,
table.cfdump_xml td,
table.cfdump_struct td,
table.cfdump_array td,
table.cfdump_query td,
table.cfdump_cfc td,
table.cfdump_object td,
table.cfdump_binary td,
table.cfdump_udf td,
table.cfdump_udfbody td,
table.cfdump_udfarguments td {
padding: 3px;
background-color: #ffffff;
vertical-align : top;
}
table.cfdump_wddx {
background-color: #000000;
}
table.cfdump_wddx th.wddx {
background-color: #444444;
}
table.cfdump_xml {
background-color: #888888;
}
table.cfdump_xml th.xml {
background-color: #aaaaaa;
}
table.cfdump_xml td.xml {
background-color: #dddddd;
}
table.cfdump_struct {
background-color: #0000cc ;
}
table.cfdump_struct th.struct {
background-color: #4444cc ;
}
table.cfdump_struct td.struct {
background-color: #ccddff;
}
table.cfdump_array {
background-color: #006600 ;
}
table.cfdump_array th.array {
background-color: #009900 ;
}
table.cfdump_array td.array {
background-color: #ccffcc ;
}
table.cfdump_query {
background-color: #884488 ;
}
table.cfdump_query th.query {
background-color: #aa66aa ;
}
table.cfdump_query td.query {
background-color: #ffddff ;
}
table.cfdump_cfc {
background-color: #ff0000;
}
table.cfdump_cfc th.cfc{
background-color: #ff4444;
}
table.cfdump_cfc td.cfc {
background-color: #ffcccc;
}
table.cfdump_object {
background-color : #ff0000;
}
table.cfdump_object th.object{
background-color: #ff4444;
}
table.cfdump_binary {
background-color : #eebb00;
}
table.cfdump_binary th.binary {
background-color: #ffcc44;
}
table.cfdump_binary td {
font-size: x-small;
}
table.cfdump_udf {
background-color: #aa4400;
}
table.cfdump_udf th.udf {
background-color: #cc6600;
}
table.cfdump_udfarguments {
background-color: #dddddd;
cell-spacing: 3;
}
table.cfdump_udfarguments th {
background-color: #eeeeee;
color: #000000;
}
</style> <script language="javascript">
// for queries we have more than one td element to collapse/expand
var expand = "open";
dump = function( obj ) {
var out = "" ;
if ( typeof obj == "object" ) {
for ( key in obj ) {
if ( typeof obj[key] != "function" ) out += key + ': ' + obj[key] + '<br>' ;
}
}
}
cfdump_toggleRow = function(source) {
//target is the right cell
if(document.all) target = source.parentElement.cells[1];
else {
var element = null;
var vLen = source.parentNode.childNodes.length;
for(var i=vLen-1;i>0;i--){
if(source.parentNode.childNodes[i].nodeType == 1){
element = source.parentNode.childNodes[i];
break;
}
}
if(element == null)
target = source.parentNode.lastChild;
else
target = element;
}
//target = source.parentNode.lastChild ;
cfdump_toggleTarget( target, cfdump_toggleSource( source ) ) ;
}
cfdump_toggleXmlDoc = function(source) {
var caption = source.innerHTML.split( ' [' ) ;
// toggle source (header)
if ( source.style.fontStyle == 'italic' ) {
// closed -> short
source.style.fontStyle = 'normal' ;
source.innerHTML = caption[0] + ' [short version]' ;
source.title = 'click to maximize' ;
switchLongToState = 'closed' ;
switchShortToState = 'open' ;
} else if ( source.innerHTML.indexOf('[short version]') != -1 ) {
// short -> full
source.innerHTML = caption[0] + ' [long version]' ;
source.title = 'click to collapse' ;
switchLongToState = 'open' ;
switchShortToState = 'closed' ;
} else {
// full -> closed
source.style.fontStyle = 'italic' ;
source.title = 'click to expand' ;
source.innerHTML = caption[0] ;
switchLongToState = 'closed' ;
switchShortToState = 'closed' ;
}
// Toggle the target (everething below the header row).
// First two rows are XMLComment and XMLRoot - they are part
// of the long dump, the rest are direct children - part of the
// short dump
if(document.all) {
var table = source.parentElement.parentElement ;
for ( var i = 1; i < table.rows.length; i++ ) {
target = table.rows[i] ;
if ( i < 3 ) cfdump_toggleTarget( target, switchLongToState ) ;
else cfdump_toggleTarget( target, switchShortToState ) ;
}
}
else {
var table = source.parentNode.parentNode ;
var row = 1;
for ( var i = 1; i < table.childNodes.length; i++ ) {
target = table.childNodes[i] ;
if( target.style ) {
if ( row < 3 ) {
cfdump_toggleTarget( target, switchLongToState ) ;
} else {
cfdump_toggleTarget( target, switchShortToState ) ;
}
row++;
}
}
}
}
cfdump_toggleTable = function(source) {
var switchToState = cfdump_toggleSource( source ) ;
if(document.all) {
var table = source.parentElement.parentElement ;
for ( var i = 1; i < table.rows.length; i++ ) {
target = table.rows[i] ;
cfdump_toggleTarget( target, switchToState ) ;
}
}
else {
var table = source.parentNode.parentNode ;
for ( var i = 1; i < table.childNodes.length; i++ ) {
target = table.childNodes[i] ;
if(target.style) {
cfdump_toggleTarget( target, switchToState ) ;
}
}
}
}
cfdump_toggleSource = function( source ) {
if ( source.style.fontStyle == 'italic' || source.style.fontStyle == null) {
source.style.fontStyle = 'normal' ;
source.title = 'click to collapse' ;
return 'open' ;
} else {
source.style.fontStyle = 'italic' ;
source.title = 'click to expand' ;
return 'closed' ;
}
}
cfdump_toggleTarget = function( target, switchToState ) {
if ( switchToState == 'open' ) target.style.display = '' ;
else target.style.display = 'none' ;
}
// collapse all td elements for queries
cfdump_toggleRow_qry = function(source) {
expand = (source.title == "click to collapse") ? "closed" : "open";
if(document.all) {
var nbrChildren = source.parentElement.cells.length;
if(nbrChildren > 1){
for(i=nbrChildren-1;i>0;i--){
target = source.parentElement.cells[i];
cfdump_toggleTarget( target,expand ) ;
cfdump_toggleSource_qry(source);
}
}
else {
//target is the right cell
target = source.parentElement.cells[1];
cfdump_toggleTarget( target, cfdump_toggleSource( source ) ) ;
}
}
else{
var target = null;
var vLen = source.parentNode.childNodes.length;
for(var i=vLen-1;i>1;i--){
if(source.parentNode.childNodes[i].nodeType == 1){
target = source.parentNode.childNodes[i];
cfdump_toggleTarget( target,expand );
cfdump_toggleSource_qry(source);
}
}
if(target == null){
//target is the last cell
target = source.parentNode.lastChild;
cfdump_toggleTarget( target, cfdump_toggleSource( source ) ) ;
}
}
}
cfdump_toggleSource_qry = function(source) {
if(expand == "closed"){
source.title = "click to expand";
source.style.fontStyle = "italic";
}
else{
source.title = "click to collapse";
source.style.fontStyle = "normal";
}
}
</script>
<table class="cfdump_struct">
<tr><th class="struct" colspan="2" onClick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">struct [empty]</th></tr>
</table>
<body class="twoColElsLtHdr">
<div id="container">
<div id="header">
<img src="images/USGI_Masthead.gif" />
</div>
<div id="sidebar1">
<table class="displayTable">
<tr><td><a href="Profile.cfm">Home</a></td>
</tr>
<tr>
<td><a href="VideoList.cfm">Videos Available</a></td>
</tr>
<tr>
<td><a href="BorrowedVideo.cfm">Videos Borrowed</a></td>
</tr>
<tr>
<td><a href="WatchedVideo.cfm">Videos Watched</a></td>
</tr>
<tr>
<td><a href="TestRecord.cfm">Test Records</a></td>
</tr>
<tr>
<td><a href="VideoPopularityList.cfm">Popularity Ranking</a></td>
</tr>
<tr>
<td><a href="Login.cfm">Log Off</a></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Admin Section</td>
</tr>
<tr>
<td><a href="VideoCheckout.cfm">Checkout Video</a></td>
</tr>
<tr>
<td><a href="CheckinDetail.cfm">Return Video</a></td>
<tr>
<td><a href="AddTestDetails.cfm">Post Score</a></td>
</tr>
<tr>
<td><a href="TestResults.cfm">Team Member<br />Profiles</a></td>
</tr>
<tr>
<td><a href="Outstanding.cfm">Outstanding List</a></td>
</tr>
<tr>
<td><a href="OverdueVideo.cfm">Overdue List</a></td>
</tr>
<tr>
<td><a href="Admin.cfm">Open Account</a></td>
</tr>
<tr>
<td><a href="Admin.cfm">Edit Account</a></td>
</tr>
<tr>
<td><a href="Admin.cfm">Inactivate<br />
Account</a></td>
</tr>
<tr>
<td><a href="AddVideo.cfm">Add Video</a></td>
</tr>
</table>
</div>
<div id="mainContent">
<table class="displayTable">
<form name="CFForm_1" id="CFForm_1" action="AddTestDetails.cfm" method="post" onsubmit="return _CF_checkCFForm_1(this)">
<tr>
<th>Employee</th>
<th>Video</th>
<th>Number of Tests</th>
<th>Score</th>
</tr>
<tr>
<td><select name="employeeID">
<option value="10">Abram Uballe </option>
<option value="5">Alizon Kiel </option>
<option value="1">Amy Gomez </option>
<option value="32">Anisa Shariff </option>
<option value="149">BarneyRubble</option>
<option value="81">Bernard Austin </option>
<option value="74">Brian Hicks </option>
<option value="112">Bridgette Hurley </option>
<option value="80">Catherine Rademacher </option>
<option value="111">Chris Segler </option>
<option value="30">Christina Cabanilla </option>
<option value="54">Cindy Castillo </option>
<option value="140">Danny Bennett </option>
<option value="28">David Coolbaugh </option>
<option value="130">Desiree Tovar </option>
<option value="21">Eileen OBrien </option>
<option value="150">EricKline</option>
<option value="79">Evan Smith </option>
<option value="61">Frank Holmes </option>
<option value="119">Gina Gonzales </option>
<option value="124">Glenn Grimes </option>
<option value="138">Herb Henion </option>
<option value="73">Hing Quan </option>
<option value="24">Jack Dzierwa </option>
<option value="109">Jeff Marks </option>
<option value="122">Jeffrey Gershon </option>
<option value="98">Jennifer Alberding </option>
<option value="144">Jim Love </option>
<option value="4">Joan Love </option>
<option value="132">Joanna Sawicka </option>
<option value="55">John Derrick </option>
<option value="145">John MacLean </option>
<option value="84">Josh Holmes </option>
<option value="58">June Falks </option>
<option value="72">Kathleen Somerville </option>
<option value="14">Kathryn Narvaez </option>
<option value="121">Kathy George </option>
<option value="29">Keith Carlson </option>
<option value="96">Kelly Niland </option>
<option value="146">Kemper Dotson </option>
<option value="22">Kristine Thomas </option>
<option value="23">Laurie Richoux </option>
<option value="18">Lidia Salzano </option>
<option value="67">Lisa Aston </option>
<option value="12">Lisa Callicotte </option>
<option value="31">Luis Gonzalez </option>
<option value="104">Mac Dee Fisher </option>
<option value="70">Marilyn Timme </option>
<option value="147">Mario Diaz </option>
<option value="120">Mark Carter </option>
<option value="68">Martha Rossington </option>
<option value="115">Mary Ann Hernandez </option>
<option value="36">Matthew Earle </option>
<option value="114">Max Porterfield </option>
<option value="34">Megan Vichich </option>
<option value="91">Melissa Ramos </option>
<option value="25">Michael Ding </option>
<option value="148">Michael Matousek </option>
<option value="110">Michael Nasto </option>
<option value="26">Michael Shotwell </option>
<option value="69">Mickey Salinas </option>
<option value="41">Mike Rico </option>
<option value="113">Nancy Reed </option>
<option value="20">Neal Lanzini </option>
<option value="100">Nick Paveglio </option>
<option value="78">Nigel Holmes </option>
<option value="57">Norma Fagan </option>
<option value="66">Patricia Merced </option>
<option value="62">Phyllis Jonas </option>
<option value="52">Ralph Aldis </option>
<option value="43">Rebekah Bonebreak </option>
<option value="83">Regina Gonzales </option>
<option value="86">Rick Thompson </option>
<option value="51">Rose Martinez </option>
<option value="38">Rosie Garcia </option>
<option value="39">Ryan Cantu </option>
<option value="2">Ryan George </option>
<option value="127">Sandra Romero </option>
<option value="85">Scott Jenkins </option>
<option value="106">Sheila Matthys </option>
<option value="128">Susan Filyk </option>
<option value="65">Susan McGee </option>
<option value="137">Tana Lawrence </option>
<option value="37">Tanveer Shergill </option>
<option value="125">Terri Knaus </option>
<option value="27">Tim Steinle </option>
<option value="11">Tracy Rios </option>
<option value="6">Valerie Williams </option>
<option value="76">Xian Liang </option>
</select></td>
<td width="30"> <select name="VideoID" id="VideoID">
</select>
</td>
<td><input name="NumTests" type="text" size="5" id="NumTests" /></td>
<td><input name="Test_Score" id="Test_Score" type="text" size="5" /></td>
</tr>
<tr>
<th>Test Status</th>
<th>Credits</th>
<th>Test Date</th>
</tr>
<tr>
<td><select id="status" select name="Test_Status" onChange="updateCredits(this, 'credits');">
<option value='1'#UserPass#>Passed</option>
<option value='0'#UserFail#>Fail</option>
</select></td>
<td><select id="credits" select name="Credits_Earned">
<option value='0'>0</option>
<option value='1'>1</option>
</select></td>
</tr>
<tr>
<td><input type = "Submit" value = "Submit" name="Submit"></td>
</tr>
</form>
<tr><td colspan="2"></td></tr>
</table>
</div>
</div>
</body>
</html>
</td></td></td></th></th></th></tr></tr></tr></table></table></table></a></abbrev></acronym></address></applet></au></b></banner></big></blink></blockquote></bq></caption></center></cite></code></comment></del></dfn></dir></div></div></dl></em></fig></fn></font></form></frame></frameset></h1></h2></h3></h4></h5></h6></head></i></ins></kbd></listing></map></marquee></menu></multicol></nobr></noframes></noscript></note></ol></p></param></person></plaintext></pre></q></s></samp></script></select></small></strike></strong></sub></sup></table></td></textarea></th></title></tr></tt></u></ul></var></wbr></xmp>
<style type="text/css">
.cfdebug
{
color:black;
background-color:white;
font-family:"Times New Roman", Times, serif;
font-size:small
}
.cfdebuglge
{
color:black;
background-color:white;
font-family:"Times New Roman", Times, serif;
font-size:medium;
}
a.cfdebuglink {color:blue; background-color:white }
</style>
<table class="cfdebug" bgcolor="white">
<tr>
<td>
<p class="cfdebug"><hr/>
<b class="cfdebuglge"><a name="cfdebug_top">Debugging Information</a></b>
<table class="cfdebug">
<tr>
<td class="cfdebug" nowrap>ColdFusion Server Developer</td>
<td class="cfdebug">8,0,0,176276</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Template </td>
<td class="cfdebug">/CF_Library_TestSQL/AddTestDetails.cfm</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Time Stamp </td>
<td class="cfdebug">31-May-11 11:40 AM</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Locale </td>
<td class="cfdebug">English (US)</td>
</tr>
<tr>
<td class="cfdebug" nowrap> User Agent </td>
<td class="cfdebug">Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Remote IP </td>
<td class="cfdebug">127.0.0.1</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Host Name </td>
<td class="cfdebug">127.0.0.1</td>
</tr>
</table>
</p>
<style type="text/css">
.template
{ color: black;
font-family: "Times New Roman", Times, serif;
font-weight: normal; }
.template_overage
{ color: red;
background-color: white;
font-family: "Times New Roman", Times, serif;
font-weight: bold; }
</style>
<p class="cfdebug"><hr/><b class="cfdebuglge"><a name="cfdebug_execution">Execution Time</a></b></p>
<a name="cfdebug_templates">
<table border="1" cellpadding="2" cellspacing="0" class="cfdebug">
<tr>
<td class="cfdebug" align="center"><b>Total Time</b></td>
<td class="cfdebug" align="center"><b>Avg Time</b></td>
<td class="cfdebug" align="center"><b>Count</b></td>
<td class="cfdebug"><b>Template</b></td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap>31 ms</td>
<td align="right" class="cfdebug" nowrap>31 ms</td>
<td align="center" class="cfdebug" nowrap>1</td>
<td align="left" class="cfdebug" nowrap><img src='/CFIDE/debug/images/topdoc.gif' alt='top level' border='0'> <b>C:\Inetpub\wwwroot\CF_Library_TestSQL\AddTestDetails.cfm</b></td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap>0 ms</td>
<td align="right" class="cfdebug" nowrap>0 ms</td>
<td align="center" class="cfdebug" nowrap>1</td>
<td align="left" class="cfdebug" nowrap>C:\Inetpub\wwwroot\CF_Library_TestSQL\Application.cfm</td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap>0 ms</td>
<td align="right" class="cfdebug" nowrap>0 ms</td>
<td align="center" class="cfdebug" nowrap>1</td>
<td align="left" class="cfdebug" nowrap>C:\Inetpub\wwwroot\CF_Library_TestSQL\sidebar_menuAdmin.cfm</td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap><i>0 ms</i></td><td colspan=2> </td>
<td align="left" class="cfdebug"><i>STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN</i></td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap><i>31 ms</i></td><td colspan=2> </td>
<td align="left" class="cfdebug"><i>TOTAL EXECUTION TIME</i></td>
</tr>
</table>
<font color="red"><span class="template_overage">red = over 250 ms average execution time</span></font>
</a>
<p class="cfdebug"><hr/><b class="cfdebuglge"><a name="cfdebug_sql">SQL Queries</a></b></p>
<code><b>getAllEmployees</b> (Datasource=librarySQL2008, Time=0ms, Records=89) in C:\Inetpub\wwwroot\CF_Library_TestSQL\AddTestDetails.cfm @ 11:40:51.051</code><br />
<pre>
SELECT EmployeeID, First_Name, Last_Name, Email
FROM Employees
WHERE Role < '2'
ORDER BY First_Name, Last_Name
</pre>
<p class="cfdebug"><hr/><b class="cfdebuglge"><a name="cfdebug_scopevars">Scope Variables</a></b></p>
<pre><b>Application Variables:</b>
applicationname=USGI_Video_Library
</pre>
<pre><b>CGI Variables:</b>
AUTH_PASSWORD=
AUTH_TYPE=
AUTH_USER=
CERT_COOKIE=
CERT_FLAGS=
CERT_ISSUER=
CERT_KEYSIZE=
CERT_SECRETKEYSIZE=
CERT_SERIALNUMBER=
CERT_SERVER_ISSUER=
CERT_SERVER_SUBJECT=
CERT_SUBJECT=
CF_TEMPLATE_PATH=C:\Inetpub\wwwroot\CF_Library_TestSQL\AddTestDetails.cfm
CONTENT_LENGTH=
CONTENT_TYPE=
CONTEXT_PATH=
GATEWAY_INTERFACE=CGI/1.1
HTTPS=off
HTTPS_KEYSIZE=
HTTPS_SECRETKEYSIZE=
HTTPS_SERVER_ISSUER=
HTTPS_SERVER_SUBJECT=
HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5
HTTP_CONNECTION=keep-alive
HTTP_COOKIE=CFID=14304; CFTOKEN=78704273; USERID=; USERHASH=; ORIGINALURLTOKEN=48186AF3%2D9650%2D45F1%2D90784B5C3A986A93; MOBILEFORMAT=false; RB=en; __utma=111872281.382149402.1304001793.1304001793.1304004590.2; __utmz=111872281.1304001793.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); JSESSIONID=f0305f914eb43aa3537950c692567571eeb1; CFAUTHORIZATION_USGI_Video_Library=am1hY2xlYW46amFrY2FsNDI6VVNHSV9WaWRlb19MaWJyYXJ5
HTTP_HOST=localhost
HTTP_REFERER=
HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
PATH_INFO=/CF_Library_TestSQL/AddTestDetails.cfm
PATH_TRANSLATED=C:\Inetpub\wwwroot\CF_Library_TestSQL\AddTestDetails.cfm
QUERY_STRING=cfdebug
REMOTE_ADDR=127.0.0.1
REMOTE_HOST=127.0.0.1
REMOTE_USER=
REQUEST_METHOD=GET
SCRIPT_NAME=/CF_Library_TestSQL/AddTestDetails.cfm
SERVER_NAME=localhost
SERVER_PORT=80
SERVER_PORT_SECURE=0
SERVER_PROTOCOL=HTTP/1.1
SERVER_SOFTWARE=Microsoft-IIS/5.1
WEB_SERVER_API=
</pre>
<pre><b>Cookie Variables:</b>
CFAUTHORIZATION_USGI_Video_Library=am1hY2xlYW46amFrY2FsNDI6VVNHSV9WaWRlb19MaWJyYXJ5
CFID=14304
CFTOKEN=78704273
JSESSIONID=f0305f914eb43aa3537950c692567571eeb1
MOBILEFORMAT=false
ORIGINALURLTOKEN=48186AF3-9650-45F1-90784B5C3A986A93
RB=en
USERHASH=
USERID=
__utma=111872281.382149402.1304001793.1304001793.1304004590.2
__utmz=111872281.1304001793.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)
</pre>
<pre><b>Form Fields:</b>
EMPLOYEEID=
</pre>
<pre><b>Request Parameters:</b>
cfdumpinited=false
</pre>
<pre><b>Server Variables:</b>
COLDFUSION=Struct (8)
OS=Struct (5)
</pre>
<pre><b>Session Variables:</b>
employeeid=145
loggedin=Yes
role=1
sessionid=f0305f914eb43aa3537950c692567571eeb1
urltoken=CFID=14304&CFTOKEN=78704273&jsessionid=f0305f914eb43aa3537950c692567571eeb1
</pre>
<pre><b>URL Parameters:</b>
CFDEBUG=
</pre>
<font size="-1" class="cfdebug"><i>Debug Rendering Time: 32 ms</i></font><br />
</td>
</tr>
</table>
<script type="text/javascript">_cf_loadingtexthtml="<div align='center'><img src='/CFIDE/scripts/ajax/resources/cf/images/loading.gif'/>";
_cf_contextpath="";
_cf_ajaxscriptsrc="/CFIDE/scripts/ajax";
_cf_jsonprefix='//';
_cf_clientid='2C0237E046853F41B3C576B25A1CF480';</script><script type="text/javascript" src="/CFIDE/scripts/ajax/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/yui/dragdrop/dragdrop-min.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/yui/logger/logger-min.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/dump/dump.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/messages/cfmessage.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/package/cfajax.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
<link rel="stylesheet" type="text/css" href="/CFIDE/scripts/ajax/yui/logger/assets/logger.css" />
<style>.yui-log .debug {background-color:brown}
</style>
<script type="text/javascript">
ColdFusion.Ajax.initSelect('VideoID','VIDEOID','VIDEO_NAME');
</script>
<script type="text/javascript">
_cf_bind_init_1306861094664=function()
{
ColdFusion.Bind.register([['employeeID','CFForm_1','change']],{'bindTo':'VideoID','bindToAttr':'value','cfc':'/CF_Library_TestSQL/MyComponent.cfc','cfcFunction':'getFilms','bindExpr':[['employeeID','employeeID','CFForm_1','value']]},ColdFusion.Bind.cfcBindHandler,true);
};ColdFusion.Event.registerOnLoad(_cf_bind_init_1306861094664);
</script>
<script type="text/javascript">
<!--
_CF_checkCFForm_1 = function(_CF_this)
{
//reset on submit
_CF_error_exists = false;
_CF_error_messages = new Array();
_CF_error_fields = new Object();
_CF_FirstErrorField = null;
//display error messages and return success
if( _CF_error_exists )
{
if( _CF_error_messages.length > 0 )
{
// show alert() message
_CF_onErrorAlert(_CF_error_messages);
// set focus to first form error, if the field supports js focus().
if( _CF_this[_CF_FirstErrorField].type == "text" )
{ _CF_this[_CF_FirstErrorField].focus(); }
}
return false;
}else {
return true;
}
}
//-->
</script>
<!-- If index.cfm?logout=1 is clicked then Log The User Out -->
<body class="twoColElsLtHdr">
<div id="container">
<div id="header">
<img src="images/USGI_Masthead.gif" />
</div>
<div id="sidebar1">
</div>
<div id="mainContent">
<table class="displayTable">
<form name="CFForm_1" id="CFForm_1" action="AddTestDetails.cfm" method="post" onsubmit="return _CF_checkCFForm_1(this)">
<tr>
<th>Employee</th>
<th>Video</th>
<th>Number of Tests</th>
<th>Score</th>
</tr>
<tr>
<td><select name="employeeID">
<option value="1">JohnSmith</option>
<option value="2">BobJones</option>
</select>
</td>
<td width="30"> <select name="VideoID" id="VideoID">
</select>
</td>
<td><input name="NumTests" type="text" size="5" id="NumTests" /></td>
<td><input name="Test_Score" id="Test_Score" type="text" size="5" /></td>
</tr>
<tr>
<th>Test Status</th>
<th>Credits</th>
<th>Test Date</th>
</tr>
<tr>
<td><select id="status" select name="Test_Status" onChange="updateCredits(this, 'credits');">
<option value='1'#UserPass#>Passed</option>
<option value='0'#UserFail#>Fail</option>
</select></td>
<td><select id="credits" select name="Credits_Earned">
<option value='0'>0</option>
<option value='1'>1</option>
</select></td>
</tr>
<tr>
<td><input type = "Submit" value = "Submit" name="Submit"></td>
</tr>
</form>
</div>
</td></tr>
</table>
</div>
</div>
</body>
</td></td></td></th></th></th></tr></tr></tr></table></table></table></a></abbrev></acronym></address></applet></au></b></banner></big></blink></blockquote></bq></caption></center></cite></code></comment></del></dfn></dir></div></div></dl></em></fig></fn></font></form></frame></frameset></h1></h2></h3></h4></h5></h6></head></i></ins></kbd></listing></map></marquee></menu></multicol></nobr></noframes></noscript></note></ol></p></param></person></plaintext></pre></q></s></samp></script></select></small></strike></strong></sub></sup></table></td></textarea></th></title></tr></tt></u></ul></var></wbr></xmp>
<style type="text/css">
.cfdebug
{
color:black;
background-color:white;
font-family:"Times New Roman", Times, serif;
font-size:small
}
.cfdebuglge
{
color:black;
background-color:white;
font-family:"Times New Roman", Times, serif;
font-size:medium;
}
a.cfdebuglink {color:blue; background-color:white }
</style>
<table class="cfdebug" bgcolor="white">
<tr>
<td>
<p class="cfdebug"><hr/>
<b class="cfdebuglge"><a name="cfdebug_top">Debugging Information</a></b>
<table class="cfdebug">
<tr>
<td class="cfdebug" nowrap>ColdFusion Server Developer</td>
<td class="cfdebug">8,0,0,176276</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Template </td>
<td class="cfdebug">/CF_Library_TestSQL/agxtest.cfm</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Time Stamp </td>
<td class="cfdebug">31-May-11 11:58 AM</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Locale </td>
<td class="cfdebug">English (US)</td>
</tr>
<tr>
<td class="cfdebug" nowrap> User Agent </td>
<td class="cfdebug">Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Remote IP </td>
<td class="cfdebug">127.0.0.1</td>
</tr>
<tr>
<td class="cfdebug" nowrap> Host Name </td>
<td class="cfdebug">127.0.0.1</td>
</tr>
</table>
</p>
<style type="text/css">
.template
{ color: black;
font-family: "Times New Roman", Times, serif;
font-weight: normal; }
.template_overage
{ color: red;
background-color: white;
font-family: "Times New Roman", Times, serif;
font-weight: bold; }
</style>
<p class="cfdebug"><hr/><b class="cfdebuglge"><a name="cfdebug_execution">Execution Time</a></b></p>
<a name="cfdebug_templates">
<table border="1" cellpadding="2" cellspacing="0" class="cfdebug">
<tr>
<td class="cfdebug" align="center"><b>Total Time</b></td>
<td class="cfdebug" align="center"><b>Avg Time</b></td>
<td class="cfdebug" align="center"><b>Count</b></td>
<td class="cfdebug"><b>Template</b></td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap>0 ms</td>
<td align="right" class="cfdebug" nowrap>0 ms</td>
<td align="center" class="cfdebug" nowrap>1</td>
<td align="left" class="cfdebug" nowrap><img src='/CFIDE/debug/images/topdoc.gif' alt='top level' border='0'> <b>C:\Inetpub\wwwroot\CF_Library_TestSQL\AGXTEST.cfm</b></td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap>0 ms</td>
<td align="right" class="cfdebug" nowrap>0 ms</td>
<td align="center" class="cfdebug" nowrap>1</td>
<td align="left" class="cfdebug" nowrap>C:\Inetpub\wwwroot\CF_Library_TestSQL\Application.cfm</td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap><i>16 ms</i></td><td colspan=2> </td>
<td align="left" class="cfdebug"><i>STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN</i></td>
</tr>
<tr>
<td align="right" class="cfdebug" nowrap><i>16 ms</i></td><td colspan=2> </td>
<td align="left" class="cfdebug"><i>TOTAL EXECUTION TIME</i></td>
</tr>
</table>
<font color="red"><span class="template_overage">red = over 250 ms average execution time</span></font>
</a>
<p class="cfdebug"><hr/><b class="cfdebuglge"><a name="cfdebug_sql">SQL Queries</a></b></p>
<code><b>getAllEmployees</b> (Datasource=librarySQL2008, Time=0ms, Records=2) in C:\Inetpub\wwwroot\CF_Library_TestSQL\AGXTEST.cfm @ 11:58:14.014</code><br />
<pre>
SELECT 1 AS EmployeeID, 'John' AS First_name, 'Smith' AS Last_Name, 'j1@com.com' AS Email UNION
SELECT 2 AS EmployeeID, 'Bob' AS First_name, 'Jones' AS Last_Name, 'j2@com.com' AS Email
</pre>
<p class="cfdebug"><hr/><b class="cfdebuglge"><a name="cfdebug_scopevars">Scope Variables</a></b></p>
<pre><b>Application Variables:</b>
applicationname=USGI_Video_Library
</pre>
<pre><b>CGI Variables:</b>
AUTH_PASSWORD=
AUTH_TYPE=
AUTH_USER=
CERT_COOKIE=
CERT_FLAGS=
CERT_ISSUER=
CERT_KEYSIZE=
CERT_SECRETKEYSIZE=
CERT_SERIALNUMBER=
CERT_SERVER_ISSUER=
CERT_SERVER_SUBJECT=
CERT_SUBJECT=
CF_TEMPLATE_PATH=C:\Inetpub\wwwroot\CF_Library_TestSQL\AGXTEST.cfm
CONTENT_LENGTH=
CONTENT_TYPE=
CONTEXT_PATH=
GATEWAY_INTERFACE=CGI/1.1
HTTPS=off
HTTPS_KEYSIZE=
HTTPS_SECRETKEYSIZE=
HTTPS_SERVER_ISSUER=
HTTPS_SERVER_SUBJECT=
HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5
HTTP_CONNECTION=keep-alive
HTTP_COOKIE=CFID=14304; CFTOKEN=78704273; USERID=; USERHASH=; ORIGINALURLTOKEN=48186AF3%2D9650%2D45F1%2D90784B5C3A986A93; MOBILEFORMAT=false; RB=en; __utma=111872281.382149402.1304001793.1304001793.1304004590.2; __utmz=111872281.1304001793.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); JSESSIONID=f0305f914eb43aa3537950c692567571eeb1; CFAUTHORIZATION_USGI_Video_Library=am1hY2xlYW46amFrY2FsNDI6VVNHSV9WaWRlb19MaWJyYXJ5
HTTP_HOST=localhost
HTTP_REFERER=
HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
PATH_INFO=/CF_Library_TestSQL/agxtest.cfm
PATH_TRANSLATED=C:\Inetpub\wwwroot\CF_Library_TestSQL\AGXTEST.cfm
QUERY_STRING=cfdebug
REMOTE_ADDR=127.0.0.1
REMOTE_HOST=127.0.0.1
REMOTE_USER=
REQUEST_METHOD=GET
SCRIPT_NAME=/CF_Library_TestSQL/agxtest.cfm
SERVER_NAME=localhost
SERVER_PORT=80
SERVER_PORT_SECURE=0
SERVER_PROTOCOL=HTTP/1.1
SERVER_SOFTWARE=Microsoft-IIS/5.1
WEB_SERVER_API=
</pre>
<pre><b>Cookie Variables:</b>
CFAUTHORIZATION_USGI_Video_Library=am1hY2xlYW46amFrY2FsNDI6VVNHSV9WaWRlb19MaWJyYXJ5
CFID=14304
CFTOKEN=78704273
JSESSIONID=f0305f914eb43aa3537950c692567571eeb1
MOBILEFORMAT=false
ORIGINALURLTOKEN=48186AF3-9650-45F1-90784B5C3A986A93
RB=en
USERHASH=
USERID=
__utma=111872281.382149402.1304001793.1304001793.1304004590.2
__utmz=111872281.1304001793.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)
</pre>
<pre><b>Server Variables:</b>
COLDFUSION=Struct (8)
OS=Struct (5)
</pre>
<pre><b>Session Variables:</b>
employeeid=145
loggedin=Yes
role=1
sessionid=f0305f914eb43aa3537950c692567571eeb1
urltoken=CFID=14304&CFTOKEN=78704273&jsessionid=f0305f914eb43aa3537950c692567571eeb1
</pre>
<pre><b>URL Parameters:</b>
CFDEBUG=
</pre>
<font size="-1" class="cfdebug"><i>Debug Rendering Time: 16 ms</i></font><br />
</td>
</tr>
</table>
SELECT Employees.EmployeeID, Employees.Last_name, Employees.First_name, Email
FROM Employees LEFT JOIN
( SELECT EmployeeID, COUNT(*) AS TotalNotCheckedIn
FROM Detail
WHERE out_date IS NOT NULL
AND In_Date IS NULL
GROUP BY EmployeeID
HAVING COUNT(*) > 1
)
mx ON Employees.EmployeeID = mx.EmployeeID
WHERE mx.EmployeeID IS NULL and Role <> '2'
ORDER BY First_Name, Last_Name
<cfset datasource = "YourDatasource">
<html>
<head>
<cfquery name="getAllEmployees" datasource="#datasource#">
SELECT 1 AS EmployeeID, 'John' AS First_name, 'Smith' AS Last_Name, 'j1@com.com' AS Email UNION
SELECT 2 AS EmployeeID, 'Bob' AS First_name, 'Jones' AS Last_Name, 'j2@com.com' AS Email
</cfquery>
</head>
<body>
<cfform action="AddTestDetails.cfm" method="post" format="html">
<table class="displayTable">
<tr>
<th>Employee</th>
<th>Video</th>
<th>Number of Tests</th>
<th>Score</th>
</tr>
<tr>
<td><cfselect name="employeeID">
<cfoutput query="getAllEmployees">
<option value="#employeeID#">#First_Name##Last_Name#</option>
</cfoutput>
</cfselect>
</td>
<td width="30"> <cfselect name="VideoID"
bind="cfc:MyComponent.getFilms({employeeID})"
value="VideoID" display="Video_Name"
bindOnLoad="true"/>
</td>
<td><cfinput type="text" id="NumTests" name="NumTests" size="5"></td>
<td><cfinput type="text" name="Test_Score" size="5"></td>
</tr>
<tr>
<th>Test Status</th>
<th>Credits</th>
<th>Test Date</th>
</tr>
<tr>
<td><select id="status" select name="Test_Status" onChange="updateCredits(this, 'credits');">
<option value='1'#UserPass#>Passed</option>
<option value='0'#UserFail#>Fail</option>
</select></td>
<td><select id="credits" select name="Credits_Earned">
<option value='0'>0</option>
<option value='1'>1</option>
</select></td>
<td><cfinput type="datefield" name="Test_Date"></td>
</tr>
<tr>
<td><input type = "Submit" value = "Submit" name="Submit"></td>
</tr>
</table>
</cfform>
</body>
</html>
ColdFusion AJAX Logger
info:http: CFC invocation response: {"COLUMNS":["EMPLOYEEID","VIDEOID","VIDEO_NAME","NUMTESTS"],"DATA":[[0,0,"Selected EmployeeID 1",0],[1,3,"Video 32",0],[2,3,"Video 31",0]]}
info:http: HTTP GET /CF_Library_TestSQL/MyComponent.cfc?method=getFilms&returnFormat=json&argumentCollection=%7B%22employeeID%22%3A%221%22%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=2C0237E046853F41B3C576B25A1CF480&_cf_rc=0
info:http: Invoking CFC: /CF_Library_TestSQL/MyComponent.cfc , function: getFilms , arguments: {"employeeID":"1"}
info:LogReader: LogReader initialized
info:global: Logger initialized
info:http: CFC invocation response: {"COLUMNS":["EMPLOYEEID","VIDEOID","VIDEO_NAME","NUMTESTS"],"DATA":[[0,0,"Selected EmployeeID 1",0],[1,3,"Video 32",0],[2,3,"Video 31",0]]}
info:http: HTTP GET /test/MyComponent.cfc?method=getFilms&_cf_ajaxproxytoken=xxxblahxxx&returnFormat=json&argumentCollection=%7B%22employeeID%22%3A%221%22%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=xxxxxxblahxxxxx&_cf_rc=0
info:http: Invoking CFC: /test/MyComponent.cfc , function: getFilms , arguments: {"employeeID":"1"}
info:LogReader: LogReader initialized
info:global: Logger initialized
<cfselect name="employeeID" query="getAllEmployees" display="FullName" value="employeeID" selected="#form.employeeID#" onchange="this.form.submit();"></cfselect>
open your db manually and look
First find a record from employees where employeeid = your #form.employeeid#
and also there needs to be a record in the detail table where employeeid also = your #form.employeeid#
and also there needs to be a record in videolist table where videoid = the detail table videoid in the same row where the match occurs for employeeid