<cfparam name="Session.NameString" default="">
<cfparam name="AlphaIndex" default="">
<CFQUERY NAME="RP" DATASOURCE="NEWtrackdata">
SELECT *
FROM LICENSE
<cfif isdefined("mtrack")>
where track = '#mtrack#'
<cfelse>
<cfif isdefined("mtype")>
where type = '#mtype#'
<cfelse>
<cfif isdefined("mdate")>
where lic_date=#createodbcdate(mdate)#
<cfelse>
<cfif Trim(Session.NameString) gt ''>
WHERE NAME LIKE '%#Session.NameString#%'
<cfelse>
<cfif '#AlphaIndex#' EQ 'All'>
<!--- No condition to pass --->
<cfelse>
WHERE NAME LIKE '#AlphaIndex#%'
</cfif>
</cfif>
</cfif>
</cfif>
</cfif>
ORDER by Name
</CFQUERY>
<HTML>
<HEAD><TITLE>Track Maintained License Data</TITLE></HEAD>
<body onload="document.forms['LicenseNameString'].elements['NameString'].focus();">
<br>
<div align="center" >
<table border="0">
<cfoutput>
<td valign="top" nowrap>
<form action="RemLicNameString.cfm" method="POST" name="LicenseNameString">
<input size="15" maxlength="50" type="Text" name="NameString">
<input type="submit" value="Name Search">
</form>
</td>
<td valign="top" nowrap>
<a class="special" href='RemLicSearch.cfm?alphaindex=All' title='List all license records' style="font-size: 75% ;"> All</a>|
<cfloop from="65" to="90" step="1" index="theCharacter">
<a class="special" href='RemLicSearch.cfm?alphaindex=#Chr(theCharacter)#' title='List all license records where name begins with "#Chr(theCharacter)#"' style="font-size: 75% ;"> #Chr(theCharacter)# </a>|
</cfloop>
</td>
</cfoutput>
</table>
</div>
<cfif #rp.RecordCount# is 0>
<div align="center" class="PageTitle">No Licenses found that begins with "<cfoutput>#AlphaIndex##Session.NameString#</cfoutput>", try another Letter.</div>
<cfelse>
<cfif isdefined("mtrack")>
<div align="center" class="PageTitle">Track Maintained License Data Where Track is <cfoutput>"#mtrack#" (Records Found: #NumberFormat(rp.RecordCount)#)</cfoutput></div>
<cfelse>
<cfif isdefined("mtype")>
<div align="center" class="PageTitle">Track Maintained License Data Where License Type Is <cfoutput>"#mtype#" (Records Found: #NumberFormat(rp.RecordCount)#)</cfoutput></div>
<cfelse>
<cfif isdefined("mdate")>
<div align="center" class="PageTitle">Track Maintained License Data Where Date Licensed Is <cfoutput>"#DateFormat(mdate,'mm/dd/yyyy')#" (Records Found: #NumberFormat(rp.RecordCount)#)</cfoutput></div>
<cfelse>
<cfif Trim(Session.NameString) gt ''>
<div align="center" class="PageTitle">Track Maintained License Data Where Name Contains <cfoutput>"#Session.NameString#" (Records Found: #NumberFormat(rp.RecordCount)#)</cfoutput></div>
<cfelse>
<div align="center" class="PageTitle">Track Maintained License Data Where Name Begins With <cfoutput>"#AlphaIndex#" (Records Found: #NumberFormat(rp.RecordCount)#)</cfoutput></div>
</cfif>
</cfif>
</cfif>
</cfif>
<cfset Session.NameString=''>
<TABLE class="BinkleyTable" width="100%">
<TR>
<TH class="ColumnHeadingCell">Pend</Th>
<TH class="ColumnHeadingCell">Track</Th>
<TH class="ColumnHeadingCell">Name</Th>
<TH class="ColumnHeadingCell">Type</Th>
<TH class="ColumnHeadingCell">City State</Th>
<TH class="ColumnHeadingCell">License Date</Th>
<TH class="ColumnHeadingCell">Comments</Th>
</TR>
<CFOUTPUT query="RP">
<TR>
<td class="NormalCell">
<a href="LicEditMenu.cfm?row=#rp.index#&alphaindex=#alphaindex#&mssn=#rp.ssn#" onMouseOver="highlight(this)" onMouseOut="noHighlight(this)" style="color: dodgerblue; font-size: 90% ;">
<cfif rp.Pending eq 1>
<div style="color: red;">Yes</div>
<cfelse>
No
</cfif>
</a>
</TD>
<td>
<a class="special"
href="RemLicSearch.cfm?mtrack=#rp.track#&alphaindex=#alphaindex#&mssn=#rp.ssn#"
title="List all license records where track code is #rp.track#"
onmouseover="return escape('Some text')"
style="font-size: 90% ;">
<cfif rp.Pending eq 1>
<div style="color: red;">
</cfif>
#Track#
</a>
</TD>
<td class="NormalCell">
<a href="LicEditMenu.cfm?row=#rp.index#&alphaindex=#alphaindex#&mssn=#rp.ssn#" onMouseOver="highlight(this)" onMouseOut="noHighlight(this)" style="color: dodgerblue; font-size: 90% ;">
<cfif rp.Pending eq 1>
<div style="color: red;">
</cfif>
#name#
</a>
</TD>
<td>
<a class="special" href="RemLicSearch.cfm?mtype=#rp.type#&alphaindex=#alphaindex#&mssn=#rp.ssn#" title="List all license records where license type is #rp.type#" onMouseOver="highlight(this)" onMouseOut="noHighlight(this)" style="font-size: 90% ;">
<cfif rp.Pending eq 1>
<div style="color: red;">
</cfif>
#Type#
</a>
</TD>
<td class="NormalCell">
<a href="LicEditMenu.cfm?row=#rp.index#&alphaindex=#alphaindex#&mssn=#rp.ssn#" onMouseOver="highlight(this)" onMouseOut="noHighlight(this)" style="color: dodgerblue; font-size: 90% ;">
<cfif rp.Pending eq 1>
<div style="color: red;">
</cfif>
#CITY_STATE#
</a>
</TD>
<td>
<a class="special" href="RemLicSearch.cfm?mdate=#rp.lic_date#&alphaindex=#alphaindex#&mssn=#rp.ssn#" title="List all license records where license date is #DateFormat(rp.lic_date,'mm/dd/yyyy')#" onMouseOver="highlight(this)" onMouseOut="noHighlight(this)" style="font-size: 90% ;">
<cfif rp.Pending eq 1>
<div style="color: red;">
</cfif>
#dateformat(LIC_DATE,"MM/DD/YYYY")#
</a>
</TD>
<td>
<a href="LicEditMenu.cfm?row=#rp.index#&alphaindex=#alphaindex#&mssn=#rp.ssn#" onMouseOver="highlight(this)" onMouseOut="noHighlight(this)" style="color: dodgerblue; font-size: 90% ;">
<cfif rp.Pending eq 1>
<div style="color: red;">
</cfif>
#COMMENTS#
</a>
</TD>
</TR>
</CFOUTPUT>
</TABLE>
</cfif>
<!--- This Works --->
<!--- <script>
document.LicenseNameString.NameString.focus();
</script> --->
</body>
</html>