Solved

How to resolve the error Server busy or unable to fulfill request ?????

Posted on 2001-06-07
14
543 Views
Last Modified: 2008-02-01
Hi,

   We 've developed an Application with Cold Fusion as Front-End , Ingres as Database and IIS as Web Server.
           When we are executing a particular page in our application which accesses a table of more than 30,000 records with lot of looping operation we get an error all of a sudden.
The Error we encountered is as Follows  :

Request canceled or ignored by serverServer busy or unable to fulfill request. The server is unable to fulfill your request due to extremely high traffic or an unexpected internal error. Please attempt your request again (if you are repeatedly unsuccessful you should notify the site administrator). (Location Code: 26)

      Pls. do suggest us on how to resolve the error, whether we 've to do some settings in Cold Fusion Application Server or in the IIS web server for handlings the load.Also is there any way to release the memory thru. the code or in the Server settings. Pls. reply ASAP.
0
Comment
Question by:Thinkpad
  • 3
  • 3
  • 3
  • +4
14 Comments
 
LVL 19

Expert Comment

by:DreamMaster
Comment Utility
Things to check are:

Closing connections when they are not needed, releasing references to objects when they are not in use...etc...etc...

Personally I have no experience with Ingres as a database so I do not know if it has any issues with speed when large numbers of records are requested...although 30.000 is not all that much...

You say that your page uses a lot of looping itterations...are you sure you use the most efficient way? Sometime redesigning your loops can help a lot for performance...

That's about what springs to mind now....

Cheers,
Max.
0
 

Author Comment

by:Thinkpad
Comment Utility
The Code (Top Frame and Bottom Frame) is enclosed for your reference. The error is encountered only in Top Frame.

Top Frame
*********
<cftry>
<cfparam name="form.hid_selsarea" default = "">
<cfparam name="form.hid_Src" default = "0">
<cfparam name="form.hid_Count" default="0">
<cfparam name="hid_Addedit" default="">
<cfparam name="cfqry_Result.RecordCount" default="0">
<cfparam name="Form.hid_Query" default="">

<cfparam name="hid_Pk" default="">
<cfparam name="hid_Sa" default="">
<cfparam name="hid_Ft" default="">
<cfparam name="hid_Fun" default="">
<cfparam name="hid_Sd" default="">
<cfparam name="hid_St" default="">
<cfparam name="hid_Sdu" default="">


<cfset tmp_Pk = trim(urldecode(hid_Pk))>
<cfset tmp_Sa = trim(urldecode(hid_Sa))>
<cfset tmp_Fun = trim(urldecode(hid_Fun))>

<cfset cflag='F'>
 
<cfset session.Addedit = "A">
<cfset FORM.hid_selsarea = #hid_selsarea#>
<html>
<head>
<title></title>
<link href="style.css" rel="STYLESHEET" type="TEXT/CSS">
</head>
<body>  
<form name="frm_Addedittop" onload="frm_onload()"  action="cf_AddEditstf.cfm" method="post">
<div align="center"><center>
<table border="1">
    <tr>
        <td colspan="13"><p align="center"><font size="4"><strong>Add
        / Edit Staff</strong></font><br>
        </p>
        </td>
    </tr>
    <tr>
        <td><table border="0">
            <tr>
                <td>&nbsp;</td>
                <td valign="top" nowrap><strong>Pmf Key</strong></td>
                <td>&nbsp;</td>
                <td valign="top" nowrap><strong>Last Name</strong></td>
                <td>&nbsp;</td>
                <td valign="top" nowrap><strong>First Name</strong></td>
                <td>&nbsp;</td>
            <td valign="top" nowrap><strong>Solution Area</strong></td>
               <td>&nbsp;</td>
                <td valign="top"><strong>Function</strong></td>
                <td>&nbsp;</td>
                <td valign="top" nowrap><strong>Date</strong></td>
                <td>&nbsp;</td>
                <td valign="top"><strong>Time</strong></td>
                        <td>&nbsp;</td>
                <td valign="top"><strong>Duration</strong></td>
                <td>&nbsp;</td>
                <td valign="top"><strong>Assignment</strong><input type = "hidden" name = "hid_selsarea" value = "<cfoutput>#form.hid_selsarea#</cfoutput>"></td>
            </tr>
<cfif #hid_Addedit# neq "ADD">

               <!--- <script language="JavaScript">
                   parent.Bottomform.document.frm_Edtstf.hid_Addedit.value = "ADD"
               </script>  --->
   <cfif #hid_Addedit# eq "EDIT">
     <cfif parameterexists(Session.cfqry_Staff)>
<!---        <cfset Session.cfqry_AddEditStaff = Session.cfqry_Staff> --->
         <cfset Form.hid_Query = Session.cfqry_Staff>
<!---          <cfoutput>#Form.hid_Query#</cfoutput> --->
       </cfif>
             <!--- <script language="JavaScript">
                   parent.Bottomform.document.frm_Edtstf.hid_Addedit.value = "EDIT"
               </script> --->
   </cfif>
      
<!---       <cfif isdefined("Session.cfqry_AddEditStaff") and #Session.cfqry_AddEditStaff# neq ""> --->
      <cfif #Form.hid_Query# neq "">
                  <!--- Executing session qyery to load all values to new query   --->
<!---                   <cfx_ingres name="cfqry_Result" db=#Session.cawdbNode# sql= #Session.cfqry_AddEditStaff#>     --->
            <cfx_ingres name="cfqry_Result" db=#Session.cawdbNode# sql=#Form.hid_Query#>                
                  <cfset cfqry_Resultnew = QueryNew("pmf_key,last_name,first_name,Conf,function,start_time,stop_time,Duration,Assignval,Assign,primary_conference,primary_function,primary_speaker,sba_relationship,product_code,tid")>
                  
                  <cfoutput query = "cfqry_Result">             
                         <cfset cflag = 'F'>             
                        <cfif #trim(hid_Ft)# eq 'ses'>
                            <cfif #trim(cfqry_Result.sessions)# neq trim(tmp_Fun)>
                                <cfset cflag = 'T'>
                              </cfif>
                        <cfelseif #trim(hid_Ft)# eq 'sta'>
                           <cfif #trim(cfqry_Result.station)# neq trim(tmp_Fun)>
                                <cfset cflag = 'T'>
                           </cfif>
                              
                        <cfelseif #trim(hid_Ft)# eq 'loc'>  
                           <cfif #trim(cfqry_Result.booth)# neq trim(tmp_Fun)>
                                <cfset cflag = 'T'>
                           </cfif>
                        </cfif>
<!--- (#trim(tmp_Pk)# neq #trim(cfqry_Result.pmf_key)#) or (#trim(tmp_Sa)# neq #trim(cfqry_Result.Conf)#) or ( #dateformat(trim(cfqry_Result.start_time),"mm-dd-yyyy")# neq #trim(hid_Sd)#) or (#left(right(trim(cfqry_Result.start_time), 8),5)# neq #trim(hid_St)#) or (#trim(hid_Sdu)# neq #trim(cfqry_Result.Duration)#) and #cflag# eq 'T' --->
                     <cfif (trim(tmp_Pk) neq trim(cfqry_Result.pmf_key)) or (trim(tmp_Sa) neq trim(cfqry_Result.Conf)) or ( dateformat(trim(cfqry_Result.start_time),"mm-dd-yyyy") neq trim(hid_Sd)) or (left(right(trim(cfqry_Result.start_time), 8),5) neq trim(hid_St)) or (trim(hid_Sdu) neq trim(cfqry_Result.Duration)) and cflag eq 'T'>
                   <cfx_ingres name="cfqry_Primary" db=#Session.cawdbNode# sql="select primary_conference,primary_function,sba_relationship from person where pmf_key = '#trim(cfqry_Result.pmf_key)#'">
                     <cfx_ingres name="cfqry_Product" db=#Session.cawdbNode# sql="select schedule.product_code as product_code, productmaster.product as product from schedule,productmaster where schedule.pmf_key ='#trim(cfqry_Result.pmf_key)#' and schedule.start_time = '#trim(cfqry_Result.start_time)#' and schedule.stop_time = '#trim(cfqry_Result.stop_time)#' and schedule.product_code = productmaster.product_code">
             
                     <cfset temp = QueryAddRow(cfqry_Resultnew)>
                    
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"pmf_key","#trim(cfqry_Result.pmf_key)#")>                   
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"last_name","#trim(cfqry_Result.last_name)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"first_name","#trim(cfqry_Result.first_name)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"Conf","#trim(cfqry_Result.Conf)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"function","#trim(cfqry_Result.function)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"start_time","#trim(cfqry_Result.start_time)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"stop_time","#trim(cfqry_Result.stop_time)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"Duration","#trim(cfqry_Result.Duration)#")>
                    
                    
                     <cfif #trim(cfqry_Result.sessions)# neq ''>
                      
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"Assignval","#trim(cfqry_Result.sessions)#")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"Assign","ses")>
                           <cfx_ingres name="cfqry_Spaeak" db=#Session.cawdbNode# sql="select * from sessions where primary_speaker = '#trim(cfqry_Result.pmf_key)#' and session_code ='#trim(cfqry_Result.sessions)#'">                     
                    <cfif #cfqry_Spaeak.recordcount# gt 0 >
                               <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_speaker","T")>
                              <cfelse>
                                 <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_speaker","F")>         
                              </cfif>  
                     <cfelseif #trim(cfqry_Result.station)# neq ''>
                      
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"Assignval","#trim(cfqry_Result.station)#")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"Assign","sta")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_speaker","F")>         
                     <cfelseif #trim(cfqry_Result.booth)# neq ''>
                      
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"Assignval","#trim(cfqry_Result.booth)#")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"Assign","loc")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_speaker","F")>         
                     </cfif>
                    
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_conference","#trim(cfqry_Primary.primary_conference)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_function","#trim(cfqry_Primary.primary_function)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"sba_relationship","#trim(cfqry_Primary.sba_relationship)#")>
                    
                     <cfif #cfqry_Product.recordcount# gt 0>
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"product_code","#trim(cfqry_Product.product_code)#")>
                        <cfelse>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"product_code","")>
                           </cfif>
                         
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"tid","#trim(cfqry_Result.tid)#")>
                  <cfelse>
                        <cfif #hid_Addedit# eq "ADT">
                           <cfset pmf_key_temp =trim(cfqry_Result.pmf_key)>                   
                           <cfset last_name_temp = trim(cfqry_Result.last_name)>
                           <cfset first_name_temp = trim(cfqry_Result.first_name)>
                           <cfset Conf_temp = trim(cfqry_Result.Conf)>
                           <cfset function_temp = trim(cfqry_Result.function)>
                           <cfset start_time_temp = trim(cfqry_Result.start_time)>
                           <cfset stop_time_temp = trim(cfqry_Result.stop_time)>
                           <cfset Duration_temp = trim(cfqry_Result.Duration)>
                           <cfset Sessions_temp = trim(cfqry_Result.sessions)>
                           <cfset Station_temp = trim(cfqry_Result.station)>
                              <cfset Booth_temp =trim(cfqry_Result.booth)>
                           <cfset tid_temp = trim(cfqry_Result.tid)>
                    </cfif>
                  </cfif>
            </cfoutput>
            <cfif #hid_Addedit# eq "ADT">
                  <cfif Parameterexists(pmf_key_temp)>

                     <cfset cflag = 'F'>             
                     <cfif #trim(hid_Ft)# eq 'ses'>
                            <cfif #trim(Sessions_temp)# eq trim(tmp_Fun)>
                                <cfset cflag = 'T'>
                              </cfif>
                        <cfelseif #trim(hid_Ft)# eq 'sta'>
                           <cfif #trim(Station_temp)# eq trim(tmp_Fun)>
                                <cfset cflag = 'T'>
                           </cfif>
                              
                        <cfelseif #trim(hid_Ft)# eq 'loc'>  
                           <cfif #trim(Booth_temp)# eq trim(tmp_Fun)>
                                <cfset cflag = 'T'>
                           </cfif>
                        </cfif>
                    
                     <cfx_ingres name="cfqry_Primary" db=#Session.cawdbNode# sql="select primary_conference,primary_function,sba_relationship from person where pmf_key = '#pmf_key_temp#'">
                     <cfx_ingres name="cfqry_Product" db=#Session.cawdbNode# sql="select schedule.product_code as product_code, productmaster.product as product from schedule,productmaster where schedule.start_time = '#trim(start_time_temp)#' and schedule.stop_time = '#trim(stop_time_temp)#' and schedule.product_code = productmaster.product_code">
             
                     <cfset temp = QueryAddRow(cfqry_Resultnew)>
                    
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"pmf_key","#trim(pmf_key_temp)#")>                   
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"last_name","#trim(last_name_temp)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"first_name","#trim(first_name_temp)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"Conf","#trim(Conf_temp)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"function","#trim(function_temp)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"start_time","#trim(start_time_temp)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"stop_time","#trim(stop_time_temp)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"Duration","#trim(Duration_temp)#")>
                    
                    
                     <cfif #trim(Sessions_temp)# neq ''>
                      
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"Assignval","#trim(Sessions_temp)#")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"Assign","ses")>
                           <cfx_ingres name="cfqry_Spaeak" db=#Session.cawdbNode# sql="select * from sessions where primary_speaker = '#trim(pmf_key_temp)#' and session_code ='#trim(Sessions_temp)#'">
                    <cfif #cfqry_Spaeak.recordcount# gt 0 >
                               <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_speaker","T")>
                              <cfelse>
                                 <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_speaker","F")>         
                              </cfif>  
                     <cfelseif #trim(Station_temp)# neq ''>
                      
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"Assignval","#trim(Station_temp)#")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"Assign","sta")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_speaker","F")>         
                     <cfelseif #trim(Booth_temp)# neq ''>
                      
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"Assignval","#trim(Booth_temp)#")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"Assign","loc")>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_speaker","F")>         
                     </cfif>
                    
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_conference","#trim(cfqry_Primary.primary_conference)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"primary_function","#trim(cfqry_Primary.primary_function)#")>
                     <cfset temp = QuerySetCell(cfqry_Resultnew,"sba_relationship","#trim(cfqry_Primary.sba_relationship)#")>
                    
                     <cfif #cfqry_Product.recordcount# gt 0>
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"product_code","#trim(cfqry_Product.product_code)#")>
                        <cfelse>
                          <cfset temp = QuerySetCell(cfqry_Resultnew,"product_code","")>
                           </cfif>
                         
                        <cfset temp = QuerySetCell(cfqry_Resultnew,"tid","#trim(tid_temp)#")>
                        </cfif>                        
              </cfif>
                  <!--- Holding selected values in relevant Hidden variables  --->
                  <cfoutput query = "cfqry_Resultnew">
                  <tr align="left">      
                      <td><input type="radio" name="rad_Select"  onclick="rad_Select_Onclick()"></td>
                              <td>#cfqry_Resultnew.pmf_key#
                              <input type = "hidden" name = "hid_Pmfkey" value = "#urlencodedformat(trim(cfqry_Resultnew.pmf_key))#">
                              </td>
                              
                      <td>&nbsp;</td>
                      <td>#cfqry_Resultnew.last_name#
                              <input type = "hidden" name = "hid_Lastname" value = "#urlencodedformat(trim(cfqry_Resultnew.last_name))#">
                              
                              </td>
                      <td>&nbsp;</td>
                      <td>#cfqry_Resultnew.first_name#
                              <input type = "hidden" name = "hid_Firstname" value = "#urlencodedformat(trim(cfqry_Resultnew.first_name))#">
                              </td>
                      <td>&nbsp;</td>
                      <td>#cfqry_Resultnew.Conf#
                              <input type = "hidden" name = "hid_Conf" value = "#urlencodedformat(trim(cfqry_Resultnew.Conf))#">
                              </td>
                              <td>&nbsp;</td>
                      <td>#cfqry_Resultnew.function#
                              <input type = "hidden" name = "hid_Function" value = "#urlencodedformat(trim(cfqry_Resultnew.function))#">
                            </td>
                      <td>&nbsp;</td>                                      
                      <td nowrap>#left(trim(cfqry_Resultnew.start_time),11)#
                              <input type = "hidden" name = "hid_Date" value = "#urlencodedformat(dateformat(trim(cfqry_Resultnew.start_time),"mm-dd-yyyy"))#">
                              </td>
                      
                              <td>&nbsp;</td>
                      <td nowrap>#left(right(trim(cfqry_Resultnew.start_time), 8),5)#
                              <input type = "hidden" name = "hid_Time" value = "#urlencodedformat(left(right(trim(cfqry_Resultnew.start_time), 8),5))#">
                              </td>
                           
                              <td>&nbsp;</td>
                      <td nowrap>#cfqry_Resultnew.Duration#
                              <input type = "hidden" name = "hid_Dura" value = "#urlencodedformat(cfqry_Resultnew.Duration)#">
                              </td>
                                                
                              <td>&nbsp;</td>
                      <td>#cfqry_Resultnew.Assignval#
                              <input type = "hidden" name = "hid_Stoptime" value = "#urlencodedformat(trim(cfqry_Resultnew.stop_time))#">
                              
                              <input type = "hidden" name = "hid_Assignval" value = "#urlencodedformat(trim(cfqry_Resultnew.Assignval))#">
                              
                              <input type = "hidden" name = "hid_Assign" value = "#urlencodedformat(trim(cfqry_Resultnew.Assign))#">
                      <input type = "hidden" name = "hid_Pfunct" value = "#urlencodedformat(trim(cfqry_Resultnew.primary_function))#">
                              
                              <input type = "hidden" name = "hid_Psarea" value = "#urlencodedformat(trim(cfqry_Resultnew.primary_conference))#">
                              <input type = "hidden" name = "hid_Speak" value = "#urlencodedformat(trim(cfqry_Resultnew.primary_speaker))#">
                              <input type = "hidden" name = "hid_Sba" value = "#urlencodedformat(trim(cfqry_Resultnew.sba_relationship))#">
                              <input type = "hidden" name = "hid_Pprod" value = "#urlencodedformat(trim(cfqry_Resultnew.product_code))#">      
                              <input type = "hidden" name = "hid_tid" value = "#trim(cfqry_Resultnew.tid)#">      
                        </td>
                                                   
                  </cfoutput>
  <cfelse>
        <cfset cfqry_Result.RecordCount      = 0>      
  </cfif>
</cfif>
                  

    <CFCATCH TYPE="Any">
    <H1>Other Error: #CFCATCH.Type#</H1>

    <CFOUTPUT>
    <UL>
    <LI><B>Message:</B> #CFCATCH.message#
    <LI><B>Detail:</B> #CFCATCH.Detail#
    </UL>
    </CFOUTPUT>
    </CFCATCH>
</CFTRY>

   
                  
<!---       <cfcatch type="any">
          <cfset CommitThis=FALSE>
      </cfcatch>
</cftry> --->
            </table>
        </td>
    </tr>
      
      <!---
    <tr>
       
            <td align="center"><input type="button" name="btn_ok"
        value="   OK    "> <input type="button" name="btn_cancel"
        value=" Cancel "></td>
    </tr>  --->
</table>

<cfoutput>
        <input type = "hidden" name = "hid_Src" value = "#form.hid_Src#">
            <input type = "hidden" name = "hid_Count" value = "#form.hid_Count#">
            <input type = "hidden" name = "hid_Addedit" value = "#hid_Addedit#">
            
            <input type = "hidden" name = "hid_Pk" value = "#hid_Pk#">
            <input type = "hidden" name = "hid_Sa" value = "#hid_Sa#">
            <input type = "hidden" name = "hid_Ft" value = "#hid_Ft#">
            <input type = "hidden" name = "hid_Fun" value = "#hid_Fun#">
            <input type = "hidden" name = "hid_Sd" value = "#hid_Sd#">
            <input type = "hidden" name = "hid_St" value = "#hid_St#">
            <input type = "hidden" name = "hid_Sdu" value = "#hid_Sdu#">
            
            <input type="Hidden" name="hid_Query" value="#urlencodedformat(Form.hid_Query)#">
</cfoutput>                          
<script language="JavaScript">
      frm_Addedittop.hid_Query.value=unescape(frm_Addedittop.hid_Query.value)
</script>
</center></div>

<p>&nbsp;</p>

<p>&nbsp;</p>
</from>
</body>
</html>


<script language = "javascript">
      
      function rad_Select_Onclick()
      {
            parent.Bottomform.document.frm_Edtstf.hid_Query.value= document.frm_Addedittop.hid_Query.value
            var count=<cfoutput>#cfqry_Result.RecordCount#</cfoutput>;
            if (count == 1)
            {
                  if (document.frm_Addedittop.rad_Select.checked)
                  {
                                    Reassigncnt1();
                                    
                                    if ((document.frm_Addedittop.hid_Assign.value) == "ses")
                                    {             
                                      parent.Bottomform.document.frm_Edtstf.rdo_Assign[0].checked = true
                                      parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ASC"
                                      parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "ses"
                                     }
                                    else if ((document.frm_Addedittop.hid_Assign.value) == "sta")
                                    {
                                      parent.Bottomform.document.frm_Edtstf.rdo_Assign[1].checked = true
                                      parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ATC"
                                      parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "sta"
                                    }
                                    else if ((document.frm_Addedittop.hid_Assign.value) == "loc")
                                    {
                                      parent.Bottomform.document.frm_Edtstf.rdo_Assign[2].checked = true
                                      parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ALC"
                                      parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "loc"
                                    }
                                    parent.Bottomform.document.frm_Edtstf.hid_Sassignval.value = unescape(document.frm_Addedittop.hid_Assignval.value)
                                    document.frm_Addedittop.hid_Count.value = 0
                                    parent.Bottomform.document.frm_Edtstf.hid_Source.value="Staff"
                                    parent.Bottomform.document.frm_Edtstf.submit();
                        }
            }
            if (count > 1)
            {      
                 
                  for (i=0;i<count;i++)
                  {
                        if (document.frm_Addedittop.rad_Select[i].checked)
                        {
                                                      
                                    Reassign(i);
                                     
                                    if ((document.frm_Addedittop.hid_Assign[i].value) == "ses")
                                    {             
                                      parent.Bottomform.document.frm_Edtstf.rdo_Assign[0].checked = true
                                      parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ASC"
                                             parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "ses"
                                    }
                                    else if ((document.frm_Addedittop.hid_Assign[i].value) == "sta")
                                    {
                                     
                                      parent.Bottomform.document.frm_Edtstf.rdo_Assign[1].checked = true
                                      parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ATC"
                                      parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "sta"
                                    }
                                    else if ((document.frm_Addedittop.hid_Assign[i].value) == "loc")
                                    {
                                      parent.Bottomform.document.frm_Edtstf.rdo_Assign[2].checked = true
                                      parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ALC"
                                      parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "loc"
                                    }
                                    
                                    parent.Bottomform.document.frm_Edtstf.hid_Sassignval.value = unescape(document.frm_Addedittop.hid_Assignval[i].value)
                                    //document.frm_Addedittop.hid_Count.value = i
                                    document.frm_Addedittop.hid_Count.value = document.frm_Addedittop.hid_tid[i].value
                                    parent.Bottomform.document.frm_Edtstf.hid_Source.value="Staff"
                                    parent.Bottomform.document.frm_Edtstf.submit();
                              
                        }
                  }
            }
            
      }                  
      function Reassign(i)
      {
            var count= "";
                  parent.Bottomform.document.frm_Edtstf.txt_Pmfkey.value = unescape(document.frm_Addedittop.hid_Pmfkey[i].value)
                  parent.Bottomform.document.frm_Edtstf.hid_Spmf.value = unescape(document.frm_Addedittop.hid_Pmfkey[i].value)
                  parent.Bottomform.document.frm_Edtstf.txt_Lastname.value = unescape(document.frm_Addedittop.hid_Lastname[i].value)
                  parent.Bottomform.document.frm_Edtstf.txt_Firstname.value = unescape(document.frm_Addedittop.hid_Firstname[i].value)
            parent.Bottomform.document.frm_Edtstf.hid_Stoptime.value = unescape(document.frm_Addedittop.hid_Stoptime[i].value)
                  //parent.Bottomform.document.frm_Edtstf.hid_Spmf.value = unescape(document.frm_Addedittop.hid_Pmfkey[i].value)
             
             count=parent.Bottomform.document.frm_Edtstf.cbo_Sarea.options.length;            
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Sarea[j].text == unescape(document.frm_Addedittop.hid_Conf[i].value))
                       {
                               
                              parent.Bottomform.document.frm_Edtstf.cbo_Sarea.selectedIndex = j;
                               break;
                         }
                  }
            
            count=parent.Bottomform.document.frm_Edtstf.cbo_Funct.options.length;
            
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Funct[j].text == unescape(document.frm_Addedittop.hid_Function[i].value))
                        {
                              parent.Bottomform.document.frm_Edtstf.cbo_Funct.selectedIndex = j;
                              break;
                        }
                  }
                                    
              count=parent.Bottomform.document.frm_Edtstf.cbo_Assign.options.length;            
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Assign[j].text == unescape(document.frm_Addedittop.hid_Assignval[i].value))
                       {
                               parent.Bottomform.document.frm_Edtstf.cbo_Assign.selectedIndex = j;
                              break;
                         }
                        else
                        {  
                          parent.Bottomform.document.frm_Edtstf.hid_valass.value = unescape(document.frm_Addedittop.hid_Assignval[i].value)
                          parent.Bottomform.document.frm_Edtstf.hid_Sdate.value = unescape(document.frm_Addedittop.hid_Date[i].value)
                          parent.Bottomform.document.frm_Edtstf.hid_Stime.value = unescape(document.frm_Addedittop.hid_Time[i].value)
                          parent.Bottomform.document.frm_Edtstf.hid_Sdura.value = unescape(document.frm_Addedittop.hid_Dura[i].value)
                         }      
                         
                  }
                  
                              
           if (parent.Bottomform.document.frm_Edtstf.cbo_Date.type == "text")      
              {      
                  
                  parent.Bottomform.document.frm_Edtstf.cbo_Date.value = unescape(document.frm_Addedittop.hid_Date[i].value)
                  parent.Bottomform.document.frm_Edtstf.hid_Sdate.value = unescape(document.frm_Addedittop.hid_Date[i].value)
                  parent.Bottomform.document.frm_Edtstf.cbo_Time.value = unescape(document.frm_Addedittop.hid_Time[i].value)
                  parent.Bottomform.document.frm_Edtstf.hid_Stime.value = unescape(document.frm_Addedittop.hid_Time[i].value)
                  parent.Bottomform.document.frm_Edtstf.cbo_Dura.value = unescape(document.frm_Addedittop.hid_Dura[i].value)
                  parent.Bottomform.document.frm_Edtstf.hid_Sdura.value = unescape(document.frm_Addedittop.hid_Dura[i].value)
            }
             else
              {
            
                  count=parent.Bottomform.document.frm_Edtstf.cbo_Date.options.length;            
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Date[j].text == unescape(document.frm_Addedittop.hid_Date[i].value))
                       {
                               parent.Bottomform.document.frm_Edtstf.cbo_Date.selectedIndex = j;
                              parent.Bottomform.document.frm_Edtstf.hid_Sdate.value = unescape(document.frm_Addedittop.hid_Date[i].value)
                               
                              break;
                        }      
                  }
            count=parent.Bottomform.document.frm_Edtstf.cbo_Time.options.length;            
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Time[j].text == unescape(document.frm_Addedittop.hid_Time[i].value))
                       {
                               parent.Bottomform.document.frm_Edtstf.cbo_Time.selectedIndex = j;
                              parent.Bottomform.document.frm_Edtstf.hid_Stime.value = unescape(document.frm_Addedittop.hid_Time[i].value)
                              break;
                        }      
                  }      
              count=parent.Bottomform.document.frm_Edtstf.cbo_Dura.options.length;      
             
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Dura[j].text == unescape(document.frm_Addedittop.hid_Dura[i].value))
                       {
                               parent.Bottomform.document.frm_Edtstf.cbo_Dura.selectedIndex = j;
                              parent.Bottomform.document.frm_Edtstf.hid_Sdura.value = unescape(document.frm_Addedittop.hid_Dura[i].value)
                              break;
                        }      
                  }      
             }
             count=parent.Bottomform.document.frm_Edtstf.cbo_Pfunct.options.length;                        
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Pfunct[j].text == unescape(document.frm_Addedittop.hid_Pfunct[i].value))
                        {
                              parent.Bottomform.document.frm_Edtstf.cbo_Pfunct.selectedIndex = j;
                              break;
                        }
                        else
                        {
                          parent.Bottomform.document.frm_Edtstf.cbo_Pfunct.selectedIndex = 0;
                        }      
                  }
                  
            count=parent.Bottomform.document.frm_Edtstf.cbo_Psarea.options.length;                        
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Psarea[j].text == unescape(document.frm_Addedittop.hid_Psarea[i].value))
                        {
                              parent.Bottomform.document.frm_Edtstf.cbo_Psarea.selectedIndex = j;
                              break;
                        }      
                        else
                        {
                          parent.Bottomform.document.frm_Edtstf.cbo_Psarea.selectedIndex = 0;
                        }

                        
                  }
            count=parent.Bottomform.document.frm_Edtstf.cbo_Pprod.options.length;                        
                  for (j=1;j<count ;j++)
                  {
                        if(unescape(parent.Bottomform.document.frm_Edtstf.cbo_Pprod[j].value) == unescape(document.frm_Addedittop.hid_Pprod[i].value))
                         {
                               parent.Bottomform.document.frm_Edtstf.cbo_Pprod.selectedIndex = j;
                               break;
                         }      
                        else
                        {
                          parent.Bottomform.document.frm_Edtstf.cbo_Pprod.selectedIndex = 0;
                        }
                  }      
         
              if (document.frm_Addedittop.hid_Sba[i].value == "T")
           {      
                    parent.Bottomform.document.frm_Edtstf.chk_Sba.checked = true
               }       
              else
               {
                   parent.Bottomform.document.frm_Edtstf.chk_Sba.checked = false
               }
               
               if (document.frm_Addedittop.hid_Speak[i].value == "T")
           {      
                    parent.Bottomform.document.frm_Edtstf.chk_Pspeak.checked = true
               }       
           else
               {
                  parent.Bottomform.document.frm_Edtstf.chk_Pspeak.checked = false
               }
             
      } // end of function

      function Reassigncnt1()
      {

            var count= "";
                  parent.Bottomform.document.frm_Edtstf.txt_Pmfkey.value = unescape(document.frm_Addedittop.hid_Pmfkey.value)
                  parent.Bottomform.document.frm_Edtstf.txt_Lastname.value = unescape(document.frm_Addedittop.hid_Lastname.value)
                  parent.Bottomform.document.frm_Edtstf.txt_Firstname.value = unescape(document.frm_Addedittop.hid_Firstname.value)
              parent.Bottomform.document.frm_Edtstf.hid_Spmf.value = unescape(document.frm_Addedittop.hid_Pmfkey.value)
                parent.Bottomform.document.frm_Edtstf.hid_Stoptime.value = unescape(document.frm_Addedittop.hid_Stoptime.value)
             count=parent.Bottomform.document.frm_Edtstf.cbo_Sarea.options.length;            
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Sarea[j].text == unescape(document.frm_Addedittop.hid_Conf.value))
                       {
                               parent.Bottomform.document.frm_Edtstf.cbo_Sarea.selectedIndex = j;
                               break;
                         }
                  }
                  
            count=parent.Bottomform.document.frm_Edtstf.cbo_Funct.options.length;
            
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Funct[j].text == unescape(document.frm_Addedittop.hid_Function.value))
                        {
                              parent.Bottomform.document.frm_Edtstf.cbo_Funct.selectedIndex = j;
                              break;
                        }
                  }
            
               count=parent.Bottomform.document.frm_Edtstf.cbo_Assign.options.length;            
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Assign[j].text == unescape(document.frm_Addedittop.hid_Assignval.value))
                       {
                               parent.Bottomform.document.frm_Edtstf.cbo_Assign.selectedIndex = j;
                              break;
                         }
                        else
                         {  
                            parent.Bottomform.document.frm_Edtstf.hid_valass.value = unescape(document.frm_Addedittop.hid_Assignval.value)
                            parent.Bottomform.document.frm_Edtstf.hid_Sdate.value = unescape(document.frm_Addedittop.hid_Date.value)
                            parent.Bottomform.document.frm_Edtstf.hid_Stime.value = unescape(document.frm_Addedittop.hid_Time.value)
                            parent.Bottomform.document.frm_Edtstf.hid_Sdura.value = unescape(document.frm_Addedittop.hid_Dura.value)
                                       
                          }      
                    }
                  
                  if (parent.Bottomform.document.frm_Edtstf.cbo_Date.type == "text")
                  {
                        parent.Bottomform.document.frm_Edtstf.cbo_Date.value = unescape(document.frm_Addedittop.hid_Date.value)
                        parent.Bottomform.document.frm_Edtstf.hid_Sdate.value = unescape(document.frm_Addedittop.hid_Date.value)
                        parent.Bottomform.document.frm_Edtstf.cbo_Time.value = unescape(document.frm_Addedittop.hid_Time.value)
                        parent.Bottomform.document.frm_Edtstf.hid_Stime.value = unescape(document.frm_Addedittop.hid_Time.value)
                        parent.Bottomform.document.frm_Edtstf.cbo_Dura.value = unescape(document.frm_Addedittop.hid_Dura.value)
                        parent.Bottomform.document.frm_Edtstf.hid_Sdura.value = unescape(document.frm_Addedittop.hid_Dura.value)
                  }
                  else      
                {
                        count=parent.Bottomform.document.frm_Edtstf.cbo_Date.options.length;            
                        for (j=1;j<count ;j++)
                        {
                                 if (parent.Bottomform.document.frm_Edtstf.cbo_Date[j].text == unescape(document.frm_Addedittop.hid_Date.value))
                                {
                               parent.Bottomform.document.frm_Edtstf.cbo_Date.selectedIndex = j;
                              parent.Bottomform.document.frm_Edtstf.hid_Sdate.value = unescape(document.frm_Addedittop.hid_Date.value)
                              break;
                              }      
                        }
                        count=parent.Bottomform.document.frm_Edtstf.cbo_Time.options.length;            
                        for (j=1;j<count ;j++)
                              {
                                    if (parent.Bottomform.document.frm_Edtstf.cbo_Time[j].text == unescape(document.frm_Addedittop.hid_Time.value))
                                   {
                                                 parent.Bottomform.document.frm_Edtstf.cbo_Time.selectedIndex = j;
                                                parent.Bottomform.document.frm_Edtstf.hid_Stime.value = unescape(document.frm_Addedittop.hid_Time.value)
                                                break;
                                    }      
                              }      
                          count=parent.Bottomform.document.frm_Edtstf.cbo_Dura.options.length;            
                        for (j=1;j<count ;j++)
                              {
                                    if (parent.Bottomform.document.frm_Edtstf.cbo_Dura[j].text == unescape(document.frm_Addedittop.hid_Dura.value))
                                   {
                                           parent.Bottomform.document.frm_Edtstf.cbo_Dura.selectedIndex = j;
                                          parent.Bottomform.document.frm_Edtstf.hid_Sdura.value = unescape(document.frm_Addedittop.hid_Dura.value)
                                          break;
                                  }      
                              }
                      
                      }
                  
             count=parent.Bottomform.document.frm_Edtstf.cbo_Pfunct.options.length;                        
                  for (j=1;j<count ;j++)
                  {
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Pfunct[j].text == unescape(document.frm_Addedittop.hid_Pfunct.value))
                        {
                                    parent.Bottomform.document.frm_Edtstf.cbo_Pfunct.selectedIndex = j;
                                    break;
                        }
                        else
                        {
                          parent.Bottomform.document.frm_Edtstf.cbo_Pfunct.selectedIndex = 0;
                        }            
                  }
                  
            count=parent.Bottomform.document.frm_Edtstf.cbo_Psarea.options.length;                        
                  for (j=1;j<count ;j++)
                  {
                      
                        if (parent.Bottomform.document.frm_Edtstf.cbo_Psarea[j].text == unescape(document.frm_Addedittop.hid_Psarea.value))
                        {
                              parent.Bottomform.document.frm_Edtstf.cbo_Psarea.selectedIndex = j;
                              break;
                        }
                        else
                        {
                          parent.Bottomform.document.frm_Edtstf.cbo_Psarea.selectedIndex = 0;
                        }
                  }
            count=parent.Bottomform.document.frm_Edtstf.cbo_Pprod.options.length;                        
                  for (j=1;j<count ;j++)
                  {
                        if (unescape(parent.Bottomform.document.frm_Edtstf.cbo_Pprod[j].value) == unescape(document.frm_Addedittop.hid_Pprod.value))
                        {
                               parent.Bottomform.document.frm_Edtstf.cbo_Pprod.selectedIndex = j;
                               break;
                        }
                        else
                        {
                          parent.Bottomform.document.frm_Edtstf.cbo_Pprod.selectedIndex = 0;
                        }
                  }      
         
              if (document.frm_Addedittop.hid_Sba.value == "T")
           {      
                    parent.Bottomform.document.frm_Edtstf.chk_Sba.checked = true
               }
              else
               {
                 parent.Bottomform.document.frm_Edtstf.chk_Sba.checked = false
               }         
             
               if (document.frm_Addedittop.hid_Speak.value == "T")
           {      
                    parent.Bottomform.document.frm_Edtstf.chk_Pspeak.checked = true
               }       
           else
               {
                   parent.Bottomform.document.frm_Edtstf.chk_Pspeak.checked = false
               }
                       
      
      }

      
      function clear()
      {
                    parent.Bottomform.document.frm_Edtstf.txt_Pmfkey.value = ""
                  parent.Bottomform.document.frm_Edtstf.txt_Lastname.value = ""
                  parent.Bottomform.document.frm_Edtstf.txt_Firstname.value = ""
           
                  parent.Bottomform.document.frm_Edtstf.cbo_Sarea.selectedIndex = 0
                  parent.Bottomform.document.frm_Edtstf.cbo_Funct.selectedIndex = 0
                  parent.Bottomform.document.frm_Edtstf.cbo_Assign.selectedIndex = 0
                  
                  parent.Bottomform.document.frm_Edtstf.cbo_Pfunct.selectedIndex = 0
                  parent.Bottomform.document.frm_Edtstf.cbo_Psarea.selectedIndex = 0
                  parent.Bottomform.document.frm_Edtstf.cbo_Pprod.selectedIndex = 0
                  
                  
                  parent.Bottomform.document.frm_Edtstf.chk_Pspeak.checked = false
                  parent.Bottomform.document.frm_Edtstf.chk_Sba.checked = false
                  
                  parent.Bottomform.document.frm_Edtstf.cbo_Date.selectedIndex = 0
                parent.Bottomform.document.frm_Edtstf.cbo_Time.selectedIndex = 0
                  parent.Bottomform.document.frm_Edtstf.cbo_Dura.selectedIndex = 0
      
      }
      
      
      
      if(document.frm_Addedittop.hid_Src.value == "EDR")      
        
        {
            
          var counter=<cfoutput>#cfqry_Result.RecordCount#</cfoutput>;
            if (counter == 1)
            {       
                  Reassigncnt1()
                  document.frm_Addedittop.rad_Select.checked = true
                  if ((document.frm_Addedittop.hid_Assign.value) == "ses")
                         {             
                                parent.Bottomform.document.frm_Edtstf.rdo_Assign[0].checked = true
                                parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ASC"
                                parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "ses"
                        }
                    else if ((document.frm_Addedittop.hid_Assign.value) == "sta")
                        {
                             parent.Bottomform.document.frm_Edtstf.rdo_Assign[1].checked = true
                                 parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ATC"
                                 parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "sta"
                        }
                  else if ((document.frm_Addedittop.hid_Assign.value) == "loc")
                        {
                                parent.Bottomform.document.frm_Edtstf.rdo_Assign[2].checked = true
                                parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ALC"
                                parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "loc"
                        }    
                  
                   parent.Bottomform.document.frm_Edtstf.hid_Sassignval.value = unescape(document.frm_Addedittop.hid_Assignval.value)       
                   document.frm_Addedittop.hid_Count.value = 0      
                   parent.Bottomform.document.frm_Edtstf.hid_Source.value="Staff"
                   parent.Bottomform.document.frm_Edtstf.submit();
            
             }                              
            if  (counter > 1)
            {  
              // var i = document.frm_Addedittop.hid_Count.value  
              var i=0;
               
               for (n=0;n < document.frm_Addedittop.hid_tid.length;n++)
               {
                  if (document.frm_Addedittop.hid_Count.value == document.frm_Addedittop.hid_tid[n].value)
                    {
                       i = n;
                         break ;
                    }
                }  
               
               Reassign(i)
            
               document.frm_Addedittop.rad_Select[i].checked = true
         
               if ((document.frm_Addedittop.hid_Assign[i].value) == "ses")
                         {             
                                parent.Bottomform.document.frm_Edtstf.rdo_Assign[0].checked = true
                                parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ASC"
                                parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "ses"
                        }
                    else if ((document.frm_Addedittop.hid_Assign[i].value) == "sta")
                        {
                             parent.Bottomform.document.frm_Edtstf.rdo_Assign[1].checked = true
                                 parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ATC"
                                 parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "sta"
                        }
                  else if ((document.frm_Addedittop.hid_Assign[i].value) == "loc")
                        {
                                parent.Bottomform.document.frm_Edtstf.rdo_Assign[2].checked = true
                                parent.Bottomform.document.frm_Edtstf.hid_Cmode.value="ALC"
                                parent.Bottomform.document.frm_Edtstf.hid_Sassign.value = "loc"
                        }
                   parent.Bottomform.document.frm_Edtstf.hid_Sassignval.value = unescape(document.frm_Addedittop.hid_Assignval[i].value)
                   document.frm_Addedittop.hid_Count.value = document.frm_Addedittop.hid_tid[i].value
                   parent.Bottomform.document.frm_Edtstf.hid_Source.value="Staff"
                 parent.Bottomform.document.frm_Edtstf.submit();
                 
              }  
            }
        
      </script>
***********************************************************
Bottom Frame
************

<cfparam name="form.hid_Source" default="">         
<cfset flag = "T">         
<cfif form.hid_Source eq 'Sessionmgmt'>
   
      <cfif parameterexists(hid_Logcheck)>
            <cfset flag = "T">
      <cfelse>
        <cfset flag = "F">         
            <cfoutput>
            <script>
             alert("Incorrect login");
                  self.location="../Travel&Telecom/main.htm";
            </script>
            </cfoutput>
      </cfif>
</cfif>      
<cfif flag eq "T">
<cfinclude template="../cf_Errpage.cfm">
<cfparam name="form.hid_CMode" default="T">
<cfparam name="form.hid_SMode" default="">
<cfparam name="form.hid_Ass" default="">
<cfparam name="form.hid_valass" default="">
<cfparam name="form.rdo_Assign" default="ses">
<cfparam name="form.chk_Pspeak" default="F">
<cfparam name="form.chk_Sba" default="F">
<cfparam name="form.hid_Pinfo" default="F">
<cfparam name="form.hid_Proc" default="F">
<cfparam name="form.hid_Stoptime" default="">
<cfparam name="form.hid_Source1" default="">
<cfparam name="form.hid_Defsarea" default="">
<cfparam name="form.hid_Defses" default="">
<cfparam name="hid_Addedit" default="">
<cfparam name="url.tmp_Pmfkey" default="">
<cfparam name="Form.hid_Query" default="">
 <!--- Temporary variable declaration part --->
<cfset msg = 0>
<cfset tmp_ses = ''>
<cfset tmp_sta = ''>
<cfset tmp_loc = ''>
<cfset counter = 0>
<cfset tmp_pmf=''>
<cfset tmp_sarea=''>
<cfset tmp_fname=''>
<cfset tmp_lname=''>
<cfset tmp_funct='SPEAKER'>
<cfset tmp_ass=''>
<cfset tmp_assval=''>
<cfset tmp_pfunct=''>
<cfset tmp_parea=''>       
<cfset tmp_pprod=''>
<cfset tmp_pspeak=''>
<cfset tmp_sba=''>
<cfset tmp_date=''>
<cfset tmp_time=''>
<cfset tmp_dura=''>

<cfset tmp_sdate=''>
<cfset tmp_stime=''>
<cfset tmp_sdura=''>
<cfset tmp_spmf=''>
<cfset warning=''>
<cfset tmp_sassign=''>
<cfset tmp_sassignval=''>
<cfset ass_flag='F'>

<cfparam name="form.hid_Count" default="0">
<!--- Temporary variable declaration part ends here--->
<script language="JavaScript">

function cbo_Sarea_onchange()
{
   frm_Edtstf.hid_Cmode.value = 'SAC'
   frm_Edtstf.submit()
}

function cbo_Assign_onchange()
  {
   
      if (frm_Edtstf.rdo_Assign[0].checked)
            {
              frm_Edtstf.hid_Cmode.value = 'ASC'
              frm_Edtstf.submit()
            }
    else if(frm_Edtstf.rdo_Assign[1].checked)       
          {
              frm_Edtstf.hid_Cmode.value = 'ATC'
            }  
      else if(frm_Edtstf.rdo_Assign[2].checked)
        {
              frm_Edtstf.hid_Cmode.value = 'ALC'
        }
      //frm_Edtstf.submit()
  }

function cbo_Pfunct_onchange()
      {
              frm_Edtstf.hid_Pinfo.value = "T"
            
      }
function cbo_Psarea_onchange()
      {
              frm_Edtstf.hid_Pinfo.value = "T"
            
      }

function chk_Sba_onclick()
      {
              frm_Edtstf.hid_Pinfo.value = "T"
      }      


function cbo_Funct_onchange()
{
 
  var str
  str=ltrim(rtrim(unescape(frm_Edtstf.cbo_Funct.value)));
  if(str.toUpperCase() == "SPEAKER")
    {
          frm_Edtstf.chk_Pspeak.disabled = false;
    }
   else
    {
    frm_Edtstf.chk_Pspeak.checked = false;
      frm_Edtstf.chk_Pspeak.value = "F";      
      frm_Edtstf.chk_Pspeak.disabled = true;
    }
 }
function btn_Search_onclick()
{
      
      if (frm_Edtstf.txt_Pmfkey.value == '' &&

frm_Edtstf.txt_Lastname.value == '')
            {
                  Err_msg(199)
                  frm_Edtstf.txt_Pmfkey.focus()
                  return false
            }

      if (frm_Edtstf.txt_Pmfkey.value.length !== 0 &&

frm_Edtstf.txt_Lastname.value.length == 0)                  
                  {
                                     

frm_Edtstf.hid_Search.value = "True"
                                      Pmfkey_Search()
                  }
                        
      if (frm_Edtstf.txt_Pmfkey.value.length == 0 &&

frm_Edtstf.txt_Lastname.value.length !== 0)                  
                        {
                                            

frm_Edtstf.hid_Search.value = "True"
                                            

//frm_Edtstf.txt_Firstname.value =""
                                                

Lastname_Search()
                                          
                        }
            
      if (frm_Edtstf.txt_Pmfkey.value.length !== 0 &&

frm_Edtstf.txt_Lastname.value.length !== 0)                  
                        {
                                    

frm_Edtstf.hid_Search.value = "True"
                                    Pmfkey_Search()
                               
                  }                        
}

function txt_Pmfkey_onchange()

      {
           
            frm_Edtstf.txt_Lastname.value =""
            frm_Edtstf.txt_Firstname.value=""
      }
function txt_Lastname_onchange()

      {
           
            frm_Edtstf.txt_Pmfkey.value =""
            frm_Edtstf.txt_Firstname.value=""
   }
      
function rdo_onclick()
      {
       
         if(frm_Edtstf.rdo_Assign[0].checked == true)
         {
           frm_Edtstf.hid_Cmode.value="SAC"
           frm_Edtstf.submit()            
         }
         else
         {
           frm_Edtstf.hid_Cmode.value="AC"
           frm_Edtstf.submit()            
            }
      }

function Pmfkey_Search() // Pmfkey Search
      {
            

ret=window.open("Person.cfm?Pmf_key="+unescape(frm_Edtstf.txt_Pmfkey.va

lue)+"&FormNm=frm_Edtstf&LastNm=txt_Lastname&FirstNm=txt_Firstname&Pmf=

txt_Pmfkey", "NewWind",

"left=50,top=50,height=500,width=650,toolbar=no,status=no,resizable=yes

,scrollbars=yes")

      }

function Lastname_Search() // Lastname Search
      {
            

ret=window.open("Person.cfm?LastName="+unescape(frm_Edtstf.txt_Lastname

.value)+"&FormNm=frm_Edtstf&PmfKey=txt_Pmfkey&FirstNm=txt_Firstname&Las

t=txt_Lastname", "NewWind",

"left=50,top=50,height=500,width=650,toolbar=no,status=no,resizable=yes

,scrollbars=yes,locationbar=yes");
      }

function ltrim(argvalue)
{

  while (1) {
    if (argvalue.substring(0, 1) != "")
      break;
    argvalue = argvalue.substring(1, argvalue.length);

  }
 
  return argvalue;
}

function rtrim(argvalue)
{
 
  while (1) {
    if (argvalue.substring(argvalue.length - 1, argvalue.length) != "")
      break;
    argvalue = argvalue.substring(0, argvalue.length - 1);
  }

  return argvalue;
}

function btn_Add_onclick()
{
frm_Edtstf.hid_Query.value=parent.Topform.document.frm_Addedittop.hid_Q

uery.value
                  
  if(frm_Edtstf.txt_Pmfkey.value == "")
   {
               Err_msg(244)
               frm_Edtstf.txt_Pmfkey.focus()
            return false
    }
  else if(frm_Edtstf.cbo_Funct.value=="")
    {
          Err_msg(245)
               frm_Edtstf.cbo_Funct.focus()
            return false
      }       
  else if (frm_Edtstf.cbo_Assign.value =="")
   {
        Err_msg(246)
               frm_Edtstf.cbo_Assign.focus()
            return false
   }  
 
   if(frm_Edtstf.txt_Pmfkey.value == "" ||

frm_Edtstf.txt_Firstname.value == "" || frm_Edtstf.txt_Lastname.value

== "")
   {
               Err_msg(66)
            frm_Edtstf.txt_Pmfkey.focus()
            return false
    }
   
   if (frm_Edtstf.cbo_Date.type == "text")
   {
      if(frm_Edtstf.cbo_Date.value == "")
        {
          alert("Date is mandatory")
          frm_Edtstf.btn_Add.focus()
            return false
        }
        if(frm_Edtstf.cbo_Time.value == "")
        {
          alert("Time is mandatory")
          frm_Edtstf.btn_Add.focus()
            return false
        }
        if(frm_Edtstf.cbo_Dura.value == "")
        {
          alert("Duration is mandatory")
          frm_Edtstf.btn_Add.focus()
            return false
        }    
   }
  else
   {
     
     if(frm_Edtstf.cbo_Date.value == "Select")
        {
          alert("Date is mandatory")
          frm_Edtstf.cbo_Date.focus()
            return false
        }
        if(frm_Edtstf.cbo_Time.value == "Select")
        {
          alert("Time is mandatory")
          frm_Edtstf.cbo_Time.focus()
            return false
        }
        if(frm_Edtstf.cbo_Dura.value == "Select")
        {
          alert("Duration is mandatory")
          frm_Edtstf.cbo_Dura.focus()
            return false
        }  
   }
   frm_Edtstf.hid_Cmode.value = "A"
   frm_Edtstf.hid_Smode.value="A"
   frm_Edtstf.submit()
}

function btn_Change_onclick()
{
 
 if(frm_Edtstf.txt_Pmfkey.value == '')
   {
               Err_msg(244)
               frm_Edtstf.txt_Pmfkey.focus()
            return false
    }
  else if(frm_Edtstf.cbo_Funct.value=="")
    {
          Err_msg(245)
               frm_Edtstf.cbo_Funct.focus()
            return false
      }       
  else if (frm_Edtstf.cbo_Assign.value =="")
   {
        Err_msg(246)
               frm_Edtstf.cbo_Assign.focus()
            return false
   }  
   
   if(frm_Edtstf.txt_Pmfkey.value == "" ||

frm_Edtstf.txt_Firstname.value == "" || frm_Edtstf.txt_Lastname.value

== "")
   {
               Err_msg(66)
            frm_Edtstf.txt_Pmfkey.focus()
            return false
    }
   
  if (frm_Edtstf.cbo_Date.type == "text")
   {
      if(frm_Edtstf.cbo_Date.value == "")
        {
          alert("Date is mandatory")
          frm_Edtstf.btn_Add.focus()
            return false
        }
        if(frm_Edtstf.cbo_Time.value == "")
        {
          alert("Time is mandatory")
          frm_Edtstf.btn_Add.focus()
            return false
        }
        if(frm_Edtstf.cbo_Dura.value == "")
        {
          alert("Duration is mandatory")
          frm_Edtstf.btn_Add.focus()
            return false
        }    
   }
  else
   {
     if(frm_Edtstf.cbo_Date.value == "Select")
        {
          alert("Date is mandatory")
          frm_Edtstf.cbo_Date.focus()
            return false
        }
        if(frm_Edtstf.cbo_Time.value == "Select")
        {
          alert("Time is mandatory")
          frm_Edtstf.cbo_Time.focus()
            return false
        }
        if(frm_Edtstf.cbo_Dura.value == "Select")
        {
          alert("Duration is mandatory")
          frm_Edtstf.cbo_Dura.focus()
            return false
        }  
   }
      
   frm_Edtstf.hid_Smode.value="C"
   frm_Edtstf.hid_Cmode.value = 'SSS'
   frm_Edtstf.submit()
}

function btn_Delete_onclick()
{
   var pmf = unescape(frm_Edtstf.hid_Spmf.value);
   var func = unescape(frm_Edtstf.cbo_Funct.value);
   var sd = unescape(frm_Edtstf.hid_Sdate.value);
   var sdt = unescape(frm_Edtstf.hid_Stime.value);
   var sdtd = unescape(frm_Edtstf.hid_Sdura.value);
   var asg = unescape(frm_Edtstf.cbo_Assign.value);
   var st = unescape(frm_Edtstf.hid_Stoptime.value);
   
   if(frm_Edtstf.txt_Pmfkey.value == '')
   {
               Err_msg(249)
               frm_Edtstf.txt_Pmfkey.focus()
            return false
    }
      
   if(frm_Edtstf.txt_Pmfkey.value == "" ||

frm_Edtstf.txt_Firstname.value == "" || frm_Edtstf.txt_Lastname.value

== "")
   {
               Err_msg(66)
            frm_Edtstf.txt_Pmfkey.focus()
            return false
    }
   
   if(confirm("Delete " + pmf + "'s assignment as  " + func + "\n" + "  

From:" + sd + " " + sdt + "  Duration:" + sdtd +" To:" + st + "  At:" +

asg + "\n" +"Are you Sure?"))
   {
        frm_Edtstf.hid_Cmode.value = "D"
            frm_Edtstf.hid_Smode.value="D"
            frm_Edtstf.hid_Count.value = 0
            frm_Edtstf.submit();
    }
}

function btn_Close_onclick()
{
    if(frm_Edtstf.hid_Source.value == "Staff")
    {

         frm_Edtstf.target = "_parent"
         frm_Edtstf.action="cf_StaffMgmt.cfm";
         frm_Edtstf.submit();
      }      
 if(frm_Edtstf.hid_Source1.value == "Sessionmgmt")
  {
           frm_Edtstf.target = "_parent"
         frm_Edtstf.action="cf_sessionmgmt.cfm";
         frm_Edtstf.submit();
   }
 }
 
function btn_Home_onclick()
{
   parent.location.href = "cf_Mainmn.cfm?hid_Logcheck=0"
}
 
function clear()
      {
                    frm_Edtstf.txt_Pmfkey.value = ""
                  frm_Edtstf.txt_Lastname.value = ""
                  frm_Edtstf.txt_Firstname.value = ""
           
                  frm_Edtstf.cbo_Sarea.selectedIndex = 0
                  frm_Edtstf.cbo_Funct.selectedIndex = 0
                  frm_Edtstf.cbo_Assign.selectedIndex = 0
                  
                  frm_Edtstf.cbo_Pfunct.selectedIndex = 0
                  frm_Edtstf.cbo_Psarea.selectedIndex = 0
                  frm_Edtstf.cbo_Pprod.selectedIndex = 0
                  
                  frm_Edtstf.chk_Pspeak.checked = false
                  frm_Edtstf.chk_Sba.checked = false
                  
                  frm_Edtstf.cbo_Date.selectedIndex = 0
                frm_Edtstf.cbo_Time.selectedIndex = 0
                  frm_Edtstf.cbo_Dura.selectedIndex = 0
      }
      
function txt_Pmfkey_onblur()
{
       frm_Edtstf.txt_Lastname.value  = ""
      frm_Edtstf.txt_Firstname.value = ""
      if(frm_Edtstf.txt_Pmfkey.value.length > 0)
      {
             frm_Edtstf.hid_Cmode.value = "SP"
            frm_Edtstf.submit()
            return true;
      }
    else
      {
         frm_Edtstf.txt_Lastname.focus()
      }

}      

</script>

<cfif form.hid_Cmode neq "T">
    <!--- holding screen values while submitting the form  --->
      <cfset tmp_pmf= '#trim(urldecode(form.txt_Pmfkey))#'>
      <cfset tmp_sarea='#trim(urldecode(form.cbo_Sarea))#'>
      <cfset tmp_fname='#trim(urldecode(form.txt_Firstname))#'>
      <cfset tmp_lname='#trim(urldecode(form.txt_Lastname))#'>
      <cfset tmp_funct='#trim(urldecode(form.cbo_Funct))#'>
      <cfset tmp_ass='#trim(urldecode(form.cbo_Assign))#'>

      <cfif form.rdo_Assign eq 'ses'>
          <cfset tmp_ses =  #trim(urldecode(form.cbo_Assign))#>
               <cfset tmp_sta = ''>
            <cfset tmp_loc = ''>
      <cfelseif form.rdo_Assign eq 'sta'>
          <cfset tmp_sta =  #trim(urldecode(form.cbo_Assign))#>
            <cfset tmp_ses = ''>
            <cfset tmp_loc = ''>
            
      <cfelseif form.rdo_Assign eq 'loc'>
            <cfset tmp_loc =  #trim(urldecode(form.cbo_Assign))#>
            <cfset tmp_sta = ''>
            <cfset tmp_ses = ''>
            
      </cfif>
      
      <cfset tmp_assval='#trim(urldecode(form.cbo_Assign))#'>
      
      <cfset tmp_sdate=form.hid_Sdate>
      <cfset tmp_stime=form.hid_Stime>
      <cfset tmp_sdura=form.hid_Sdura>
      <cfset tmp_spmf=form.hid_Spmf>
      <cfset tmp_sassign = form.hid_Sassign>
      <cfset tmp_sassignval = form.hid_Sassignval>
      
      <cfset tmp_pfunct='#trim(urldecode(form.cbo_Pfunct))#'>
      <cfset tmp_parea='#trim(urldecode(form.cbo_Psarea))#'>       
      <cfset tmp_pprod='#trim(urldecode(form.cbo_Pprod))#'>
      <cfset tmp_pspeak='#trim(urldecode(form.chk_Pspeak))#'>
      
      
      <cfset tmp_sba='#trim(urldecode(form.chk_Sba))#'>
      <cfset tmp_date='#trim(urldecode(form.cbo_Date))#'>
      <cfset tmp_time='#trim(urldecode(form.cbo_Time))#'>
      <cfset tmp_dura='#trim(urldecode(form.cbo_Dura))#'>
      
      
      <!--- new code --->
      
  <cfif form.hid_Source eq "Staff" and trim(form.hid_valass) neq ''>
          
             <cfset

tmp_assval='#trim(urldecode(form.hid_valass))#'>
             <cfset form.cbo_Assign =

'#trim(urldecode(form.hid_valass))#'>
             <cfset form.hid_Cmode = "ASC">
             
    <cfif form.rdo_Assign eq 'ses'>
          <cfset tmp_ses =  #trim(urldecode(form.cbo_Assign))#>
          
            <cfset tmp_sta = ''>
            <cfset tmp_loc = ''>
      <cfelseif form.rdo_Assign eq 'sta'>
          <cfset tmp_sta =  #trim(urldecode(form.cbo_Assign))#>
            <cfset tmp_ses = ''>
            <cfset tmp_loc = ''>
            
      <cfelseif form.rdo_Assign eq 'loc'>
            <cfset tmp_loc =  #trim(urldecode(form.cbo_Assign))#>
            <cfset tmp_sta = ''>
            <cfset tmp_ses = ''>
            
      </cfif>
        <cfset form.hid_valass = ''>
 
  </cfif>       
      <!--- new code ends --->

<cfelse>
     <cfif parameterexists(url.hid_Source)>
           <cfset form.hid_Source = "Staff">
             <cfset form.hid_Defsarea = #trim(url.hid_selsarea)#>            
             <cfset tmp_sarea = #trim(url.hid_selsarea)#>
             <cfset form.hid_Defses = '#trim(url.hid_Defses)#'>
      <cfelse>
           <cfset form.hid_Source1 = "Sessionmgmt">

             <cfset form.hid_Defsarea = #trim(url.hid_selsarea)#>            
             <cfset tmp_sarea = #trim(url.hid_selsarea)#>
             <cfset form.hid_Defses = '#trim(url.hid_Defses)#'>      
                         
       </cfif>

       <cfif #trim(form.hid_Defses)# eq ''>
          <cfset form.hid_Cmode = "SAC">
       <cfelse>
             <cfif parameterexists(url.hid_Source)>
               <cfset form.cbo_Assign = '#trim(url.hid_Defses)#'>
              <cfelse>
                     <cfset form.cbo_Assign  =

'#trim(url.hid_Defses)#'>      
              </cfif>
      
         <cfset form.hid_Cmode = "ASC">
        
      </cfif>
      
</cfif>      


<cfif form.hid_Smode eq "A">
      <cfif #form.hid_Proc# neq 'ATY'>
        
            <cfif #tmp_pmf# neq "TBA">
                  <cfset #stdate# = #tmp_date# & ' ' &

#tmp_time#>
                  <cfx_ingres name="cfqry_ruledates"

db=#Session.cawdbNode# sql="select date('#stdate#') as

new_start,date('#stdate#') + date('#tmp_dura#') as new_stop">  
            
                  <cfset new_start =

trim(cfqry_ruledates.new_start)>
                  <cfset new_stop =

trim(cfqry_ruledates.new_stop)>
                  
            <!--- checking rule10 --->      
                <cfset warning = "Desired Schedule time " &

#new_start#      & " to " & #new_stop# & "\n\n Currently scheduled

commitments include: \n\n ">                
                  
                  
                  <cfx_ingres name="cfqry_Insrule10"

db=#Session.cawdbNode# sql="select start_time as old_start, stop_time

as old_stop,sessions as old_session_code, booth as

old_booth_code,station as old_station_code, conf as old_conf_code,

function as old_function from schedule
                           where uppercase(pmf_key) =

'#ucase(rereplace(tmp_pmf,"'","''","ALL"))#' and (( start_time <=

'#new_start#' and stop_time > '#new_start#') or (start_time <

'#new_stop#'  and stop_time >= '#new_stop#') or  ( start_time >=

'#new_start#' and stop_time <= '#new_stop#') or ((  (stop_time <=

'#new_start#' and (stop_time + date('15 minutes')) > '#new_start#') or

(start_time >= '#new_stop#' and (start_time - date('15 minutes')) <

'#new_stop#' ) ))) order by 1">
             
              <cfif #cfqry_Insrule10.recordcount# gt 0>
               
                  <cfset counter = 0>                   
                     <cfloop query="cfqry_Insrule10">  
                         <cfset counter = counter + 1>
                        <cfset warning = warning & "  " &

#counter# & "  ">
                        <cfif

#trim(cfqry_Insrule10.old_conf_code)# neq "">
                                <cfset warning = warning & "  

Conference " &  #trim(cfqry_Insrule10.old_conf_code)#>  
                        </cfif>
                        <cfif

#trim(cfqry_Insrule10.old_booth_code)# neq "">
                               <cfset warning = warning & "  

Location " &  #trim(cfqry_Insrule10.old_booth_code)#>  
                        </cfif>
                        <cfif

#trim(cfqry_Insrule10.old_station_code)# neq "">
                                <cfset warning = warning & "  

Station " &  #trim(cfqry_Insrule10.old_station_code)#>  
                        </cfif>
                        <cfif

#trim(cfqry_Insrule10.old_session_code)# neq "">
                                <cfset warning = warning & "  

Session " &  #trim(cfqry_Insrule10.old_session_code)#>  
                        </cfif>
                        <cfif

#trim(cfqry_Insrule10.old_function)# neq "">
                                <cfset warning = warning & " as

a  " &  #trim(cfqry_Insrule10.old_function)#>  
                        </cfif>
                        <cfif #trim(cfqry_Insrule10.old_start)#

neq "" and #trim(cfqry_Insrule10.old_stop)# neq "">
                              <cfset warning = warning & "

from " & #trim(cfqry_Insrule10.old_start)# & " to " &

#trim(cfqry_Insrule10.old_stop)#>
                        </cfif>

                    <cfif

(((#rereplace(tmp_funct,"'","''","ALL")# neq 'MONITOR') or
                         (#rereplace(tmp_funct,"'","''","ALL")#

eq 'MONITOR' and '#trim(cfqry_Insrule10.old_function)#' neq 'MONITOR'))

and
                       

((datecompare("#new_start#","#trim(cfqry_Insrule10.old_start)#") eq 1

and datecompare("#new_start#","#trim(cfqry_Insrule10.old_stop)#") eq

-1) or
                        (datecompare

("#new_stop#","#trim(cfqry_Insrule10.old_start)#") eq 1 and

datecompare("#new_stop#","#trim(cfqry_Insrule10.old_stop)#") eq -1) or
                        (datecompare

("#new_start#","#trim(cfqry_Insrule10.old_start)#") lte 0 and

datecompare("#new_stop#","#trim(cfqry_Insrule10.old_stop)#") eq 0) or
                        (datecompare

("#new_start#","#trim(cfqry_Insrule10.old_start)#") eq 0 and

datecompare("#new_stop#","#trim(cfqry_Insrule10.old_stop)#") gte 0)))>
                              <cfset #form.hid_Proc# = 'ATD'>
                        <cfelse>
                                 <cfset #form.hid_Proc# = 'AT'>
                         </cfif>
               
                  </cfloop>
                  
                  <cfelse>
                      <cfset #form.hid_Proc# = 'ATY'>
                  </cfif>                   
                               
             <cfelse>
              <cfset #form.hid_Proc# = 'ATY'>
            </cfif>
            
      </cfif>
      <!--- process skipped for  getting rule 10 confirmation, see

code below for flag AT  --->       
   
   <cfif #form.hid_Proc# eq 'ATY'>
         <!--- After confirmation of rule control adding process starts

here --->            
           <cfset #form.hid_Proc# = ''>
            <cfset #stdate# = #tmp_date# & ' ' & #tmp_time#>
            <cfif trim(form.rdo_Assign) is "ses">
            
                  <cfx_ingres name="cfqry_Inssche"

db=#Session.cawdbNode# sql="insert into

schedule(pmf_key,start_time,stop_time,function,booth,conf,sessions,stat

ion,product_code)

values('#ucase(rereplace(tmp_pmf,"'","''","ALL"))#','#stdate#','#stdate

#' +

date('#tmp_dura#'),'#rereplace(tmp_funct,"'","''","ALL")#','','#rerepla

ce(tmp_sarea,"'","''","ALL")#','#rereplace(tmp_ses,"'","''","ALL")#',''

,'#rereplace(tmp_pprod,"'","''","ALL")#')">            
            <cfelseif trim(form.rdo_Assign) is "sta">            
                  <cfx_ingres name="cfqry_Inssche"

db=#Session.cawdbNode# sql="insert into

schedule(pmf_key,start_time,stop_time,function,booth,conf,sessions,stat

ion,product_code)

values('#ucase(rereplace(tmp_pmf,"'","''","ALL"))#','#stdate#','#stdate

#' +

date('#tmp_dura#'),'#rereplace(tmp_funct,"'","''","ALL")#','','#rerepla

ce(tmp_sarea,"'","''","ALL")#','','#rereplace(tmp_sta,"'","''","ALL")#'

,'#rereplace(tmp_pprod,"'","''","ALL")#')">            
            <cfelseif trim(form.rdo_Assign) is "loc">            
                  <cfx_ingres name="cfqry_Inssche"

db=#Session.cawdbNode# sql="insert into

schedule(pmf_key,start_time,stop_time,function,booth,conf,sessions,stat

ion,product_code)

values('#ucase(rereplace(tmp_pmf,"'","''","ALL"))#','#stdate#','#stdate

#' +

date('#tmp_dura#'),'#rereplace(tmp_funct,"'","''","ALL")#','#rereplace(

tmp_loc,"'","''","ALL")#','#rereplace(tmp_sarea,"'","''","ALL")#','',''

,'#rereplace(tmp_pprod,"'","''","ALL")#')">            
            </cfif>
<!---             <cfx_ingres name="cfqry_Inssche" db=#Session.cawdbNode#

sql="insert into

schedule(pmf_key,start_time,stop_time,function,booth,conf,sessions,stat

ion,product_code)

values('#ucase(rereplace(tmp_pmf,"'","''","ALL"))#','#stdate#','#stdate

#' +

date('#tmp_dura#'),'#rereplace(tmp_funct,"'","''","ALL")#','#rereplace(

tmp_loc,"'","''","ALL")#','#rereplace(tmp_sarea,"'","''","ALL")#','#rer

eplace(tmp_ses,"'","''","ALL")#','#rereplace(tmp_sta,"'","''","ALL")#',

'#rereplace(tmp_pprod,"'","''","ALL")#')"> --->
   
            <cfif #tmp_pspeak# eq 'T' and #tmp_ses# neq '' and

#tmp_funct# eq 'SPEAKER'>
                     <cfx_ingres name="cfqry_Insupdses"

db=#Session.cawdbNode# sql="update sessions set

primary_speaker='#ucase(rereplace(tmp_pmf,"'","''","ALL"))#' where

session_code='#rereplace(tmp_ses,"'","''","ALL")#'">
            </cfif>
       
            <cfif form.hid_Pinfo eq 'T'>
              <cfx_ingres name="cfqry_Insupdper"

db=#Session.cawdbNode# sql="update person set

primary_conference='#rereplace(tmp_parea,"'","''","ALL")#',primary_func

tion='#rereplace(tmp_pfunct,"'","''","ALL")#',sba_relationship='#tmp_sb

a#' where

uppercase(pmf_key)='#ucase(rereplace(tmp_pmf,"'","''","ALL"))#'">    
            </cfif>
            
             <cfx_ingres name="cfqry_Ssdate" db=#Session.cawdbNode#

sql="select start_time,stop_time from schedule where start_time =

'#stdate#' and stop_time = '#stdate#' + date('#tmp_dura#') and

uppercase(pmf_key) = '#ucase(rereplace(tmp_pmf,"'","''","ALL"))#'">
            
            <cfx_ingres name="cfqry_Inswasis"

db=#Session.cawdbNode# sql="insert into

wasis_log(table_affected,what_affected,special,date_of_change,changed_b

y,comments) values

('SCHEDULE','#ucase(rereplace(tmp_pmf,"'","''","ALL"))#','',date('now')

,'#Session.Inventpmfkey#','ADDED:(/FUNCTION=' +

'#rereplace(trim(tmp_funct),"'","''","ALL")#' + ' /START=' +

'#trim(cfqry_Ssdate.start_time)#' + ' /STOP=' +

'#trim(cfqry_Ssdate.stop_time)#' + ' FOR /CONFERENCE=' +

'#trim(tmp_sarea)#')">
             <cfset msg = 4>  
             <!--- setting session query to reflect the changes to

the upper frame --->
               <cfset clause = "schedule.pmf_key = person.pmf_key

and schedule.pmf_key = '#ucase(rereplace(tmp_pmf,"'","''","ALL"))#' and

schedule.conf = '#trim(tmp_sarea)#'" >
                        
               <cfset clause = clause & " and schedule.function =

'#rereplace(trim(tmp_funct),"'","''","ALL")#'" >
               <cfset #stdate# = #tmp_date# & ' ' & #tmp_time#>
               <cfset clause = clause & " and start_time='#stdate#'

and stop_time ='#stdate#' + date('#tmp_dura#')">            
               
                  <cfif form.rdo_Assign eq 'ses'>
                        <cfset clause=clause & " and

schedule.sessions = '#rereplace(trim(tmp_ses),"'","''","ALL")#'" >
                        <cfset sqlstr = "select

Schedule.Pmf_Key , Person.Last_Name,Person.First_Name,      

Schedule.Function,Schedule.Start_Time,

Schedule.Stop_Time,Schedule.Sessions,Schedule.Station,      Schedule.Booth,      

Schedule.Conf,      char(Person.Shirt_Size) as Shirt_Size ,

Schedule.Stop_Time - Schedule.Start_Time as duration,Schedule.tid FROM

SCHEDULE, PERSON WHERE " & clause  & " order by 1,5">                        
                  <cfelseif form.rdo_Assign eq 'sta'>
                        <cfset clause=clause & " and

schedule.station = '#rereplace(trim(tmp_sta),"'","''","ALL")#'" >
                        <cfset sqlstr = "select

Schedule.Pmf_Key , Person.Last_Name,Person.First_Name,      

Schedule.Function,Schedule.Start_Time,

Schedule.Stop_Time,Schedule.Sessions,Schedule.Station,      Schedule.Booth,      

Schedule.Conf,      char(Person.Shirt_Size) as Shirt_Size ,

Schedule.Stop_Time - Schedule.Start_Time as duration,Schedule.tid FROM

SCHEDULE, PERSON WHERE " & clause  & " order by 1,5">
                  <cfelseif form.rdo_Assign eq 'loc'>
                      <cfset clause= clause & " and

schedule.booth = '#rereplace(trim(tmp_loc),"'","''","ALL")#'" >            
                        <cfset sqlstr = "select

Schedule.Pmf_Key , Person.Last_Name,Person.First_Name,      

Schedule.Function,Schedule.Start_Time,

Schedule.Stop_Time,Schedule.Sessions,Schedule.Station,      Schedule.Booth,      

Schedule.Conf,      char(Person.Shirt_Size) as Shirt_Size ,

Schedule.Stop_Time - Schedule.Start_Time as duration,Schedule.tid FROM

SCHEDULE, PERSON WHERE " & clause  & " order by 1,5">
                </cfif>
                  
                  <cfif form.hid_Addedit eq 'ADD'>
<!---                         <cfset Session.cfqry_AddEditStaff =

#sqlstr#> --->
                  <cfelse>
                      
                        <script language="JavaScript">
                         

parent.Topform.document.frm_Addedittop.hid_Pk.value =

"<cfoutput>#urlencodedformat(tmp_Pmf)#</cfoutput>"
                         

parent.Topform.document.frm_Addedittop.hid_Sa.value =

"<cfoutput>#urlencodedformat(tmp_sarea)#</cfoutput>"
                         

parent.Topform.document.frm_Addedittop.hid_Ft.value =

"<cfoutput>#form.rdo_Assign#</cfoutput>"
                         

parent.Topform.document.frm_Addedittop.hid_Fun.value =

"<cfoutput>#urlencodedformat(tmp_assval)#</cfoutput>"
                         

parent.Topform.document.frm_Addedittop.hid_Sd.value =

"<cfoutput>#tmp_date#</cfoutput>"
                         

parent.Topform.document.frm_Addedittop.hid_St.value =

"<cfoutput>#tmp_time#</cfoutput>"
                         

parent.Topform.document.frm_Addedittop.hid_Sdu.value =

"<cfoutput>#tmp_dura#</cfoutput>"
                        </script>
                      <!--- setting session query to reflect the

changes to the upper frame --->
                         <cfset clause1 = "schedule.pmf_key =

person.pmf_key and schedule.pmf_key =

'#ucase(rereplace(tmp_pmf,"'","''","ALL"))#' and schedule.conf =

'#trim(tmp_sarea)#'" >
                           
                        <cfset clause1 = clause1 & " and

schedule.function = '#rereplace(trim(tmp_funct),"'","''","ALL")#'" >
                           <cfset #stdate# = #tmp_date# & ' ' &

#tmp_time#>
                      <cfset clause1 = clause1 & " and

start_time='#stdate#' and stop_time ='#stdate#' + date('#tmp_dura#')">
                           <cfif form.rdo_Assign eq 'ses'>
                                 <cfset clause1=clause1 & " and

schedule.sessions = '#rereplace(trim(tmp_ses),"'","''","ALL")#'" >
                      <cfelseif form.rdo_Assign eq 'sta'>
                            <cfset clause1=clause1 & " and

schedule.station = '#rereplace(trim(tmp_sta),"'","''","ALL")#'" >                        
                           <cfelseif form.rdo_Assign eq 'loc'>
                             <cfset clause1 = clause1 & " and

schedule.booth = '#rereplace(trim(tmp_loc),"'","''","ALL")#'" >            
                     </cfif>
                        
<!---                         <cfset sqlstr =

left(trim(Session.cfqry_AddEditStaff),len(trim(Session.cfqry_AddEditSta

ff)) - 13)>  --->
                        <cfif len(trim(Form.hid_Query)) gt 0>
                              <cfset sqlstr =

left(trim(Form.hid_Query),len(trim(Form.hid_Query)) - 13)>
                              <cfset sqlstr = sqlstr & ' or

(' & clause1 & ' )' & ' order by 1,5'>
                        </cfif>
<!---                         <cfset Session.cfqry_AddEditStaff =

#sqlstr#>   --->
                  </cfif>
              
            <cfset tmp_pmf = ''>    
            <cfset tmp_lname = ''>
            <cfset tmp_fname = ''>
            <cfset form.chk_Pspeak = "F">
          <cfset form.chk_Sba      ="F">
            <cfset tmp_pfunct=''>
            <cfset tmp_parea=''>       
            <cfset tmp_pprod=''>
            <cfset tmp_pspeak=''>
      
                 
            <cfset #form.hid_Smode# = ''>
            <cfset #form.hid_Proc# =''>
    </cfif>
<cfelseif form.hid_Smode eq "C">
               
   <!--- Checking Rule10 starts here --->
   <cfif #form.hid_Proc# neq 'CTY'>      
            
             <cfif #tmp_pmf# neq "TBA">
                  
              <cfif ((ucase(trim(tmp_Pmf)) neq

ucase(trim(tmp_spmf))) or (trim(tmp_date) neq trim(tmp_sdate)) or

(trim(tmp_time) neq trim(tmp_stime)) or (trim(tmp_dura) neq

trim(tmp_sdura)))>
                                    
                  <cfset #stdate# = #tmp_date# & ' ' &

#tmp_time#>
                  <cfx_ingres name="cfqry_ruledates"

db=#Session.cawdbNode# sql="select date('#stdate#') as

new_start,date('#stdate#') + date('#tmp_dura#') as new_stop">  
            
                  <cfset new_start =

trim(cfqry_ruledates.new_start)>
                  <cfset new_stop =

trim(cfqry_ruledates.new_stop)>
                  
                  <cfset warning = "Desired Schedule time: " &

#new_start#      & " to " & #new_stop# & "\n\n Currently scheduled

commitments include: \n\n">                
                                    
                <cfx_ingres name="cfqry_Insrule10"

db=#Session.cawdbNode# sql="select pmf_key, start_time as old_start,

stop_time as old_stop,sessions as old_session_code, booth as

old_booth_code,station as old_station_code, conf as old_conf_code,

function as old_function from schedule
                       where uppercase(pmf_key)=

'#ucase(rereplace(tmp_pmf,"'","''","ALL"))#' and (( start_time <=

'#new_start#' and stop_time > '#new_start#') or (start_time <

'#new_stop#'  and stop_time >= '#new_stop#') or  ( start_time >=

'#new_start#' and stop_time <= '#new_stop#') or (((stop_time <=

'#new_start#' and (stop_time + date('15 minutes')) > '#new_start#') or

(start_time >= '#new_stop#' and (start_time - date('15 minutes')) <

'#new_stop#' )))) order by 1">
            
                <cfif #cfqry_Insrule10.recordcount# gt 0>
                          
                     <cfset counter = 0>
                    <cfloop query="cfqry_Insrule10">
                      <cfif tmp_sassign eq 'ses'>
                            <cfif trim(tmp_sassignval) neq

trim(cfqry_Insrule10.old_session_code)>
                                <cfset ass_flag  = "T">  
                              </cfif>
                              
                        <cfelseif tmp_sassign eq 'sta'>
                            <cfif trim(tmp_sassignval) neq

trim(cfqry_Insrule10.old_station_code)>
                                <cfset ass_flag  = "T">  
                              </cfif>
                           
                        <cfelseif tmp_sassign eq 'loc'>
                             <cfif trim(tmp_sassignval) neq

trim(cfqry_Insrule10.old_booth_code)>
                                <cfset ass_flag  = "T">  
                              </cfif>
                           
                        </cfif>                                        
                      <cfset #rsdate# = #tmp_sdate# & ' ' &

#tmp_stime#>  
                    
                     <cfx_ingres name="cfqry_compdates"

db=#Session.cawdbNode# sql="select date('#rsdate#') as

act_start,date('#rsdate#') + date('#tmp_sdura#') as act_stop">  
                 
                         <cfif (ucase(trim(#tmp_spmf#)) neq

trim(#cfqry_Insrule10.pmf_key#)) and

(datecompare("#trim(cfqry_compdates.act_start)#","#trim(cfqry_Insrule10

.old_start)#") neq 0) and

(datecompare("#trim(cfqry_compdates.act_stop)#","#trim(cfqry_Insrule10.

old_stop)#") neq 0) and (#ass_flag# eq "T")>
                          
                              <cfset counter = counter + 1>
                              <cfset warning = warning & "  "

& #counter# & "  ">
                              <cfif

#trim(cfqry_Insrule10.old_conf_code)# neq "">
                                      <cfset warning =

warning & "  Conference " &  #trim(cfqry_Insrule10.old_conf_code)#>  
                              </cfif>
                              <cfif

#trim(cfqry_Insrule10.old_booth_code)# neq "">
                                     <cfset warning =

warning & "  Location " &  #trim(cfqry_Insrule10.old_booth_code)#>  
                              </cfif>
                              <cfif

#trim(cfqry_Insrule10.old_station_code)# neq "">
                                      <cfset warning =

warning & "  Station " &  #trim(cfqry_Insrule10.old_station_code)#>  
                              </cfif>
                              <cfif

#trim(cfqry_Insrule10.old_session_code)# neq "">
                                      <cfset warning =

warning & "  Session " &  #trim(cfqry_Insrule10.old_session_code)#>  
                              </cfif>
                              <cfif

#trim(cfqry_Insrule10.old_function)# neq "">
                                      <cfset warning =

warning & " as a  " &  #trim(cfqry_Insrule10.old_function)#>  
                              </cfif>
                              <cfif

#trim(cfqry_Insrule10.old_start)# neq "" and

#trim(cfqry_Insrule10.old_stop)# neq "">
                                    <cfset warning =

warning & " from " & #trim(cfqry_Insrule10.old_start)# & " to " &

#trim(cfqry_Insrule10.old_stop)#>
                              </cfif>

                              <cfif ((

(#rereplace(tmp_funct,"'","''","ALL")# neq 'MONITOR') or
                                   

(#rereplace(tmp_funct,"'","''","ALL")# eq 'MONITOR' and

'#trim(cfqry_Insrule10.old_function)#' neq 'MONITOR')) and
                                   

((datecompare("#new_start#","#trim(cfqry_Insrule10.old_start)#") eq 1

and datecompare("#new_start#","#trim(cfqry_Insrule10.old_stop)#") eq

-1) or
                                    (datecompare

("#new_stop#","#trim(cfqry_Insrule10.old_start)#") eq 1 and

datecompare("#new_stop#","#trim(cfqry_Insrule10.old_stop)#") eq -1) or
                                    (datecompare

("#new_start#","#trim(cfqry_Insrule10.old_start)#") lte 0 and

datecompare("#new_stop#","#trim(cfqry_Insrule10.old_stop)#") eq 0) or
                                    (datecompare

("#new_start#","#trim(cfqry_Insrule10.old_start)#") eq 0 and

datecompare("#new_stop#","#trim(cfqry_Insrule10.old_stop)#") gte 0)))>  
                                      
                                    <cfset #form.hid_Proc#

= 'CTD'>
                               <cfelse>
                                           <cfset #form.hid_Proc#

= 'CT'>
                               </cfif>
                        
                         <cfelse>       
                                
                            <cfset #form.hid_Proc# = 'CTY'>            
                        </cfif>
                    </cfloop>         
                  
                  <cfelse>
                    <cfset #form.hid_Proc# = 'CTY'>                  
                  </cfif>            
            <cfelse>
              <cfset #form.hid_Proc# = 'CTY'>                  
            </cfif>      
         <cfelse>
               <cfset #form.hid_Proc# = 'CTY'>                  
         </cfif>
              
      </cfif>      
      <!--- process skipped for  getting rule 10 confirmation,see

code below for flag CT --->
      
   <cfif #form.hid_Proc# eq 'CTY'>
      <!--- After confirmation of rule control updation process

starts here --->                  
            
               <cfset #wcsdate# = #tmp_sdate# & ' ' & #tmp_stime#>
             <cfset #stdate# = #tmp_date# & ' ' & #tmp_time#>
            <cfif trim(form.rdo_Assign) is "ses">
                  <cfx_ingres name="cfqry_Updsche"

db=#Session.cawdbNode# sql="update schedule set pmf_key =

'#ucase(rereplace(tmp_pmf,"'","''","ALL"))#',

start_time='#stdate#',stop_time ='#stdate#'

+date('#tmp_dura#'),function='#rereplace(tmp_funct,"'","''","ALL")#',bo

oth='',

conf='#rereplace(tmp_sarea,"'","''","ALL")#',sessions='#rereplace(tmp_s

es,"'","''","ALL")#',station='',product_code='#rereplace(tmp_pprod,"'",

"''","ALL")#' where uppercase(pmf_key) = '#ucase(tmp_spmf)#' and

start_time='#wcsdate#' and stop_time ='#wcsdate#' +

date('#tmp_sdura#')">             
            <cfelseif trim(form.rdo_Assign) is "sta">
                  <cfx_ingres name="cfqry_Updsche"

db=#Session.cawdbNode# sql="update schedule set pmf_key =

'#ucase(rereplace(tmp_pmf,"'","''","ALL"))#',

start_time='#stdate#',stop_time ='#stdate#'

+date('#tmp_dura#'),function='#rereplace(tmp_funct,"'","''","ALL")#',bo

oth='', conf='#rereplace(tmp_sarea,"'","''","ALL")#',sessions='',

station='#rereplace(tmp_sta,"'","''","ALL")#',product_code='#rereplace(

tmp_pprod,"'","''","ALL")#' where uppercase(pmf_key) =

'#ucase(tmp_spmf)#' and start_time='#wcsdate#' and stop_time

='#wcsdate#' + date('#tmp_sdura#')">             
            <cfelseif trim(form.rdo_Assign) is "loc">
                  <cfx_ingres name="cfqry_Updsche"

db=#Session.cawdbNode# sql="update schedule set pmf_key =

'#ucase(rereplace(tmp_pmf,"'","''","ALL"))#',

start_time='#stdate#',stop_time ='#stdate#'

+date('#tmp_dura#'),function='#rereplace(tmp_funct,"'","''","ALL")#',bo

oth='#rereplace(tmp_loc,"'","''","ALL")#',conf='#rereplace(tmp_sarea,"'

","''","ALL")#',sessions='',station='',product_code='#rereplace(tmp_ppr

od,"'","''","ALL")#' where uppercase(pmf_key) = '#ucase(tmp_spmf)#' and

start_time='#wcsdate#' and stop_time ='#wcsdate#' +

date('#tmp_sdura#')">             
            </cfif>

<!---                <cfx_ingres name="cfqry_Updsche"

db=#Session.cawdbNode# sql="update schedule set pmf_key =

'#ucase(rereplace(tmp_pmf,"'","''","ALL"))#',

start_time='#stdate#',stop_time ='#stdate#' +

date('#tmp_dura#'),function='#rereplace(tmp_funct,"'","''","ALL")#',boo

th='#rereplace(tmp_loc,"'","''","ALL")#',conf='#rereplace(tmp_sarea,"'"

,"''","ALL")#',sessions='#rereplace(tmp_ses,"'","''","ALL")#',station='

#rereplace(tmp_sta,"'","''","ALL")#',product_code='#rereplace(tmp_pprod

,"'","''","ALL")#' where uppercase(pmf_key) = '#ucase(tmp_spmf)#' and

start_time='#wcsdate#' and stop_time ='#wcsdate#' +

date('#tmp_sdura#')">  --->

            <cfif tmp_pspeak eq "T" and tmp_ses neq '' and

#tmp_funct# eq 'SPEAKER'>
               <cfx_ingres name="cfqry_chgupdses"

db=#Session.cawdbNode# sql="update sessions set

primary_speaker='#ucase(rereplace(tmp_pmf,"'","''","ALL"))#' where

session_code='#rereplace(tmp_ses,"'","''","ALL")#'">  
            <cfelseif tmp_pspeak eq "F" and tmp_ses neq '' and

#tmp_funct# eq 'SPEAKER'>
               <cfx_ingres name="cfqry_Speak"

db=#Session.cawdbNode# sql="select * from sessions where

primary_speaker = '#ucase(rereplace(tmp_pmf,"'","''","ALL"))#' and

session_code='#rereplace(tmp_ses,"'","''","ALL")#'">
                <cfif #cfqry_Speak.recordcount# gt 0>
                  <cfx_ingres name="cfqry_chgupdses"

db=#Session.cawdbNode# sql="update sessions set primary_speaker=''

where session_code='#rereplace(tmp_ses,"'","''","ALL")#'">  
                </cfif>
            </cfif>
         
            <cfif form.hid_Pinfo eq 'T'>
               <cfx_ingres name="cfqry_chgupdper"

db=#Session.cawdbNode# sql="update person set

primary_conference='#rereplace(tmp_parea,"'","''","ALL")#',primary_func

tion='#rereplace(tmp_pfunct,"'","''","ALL")#',sba_relationship='#tmp_sb

a#' where

uppercase(pmf_key)='#ucase(rereplace(tmp_pmf,"'","''","ALL"))#'">
            </cfif>
             
            <cfx_ingres name="cfqry_Ssdate" db=#Session.cawdbNode#

sql="select start_time,stop_time from  schedule where

start_time='#stdate#' and stop_time = '#stdate#' + date('#tmp_dura#')

and uppercase(pmf_key) = '#ucase(tmp_pmf)#'">
            <cfx_ingres name="cfqry_Chgwasis"

db=#Session.cawdbNode# sql="insert into

wasis_log(table_affected,what_affected,special,date_of_change,changed_b

y,comments) values

('SCHEDULE','#ucase(rereplace(tmp_pmf,"'","''","ALL"))#','',date('now')

,'#session.Inventpmfkey#','UPDATD:(/FUNCTION=' +

'#rereplace(tmp_funct,"'","''","ALL")#' + ' /START=' +

'#trim(cfqry_Ssdate.start_time)#' + ' /STOP=' +

'#trim(cfqry_Ssdate.stop_time)#' + ' FOR /CONFERENCE=' +

'#tmp_sarea#')">  
              
            <cfset msg = 3>
                  <!--- setting session query to reflect the

changes to the upper frame --->
                  <cfset clause1 = "schedule.pmf_key =

person.pmf_key and schedule.pmf_key =

'#ucase(rereplace(tmp_pmf,"'","''","ALL"))#' and schedule.conf =

'#trim(tmp_sarea)#'" >
                     <cfset clause1 = clause1 & " and

schedule.function = '#rereplace(trim(tmp_funct),"'","''","ALL")#'" >
                     <cfset #stdate# = #tmp_date# & ' ' &

#tmp_time#>
                  <cfset clause1 = clause1 & " and

start_time='#stdate#' and stop_time ='#stdate#' + date('#tmp_dura#')">
                     <cfif form.rdo_Assign eq 'ses'>
                           <cfset clause1=clause1 & " and

schedule.sessions = '#rereplace(trim(tmp_ses),"'","''","ALL")#'" >
                  <cfelseif form.rdo_Assign eq 'sta'>
                      <cfset clause1=clause1 & " and

schedule.station = '#rereplace(trim(tmp_sta),"'","''","ALL")#'" >                        
                     <cfelseif form.rdo_Assign eq 'loc'>
                       <cfset clause1 = clause1 & " and

schedule.booth = '#rereplace(trim(tmp_loc),"'","''","ALL")#'" >            
                  </cfif>
                        
<!---                   <cfset sqlstr =

left(trim(Session.cfqry_AddEditStaff),len(trim(Session.cfqry_AddEditSta

ff)) - 13)>
 --->                        
                   <cfif len(trim(Form.hid_Query)) gt 0>
                        <cfset sqlstr =

left(trim(Form.hid_Query),len(trim(Form.hid_Query)) - 13)>
                        <cfset sqlstr = sqlstr & ' or (' &

clause1 & ' )' & ' order by 1,5'>
                  </cfif>

<!---                   <cfset sqlstr = sqlstr & ' or (' & clause1 & '

)' & ' order by 1,5'>
                   <cfset Session.cfqry_AddEditStaff = #sqlstr#>  

--->
                  <script language="JavaScript">
                         

parent.Topform.document.frm_Addedittop.hid_Pk.value = ""
                         

parent.Topform.document.frm_Addedittop.hid_Sa.value = ""
                         

parent.Topform.document.frm_Addedittop.hid_Ft.value = ""
                         

parent.Topform.document.frm_Addedittop.hid_Fun.value = ""
                         

parent.Topform.document.frm_Addedittop.hid_Sd.value = ""
                         

parent.Topform.document.frm_Addedittop.hid_St.value = ""
                         

parent.Topform.document.frm_Addedittop.hid_Sdu.value = ""
             </script>      
           <cfset #form.hid_Smode# = ''>
            <cfset #form.hid_Proc# = ''>
            
   </cfif>  
<cfelseif form.hid_Smode eq "D">  
          <!--- checking for alias  --->  
            <cfx_ingres name="cfqry_alias" db=#Session.cawdbNode#

sql="select alias as ses_alias from alias where alias =

'#rereplace(tmp_ses,"'","''","ALL")#'">
       
            <cfif cfqry_alias.ses_alias neq ''>
                   <cfset msg = 2>
        </cfif>
             <!--- delete process starts here --->
            <cfif msg neq 2>
            
                  <cfset stdate =  #tmp_sdate# & ' ' &

#tmp_stime#>
                  <cfset where_clause = "uppercase(pmf_key) =

'#ucase(rereplace(tmp_spmf,"'","''","ALL"))#' and start_time='#stdate#'

and stop_time ='#stdate#' + date('#tmp_sdura#')">    
         
                  <cfx_ingres name="cfqry_Delsche"

db=#Session.cawdbNode# sql="delete from schedule where #where_clause#">
                  <cfx_ingres name="cfqry_Delwasis"

db=#Session.cawdbNode# sql="insert into

wasis_log(table_affected,what_affected,special,date_of_change,changed_b

y,comments) values

('SCHEDULE','#ucase(rereplace(tmp_pmf,"'","''","ALL"))#','',date('now')

,'#session.Inventpmfkey#','DELETED ASSIGNMENT')">
             
                  <cfif tmp_pspeak eq "T" and tmp_ses neq '' and

#tmp_funct# eq 'SPEAKER'>
                           <cfx_ingres name="cfqry_delupdses1"

db=#Session.cawdbNode# sql="update sessions set primary_speaker=''

where session_code='#rereplace(tmp_ses,"'","''","ALL")#' and

primary_speaker='#ucase(rereplace(tmp_pmf,"'","''","ALL"))#'">
              </cfif>
                    
                  <cfif cfqry_alias.ses_alias neq ''>
                      <cfx_ingres name="cfqry_delupdses2"

db=#Session.cawdbNode# sql="update sessions set primary_speaker=''

where session_code='#rereplace(cfqry_alias.ses_alias,"'","''","ALL")#'

and primary_speaker='#ucase(rereplace(tmp_pmf,"'","''","ALL"))#'">
                  </cfif>             
                  <cfset msg = 5>
                 <cfset form.hid_Smode = ''>
                  
                  <cfset tmp_pmf = ''>    
                  <cfset tmp_lname = ''>
                  <cfset tmp_fname = ''>
                  <cfset form.chk_Pspeak = "F">
                <cfset form.chk_Sba      ="F">
                  <cfset tmp_pfunct=''>
                  <cfset tmp_parea=''>       
                  <cfset tmp_pprod=''>
                  <cfset tmp_pspeak=''>
            
            </cfif>
             
</cfif>


 <cfif #form.hid_Cmode# neq "">
 
   <cfif Session.Security.Conf_All eq 1>  
         <cfx_ingres name="cfqry_Loadsarea" db=#Session.cawdbNode#

sql="Select name,uppercase(name) from conferences order by 2">
   
   <cfelse>  
      <cfx_ingres name="cfqry_Loadsarea" db=#Session.cawdbNode#

sql="Select conference from security where username =

'#session.pmfkey#' and left(conference,4) != 'CWS-' order by 1">
   </cfif>
 
      <cfx_ingres name="cfqry_Loadfunct" db=#Session.cawdbNode# sql=

"Select name,uppercase(name) from Function order by 2">
       
    <cfx_ingres name="cfqry_Loadprodcut" db=#Session.cawdbNode#

sql="Select product_code,product,uppercase(product) from productmaster

order by 3">
   
      <cfx_ingres name="cfqry_Loadsession" db=#Session.cawdbNode#

sql="Select session_code, uppercase(session_code) from Sessions Where

Conference ='#rereplace(tmp_sarea,"'","''","ALL")#' order by 2">
     
           <!--- checking default --->
         <cfif (#trim(urldecode(form.hid_Defses))# eq '' and

form.hid_Cmode eq 'T') or form.hid_Cmode eq 'SAC'>
                          
                        
                              <cfx_ingres

name="cfqry_Loadsession1" db=#Session.cawdbNode# sql="Select

session_code, uppercase(session_code) from Sessions Where Conference

='#rereplace(tmp_sarea,"'","''","ALL")#' order by 2" maxrow="1">
                            <cfset form.cbo_Assign =

'#urlencodedformat(trim(cfqry_Loadsession1.session_code))#'>
                            <cfset form.hid_Defses =

'#urlencodedformat(trim(cfqry_Loadsession1.session_code))#'>
                   
                              <cfset tmp_assval =

urldecode(trim(form.cbo_Assign))>
                              <cfset tmp_ses =

urldecode(trim(form.cbo_Assign))>
                              
                                <cfset form.hid_Cmode = 'ASCE'>
                      
                  </cfif>
      
          <cfx_ingres name="cfqry_Loaddate" db=#Session.cawdbNode#

sql="Select distinct(name),date(name) from ca_world_Dates Order by 2">
            <cfx_ingres name="cfqry_Loadtime"

db=#Session.cawdbNode# sql="Select distinct(name) from

session_start_times Order by 1">
          <cfx_ingres name="cfqry_Loaddura" db=#Session.cawdbNode#

sql="Select distinct(name) from session_stop_times Order by 1">

</cfif>
<cfif #form.hid_Cmode# eq 'SP'>
    <cfset txt_Pmfkey =

Rereplace(#trim(form.txt_Pmfkey)#,"'","''","ALL")>      
      <cfx_ingres name="cfqry_Check" db=#Session.cawdbNode#

sql="select last_name, first_name ,

pmf_key,primary_function,primary_conference,sba_relationship from

person where uppercase(pmf_key) = '#trim(ucase(txt_Pmfkey))#'">
      <cfif cfqry_Check.recordcount gt 0>
               <cfset tmp_Ppmf = trim(cfqry_Check.pmf_key)>
            <cfset tmp_lname = trim(cfqry_Check.last_name)>
            <cfset tmp_fname = trim(cfqry_Check.first_name)>
            <cfif trim(cfqry_Check.sba_relationship) eq "T">
               <cfset form.chk_Sba = "T">
            </cfif>
            <cfset tmp_pfunct=trim(cfqry_Check.primary_function)>
            <cfset tmp_parea=trim(cfqry_Check.primary_conference)>       
            
      </cfif>      
</cfif>            

<html>
<head>
<title></title>
<link href="style.css" rel="STYLESHEET" type="TEXT/CSS">
</head>

<body>
<form name="frm_Edtstf" action="Cf_AdEdtstf.cfm" method="post">  
<input type="hidden" name="hid_Query"

value="<cfoutput>#trim(Form.hid_Query)#</cfoutput>">
<script language="JavaScript">
      frm_Edtstf.hid_Query.value=unescape(frm_Edtstf.hid_Query.value)
</script>
<div align="center"><center>
<table border="0" cellspacing="0" cellpading="0">
    <tr>
     <!--- loading solution area  --->  
             <cfif session.Security.Conf_All eq 1>
              <td>Solution Area<br>
              <select name="cbo_Sarea" size="1" style="width:200px"

onchange="cbo_Sarea_onchange()">
                  <option value="">(Select)</option>
                 <cfoutput query="cfqry_Loadsarea">      
                   <cfif #trim(tmp_sarea)# eq

#trim(cfqry_Loadsarea.name)#>
                     <option

value="#urlencodedformat(trim(cfqry_Loadsarea.name))#" selected

>#trim(cfqry_Loadsarea.name)#</option>
                   <cfelse>
                     <option

value="#urlencodedformat(trim(cfqry_Loadsarea.name))#">#trim(cfqry_Load

sarea.name)#</option>
                   </cfif>
                  
             </cfoutput>
              </select></td>
            <cfelse>
              <td>Solution Area<br>
              <select name="cbo_Sarea" size="1" style="width:200px"

onchange="cbo_Sarea_onchange()">
                  <option value="">(Select)</option>
                <cfoutput query="cfqry_Loadsarea">
                  <cfif #trim(tmp_sarea)# eq

#trim(cfqry_Loadsarea.conference)#>        
                  <option

value="#urlencodedformat(trim(cfqry_Loadsarea.conference))#"

selected>#trim(cfqry_Loadsarea.conference)#</option>
                  <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadsarea.conference))#">#trim(cfqr

y_Loadsarea.conference)#</option>
                  </cfif>
             </cfoutput>
              </select></td>
            </cfif>
            <cfoutput>
            <td>PMF Key<br>
        <input type="text" size="20" name="txt_Pmfkey" style="width:90"  

value="#urlencodedformat(tmp_pmf)#" maxlength="11"

onchange="txt_Pmfkey_onchange()" onblur="txt_Pmfkey_onblur()"></td>
            <td>First Name<br>
        <input type="text" size="20" name="txt_Firstname"

style="width:125px" value="#urlencodedformat(tmp_fname)#"

maxlength="20" readonly></td>
        <td>Last Name<br>
        <input type="text" size="20" name="txt_Lastname"

style="width:150px" value="#urlencodedformat(tmp_lname)#"

maxlength="16" onchange="txt_Lastname_onchange()"></td>
        <td><br>
        <input type="button" name="btn_Search" value="Search"

style="width:50px" onclick="btn_Search_onclick()"></td>
       </cfoutput>      
      </tr>
    <tr>
       <!--- function loads here --->
          <td>Function<br>
        <select name="cbo_Funct" size="1" style="width:200px"

onchange="cbo_Funct_onchange()">
           <option value="">(Select)</option>
                  <cfoutput query="cfqry_Loadfunct">
                  <cfif #trim(tmp_funct)# eq

#trim(cfqry_Loadfunct.name)#>
                  <option

value="#urlencodedformat(trim(cfqry_Loadfunct.name))#"

selected>#trim(cfqry_Loadfunct.name)#</option>
                  <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadfunct.name))#">#trim(cfqry_Load

funct.name)#</option>
              </cfif>       
                  </cfoutput>            
        </select></td>
        <td colspan="2"><p align="center">Assignment<br>
            <!--- Assignment radoi button checked for (session)  

--->
            <cfif form.rdo_Assign eq 'ses'>
              <input type="radio" name="rdo_Assign" value="ses"

checked onclick="rdo_onclick()" >Session
                  <input type="radio" name="rdo_Assign"

value="sta" onclick="rdo_onclick()">Station
                  <input type="radio" name="rdo_Assign"

value="loc" onclick="rdo_onclick()"> Location</p>
        <!--- Assignment radoi button checked for (session)  --->
            <cfelseif form.rdo_Assign eq 'sta'>
            
                <input type="radio" name="rdo_Assign" value="ses"  

onclick="rdo_onclick()" >Session
                  <input type="radio" name="rdo_Assign"

value="sta" checked onclick="rdo_onclick()">Station
                  <input type="radio" name="rdo_Assign"

value="loc" onclick="rdo_onclick()"> Location</p>
            <!--- Assignment radoi button checked for (session)  

--->
            <cfelseif form.rdo_Assign eq 'loc'>
                <input type="radio" name="rdo_Assign" value="ses"  

onclick="rdo_onclick()" >Session
                  <input type="radio" name="rdo_Assign"

value="sta"  onclick="rdo_onclick()">Station
                  <input type="radio" name="rdo_Assign"

value="loc" checked onclick="rdo_onclick()"> Location</p>
            </cfif>
            </td>
            <!--- Assignment list loading for session  --->
         <cfif form.rdo_Assign eq 'ses'>
                      
                     <cfif #form.hid_Cmode# eq 'ASC' or

#form.hid_Cmode# eq 'ASCE' >
                        <cfset tmp_ses =

trim(URLdecode(form.cbo_Assign))>
                        <cfset tmp_assval =

trim(URLdecode(form.cbo_Assign))>
                        
                        <cfx_ingres name="cfqry_alias"

db=#Session.cawdbNode# sql="select alias as ses_alias from alias where

alias = '#rereplace(tmp_ses,"'","''","ALL")#'">
                  
                        <cfif trim(cfqry_alias.ses_alias) neq

''>
                          <cfset msg = 1>
                          <cfset tmp_assval = form.hid_Ass>
                         
                        <cfelse>
                          <cfset form.hid_Ass = tmp_assval>  
                        </cfif>            
                                
                                                
                        <cfx_ingres name="cfqry_sesdate"

db=#Session.cawdbNode# sql="Select

start_date,stop_date,stop_date-start_date as dura from Sessions where

Session_code ='#rereplace(tmp_assval,"'","''","ALL")#'">
                                   <cfset tmp_date  =

left(trim(cfqry_sesdate.start_Date),11)>
                                <cfset tmp_time  =

left(right(trim(cfqry_sesdate.start_Date), 8),5)>
                                <cfset tmp_dura =  

trim(cfqry_sesdate.dura)>
                                
                    </cfif>
                    
                  <td colspan="2"><br>
                  <select name="cbo_Assign" size="1"

style="width:150px" onchange="cbo_Assign_onchange()">
                    <option value="">(Select)</option>
                  <cfoutput query="cfqry_Loadsession">
                    <cfif #trim(tmp_assval)# eq

#trim(cfqry_Loadsession.session_code)# >      
                     <option

value="#urlencodedformat(trim(cfqry_Loadsession.session_code))#"

selected>#trim(cfqry_Loadsession.session_code)#</option>
                 <cfelse>
                     <option

value="#urlencodedformat(trim(cfqry_Loadsession.session_code))#">#trim(

cfqry_Loadsession.session_code)#</option>
                    </cfif>
                    </cfoutput>                            
              </select></td>
                    <!--- Assignment list loading for station  

--->
             <cfelseif form.rdo_Assign eq 'sta'>
               
                  <cfx_ingres name="cfqry_Loadstation"

db=#Session.cawdbNode# sql="Select stationid,uppercase(stationid) from

station where conference ='#rereplace(tmp_sarea,"'","''","ALL")#' order

by 2">
                  <td colspan="2"><br>
                  <select name="cbo_Assign" size="1" style="width:150px"

onchange="cbo_Assign_onchange()">
                    <option value="">(Select)</option>
                <cfoutput query="cfqry_Loadstation">      
                  <cfif #trim(tmp_assval)# eq

#trim(cfqry_Loadstation.stationid)# >      
                  <option

value="#urlencodedformat(trim(cfqry_Loadstation.stationid))#"

selected>#trim(cfqry_Loadstation.stationid)#</option>
              <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadstation.stationid))#">#trim(cfq

ry_Loadstation.stationid)#</option>
                  </cfif>
                  </cfoutput>                            
          </select></td>
              <!--- Assignment list loading for station  --->
          <cfelseif form.rdo_Assign eq 'loc'>
                <cfx_ingres name="cfqry_Loadbooth"

db=#Session.cawdbNode# sql="Select name,uppercase(name) from booth

where conf = '#rereplace(tmp_sarea,"'","''","ALL")#' order by 2">

              <td colspan="2"><br>
                  <select name="cbo_Assign" size="1" style="width:150px"

onchange="cbo_Assign_onchange()">
                    <option value="">(Select)</option>
                <cfoutput query="cfqry_Loadbooth">      
                  <cfif #trim(tmp_assval)# eq

#trim(cfqry_Loadbooth.name)#>      
                  <option

value="#urlencodedformat(trim(cfqry_Loadbooth.name))#"

selected>#trim(cfqry_Loadbooth.name)#</option>
                  <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadbooth.name))#">#trim(cfqry_Load

booth.name)#</option>
                  </cfif>
              </cfoutput>                            
           </select></td>
            </cfif>
    </tr>
    <tr>
        <!--- Primary function list loading   --->
        <td>Primary Function<br>
              <select name="cbo_Pfunct" size="1" style="width:200px"

onchange="cbo_Pfunct_onchange()">
                 <option value="">(Select)</option>
                  <cfoutput query="cfqry_Loadfunct">      
                  <cfif #trim(tmp_pfunct)# eq  

#trim(cfqry_Loadfunct.name)#>
                  <option

value="#urlencodedformat(trim(cfqry_Loadfunct.name))#"

selected>#trim(cfqry_Loadfunct.name)#</option>
                  <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadfunct.name))#">#trim(cfqry_Load

funct.name)#</option>
              </cfif>
                  </cfoutput>                                                    
              </select></td>
         <!--- Primary solution  list loading   --->
        <td  colspan="2">Primary Solution Area<br>
              <cfif session.Security.Conf_All eq 1>
                <select name="cbo_Psarea" size="1"

style="width:200px" onchange="cbo_Psarea_onchange()">
                  <option value="">(Select)</option>
                <cfoutput query="cfqry_Loadsarea">      
                  <cfif #trim(tmp_parea)# eq

#trim(cfqry_Loadsarea.name)#>
                  <option

value="#urlencodedformat(trim(cfqry_Loadsarea.name))#"

selected>#trim(cfqry_Loadsarea.name)#</option>
              <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadsarea.name))#">#trim(cfqry_Load

sarea.name)#</option>
                  </cfif>
                  </cfoutput>
                </select>
              <cfelse>
                <select name="cbo_Psarea" size="1"

style="width:200px" onchange="cbo_Psarea_onchange()">
                  <option value="">(Select)</option>
                <cfoutput query="cfqry_Loadsarea">      
                  <cfif #trim(tmp_parea)# eq

#trim(cfqry_Loadsarea.conference)#>
                  <option

value="#urlencodedformat(trim(cfqry_Loadsarea.conference))#"

selected>#trim(cfqry_Loadsarea.conference)#</option>
                  <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadsarea.conference))#">#trim(cfqr

y_Loadsarea.conference)#</option>
                  </cfif>
                  </cfoutput>
                </select>
              </cfif></td>
                              
            <!--- Primary product list loading   --->      
        <td colspan="2">Primary Product<br>
        <select name="cbo_Pprod" size="1" style="width:250px">
           <option value="">(Select)</option>
                <cfoutput query="cfqry_Loadprodcut">      
                  <cfif #trim(tmp_pprod)# eq

#trim(cfqry_Loadprodcut.product_code)#>
                  <option

value="#urlencodedformat(trim(cfqry_Loadprodcut.product_code))#"

selected>#trim(cfqry_Loadprodcut.product)#</option>
                  <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadprodcut.product_code))#">#trim(

cfqry_Loadprodcut.product)#</option>
                  </cfif>
                  </cfoutput>
          </select></td>
        <td>&nbsp;</td>
    </tr>
          <tr>   <!--- checking for primary speaker  --->
              <cfif form.chk_Pspeak eq "T">
                  <td><input type="checkbox" name="chk_Pspeak"  

checked value="T">Primary Speaker</td>
                  <cfelse>
                  <td><input type="checkbox" name="chk_Pspeak"  

value="T">Primary Speaker</td>
                  </cfif>
                  <!--- checking for sba relationship --->
                  <cfif form.chk_Sba eq "T">
                  <td><input type="checkbox" name="chk_Sba"

value="T" checked onclick="chk_Sba_onclick()">SBA Relationship</td>
                <cfelse>
                  <td><input type="checkbox" name="chk_Sba"

value="T" onclick="chk_Sba_onclick()">SBA Relationship</td>
                  </cfif>
               <td>&nbsp;</td>
                  <td>&nbsp;</td>
    </tr>
    <tr>
        <cfif form.rdo_Assign eq 'ses'>
                 <cfif #form.hid_Proc# eq 'AT'>
                           <cfset tmp_date  =

trim(form.hid_Sldate)>
                        <cfset tmp_time  =

trim(form.hid_Sltime)>
                        <cfset tmp_dura =  

trim(form.hid_Sldura)>
                    </cfif>
                  
               <cfoutput>
              <td>Date<br><input type="text" name="cbo_Date"

size="1" style="width:80px"

value="#dateformat(trim(tmp_date),"mm-dd-yyyy")#" readonly></td>
              <td>Time<br><input type="text" name="cbo_Time"

size="1" style="width:55px" value="#trim(tmp_time)#" readonly></td>
              <td>Duration<br><input type="text" name="cbo_Dura"

size="1" style="width:100px" value="#trim(tmp_dura)#" readonly></td>
               </cfoutput>
         <cfelse>
         <!--- loading date list  --->
         <td>Date<br>
                  <select name="cbo_Date" size="1"

style="width:80px">
                <option value="Select">(Select)</option>
            <cfoutput query="cfqry_Loaddate">
                  <cfif #trim(tmp_date)# eq

#trim(cfqry_Loaddate.name)#>      
                  <option

value="#urlencodedformat(trim(cfqry_Loaddate.name))#"

selected>#trim(cfqry_Loaddate.name)#</option>
                  <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loaddate.name))#">#trim(cfqry_Loadd

ate.name)#</option>
                  </cfif>
                  </cfoutput>
                  </select></td>
             <!--- loading time list  --->      
        <td>Time<br>
              <select name="cbo_Time" size="1" style="width:55px">
                  <option value="Select">(Select)</option>
              <cfoutput query="cfqry_Loadtime">      
                  <cfif #trim(tmp_time)# eq

#trim(cfqry_Loadtime.name)#>      
                  <option

value="#urlencodedformat(trim(cfqry_Loadtime.name))#"

selected>#trim(cfqry_Loadtime.name)#</option>
                  <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loadtime.name))#">#trim(cfqry_Loadt

ime.name)#</option>
                </cfif>
                  </cfoutput>                
                  </select></td>
             <!--- loading duration list  --->            
        <td>Duration<br>
              <select name="cbo_Dura" size="1" style="width:100px">
                  <option value="Select">(Select)</option>
            <cfoutput query="cfqry_Loaddura">      
                  <cfif #trim(tmp_dura)# eq

#trim(cfqry_Loaddura.name)#>      
                  <option

value="#urlencodedformat(trim(cfqry_Loaddura.name))#"

selected>#trim(cfqry_Loaddura.name)#</option>
                <cfelse>
                  <option

value="#urlencodedformat(trim(cfqry_Loaddura.name))#">#trim(cfqry_Loadd

ura.name)#</option>
                  </cfif>
                  </cfoutput>                
                  </select></td>
             </cfif>      
            
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>
</center></div><div align="center"><center>

<table border="0">
    <tr>
        <td><input type="button" name="btn_Add" value="Add"

style="width:50px" onclick="btn_Add_onclick()"></td>
        <td><input type="button" name="btn_Change" value="Change"

style="width:50px" onclick="btn_Change_onclick()"></td>
        <td><input type="button" name="btn_Delete" value="Delete"

style="width:50px"onclick="btn_Delete_onclick()"></td>
        <td><input type="button" name="btn_Close" value="Close"

style="width:50px" onclick="btn_Close_onclick()"></td>
            <td><input type="button" name="btn_Home" value="Home"

style="width:50px" onclick="btn_Home_onclick()"></td>
    </tr>
</table>
<cfoutput>
<input type = "hidden" name = "hid_Logcheck" value = "0">
<input type="hidden" name="hid_Search" value="False">
<input type="hidden" name="hid_Cmode" value="#form.hid_Cmode#">
<input type="hidden" name="hid_Pinfo" value="#form.hid_Pinfo#">
<input type="hidden" name="hid_Ass" value="#form.hid_Ass#">
<input type="hidden" name="hid_Smode" value="">
<input type="hidden" name="hid_Source" value="#form.hid_Source#">
<input type="hidden" name="hid_Source1" value="#form.hid_Source1#">
<input type="hidden" name="hid_Proc" value="#form.hid_Proc#">
<input type="hidden" name="hid_Addedit" value="#hid_Addedit#">

<input type="hidden" name="hid_Stoptime"

value="#dateformat(urldecode(form.hid_Stoptime),"mm-dd-yyyy")#">

<!--- <input type="hidden" name="hid_Stoptime" value="##"> --->
<input type="hidden" name="hid_Sdate" value="#tmp_sdate#">
<input type="hidden" name="hid_Stime" value="#tmp_stime#">
<input type="hidden" name="hid_Sdura" value="#tmp_sdura#">
<input type="hidden" name="hid_Spmf" value="#tmp_spmf#">
<input type="hidden" name="hid_Sassign" value="#tmp_sassign#">
<input type="hidden" name="hid_Sassignval"

value="#urlencodedformat(tmp_sassignval)#">

<input type="hidden" name="hid_Sldate" value="#tmp_date#">
<input type="hidden" name="hid_Sltime" value="#tmp_time#">
<input type="hidden" name="hid_Sldura" value="#tmp_dura#">
<input type="hidden" name="hid_Slpmf" value="#tmp_pmf#">

<input type="hidden" name="hid_valass" value="">

<input type="hidden" name="hid_Defsarea"

value="#urlencodedformat(form.hid_Defsarea)#">
<input type="hidden" name="hid_Defses"

value="#urlencodedformat(form.hid_Defses)#">
<input type="hidden" name="hid_Count"

value="#urlencodedformat(form.hid_Count)#">
<!--- Added by Sheeba(4 hidden)--->
<input type="hidden" name="tmp_Solnarea" >
<input type="hidden" name="hid_Calledfrm" >
<input type = "hidden" name = "cbo_Track">
<input type = "hidden" name = "tmp_Pmfkey">


</cfoutput>
</center></div>

<p>&nbsp;</p>
</form>
</body>
</html>


<cfif parameterexists(url.hid_Source)>
      <script language = "javascript">
            frm_Edtstf.tmp_Solnarea.value

="<cfoutput>#url.tmp_Solnarea#</cfoutput>";
            frm_Edtstf.hid_Calledfrm.value =

"<cfoutput>#url.hid_Calledfrm#</cfoutput>";      
            frm_Edtstf.cbo_Track.value =

"<cfoutput>#url.cbo_Track#</cfoutput>";
            frm_Edtstf.hid_Source.value =

"<cfoutput>#url.hid_Source#</cfoutput>";            
            frm_Edtstf.tmp_Pmfkey.value =

"<cfoutput>#url.tmp_Pmfkey#</cfoutput>";                                                                                    
      </script>            
<cfelseif parameterexists(form.tmp_Solnarea)>

      <script language = "javascript">
            frm_Edtstf.tmp_Solnarea.value =

"<cfoutput>#urlencodedformat(form.cbo_Sarea)#</cfoutput>";
            frm_Edtstf.hid_Calledfrm.value =

"<cfoutput>#urlencodedformat(form.hid_Calledfrm)#</cfoutput>";
                        
            frm_Edtstf.cbo_Track.value =

"(<cfoutput>#urlencodedformat(form.cbo_Track)#</cfoutput>";            
            frm_Edtstf.tmp_Pmfkey.value =

"<cfoutput>#urlencodedformat(form.txt_Pmfkey)#</cfoutput>";                                                                                    
      </script>                        
<cfelseif parameterexists(form.cbo_Solnarea)>
       <script language = "javascript">
            frm_Edtstf.tmp_Solnarea.value =

"<cfoutput>#urlencodedformat(form.cbo_Solnarea)#</cfoutput>";
            frm_Edtstf.cbo_Track.value =

"<cfoutput>#urlencodedformat(form.cbo_Track)#</cfoutput>";            
      </script>                        
 </cfif>


<script language="javascript">
    frm_Edtstf.txt_Pmfkey.value = unescape(frm_Edtstf.txt_Pmfkey.value)
      frm_Edtstf.txt_Firstname.value =

unescape(frm_Edtstf.txt_Firstname.value)
      frm_Edtstf.txt_Lastname.value =

unescape(frm_Edtstf.txt_Lastname.value)
      frm_Edtstf.hid_Calledfrm.value =

unescape(frm_Edtstf.hid_Calledfrm.value )      
      frm_Edtstf.hid_Sassignval.value =

unescape(frm_Edtstf.hid_Sassignval.value)
</script>


 <!--- Retainnig primary speaker check box value   --->      
<script language="javascript">
 
  var str
  str=ltrim(rtrim(unescape(frm_Edtstf.cbo_Funct.value)));
  if(str.toUpperCase() == "SPEAKER")
   {
      frm_Edtstf.chk_Pspeak.disabled = false;
   }
   else  
   {
      frm_Edtstf.chk_Pspeak.checked = false;
      frm_Edtstf.chk_Pspeak.value = "F";
      frm_Edtstf.chk_Pspeak.disabled = true;  
   }       
</script>

 <!--- Setting focus to controls  --->       
<cfif form.hid_Cmode eq 'ATC' or form.hid_Cmode eq 'ALC'>
  <script language="javascript">
       frm_Edtstf.cbo_Assign.focus()
  </script>
 
<cfelseif form.hid_Cmode eq 'ASC' or form.hid_Cmode eq 'Staff'>
   <script language="javascript">
      frm_Edtstf.cbo_Assign.focus()
   </script>  
<cfelseif form.hid_Cmode eq 'SAC'>
   <script language="javascript">
      frm_Edtstf.cbo_Sarea.focus()
      </script>
<cfelseif form.hid_Cmode eq 'AC'>      
      <script language="javascript">  
    if (frm_Edtstf.cbo_Date.type == "text")
      {
        frm_Edtstf.cbo_Date.text = ""
      frm_Edtstf.cbo_Time.text = ""
      frm_Edtstf.cbo_Dura.text = ""
        
      }
      else
      {
        frm_Edtstf.cbo_Date.selectedIndex = 0
      frm_Edtstf.cbo_Time.selectedIndex = 0
      frm_Edtstf.cbo_Dura.selectedIndex = 0
       }
      frm_Edtstf.cbo_Assign.focus()
   </script>
<cfelseif #form.hid_Cmode# eq 'SP'>
  <script language="javascript">    
    window.focus()
    frm_Edtstf.btn_Search.focus()
  </script>
</cfif>

<!--- Confirmation messages given  --->
<cfif msg eq 1>
 <cfif form.hid_Cmode eq 'ASC'>
        <script language="javascript">
              Err_msg(248)
              frm_Edtstf.cbo_Assign.focus()
        </script>
 </cfif>
<cfelseif msg eq 4>
   <!--- <cfif form.hid_Source eq "Staff"> --->
            <script language="javascript">
                document.frm_Edtstf.hid_Addedit.value = 'ADT'
               

parent.Topform.document.frm_Addedittop.hid_Addedit.value = 'ADT'
               

//parent.Topform.document.frm_Addedittop.hid_Count.value = 0  
                  

parent.Topform.document.frm_Addedittop.hid_Src.value = 'ADR'
                  

parent.Topform.document.frm_Addedittop.hid_Query.value =

'<cfoutput>#urlencodedformat(sqlstr)#</cfoutput>'
                  frm_Edtstf.hid_Query.value =

'<cfoutput>#urlencodedformat(sqlstr)#</cfoutput>'
                  

parent.Topform.document.frm_Addedittop.hid_Query.value

=unescape(parent.Topform.document.frm_Addedittop.hid_Query.value)
                  

frm_Edtstf.hid_Query.value=unescape(frm_Edtstf.hid_Query.value)
                parent.Topform.document.frm_Addedittop.submit()
            </script>
<cfelseif msg eq 3>
   <!--- <cfif form.hid_Source eq "Staff"> --->
            <script language="javascript">
                document.frm_Edtstf.hid_Addedit.value = 'EDT'
               

parent.Topform.document.frm_Addedittop.hid_Addedit.value = 'EDT'
               

//parent.Topform.document.frm_Addedittop.hid_Count.value = 0  
                  

parent.Topform.document.frm_Addedittop.hid_Src.value = 'EDR'
                  

parent.Topform.document.frm_Addedittop.hid_Query.value

='<cfoutput>#urlencodedformat(sqlstr)#</cfoutput>'
                  frm_Edtstf.hid_Query.value =

'<cfoutput>#urlencodedformat(sqlstr)#</cfoutput>'
                  

parent.Topform.document.frm_Addedittop.hid_Query.value

=unescape(parent.Topform.document.frm_Addedittop.hid_Query.value)
                  

frm_Edtstf.hid_Query.value=unescape(frm_Edtstf.hid_Query.value)
                parent.Topform.document.frm_Addedittop.submit()
            </script>
            
<cfelseif msg eq 2>
 <script language="javascript">
  Err_msg(248)
  frm_Edtstf.cbo_Assign.focus()
 </script>
<cfelseif msg eq 5>
   <cfif form.hid_Source eq "Staff">
        <script language="javascript">
              

parent.Topform.document.frm_Addedittop.hid_Addedit.value ='DEL'
                 parent.Topform.document.frm_Addedittop.hid_Src.value =

'DR'
              parent.Topform.document.frm_Addedittop.hid_Count.value

= 0
                     parent.Topform.document.frm_Addedittop.submit()
        </script>       
   <cfelse>      
     <script language="javascript">
           frm_Edtstf.cbo_Sarea.focus()      
       </script>
   </cfif>       
</cfif>

<cfif form.hid_Proc eq 'AT'>
  <script language="javascript">
   var str = "<cfoutput>#warning#</cfoutput>" + " (This is a potential

conflict)";
      str = str + "\n Would you like to schedule this person given

the time considerations?"
    if(confirm(str))
        {
          
            frm_Edtstf.hid_Proc.value = "ATY"
            frm_Edtstf.hid_Cmode.value = "ASC" // consider ATC and

ALC
            frm_Edtstf.hid_Smode.value = "A"
            
            frm_Edtstf.submit()
        }
       else
       {
         frm_Edtstf.hid_Smode.value = ""
         frm_Edtstf.hid_Proc.value = ""
         frm_Edtstf.hid_Cmode.value = "ASC"
         frm_Edtstf.cbo_Sarea.focus()
       }  
  </script>
<cfelseif form.hid_Proc eq 'CT'>
   <script language="javascript">
    var str = "<cfoutput>#warning#</cfoutput>" + " (This is a potential

conflict)";
      str = str + "\n Would you like to schedule this person given

the time considerations?"
    if(confirm(str))
        {
        
          frm_Edtstf.hid_Proc.value = "CTY"
            frm_Edtstf.hid_Cmode.value = "ASC" // consider ATC and

ALC
            frm_Edtstf.hid_Smode.value = "C"
            frm_Edtstf.submit()
        }
      else
      {
        frm_Edtstf.hid_Smode.value = ""
        frm_Edtstf.hid_Proc.value = ""
        frm_Edtstf.cbo_Sarea.focus()
      }  
  </script>
<cfelseif form.hid_Proc eq 'ATD'>
   <script language="javascript">
     var str = "<cfoutput>#warning#</cfoutput>";
      alert(str + " ( This is a direct conflict )");
      frm_Edtstf.hid_Smode.value = ""
        frm_Edtstf.hid_Proc.value = ""
        frm_Edtstf.cbo_Sarea.focus()
  </script>
<cfelseif form.hid_Proc eq 'CTD'>
   <script language="javascript">
     var str = "<cfoutput>#warning#</cfoutput>";
      alert(str + " ( This is a direct conflict )");
      frm_Edtstf.hid_Smode.value = ""
        frm_Edtstf.hid_Proc.value = ""
        frm_Edtstf.cbo_Sarea.focus()
   </script>
</cfif>

<cfif session.Security.Conf eq 2>  
   <script language="javascript">      
     frm_Edtstf.btn_Delete.disabled = true
   </script>
</cfif>

<cfif form.hid_Source1 eq 'Sessionmgmt'>
 
 <!---  <script language="javascript">      
       frm_Edtstf.btn_Delete.disabled = true
         frm_Edtstf.btn_Change.disabled = true
  </script>   --->
 </cfif>  
</cfif>
      
      
0
 

Expert Comment

by:Hotwu
Comment Utility
hahahhaha
0
 
LVL 24

Expert Comment

by:SunBow
Comment Utility
I tend to agree w/ DreamMaster, it seems a design issue, so I'd ask on the bandwidth - is query of one line, one record able to hit the backend with all due speed. 30K can be a quick bottleneck, consider decreasing it through design (what is most likely to be retrieved most regularly.)

That's a lot of code, and thankYe for being precise and not beating around the bush, but consider posting a zero pt q in ColdFusion topic area to solicit larger audience that might 'see' things they've more experience with for the looping issues.

A more obvious gotcha is not using an index at backend. Less obvious, is using query that either works too hard to find one record, or, neglects work already done in the query itself, which leads to unnecessary repetition.

Knowing the data itself has value. Consider the lengthy if-then else like:

> "...value) == "ses")"

If this is the least likely, then it runs more tests than needed.  One speed move is to mentally presort the else-if tests by likelihood of success in passing the test, code the most popular one as first test, then the remaining code is executed less.

While I assume other cleanup operations can shave milliseconds here and there, as DreamMaster indicates, doing so in the innermost loops first gets the most bang_for_the-buck.
0
 
LVL 15

Expert Comment

by:a.marsh
Comment Utility
This question has been open for some time and is now in need of wrapping up.

Please DO NOT accept this comment as the answer to the question, it is purely an alert to the fact that this question is still open.

It would be greatly appreciated if any of the participants could comment back here in order to give assistance in what the status of this question is and what should be done with it (delete, 0 PAQ, award points etc).

Kindest Regards

Ant
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 30 total points
Comment Utility
I have no idea what to do with this question...I know I'm not going to check THAT amount of code...I simply don't have the time for that...either delete or award the points to me or SunBow

Max.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
<indignation>
   25 open questions -- 30 points offered when it is worth 100 just to read all of that
</indignation>

It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
DreamMaster and Sunbow Should each be awarded the full 30 points Plus a bonus.

I will ask that the account of Thinkpad be suspended until the old questions are delat with.

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 19

Expert Comment

by:DreamMaster
Comment Utility
You will hear no bad words from me there Cd&...

Max.
0
 
LVL 5

Expert Comment

by:Netminder
Comment Utility
Thinkpad,

These questions are still open, and our records show you have logged in recently. Further, your record of responding and closing questions is deplorable. Please resolve these immediately; continued disregard of your open questions will result in the force/acceptance of a comment as an answer, and other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.

http://www.experts-exchange.com/questions/Q.11917258.html
http://www.experts-exchange.com/questions/Q.20003765.html
http://www.experts-exchange.com/questions/Q.20042170.html
http://www.experts-exchange.com/questions/Q.20077526.html
http://www.experts-exchange.com/questions/Q.20079298.html
http://www.experts-exchange.com/questions/Q.20080026.html
http://www.experts-exchange.com/questions/Q.20090703.html
http://www.experts-exchange.com/questions/Q.20092470.html
http://www.experts-exchange.com/questions/Q.20090755.html
http://www.experts-exchange.com/questions/Q.20094545.html
http://www.experts-exchange.com/questions/Q.20097452.html
http://www.experts-exchange.com/questions/Q.20106026.html
http://www.experts-exchange.com/questions/Q.20111855.html
http://www.experts-exchange.com/questions/Q.20122592.html
http://www.experts-exchange.com/questions/Q.11971778.html
http://www.experts-exchange.com/questions/Q.11822578.html
http://www.experts-exchange.com/questions/Q.11618338.html
http://www.experts-exchange.com/questions/Q.11520158.html
http://www.experts-exchange.com/questions/Q.11495358.html
http://www.experts-exchange.com/questions/Q.20129373.html
http://www.experts-exchange.com/questions/Q.20131212.html
http://www.experts-exchange.com/questions/Q.20094548.html
http://www.experts-exchange.com/questions/Q.20184779.html
http://www.experts-exchange.com/questions/Q.20185293.html
http://www.experts-exchange.com/questions/Q.20131218.html
http://www.experts-exchange.com/questions/Q.20206981.html
http://www.experts-exchange.com/questions/Q.20227490.html
http://www.experts-exchange.com/questions/Q.20228191.html
http://www.experts-exchange.com/questions/Q.20242801.html
http://www.experts-exchange.com/questions/Q.20247143.html
http://www.experts-exchange.com/questions/Q.20248480.html
http://www.experts-exchange.com/questions/Q.20250984.html
http://www.experts-exchange.com/questions/Q.20256536.html
http://www.experts-exchange.com/questions/Q.20256334.html
http://www.experts-exchange.com/questions/Q.20256535.html
http://www.experts-exchange.com/questions/Q.20267197.html
http://www.experts-exchange.com/questions/Q.20273340.html
http://www.experts-exchange.com/questions/Q.20274774.html
http://www.experts-exchange.com/questions/Q.20276269.html

EXPERTS: Please leave your thoughts on this question here.

Thanks,

Netminder
Community Support Moderator
Experts Exchange
0
 
LVL 5

Expert Comment

by:Netminder
Comment Utility
Force-accepted by
Netminder
Community Support Moderator
Experts Exchange

SunBow: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?qid=20275268
0
 
LVL 24

Expert Comment

by:SunBow
Comment Utility
wow.
meThinx there are lounge pts available to anyone who can accumulate this many open Q's.

Race ya there and back  !!!
0
 
LVL 24

Expert Comment

by:SunBow
Comment Utility
hmm, now nominating: Cd&=PUCK
0
 
LVL 5

Expert Comment

by:Netminder
Comment Utility
SunBow,

Nope. Do we get to deduct points for wrong answers? <smirk>

N
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
lol

Cd&
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now