b1nary0mega
6/25/2014 - 5:49 PM

The SAWGI unit needs to know how many folks have signed up for a shift to allow the employees to juggle appropriately. This will provide th

The SAWGI unit needs to know how many folks have signed up for a shift to allow the employees to juggle appropriately. This will provide that count to the employee. This code is part of the "sch_entry.cfm" file and starts around line #703.

<!---//BEGIN SAWGI count of "8DS" (stay) shifts //--->
<cfif session.unit_id EQ 'SAWGI'>
  <!--- mod code makes sure we only do this for productive code cells --->
  <cfif col MOD slots_per_day EQ 1>
    <!--- this will determine how many days from the starting date we have moved forward --->
    <cfset sawgi_daysForward = (#col# - 1)/8>
    <!--- this will get us the date for the current cell that we are on --->
    <cfset sawgi_cell_date = #DateAdd("d",sawgi_daysForward,variables.from_date)#>
    <!--- query the db and get a count of the desired shift for the desired date --->
    <cfquery name="getTcCount" datasource="#application.datasrc_mss#" dbtype="#application.dbtype_mss#">
      select count(*) as theCount
      from employee_times
      where end_dttm = to_date('#dateformat(sawgi_cell_date,"mm-dd-yy")# 00:00:00', 'mm-dd-yy hh24:mi:ss')
      and unit_id='SAWGI'
      and lower(time_code) like '%8ds%'
    </cfquery>
  </cfif>
</cfif>
<!---//END SAWGI count of "8DS" (stay) shifts //--->

<!--- display the empls time code --->
<cfif col MOD slots_per_day EQ 1>
  #cell_content# 
  <!---//BEGIN SAWGI count of 8DS output//--->
  <cfif session.unit_id eq 'SAWGI'>
    <br />
    (Stays: #getTcCount.theCount#*)
  </cfif>
  <!---//END SAWGI count of 8Ds output//--->
  </td>
  <cfset variables.subGroupd = Empls [#row#] [#iSg#]>
  <cfset dayofwk = "???">
<cfelse>
  <cfset colPT = (col - half_day_cols)>
  <cfset justify = EmplTimes [#row#] [#colpt#] [3]>
  <cfset cell_content_np = EmplTimes [#row#] [#colPT#] [2]>
  #cell_content_np#
  </td>
  <td bgcolor="black">&nbsp;</td>
</cfif>