0 Replies Latest reply on Jan 12, 2007 2:05 PM by emmim44

    Silly Err

    emmim44 Level 1

      <CFQUERY NAME="SingleQuery" DATASOURCE="#FormVector#">
      select genbid_assignmentinfo.facname
      , genbid_assignmentinfo.facsch
      , genbid_bidresult.lastname
      , genbid_bidresult.firstname
      , genbid_bidresult.homefac
      , genbid_assignmentinfo.facspot
      , genbid_assignmentinfo.facid

      from genbid_assignmentinfo
      left
      join genbid_bidresult
      on genbid_bidresult.facsch = genbid_assignmentinfo .facsch
      and genbid_bidresult.facname = genbid_assignmentinfo .facname
      and genbid_bidresult.factype = 'SGT'
      order
      by genbid_assignmentinfo .facname
      , genbid_assignmentinfo .facsch
      , genbid_bidresult.lastname
      , genbid_bidresult.firstname
      </CFQUERY>


      <cfquery name="gethomefac" datasource="#FormVector#">
      select facid as id,facname as fc
      from genbid_facility

      order by facname
      </cfquery>

      <cfquery name="gethomefacTmp" datasource="#FormVector#">
      SELECT cast(facid AS VARCHAR(5)) || '_' || (CASE
      WHEN (facid = 38 OR facid = 37) AND firstname IS NULL THEN homefac
      WHEN (facid = 38 OR facid=37 ) AND firstname IS NOT NULL THEN firstname ||''||lastname
      ELSE firstname||''||lastname
      END ) AS ID
      FROM GENBID_ASSIGNMENTTEMP
      </cfquery>


      <form method="post">
      <table width="650px" border="0" align="center" cellpadding="2" cellspacing="2" class="graytableborder">
      <cfset s=0>
      <cfset idList = valuelist(gethomefacTmp.ID)>
      <cfset idList1 = valuelist(gethomefacTmp.ID)>
      <CFOUTPUT QUERY="SingleQuery" GROUP="facname">

      <tr>
      <td height="78" align="center" valign="middle" bgcolor="##CCCCCC"><span class="style3">#facname#</span></td>
      <CFOUTPUT GROUP="facsch">
      <td align="left" valign="top"><span class="style1"><span class="style4">#facsch#</span><br />
      <span class="style6">


      <cfset i=0>


      <cfif firstname neq "">
      <cfoutput>



      <cfset thisid = NumberFormat(facid) & '_' & firstname&lastname>


      <cfif ListFindnocase( idList1 , thisid )>


      <cfif facname eq "VR">
      <cfset chkV="checked">
      <cfelse>
      <cfset chk="checked">
      </cfif>

      <cfelse>

      <cfset chk=""><cfset chkV="">
      </cfif>



      <input type="checkbox" name="Occ" <cfif facname eq "VR">#chkV#<cfelse>#chk#</cfif> value="#facname#|#facsch#|#facid#|#i#|#firstname#|#lastname#<cfif facname eq "VR">|#homefac#</cfif>"><cfif facname eq "VR">#homefac#</cfif>- #firstname# #lastname# <br />

      <cfset i=i+1>

      </cfoutput>
      </cfif>

      <cfset w="*">

      <cfset chk=""><cfset chkV="">
      <cfset fs=#facspot#-#i#>
      <cfloop index="b" from="1" to="#fs#">
      <cfset fid=#facid#>
      <cfset fac=#facname#>

      <cfif facname neq "VR">
      <cfset OpenS = NumberFormat(facid) & '_'>
      <cfif ListFindnocase(idList,trim(OpenS))>
      <cfset chk="checked">
      <cfset idList =listdeleteat(idList,ListFindnocase(idList,trim(OpenS)))>
      <cfelse>
      <cfset chk="">
      </cfif>


      </cfif>


      <cfset fl="n">
      <cfif facname neq "VR">
      <input type="checkbox" name="Occ" <cfif facname eq "VR" >#chkV#<cfelse>#chk#</cfif> value="#facname#|#facsch#|#facid#|#b##i#|#fl#|#fl#<cfif facname eq "VR">|#w#</cfif>">


      Open Spot<br />
      <cfelse>

      <select name="Vr12H8H" >
      <option value=""></option>
      <cfloop query="gethomefac">
      <cfif ListContainsnocase(idList,fid& '_' &trim(fc) )>
      <cfset chk0="selected"><cfset hj=#ListContainsnocase(idList,fid& '_' &trim(fc) )#>

      <option value="#fid#|#fc#" #chk0#>#fc#</option>
      <cfelse>

      <option value="#fid#|#fc#">#fc#</option>
      </cfif>

      </cfloop>
      </select><br />

      <cfset idList =listdeleteat(idList,hj )>

      </cfif>



      </cfloop>
      </span></span>

      </td>



      </CFOUTPUT>

      </tr>
      <tr><td><hr size="0.5" noshade="noshade" color="##99CC00"/></td><td colspan="6"><hr size="0.5" noshade="noshade" color="##99CC00"/></td></tr>

      </CFOUTPUT>