Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

badge swipe system issues.

Status
Not open for further replies.

mp2admin

Programmer
Apr 17, 2008
10
US
Hi I have a badge swipe application where an operator swipes their badge and the number gets stored in the database. I am tring to distinguish when they swipe in and swipe out and display the data to an end user.

Its been awhile since I've been here, could someone lend their expertize.


Here is my data from the database

Badge tagname datetime id
57370 bl_packer1_dat_badge 4/17/2008 8:54:31 AM 1
57370 bl_packer1_dat_badge 4/17/2008 8:55:01 AM 2
31123 bl_packer1_dat_badge 4/17/2008 8:55:31 AM 3
31123 bl_packer1_dat_badge 4/17/2008 8:56:00 AM 4
31724 bl_packer1_dat_badge 4/17/2008 8:56:31 AM 5
57370 bl_packer1_dat_badge 4/17/2008 1:14:32 AM 6

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<cfsetting showDebugOutput="yes">

<!--- Expire page --->

<META http-EQUIV="Expires" CONTENT="Mon, 01 Jan 1970 23:59:59 GMT">
<CFHEADER NAME="Pragma" VALUE="no-cache">
<CFHEADER NAME="Expires" VALUE="Now()">
<CFHEADER NAME="cache-control" VALUE="no-cache, no-store, must-revalidate">

<cfparam default="" name="ab">
<CFSET myarray1 = arrayNew(1)>
<CFSET myarray2 = arrayNew(1)>

<CFSET time_in_1 = arrayNew(1)>
<CFSET time_out_2 = arrayNew(1)>

<cfset aa = 0>
<CFPARAM NAME="NameList" DEFAULT="">
<CFPARAM NAME="NameList2" DEFAULT="">

<script>
<!--
/*
By George Chiang (WA's JavaScript tutorial)
*/

function show2(){
if (!document.all)
return

var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="AM"

if (hours>12){
dn="PM"
hours=hours-12
}

if (hours==0)
hours=12

if (minutes<=9)
minutes="0"+minutes

if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds+" "+dn
tick2.innerHTML="<b style='font-size:32;color:white;'>"+ctime+"</b>"
setTimeout("show2()",1000)
}

window.onload=show2
//-->
</script>

<head>

<!--- Refresh 1000 = 1 seconds --->

<!--- <SCRIPT language="Javascript">
setTimeout('location.href="</SCRIPT>
--->
</head>

<cfquery name="standards" datasource="MP2_prod">
select cell_id, standard_rate,tag
from Crayon_Labeling_Standard_Rate
where area = 'markers'
and name like '%bl_packer1%'
</cfquery>

<cfloop query="standards">
<cfset "#standards.tag#" = #standards.standard_rate#>
</cfloop>

<link rel="stylesheet" href="/stylesheets/marker_visual_manage.css" type="text/css">

<cfset crayon_shift1 = createdatetime(datepart("yyyy",now()), datepart("m", now()), datepart("d", now()),7,30,0)>
<cfset crayon_shift2 = createdatetime(datepart("yyyy",now()), datepart("m", now()), datepart("d", now()),15,30,0)>

<cfif timeformat(now(), timeformat(now(), "HH:mm:ss")) gt "23:45:00" and timeformat(now(), "HH:mm:ss") lte "23:59:59">
<cfset crayon_shift3 = createdatetime(datepart("yyyy",now()), datepart("m", now()), datepart("d", now()),23,30,0)>
<cfelse>
<cfset crayon_shift3 = createdatetime(datepart("yyyy",now()-1), datepart("m", now()-1), datepart("d", now()-1),23,30,0)>
</cfif>

<cfif timeformat(now(), "HH:mm:ss") gte "07:30:00" and timeformat(now(), "HH:mm:ss") lte "15:30:00">
<cfset shift_crayon = 1>
<cfset shift_crayon_1 = 3>
<cfset shift_crayon_2 = 2>
<cfset shift_crayon_3 = 1>

<cfset shift_crayon_time_1 = dateadd("n", -480, crayon_shift1)>
<cfset shift_crayon_time_2 = dateadd("n", -960, crayon_shift1)>
<cfset shift_crayon_time_3 = dateadd("n", -1440, crayon_shift1)>
</cfif>

<cfif timeformat(now(), "HH:mm:ss") gte "15:30:00" and timeformat(now(), "HH:mm:ss") lte "23:30:00">
<cfset shift_crayon = 2>
<cfset shift_crayon_1 = 1>
<cfset shift_crayon_2 = 3>
<cfset shift_crayon_3 = 2>

<cfset shift_crayon_time_1 = dateadd("n", -480, crayon_shift2)>
<cfset shift_crayon_time_2 = dateadd("n", -960, crayon_shift2)>
<cfset shift_crayon_time_3 = dateadd("n", -1440, crayon_shift2)>
</cfif>

<cfif (timeformat(now(), "HH:mm:ss") gte "00:00:00" and timeformat(now(), "HH:mm:ss") lte "07:30:00") or (timeformat(now(), "HH:mm:ss") gt "23:30:00" and timeformat(now(), "HH:mm:ss") lte "23:59:59")>
<cfset shift_crayon = 3>
<cfset shift_crayon_1 = 2>
<cfset shift_crayon_2 = 1>
<cfset shift_crayon_3 = 3>

<cfset shift_crayon_time_1 = dateadd("n", -480, crayon_shift3)>
<cfset shift_crayon_time_2 = dateadd("n", -960, crayon_shift3)>
<cfset shift_crayon_time_3 = dateadd("n", -1440, crayon_shift3)>
</cfif>

<cfif timeformat(now(), "HH:mm:ss") gte "07:30:00" and timeformat(now(), "HH:mm:ss") lt "15:30:00">

<cfset shift_s = createdatetime(datepart("YYYY",now()), datepart("M", now()), datepart("d", now()),7,30,0)>
<cfset shift_e = createdatetime(datepart("yyyy",now()), datepart("m", now()), datepart("d", now()),15,30,0)>

<cfelseif timeformat(now(), "HH:mm:ss") gte "15:30:00" and timeformat(now(), "HH:mm:ss") lt "23:30:00">

<cfset shift_s = createdatetime(datepart("YYYY",now()), datepart("M", now()), datepart("d", now()),15,30,0)>
<cfset shift_e = createdatetime(datepart("yyyy",now()), datepart("m", now()), datepart("d", now()),23,30,0)>

<cfelseif (timeformat(now(), "HH:mm:ss") gte "00:00:00" and timeformat(now(), "HH:mm:ss") lt "07:30:00") or (timeformat(now(), "HH:mm:ss") gt "23:30:00" and timeformat(now(), "HH:mm:ss") lte "23:59:59")>
<cfset shift_s = createdatetime(datepart("yyyy",now()-1), datepart("m", now()-1), datepart("d", now()-1),23,30,0)>
<cfset shift_e = createdatetime(datepart("yyyy",now()), datepart("m", now()), datepart("d", now()),07,30,0)>

</cfif>

<body>

<cfflush>

<!--- Get the Minutes from the start of the shift, if it is 0 set it to 1 to avoid error due to division by 0 further down --->

<cfif shift_crayon eq 1>
<cfset crayon_shift_minute = datediff("n", crayon_shift1, now())>
<cfif crayon_shift_minute eq 0>
<cfset crayon_shift_minute = 1>
</cfif>
</cfif>

<cfif shift_crayon eq 2>
<cfset crayon_shift_minute = datediff("n", crayon_shift2, now())>
<cfif crayon_shift_minute eq 0>
<cfset crayon_shift_minute = 1>
</cfif>
</cfif>

<cfif shift_crayon eq 3>
<cfset crayon_shift_minute = datediff("n", crayon_shift3, now())>
<cfif crayon_shift_minute eq 0>
<cfset crayon_shift_minute = 1>
</cfif>
</cfif>

<cfflush>

<cfquery name="qry_data" datasource="mp2_prod">
select cell_id, (standard_rate*3) as standard_rate, name, tag, ref_1, ref_2, ref_3, ref_4,ref_5, area,standard_rate as standard_rate2,(standard_rate/8) as standard_rate_hour
from crayon_labeling_Standard_Rate
where name like '%bl_packer1%'
and tag is not null
order by name asc
</cfquery>

<cfset stat = 0>

<cfloop query="qry_data">

<cfquery name="last_shift_hours" datasource="MP2_prod">
select id, machine, shift, start_date, end_date, date, start_time_hour,right(cast(cast(start_time_minute + 100 as char(7)) as int),2)as start_time_minute,end_time_hour,right(cast(cast(end_time_minute + 100 as char(7)) as int),2) as end_time_minute
from marker_rate
<cfif (timeformat(now(), "HH:mm:ss") gt "23:45:00" and timeformat(now(), "HH:mm:ss") lte "23:59:59")>
where date = '#dateformat(now()+1,"mm/dd/yyyy")#'
<cfelse>
where date = '#dateformat(now(),"mm/dd/yyyy")#'
</cfif>
and shift = '#shift_crayon#'
and machine = '#qry_data.name#'
ORDER BY start_time_hour desc
</cfquery>

<CFPARAM NAME="myList1" DEFAULT="">

<cfset total_remain_time_3 = 0>

<cfset time_2 = 0>
<cfset op_a = 0>
<cfloop query="last_shift_hours">

<cfset p_end = "#dateformat(date,"mm/dd/yyyy")# #end_time_hour#:#end_time_minute#">
<cfset start = "#dateformat(date,"mm/dd/yyyy")# #start_time_hour#:#start_time_minute#">
<cfset end = "#dateformat(date,"mm/dd/yyyy")# #end_time_hour#:#end_time_minute#">

<cfif #start# neq '#dateformat(date,"mm/dd/yyyy")# :'>

<cfif (timeformat(#p_end#, "HH:mm") gte "00:00" and timeformat(#p_end#, "HH:mm") lte "07:45") >
<cfset start = "#dateformat(start_date,"mm/dd/yyyy")# #start_time_hour#:#start_time_minute#">
<cfset end = "#dateformat(end_date,"mm/dd/yyyy")# #end_time_hour#:#end_time_minute#">
<cfelseif (timeformat(#p_end#, "HH:mm") gt "23:45" and timeformat(#p_end#, "HH:mm") lte "23:59")>
<cfset end = "#dateformat(date,"mm/dd/yyyy")# #end_time_hour#:#end_time_minute#">
</cfif>

</cfif>

<cfif #start# eq '#dateformat(date,"mm/dd/yyyy")# :'>
<cfset start = "0">
<cfset end = "0">
</cfif>

<cfset difference_2 = datediff("n", start, end)>

<cfset time_2 = time_2 + #difference_2#>

<cfset remain_time_2 = 480 - #time_2#>

<cfset total_remain_time_3 = remain_time_2/60>

<cfif #start# lt '#dateformat(now(),"mm/dd/yyyy")# #timeformat(now(),"HH:mm")#' and #start# neq '0'>
<cfset "sched_meet_occur_#last_shift_hours.machine#" = 1>
<cfelse>
<cfset "sched_meet_occur_#last_shift_hours.machine#" = 0>
</cfif>

<cfif #start# lt '#dateformat(now(),"mm/dd/yyyy")# #timeformat(now(),"HH:mm")#' and #end# gt '#dateformat(now(),"mm/dd/yyyy")# #timeformat(now(),"HH:mm")#'>
<cfset "sched_stat_#last_shift_hours.machine#" = 1>
<cfset "sched_meet_#last_shift_hours.machine#" = "#start# - #end#">
<cfset mylist1 = "#ListAppend(MyList1,last_shift_hours.machine)#">
<cfelse>
<cfset "sched_stat_#last_shift_hours.machine#" = 0>
</cfif>

</cfloop>

<cfset "sched_min_#qry_data.name#" = #total_remain_time_3#*60>

<cfif #evaluate("sched_stat_#last_shift_hours.machine#")# eq 0>
<cfset stat = stat + 1>
</cfif>
</cfloop>

<!--- <cfset machines = ListSort("#mylist1#","Numeric", "asc", ",")>
<cfset max = #trim(ListLast(machines))#> --->

<!--- Start machine data --->

<cfset line_eff = 0>

<cfloop list="bl_packer1" index="ppk">

<cfquery name="get_24pack#ppk#" datasource="BSIMFG_runtime">
select top 1 datetime, tagname, isnull(value,0) as value
from analoglive
where tagname like 'wf_jon1_dat_%pack_produced'
order by datetime desc
</cfquery>

<cfset "srh_#ppk#" = #abs(evaluate("sched_min_#ppk#"))#/60>
<cfset "target_diff_#ppk#" = #evaluate("bl_packer1_#mid(get_24packbl_packer1.tagname,13,2)#_target")#/8>
<cfset "target_#ppk#" = #abs(evaluate("target_diff_#ppk#"))#*#abs(evaluate("srh_#ppk#"))#>

<cfif #evaluate("sched_meet_occur_#ppk#")# eq 1>
<cfset "shift_minute_#ppk#" = (480 - crayon_shift_minute - #abs(evaluate("sched_min_#ppk#"))#)>
<cfelse>
<cfset "shift_minute_#ppk#" = crayon_shift_minute>
</cfif>

<cfif #abs(evaluate("sched_min_#ppk#"))# gt 0>
<cfif #abs(evaluate("sched_min_#ppk#"))# eq 0>
<cfset "pack24_#ppk#_ct" = 0>
<cfelse>
<cfset "pack24_#ppk#_ct" = (#abs(evaluate("target_#ppk#"))# * #abs(evaluate("shift_minute_#ppk#"))#)/#abs(evaluate("sched_min_#ppk#"))#>
</cfif>
<cfelse>
<cfset "pack24_#ppk#_ct" = 0>
</cfif>

<cfif #abs(evaluate("get_24pack#ppk#.value"))# gt 0 and #abs(evaluate("sched_min_#ppk#"))# gt 0 and #abs(evaluate("pack24_#ppk#_ct"))# gt 0>
<cfset "pack24_#ppk#_eff" = #abs(evaluate("get_24pack#ppk#.value"))#/#abs(evaluate("pack24_#ppk#_ct"))# * 100>
<cfelse>
<cfset "pack24_#ppk#_eff" = 0>
</cfif>

<cfif #abs(evaluate("sched_stat_#ppk#"))# eq 0 and #stat# gt 0>
<cfset line_eff = line_eff + #abs(evaluate("pack24_#ppk#_eff"))#>
</cfif>

</cfloop>

<!--- End machine data --->

<!--- Start Insert HID Data --->

<cfquery datasource="mp2">
TRUNCATE TABLE "test"
</cfquery>

<cfquery name="op_data" datasource="BSIMFG_runtime">
select datetime, value, tagname
from stringhistory
where tagname = 'bl_packer1_dat_badge'
and datetime >= {ts '2008-04-17 07:30:00'}
and datetime <= {ts '2008-04-17 15:30:00'}
and (value != '0'
and len(value) > 3)
order by datetime asc
</cfquery>

<cfloop query = "op_data">

<cfquery datasource="mp2">
BEGIN TRAN
insert into test(datetime, tagname, badge)
values (
'#dateformat(op_data.datetime,"mm/dd/yyyy")# #timeformat(op_data.datetime,"hh:mm:ss")# ',
'#op_data.tagname#',
'#op_data.value#'
)
COMMIT TRAN
</cfquery>

</cfloop>

<!--- End Insert HID Data --->

<cfif (timeformat(now(), "HH:mm:ss") gte "15:44:00" and timeformat(now(), "HH:mm:ss") lte "15:48:00") or (timeformat(now(), "HH:mm:ss") gte "23:44:00" and timeformat(now(), "HH:mm:ss") lte "23:48:00") or (timeformat(now(), "HH:mm:ss") gte "07:44:00" and timeformat(now(), "HH:mm:ss") lte "07:44:00")>

<div style="margin:250px 250px; padding:0px;text-align:center;"><font size="+4"><strong>Updating Information<br>
Please Wait</strong><br>
<img src="time.gif">
</div>

<cfelse>

<table class="sample" width="100%" height="100%">

<tr>
<td align="center"><font color="#0000ff"><strong>Operators</strong></font></td>
<td align="center"><font color="#0000ff"><strong>Current<br>Count</strong></td>
<td align="center"><font color="#0000ff"><strong>Time<br>Target</strong></font></td>
<td align="center"><font color="#0000ff"><strong>%</strong></font></td>
<td align="center"><font color="#0000ff"><strong>Shift<br>Target</strong></font></td>
</tr>

<!--- Start calculate correct machine to display --->

<cfloop list="bl_packer1" index="pk">

<!--- HID queries --->

<cfquery name="operator_id_1" datasource="mp2">
select datetime, badge as value
from test
where tagname = 'bl_packer1_dat_badge'
and datetime >= {ts '2008-04-17 07:30:00'}
and datetime <= {ts '2008-04-17 15:30:00'}
order by datetime desc
</cfquery>

<cfquery name="get_emp" datasource="MP2">
select top 1 firstname, lastname
from Crayon_Operators
where badge = '#trim(operator_id_1.value)#'
and len(badge) != 0
</cfquery>
<!---
<cfloop list="bl_packer1" index="pk">

<cfquery name="one" datasource="mp2">
select datetime, badge as value
from test
where tagname = 'bl_packer1_dat_badge'
order by datetime desc
</cfquery>--->

<cfloop query="operator_id_1">

<cfquery name="op_out" datasource="mp2">
select datetime, badge as value
from test
where tagname = 'bl_packer1_dat_badge'
and badge = '#operator_id_1.value#'
and datetime > '#operator_id_1.datetime#'
</cfquery>

<cfset list1 = #arrayAppend(myarray1, "#operator_id_1.value#")#>
<cfset list2 = #arrayAppend(myarray2, "#op_out.value#")#>

<cfset op_in_1 = #arrayAppend(time_in_1, "#operator_id_1.value# - #dateformat(operator_id_1.datetime,"mm/dd/yyyy")# #timeformat(operator_id_1.datetime,"HH:mm:ss")#")#>
<cfset op_out_2 = #arrayAppend(time_out_2, "#dateformat(op_out.datetime,"mm/dd/yyyy")# #timeformat(op_out.datetime,"HH:mm:ss")#")#>

<!--- </cfloop> --->

</cfloop>

<cfset total_records=operator_id_1.recordcount>

<cfset display_routine = 0>

<cfloop index="Counter" from=1 to="#Total_Records#">
<cfif #MyArray1[Counter]# neq #MyArray2[Counter]#>
<CFSET NameList = "#ListAppend(NameList,counter)#">
<cfelse>
<cfset aza = "#time_in_1[Counter]# #time_out_2[Counter]#">
<cfset namelist2 = "#ListAppend(NameList2,aza)#">
</cfif>

</cfloop>
<cfoutput>#namelist2#</cfoutput><br>
<cfoutput>#namelist#</cfoutput>
<!--- Start remove duplicate entries --->

<cfset l_catid = #namelist2#>
<cfset l_newcatid = "">
<cfloop list="#l_catId#" index="item">
<cfif not listfind(l_newcatid, item)>
<cfset l_newcatid = listappend(l_newcatid, item)>
</cfif>
</cfloop>

<!--- End remove duplicate entries --->

<cfloop list="#l_newcatid#" index="sort_list">

<cfset badge = #left(sort_list,6)#>

<cfif #len(sort_list)# lt 51>
<cfset op_start_time = #mid(sort_list,10,19)#>
<cfset op_end_time = #mid(sort_list,30,39)#>
<cfelse>
<cfset op_start_time = #mid(sort_list,13,19)#>
<cfset op_end_time = #mid(sort_list,33,39)#>
</cfif>

<cfset in_out_diff = #datediff("n", op_start_time, op_end_time)#>

<cfquery name="prodcount_chk" datasource="BSIMFG_runtime">
select top 1 tagname, isnull(value,0) as value
from analoglive
where tagname like 'wf_jon1_dat_%pack_produced'
order by datetime desc
</cfquery>

<cfquery name="prodcount" datasource="BSIMFG_runtime">
select top 1 tagname, isnull(value,0) as value
from analoghistory
where tagname = '#prodcount_chk.tagname#'
and datetime >= '#op_start_time#'
and datetime <= '#op_end_time#'
order by datetime desc
</cfquery>

<cfset rate_min = (#evaluate("target_diff_#pk#")#/60)*#in_out_diff#>
<cfif #rate_min# gt '0' and #prodcount.value# gt '0'>
<cfset rate_eff = (#val(prodcount.value)#/#val(rate_min)#)*100>
<cfelse>
<cfset rate_eff = 0>
</cfif>

</cfloop>

<!--- End calculate correct machine to display --->

<cfset ab = 0>

<cfif listlen(namelist) eq 0>
<td colspan=5>
<font size="+4">
<strong>
No Data
<br>
Waiting For Operator
</strong>
<br>
</td>
<cfabort>
</cfif>

<cfloop index="Counter" list="#namelist#">

<cfset ab = ab + 1>

<cfif ab lte 4>

<!--- Set color for over/under rate current target rate--->

<cfif #mylist1# contains #pk#>
<tr class="meeting">
<cfelseif #abs(evaluate("pack24_#pk#_eff"))# gte '100'>
<tr class="over_eff">
<cfelseif #abs(evaluate("pack24_#pk#_eff"))# lt '100'>
<tr class="under_eff">
</cfif>

<cfif #MyArray1[Counter]# neq #MyArray2[Counter]#>

<td nowrap>

<!--- HID output --->

<font size="5" <cfif #mylist1# contains #pk#> color="black" <cfelse> color="white" </cfif>>
Operator <cfoutput>#ab#</cfoutput> <br>
[
<strong>
<cfif #get_emp.recordcount# gt 0>
<cfoutput>#Left( UCase( "#get_emp.firstname#" ), 1)##Right( LCase( "#get_emp.firstname#" ), Len( "#get_emp.firstname#" ) - 1)# #Left( UCase( "#get_emp.lastname#" ), 1)##Right( LCase( "#get_emp.lastname#" ), Len( "#get_emp.lastname#" ) - 1)#</cfoutput>
<cfelseif #operator_id_1.recordcount# gt '0'>
<cfoutput>#MyArray1[Counter]#</cfoutput>
<cfelse>
N/A
</cfif>
</strong>
]
</font>
</td>

</cfif>
</cfif>

<!--- end HID output --->

<!--- output production data --->

<cfset aa = aa + 1>

<cfif aa eq 1>

<cfif #evaluate("get_24pack#pk#.value")# gt '0'>
<td align="right" rowspan="4"><strong><cfoutput>#numberformat(evaluate("get_24pack#pk#.value"))#</cfoutput></strong></td>
<cfelse>
<td align="right" rowspan="4"><strong>0</strong></td>
</cfif>

<!--- Highlight machine down --->

<cfif #mylist1# contains #pk#>
<td colspan=2 rowspan=4 bgcolor="yellow" align="center"><strong><font color="black" class="meet_size">Machine Scheduled Down <br><cfoutput>#evaluate("sched_meet_#pk#")#</cfoutput></font></strong></td>
<cfelse>
<td align="right" rowspan="4">
<strong>
<cfoutput>#numberformat(evaluate("pack24_#pk#_ct"))#</cfoutput>
</strong>
</td>

<td align="right" rowspan="4">
<strong>
<cfoutput>#numberformat(evaluate("pack24_#pk#_eff"),"__._")#</cfoutput>
</strong>
</td>

</cfif>

<td align="right" rowspan="4"><strong><cfoutput>#numberformat(evaluate("target_#pk#"))#</cfoutput></strong></td>

</cfif>

</cfloop>

<cfif ab eq listlen(namelist)>
<cfif #listlen(namelist)# eq 1>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
<cfelseif #listlen(namelist)# eq 2>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
<cfelseif #listlen(namelist)# eq 3>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
<cfelseif #listlen(namelist)# eq 0>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
<tr bgcolor="yellow">
<td align="center"><font size="5" color="black">Waiting For Swipe</font></td>
</tr>
</cfif>

</cfif>
</cfloop>

<tr>
<td align="right" colspan="5">

<cfif #abs(line_eff)# gte 100>

<div style="width:730px;background-color : green">
<font size="+3" color="white"><strong>
Line Efficiency = <cfoutput>#numberformat(line_eff,"___._")#</cfoutput>% -
</strong></font>
<span id=tick2>
</span>
</div>

<cfelse>

<div style="width:730px;background-color : red">
<font size="+3" color="white"><strong>
Line Efficiency = <cfoutput>#numberformat(line_eff,"___._")#</cfoutput>% -
</strong></font>
<span id=tick2>
</span>
</div>

</cfif>

</td>
</tr>
</cfif>

</table>
</body>

</html>
 
Oi, so many lines of code. The only insert statement I see is:

<cfquery datasource="mp2">
BEGIN TRAN
insert into test(datetime, tagname, badge)
values (
'#dateformat(op_data.datetime,"mm/dd/yyyy")# #timeformat(op_data.datetime,"hh:mm:ss")# ',
'#op_data.tagname#',
'#op_data.value#'
)
COMMIT TRAN
</cfquery>

So, you will need to retrieve the datetime for that op_data.value. Also, getDate() is short for:

'#dateformat(op_data.datetime,"mm/dd/yyyy")# #timeformat(op_data.datetime,"hh:mm:ss")# ',

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top