Advertisement
aparker81

Multiple File Upload w/ CF8

Mar 25th, 2011
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <cfif not cgi.server_port_secure>
  2.    <cflocation url="https://#cgi.server_name##cgi.script_name#?#cgi.query_string#" />
  3. </cfif>
  4.  
  5. <cfsilent>
  6.     <cfsetting showdebugoutput="no">
  7.    
  8.     <cffunction name="makeRandomString" returntype="string" output="false">
  9.        <cfset var chars = "23456789AaBbCDdEdFGgHhJKMNPQqRrS">
  10.        <cfset var length = randRange(4,6)>
  11.        <cfset var result = "">
  12.        <cfset var i = "">
  13.        <cfset var char = "">
  14.        
  15.        <cfscript>
  16.        for(i=1; i <= length; i++) {
  17.           char = mid(chars, randRange(1, len(chars)),1);
  18.           result&=char;
  19.        }
  20.        </cfscript>
  21.          
  22.        <cfreturn result>
  23.     </cffunction>
  24.    
  25.    
  26.     <!--- Param FORM variables. --->
  27.     <cfparam
  28.         name="URL.Reg"
  29.        type="string"
  30.        default=""
  31.        />
  32.    
  33.     <cfparam
  34.         name="FORM.fname"
  35.         type="string"
  36.         default=""
  37.         />
  38.  
  39.     <cfparam
  40.         name="FORM.lname"
  41.         type="string"
  42.         default=""
  43.         />
  44.  
  45.     <cfparam
  46.         name="FORM.universityId"
  47.         type="string"
  48.         default=""
  49.         />
  50.        
  51.     <cfparam
  52.         name="FORM.classification"
  53.         type="string"
  54.         default=""
  55.         />
  56.    
  57.     <cfparam
  58.         name="FORM.school"
  59.         type="string"
  60.         default=""
  61.         />
  62.    
  63.     <cfparam
  64.         name="FORM.department"
  65.         type="string"
  66.         default=""
  67.         />
  68.  
  69.     <cfparam
  70.         name="FORM.address1"
  71.         type="string"
  72.         default=""
  73.         />
  74.  
  75.     <cfparam
  76.         name="FORM.address2"
  77.         type="string"
  78.         default=""
  79.         />
  80.  
  81.     <cfparam
  82.         name="FORM.email"
  83.         type="string"
  84.         default=""
  85.         />
  86.  
  87.     <cfparam
  88.         name="FORM.phone"
  89.         type="string"
  90.         default=""
  91.         />
  92.  
  93.     <cfparam
  94.         name="FORM.NOMfname"
  95.         type="string"
  96.         default=""
  97.         />
  98.  
  99.     <cfparam
  100.         name="FORM.NOMlname"
  101.         type="string"
  102.         default=""
  103.         />
  104.  
  105.     <cfparam
  106.         name="FORM.NOMuniversityId"
  107.         type="string"
  108.         default=""
  109.         />
  110.  
  111.     <cfparam
  112.         name="FORM.NOMschool"
  113.         type="string"
  114.         default=""
  115.         />
  116.    
  117.     <cfparam
  118.         name="FORM.NOMdepartment"
  119.         type="string"
  120.         default=""
  121.         />
  122.  
  123.     <cfparam
  124.         name="FORM.NOMaddress1"
  125.         type="string"
  126.         default=""
  127.         />
  128.  
  129.     <cfparam
  130.         name="FORM.NOMaddress2"
  131.         type="string"
  132.         default=""
  133.         />
  134.  
  135.     <cfparam
  136.         name="FORM.NOMemail"
  137.         type="string"
  138.         default=""
  139.         />
  140.  
  141.     <cfparam
  142.         name="FORM.NOMphone"
  143.         type="string"
  144.         default=""
  145.         />
  146.  
  147.     <cfparam
  148.         name="FORM.nominationLetter"
  149.         type="string"
  150.         default=""
  151.         />
  152.  
  153.     <cfparam
  154.         name="FORM.curriculumVita"
  155.         type="string"
  156.         default=""
  157.         />
  158.  
  159.     <cfparam
  160.         name="FORM.recommendation"
  161.         type="string"
  162.         default=""
  163.         />
  164.  
  165.     <cfparam
  166.         name="FORM.recommendation2"
  167.         type="string"
  168.         default=""
  169.         />
  170.     <cfparam
  171.         name="FORM.recommendation3"
  172.         type="string"
  173.         default=""
  174.         />
  175.     <cfparam
  176.         name="FORM.recommendation4"
  177.         type="string"
  178.         default=""
  179.         />
  180.     <cfparam
  181.         name="FORM.recommendation5"
  182.         type="string"
  183.         default=""
  184.         />
  185.     <cfparam
  186.         name="FORM.recommendation6"
  187.         type="string"
  188.         default=""
  189.         />
  190.        
  191.     <cfparam
  192.         name="FORM.captcha"
  193.         type="string"
  194.         default=""
  195.         />
  196.  
  197.  
  198.     <!---
  199.         For the form submission flag, since we are asking
  200.         it to be of type numeric, we have to catch the
  201.         CFParam in case someone has hacked the HTML and
  202.         altered the value being sent (a non-numeric value
  203.         will throw a ColdFusion error).
  204.     --->
  205.     <cftry>
  206.         <cfparam
  207.             name="FORM.submitted"
  208.             type="numeric"
  209.             default="0"
  210.             />
  211.  
  212.         <!--- Catch CFParam data type errors. --->
  213.         <cfcatch>
  214.             <cfset FORM.submitted = 0 />
  215.         </cfcatch>
  216.     </cftry>
  217.  
  218.  
  219.     <!--- Define an array to catch the form errors. --->
  220.     <cfset arrErrors = ArrayNew( 1 ) />
  221.  
  222.  
  223.     <!--- Check to see if the form has been submitted. --->
  224.     <cfif FORM.submitted>
  225.  
  226.         <!---
  227.             Now that the form has been submitted, we need
  228.             to validate the data.
  229.         --->
  230.        
  231.         <!--- Validate first name. --->
  232.         <cfif NOT Len( FORM.fname )>
  233.             <cfset ArrayAppend(
  234.                 arrErrors,
  235.                 "Please enter the nominee's first name."
  236.                 ) />
  237.         </cfif>
  238.         <!--- Validate last name. --->
  239.         <cfif NOT Len( FORM.lname )>
  240.             <cfset ArrayAppend(
  241.                 arrErrors,
  242.                 "Please enter the nominee's last name."
  243.                 ) />
  244.         </cfif>
  245.         <!--- Validate id number. --->
  246.         <cfif NOT Len( FORM.universityId )>
  247.             <cfset ArrayAppend(
  248.                 arrErrors,
  249.                 "Please enter the nominee's ten-digit University ID."
  250.                 ) />
  251.         </cfif>    
  252.         <!--- Validate rank. --->
  253.         <cfif NOT Len( FORM.classification )>
  254.             <cfset ArrayAppend(
  255.                 arrErrors,
  256.                 "Please select the nominee's classification."
  257.                 ) />
  258.         </cfif>    
  259.  
  260.         <!--- Validate school. --->
  261.         <cfif NOT Len( FORM.school )>
  262.             <cfset ArrayAppend(
  263.                 arrErrors,
  264.                 "Please enter the nominee's school."
  265.                 ) />
  266.         </cfif>
  267.         <!--- Validate campus address. --->
  268.         <cfif NOT Len( FORM.address1)>
  269.             <cfset ArrayAppend(
  270.                 arrErrors,
  271.                 "Please enter the nominee's campus address."
  272.                 ) />
  273.         </cfif>
  274.         <!--- Validate email address. --->
  275.         <cfif not len(trim(form.email)) or not isValid("email", form.email)>
  276.             <cfset ArrayAppend(
  277.                 arrErrors,
  278.                 "Please enter the nominee's University email address."
  279.                 ) />
  280.         </cfif>
  281.         <!--- Validate campus phone. --->
  282.         <cfif NOT Len( FORM.phone)>
  283.             <cfset ArrayAppend(
  284.                 arrErrors,
  285.                 "Please enter the nominee's campus phone number."
  286.                 ) />
  287.         </cfif>
  288.         <!---Validate Nominator's first name--->
  289.         <cfif NOT Len( FORM.NOMfname )>
  290.             <cfset ArrayAppend(
  291.                 arrErrors,
  292.                 "Please enter nominator's first name."
  293.                 ) />
  294.         </cfif>
  295.         <!---Validate Nominator's last name--->
  296.         <cfif NOT Len( FORM.NOMlname )>
  297.             <cfset ArrayAppend(
  298.                 arrErrors,
  299.                 "Please enter nominator's last name."
  300.                 ) />
  301.         </cfif>
  302.         <!---Validate Nominator's id number--->
  303.         <cfif NOT Len( FORM.NOMuniversityId )>
  304.             <cfset ArrayAppend(
  305.                 arrErrors,
  306.                 "Please enter nominator's ten-digit University ID."
  307.                 ) />
  308.         </cfif>
  309.         <!---Validate Nominator's school--->
  310.         <cfif NOT Len( FORM.NOMschool )>
  311.             <cfset ArrayAppend(
  312.                 arrErrors,
  313.                 "Please enter nominator's school."
  314.                 ) />
  315.         </cfif>
  316.         <!---Validate Nominator's address--->
  317.         <cfif NOT Len( FORM.NOMaddress1 )>
  318.             <cfset ArrayAppend(
  319.                 arrErrors,
  320.                 "Please enter nominator's address."
  321.                 ) />
  322.         </cfif>
  323.         <!---Validate Nominator's email--->
  324.         <cfif not len(trim(form.NOMemail)) or not isValid("email", form.NOMemail)>
  325.             <cfset ArrayAppend(
  326.                 arrErrors,
  327.                 "Please enter nominator's email address."
  328.                 ) />
  329.         </cfif>
  330.         <!--- Validate nominator's phone number. --->
  331.         <cfif NOT Len( FORM.NOMphone)>
  332.             <cfset ArrayAppend(
  333.                 arrErrors,
  334.                 "Please enter nominator's campus phone number."
  335.                 ) />
  336.         </cfif>
  337.         <!---
  338.             When it comes to validating the documents, we want to
  339.             check to see if they selected one. Then, once they
  340.             selected one, we ONLY want to mess with it if there
  341.             are no errors caused by other form fields.
  342.         --->
  343.        
  344.         <!--- Validate nomination letter. --->
  345.         <cfif NOT Len( FORM.nominationLetter )>
  346.             <cfset ArrayAppend(
  347.                 arrErrors,
  348.                 "Please select a file to upload as your nomination letter."
  349.                 ) />
  350.         </cfif>
  351.         <!--- Validate curriculum vita. --->
  352.         <cfif NOT Len( FORM.curriculumVita )>
  353.             <cfset ArrayAppend(
  354.                 arrErrors,
  355.                 "Please select a file to upload as your curriculum vita."
  356.                 ) />
  357.         </cfif>
  358.         <!--- Validate first recommendation document. --->
  359.         <cfif NOT Len( FORM.recommendation )>
  360.             <cfset ArrayAppend(
  361.                 arrErrors,
  362.                 "Please select a file to upload as your first recommendation letter."
  363.                 ) />
  364.         </cfif>
  365.         <!---Validate CAPTCHA --->
  366.         <cfif hash(form.captcha) neq form.captchaHash>
  367.             <cfset ArrayAppend(
  368.                arrErrors,
  369.                "You did not enter the correct security text."
  370.                ) />
  371.        
  372.                
  373.     <cfelseif NOT ArrayLen( arrErrors )>
  374.            
  375.         <!---Set file upload destination path to nominationUploads/firstname_lastname--->  
  376.         <cfset destination = expandPath("./nominationUploads/#fname#_#lname#/")>
  377.        
  378.         <!---If the destination directory does not exist, create it.  This will be unique for each nominee.--->                                
  379.         <cfif not directoryExists(destination)>
  380.             <cfdirectory action="create" directory="#destination#">
  381.         </cfif>
  382.  
  383.         <!---Upload  document to the destination.  Accept only MSWord, PDF, RTF and plain text files.--->
  384.         <cffile action="upload"
  385.                 filefield="nominationLetter"
  386.                 accept="application/msword, application/pdf, application/rtf, text/plain,  application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  387.                 destination="#destination#"
  388.                 nameconflict="makeunique">
  389.        
  390.         <!--- Create variable to reference the original document name and extension uploaded from client.--->          
  391.         <cfset clientNominationLetter = #file.ClientFile#>
  392.         <!---Create variable to reference renamed document.  Retain orignal file extension.--->  
  393.         <cfset renameNomination = "nominationLetter"&"."&#cffile.clientFileExt#>
  394.        
  395.         <!---Rename uploaded document using variable.  Save renamed document to original destination.--->
  396.         <cffile action="rename"
  397.                 source="#destination##File.ServerFile#"
  398.                 destination="#destination##Trim(renameNomination)#">
  399.  
  400.  
  401.         <!---Upload document to the destination.  Accept only MSWord, PDF, RTF and plain text files.--->
  402.         <cffile action="upload"
  403.                 filefield="curriculumVita"
  404.                 accept="application/msword, application/pdf, application/rtf, text/plain,  application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  405.                 destination="#destination#"
  406.                 nameconflict="makeunique">
  407.        
  408.         <!--- Create variable to reference the original document name and extension uploaded from client.--->          
  409.         <cfset clientCurriculumVita = #file.ClientFile#>       
  410.         <!---Create variable to reference renamed document.  Retain orignal file extension.--->  
  411.         <cfset renameCurriculumVita = "curriculumVita"&"."&#cffile.clientFileExt#>
  412.        
  413.         <!---Rename uploaded document using variable.  Save renamed document to original destination.--->
  414.         <cffile action="rename"
  415.                 source="#destination##File.ServerFile#"
  416.                 destination="#destination##Trim(renameCurriculumVita)#">       
  417.  
  418.         <!---Upload  document to the destination.  Accept only MSWord, PDF, RTF and plain text files.--->
  419.         <cffile action="upload"
  420.                 filefield="recommendation"
  421.                 accept="application/msword, application/pdf, application/rtf, text/plain,  application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  422.                 destination="#destination#"
  423.                 nameconflict="makeunique">
  424.        
  425.         <!--- Create variable to reference the original document name and extension uploaded from client.--->          
  426.         <cfset clientRecommendation = #file.ClientFile#>
  427.         <!---Create variable to reference renamed document.  Retain orignal file extension.--->  
  428.         <cfset renameRecommendation = "recommendation"&"."&#cffile.clientFileExt#>
  429.        
  430.         <!---Rename uploaded document using variable.  Save renamed document to original destination.--->
  431.         <cffile action="rename"
  432.                 source="#destination##File.ServerFile#"
  433.                 destination="#destination##Trim(renameRecommendation)#">
  434.                
  435.                
  436.             <cfif Len(form.recommendation2)>
  437.                 <!---Upload  document to the destination.  Accept only MSWord, PDF, RTF and plain text files.--->
  438.                 <cffile action="upload"
  439.                         filefield="recommendation2"
  440.                         accept="application/msword, application/pdf, application/rtf, text/plain,  application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  441.                         destination="#destination#"
  442.                         nameconflict="makeunique">
  443.  
  444.                 <!--- Create variable to reference the original document name and extension uploaded from client.--->          
  445.                 <cfset clientRecommendation2 = #file.ClientFile#>  
  446.                 <!---Create variable to reference renamed document.  Retain orignal file extension.--->  
  447.                 <cfset renameRecommendation2 = "recommendation2"&"."&#cffile.clientFileExt#>
  448.                
  449.                 <!---Rename uploaded document using variable.  Save renamed document to original destination.--->
  450.                 <cffile action="rename"
  451.                         source="#destination##File.ServerFile#"
  452.                         destination="#destination##Trim(renameRecommendation2)#">      
  453.             </cfif>    
  454.                        
  455.             <cfif Len(form.recommendation3)>
  456.                 <!---Upload  document to the destination.  Accept only MSWord, PDF, RTF and plain text files.--->
  457.                 <cffile action="upload"
  458.                         filefield="recommendation3"
  459.                         accept="application/msword, application/pdf, application/rtf, text/plain,  application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  460.                         destination="#destination#"
  461.                         nameconflict="makeunique">
  462.                
  463.                 <!--- Create variable to reference the original document name and extension uploaded from client.--->          
  464.                 <cfset clientRecommendation3 = #file.ClientFile#>              
  465.                 <!---Create variable to reference renamed document.  Retain orignal file extension.--->  
  466.                 <cfset renameRecommendation3 = "recommendation3"&"."&#cffile.clientFileExt#>
  467.                
  468.                 <!---Rename uploaded document using variable.  Save renamed document to original destination.--->
  469.                 <cffile action="rename"
  470.                         source="#destination##File.ServerFile#"
  471.                         destination="#destination##Trim(renameRecommendation3)#">      
  472.             </cfif>    
  473.                        
  474.             <cfif Len(form.recommendation4)>
  475.                 <!---Upload  document to the destination.  Accept only MSWord, PDF, RTF and plain text files.--->
  476.                 <cffile action="upload"
  477.                         filefield="recommendation4"
  478.                         accept="application/msword, application/pdf, application/rtf, text/plain,  application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  479.                         destination="#destination#"
  480.                         nameconflict="makeunique">
  481.                
  482.                 <!--- Create variable to reference the original document name and extension uploaded from client.--->          
  483.                 <cfset clientRecommendation4 = #file.ClientFile#>
  484.                 <!---Create variable to reference renamed document.  Retain orignal file extension.--->  
  485.                 <cfset renameRecommendation4 = "recommendation4"&"."&#cffile.clientFileExt#>
  486.                
  487.                 <!---Rename uploaded document using variable.  Save renamed document to original destination.--->
  488.                 <cffile action="rename"
  489.                         source="#destination##File.ServerFile#"
  490.                         destination="#destination##Trim(renameRecommendation4)#">      
  491.             </cfif>    
  492.                        
  493.             <cfif Len(form.recommendation5)>
  494.                 <!---Upload  document to the destination.  Accept only MSWord, PDF, RTF and plain text files.--->
  495.                 <cffile action="upload"
  496.                         filefield="recommendation5"
  497.                         accept="application/msword, application/pdf, application/rtf, text/plain,  application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  498.                         destination="#destination#"
  499.                         nameconflict="makeunique">
  500.                
  501.                 <!--- Create variable to reference the original document name and extension uploaded from client.--->              
  502.                 <cfset clientRecommendation5 = #file.ClientFile#>
  503.                 <!---Create variable to reference renamed document.  Retain orignal file extension.--->  
  504.                 <cfset renameRecommendation5 = "recommendation5"&"."&#cffile.clientFileExt#>
  505.                
  506.                 <!---Rename uploaded document using variable.  Save renamed document to original destination.--->
  507.                 <cffile action="rename"
  508.                         source="#destination##File.ServerFile#"
  509.                         destination="#destination##Trim(renameRecommendation5)#">      
  510.             </cfif>    
  511.                        
  512.             <cfif Len(form.recommendation6)>
  513.                 <!---Upload  document to the destination.  Accept only MSWord, PDF, RTF and plain text files.--->
  514.                 <cffile action="upload"
  515.                         filefield="recommendation6"
  516.                         accept="application/msword, application/pdf, application/rtf, text/plain,  application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  517.                         destination="#destination#"
  518.                         nameconflict="makeunique">
  519.                
  520.                 <!--- Create variable to reference the original document name and extension uploaded from client.--->              
  521.                 <cfset clientRecommendation6 = #file.ClientFile#>
  522.                 <!---Create variable to reference renamed document.  Retain orignal file extension.--->  
  523.                 <cfset renameRecommendation6 = "recommendation6"&"."&#cffile.clientFileExt#>
  524.                
  525.                 <!---Rename uploaded document using variable.  Save renamed document to original destination.--->
  526.                 <cffile action="rename"
  527.                         source="#destination##File.ServerFile#"
  528.                         destination="#destination##Trim(renameRecommendation6)#">      
  529.             </cfif>    
  530.  
  531.         </cfif>
  532.            
  533.         <!---
  534.             Now that we have validated our form data, let's
  535.             check to see if there are any form validation
  536.             errors. Only if there are no errors do w want to
  537.             continue processing the data - otherwise, we want
  538.             to skip this next part and let the form re-render.
  539.         --->
  540.         <cfif NOT ArrayLen( arrErrors )>
  541.  
  542.            
  543.         <cfquery name="qAddNominee" datasource="myDSN">
  544.        
  545.             INSERT INTO myTable (submitDate,
  546.                                     fname,
  547.                                     lname,
  548.                                     universityID,
  549.                                     classification,
  550.                                     school,
  551.                                     department,
  552.                                     address1,
  553.                                     address2,
  554.                                     email,
  555.                                     phone,
  556.                                     NOMfname,
  557.                                     NOMlname,
  558.                                     NOMuniversityID,
  559.                                     NOMschool,
  560.                                     NOMdepartment,
  561.                                     NOMaddress1,
  562.                                     NOMaddress2,
  563.                                     NOMemail,
  564.                                     NOMphone)
  565.                                                
  566.             VALUES ('#DateFormat(now(), "mm/dd/yyyy")#',
  567.                         '#fname#',
  568.                         '#lname#',
  569.                         '#universityID#',
  570.                         '#classification#',
  571.                         '#school#',
  572.                         '#department#',
  573.                         '#address1#',
  574.                         '#address2#',
  575.                         '#email#',
  576.                         '#phone#',
  577.                         '#NOMfname#',
  578.                         '#NOMlname#',
  579.                         '#NOMuniversityID#',
  580.                         '#NOMschool#',
  581.                         '#NOMdepartment#',
  582.                         '#NOMaddress1#',
  583.                         '#NOMaddress2#',
  584.                         '#NOMemail#',
  585.                         '#NOMphone#')
  586.            
  587.         </cfquery>
  588.  
  589.             <cfmail
  590.                 to="#NOMEmail#"
  591.                 from="email"
  592.                 subject="Award"
  593.                 type="html"
  594.                 failto="email"
  595.                 >
  596.                 <p>Hello,</p>
  597.                 <p>
  598.                     The following nomination has been
  599.                     submitted through the <a href="#CGI.HTTP_REFERER#">Alvin S. Bynum Mentor Award web site</a> on
  600.                     #DateFormat( Now(), "mmm d, yyyy" )# at
  601.                     #TimeFormat( Now(), "h:mm TT" )#.
  602.                 </p>
  603.                
  604.                 <h3>Nominee Details</h3>
  605.                 <ul>
  606.                     <li>First Name: #form.fname#</li>
  607.                     <li>Last Name:  #form.lname#</li>
  608.                     <li>University ID:  #form.universityId#</li>
  609.                     <li>Classificaiton:  #form.classification#</li>
  610.                     <li>School Affiliation:  #form.school#</li>
  611.                     <cfif len("form.department") GTE 1><li>Department:  #form.department#</li></cfif>
  612.                     <li>Campus Address:  #form.address1#
  613.                     <cfif len(form.address2) GTE 1><li>Campus Address:  #form.address2#</li></cfif>
  614.                     <li>University Email:  #form.email#</li>
  615.                     <li>University Phone:  #form.phone#</li>
  616.                 </ul>
  617.                 <br />
  618.  
  619.  
  620.                 <h3>Nominator Details</h3>
  621.                 <ul>
  622.                     <li>First Name: #form.NOMfname#</li>
  623.                     <li>Last Name:  #form.NOMlname#</li>
  624.                     <li>University ID:  #form.NOMuniversityId#</li>
  625.                     <li>School Affiliation:  #form.NOMschool#</li>
  626.                     <cfif len("form.NOMdepartment") GTE 1><li>Department:  #form.NOMdepartment#</li></cfif>
  627.                     <li>Campus Address 1:  #NOMaddress1#
  628.                     <cfif len("form.NOMaddress2") GTE 1><li>Campus Address 2:  #form.NOMaddress2#</li></cfif>
  629.                     <li>University Email:  #form.NOMemail#</li>
  630.                     <li>University Phone:  #form.NOMphone#</li>
  631.                 </ul>
  632.                 <br />
  633.                
  634.                 <h3>Document Details</h3>
  635.                 <ul>
  636.                     <li>Nomination Letter:  <cfoutput>#clientNominationLetter#</cfoutput></li>         
  637.                     <li>Curriculum Vita:  <cfoutput>#clientCurriculumVita#</cfoutput></li>
  638.                     <li>Recommendation Letter:  <cfoutput>#clientRecommendation#</cfoutput></li>
  639.                     <cfif Len(form.recommendation2)><li>Recommendation Letter ##2:  <cfoutput>#clientRecommendation2#</cfoutput></li></cfif>
  640.                     <cfif Len(form.recommendation3)><li>Recommendation Letter ##3:  <cfoutput>#clientRecommendation3#</cfoutput></li></cfif>
  641.                     <cfif Len(form.recommendation4)><li>Recommendation Letter ##4:  <cfoutput>#clientRecommendation4#</cfoutput></li></cfif>
  642.                     <cfif Len(form.recommendation5)><li>Recommendation Letter ##5:  <cfoutput>#clientRecommendation5#</cfoutput></li></cfif>
  643.                     <cfif Len(form.recommendation6)><li>Recommendation Letter ##6:  <cfoutput>#clientRecommendation6#</cfoutput></li></cfif>
  644.                 </ul>
  645.                 <br />
  646.                    
  647.                 <p>Thank you.</p>
  648.                
  649.            
  650.             <!---
  651.                 At this point, you would probably forward
  652.                 the user to another page using something
  653.                 like CFLocation.
  654.             --->
  655.  
  656.             </cfmail>
  657.            
  658.         <cflocation url="index.cfm?reg=y">
  659.         </cfif>
  660.        
  661.     </cfif>
  662.  
  663. </cfsilent>
  664.  
  665. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  666. <html xmlns="http://www.w3.org/1999/xhtml">
  667. <head>
  668. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  669. <title>Award</title>
  670. <link rel="icon" href="favicon.ico" type="image/x-icon" />
  671.  
  672.  
  673. <script src="../../js/jquery.js" language="text/javascript"></script>
  674. <script src="../../js/charLimter.js" language="text/javascript"></script>
  675. <script src="expand.js" type="text/javascript"></script>
  676.  
  677.  
  678. </head>
  679.  
  680. <body>
  681.  
  682.  
  683.     <!--Holds Right area for main section -->
  684.    <div id="rightFaa">
  685.  
  686.     <h3><strong>AWARD &ndash; 2011</strong></h3>
  687.     <cfif #now()# GTE '1/18/2011'>
  688.         <p>Nominations for the 2011 awards cycle have closed.  We will begin to accept submissions for the 2012 awards cycle in October.  Thank you for your interest.</p>
  689.     <cfelse>
  690.    
  691.     <cfoutput>
  692.         <!--- Check to see if we have any form errors. --->
  693.         <cfif ArrayLen( arrErrors )>
  694.    
  695.             <h4>Please review the following:</h4>
  696.    
  697.             <ul>
  698.                 <cfloop
  699.                     index="intError"
  700.                     from="1"
  701.                     to="#ArrayLen( arrErrors )#"
  702.                     step="1">
  703.    
  704.                     <li>
  705.                         <div class="required">#arrErrors[ intError ]#</div>
  706.                     </li>
  707.                 </cfloop>
  708.             </ul>
  709.         </cfif>
  710.     </cfoutput>
  711.    
  712.    
  713. <cfif URL.Reg EQ "Y">
  714.         <p>Thank you for your submission</p>
  715.       <p class="attention">&nbsp;</p>
  716.   <cfelse>
  717.         <p>
  718.       <p class="attention">PLEASE VERIFY THAT YOUR CANDIDATE MEETS ALL ELIGIBILITY REQUIREMENTS AND YOU HAVE ACCESS TO ALL RELEVANT INFORMATION BEFORE SUBMITTING YOUR NOMINATION.</p>
  719.     <cfoutput>
  720.    
  721.         <div>
  722.              <form
  723.                  action="#cgi.SCRIPT_NAME#"
  724.                  method="post"
  725.                  enctype="multipart/form-data">
  726.                  
  727.              
  728.              <!--- Our form submission flag. --->
  729.              <input type="hidden" name="submitted" value="1" />
  730.               <p>Fields marked <span class="required">&##8727;</span> are required.</p>
  731.              
  732.                 <fieldset>  
  733.                     <legend>Nominee  Information</legend>
  734.                         <div class="notes">
  735.                             <h4>Eligibility</h4>
  736.                                 <p class="last">Those eligible include full- and part-time faculty and academic  professional staff, including all advisors, mentors, and counselors at the TE,  PA, and PB employee classifications.</p>
  737.                 </div>
  738.                         <ol>  
  739.                             <li>  
  740.                                 <label for="first name"><span class="required">&##8727;</span>First Name:</label>  
  741.                                     <input id="fname" name="fname" class="text"  type="text" maxlength="25" value="#form.fname#" tabindex="1"/>  
  742.                             </li>  
  743.                             <li>
  744.                                 <label for="last name"><span class="required">&##8727;</span>Last Name:</label>  
  745.                                     <input id="lname" name="lname" class="text"  type="text" maxlength="25" value="#form.lname#" tabindex="2"/>  
  746.                             </li>
  747.                             <li>
  748.                                 <label for="university id"><span class="required">&##8727;</span>University ID:</label>  
  749.                                     <input id="universityId" name="universityId" class="text"  type="text" maxlength="10" value="#form.universityId#" tabindex="3"/>  
  750.                             </li>
  751.                             <li>
  752.                                 <label for="classification"><span class="required">&##8727;</span>Classification:</label>
  753.                                     <select name="classification" tabindex="4"/>
  754.                                             <option value="">&ndash; select &ndash;</option>
  755.                                             <option value="faculty">Faculty (Full- or part-time)</option>
  756.                                             <option value="staff">Professional Staff (TE, PA, or PB)</option>
  757.                                     </select>
  758.                             </li>
  759.                            
  760.                            
  761.                             <br />
  762.                             <li>
  763.                                 <label for="school"><span class="required">&##8727;</span>School:</label>  
  764.                                     <input id="school" name="school"   type="text" maxlength="50" value="#form.school#" tabindex="5"/>  
  765.                             </li>
  766.                             <li>
  767.                                 <label for="department">Department:</label>  
  768.                                     <input id="department" name="department" class="text"  type="text" maxlength="50" value="#form.department#" tabindex="6"/>  
  769.                             </li>
  770.                             <li>
  771.                                 <label for="address 1"><span class="required">&##8727;</span>Campus Address:</label>  
  772.                                     <input id="address1" name="address1" class="text"  type="text" maxlength="50" value="#form.address1#" tabindex="7"/>  
  773.                             </li>
  774.                             <li>
  775.                                 <label for="address 2">&nbsp;</label>  
  776.                                     <input id="address2" name="address2" class="text"  type="text" maxlength="50" value="#form.address2#" tabindex="8"/>  
  777.                             </li>
  778.                             <li>  
  779.                                 <label for="email"><span class="required">&##8727;</span>University Email:</label>  
  780.                                     <input id="email" name="email" class="text" type="text" maxlength="20" value="#form.email#" tabindex="9"/>  
  781.                             </li>  
  782.                             <li>  
  783.                                 <label for="phone"><span class="required">&##8727;</span>University Phone Number:</label>  
  784.                                     <input id="phone" name="phone" class="text" type="text" maxlength="20" value="#form.phone#" tabindex="10"/>  
  785.                             </li>  
  786.                         </ol>  
  787.                 </fieldset>
  788.                    
  789.                 <fieldset class="nominator">  
  790.                     <legend>Nominator Information</legend>
  791.                         <div class="notes">
  792.                             <h4>Nominator Information</h4>
  793.                                 <p class="last">Please enter your  information.</p>
  794.                                 <p class="last"><br />
  795.                                   For jointly prepared nominations, only one Nominator's information can be entered as a contact.  All other Nominators can be accounted for at the end of the Nomination Letter.</p>
  796.                         </div>
  797.                             <ol>  
  798.                                 <li>  
  799.                                     <label for="NOMfname"><span class="required">&##8727;</span>First Name:</label>  
  800.                                         <input id="fname" name="NOMfname" class="text"  type="text" maxlength="25" value="#form.NOMfname#" tabindex="11"/>  
  801.                                 </li>  
  802.                                 <li>
  803.                                     <label for="NOMlname"><span class="required">&##8727;</span>Last Name:</label>  
  804.                                         <input id="lname" name="NOMlname" class="text"  type="text" maxlength="25" value="#form.NOMlname#" tabindex="12"/>  
  805.                                 </li>
  806.                                 <li>
  807.                                     <label for="NOMuniversityId"><span class="required">&##8727;</span>University ID:</label>  
  808.                                         <input id="universityId" name="NOMuniversityId" class="text"  type="text" maxlength="10" value="#form.NOMuniversityId#" tabindex="13"/>  
  809.                                 </li>
  810.                                 <li>
  811.                                     <label for="NOMschool"><span class="required">&##8727;</span>School:</label>  
  812.                                         <input id="school" name="NOMschool" class="text"  type="text" maxlength="50" value="#form.NOMschool#" tabindex="14"/>  
  813.                                 </li>
  814.                                 <li>
  815.                                     <label for="NOMdepartment">Department:</label>  
  816.                                         <input id="department" name="NOMdepartment" class="text"  type="text" maxlength="50" value="#form.NOMdepartment#" tabindex="15"/>  
  817.                                 </li>
  818.                                 <li>
  819.                                     <label for="NOMaddress1"><span class="required">&##8727;</span>Campus Address:</label>  
  820.                                         <input id="address1" name="NOMaddress1" class="text"  type="text" maxlength="50" value="#form.NOMaddress1#" tabindex="16"/>  
  821.                                 </li>
  822.                                 <li>
  823.                                     <label for="NOMaddress2">&nbsp;</label>  
  824.                                         <input id="address2" name="NOMaddress2" class="text"  type="text" maxlength="50" value="#form.NOMaddress2#" tabindex="17"/>  
  825.                                 </li>
  826.                                 <li>  
  827.                                     <label for="NOMemail"><span class="required">&##8727;</span>University Email:</label>  
  828.                                         <input id="email" name="NOMemail" class="text" type="text" maxlength="20" value="#form.NOMemail#" tabindex="18"/>  
  829.                                 </li>
  830.                                 <li>  
  831.                                     <label for="NOMphone"><span class="required">&##8727;</span>University Phone:</label>  
  832.                                         <input id="phone" name="NOMphone" class="text" type="text" maxlength="20" value="#form.NOMphone#" tabindex="19"/>  
  833.                                 </li>
  834.                                
  835.                             </ol>  
  836.                 </fieldset>
  837.                    
  838.                 <fieldset>
  839.                     <legend>Supporting Documents</legend>
  840.                         <div class="notes">
  841.                             <h4>Document Information</h4>
  842.                                 <p class="last">Please upload documents that are in the format of PDF, DOC, DOCX, RTF, or TXT.</p>
  843.                         </div>
  844.                         <ol>
  845.                             <li>
  846.                                 <label for="nomination letter"><span class="required">&##8727;</span>Nomination Letter:</label>
  847.                                     <input type="file" name="nominationLetter"tabindex="20">
  848.                             </li>
  849.                             <br />                     
  850.                             <li>
  851.                                 <label for="curriculumVita"><span class="required">&##8727;</span>Candidate's Curriculum Vita:</label>
  852.                                     <input type="file" name="curriculumVita" tabindex="21">
  853.                             </li>
  854.                             <br />
  855.                             <li>
  856.                                 <label for="recommendation"><span class="required">&##8727;</span>Recommendation Letter 1:</label>
  857.                                     <input type="file" name="recommendation" tabindex="22">
  858.                             </li>
  859.                             <br />
  860.                             <li>
  861.                                 <label for="recommendation">Recommendation Letter 2:</label>
  862.                                     <input type="file" name="recommendation2" tabindex="23">
  863.                             </li>
  864.                             <br />
  865.                             <li>
  866.                                 <label for="recommendation">Recommendation Letter 3:</label>
  867.                                     <input type="file" name="recommendation3" tabindex="24">
  868.                             </li>
  869.                             <br />
  870.                             <li>
  871.                                 <label for="recommendation">Recommendation Letter 4:</label>
  872.                                     <input type="file" name="recommendation4" tabindex="25">
  873.                             </li>
  874.                             <br />
  875.                             <li>
  876.                                 <label for="recommendation">Recommendation Letter 5:</label>
  877.                                     <input type="file" name="recommendation5" tabindex="26">
  878.                             </li>
  879.                             <br />
  880.                             <li>
  881.                                 <label for="recommendation">Recommendation Letter 6:</label>
  882.                                     <input type="file" name="recommendation6" tabindex="27">
  883.                             </li>
  884.                             <br />
  885.                             <li>
  886.                                 <label for="security"><span class="required">&##8727;</span>Enter Text Below (case-sensitive):</label>
  887.                                 <input id="captcha" name="captcha" class="text" type="text" tabindex="30"/>
  888.                             </li>
  889.                         </ol>
  890.                             <cfset captcha = makeRandomString()>
  891.                             <cfset captchaHash = hash(captcha)>
  892.                                 <input type="hidden" name="captchaHash" value="#captchaHash#">  
  893.                             <cfimage action="captcha" width="300" height="55" text="#captcha#" fonts="verdana,arial" >  
  894.                         </fieldset>            
  895.                     <br />
  896.                     <input type="hidden" value="#Now()#" />
  897.                     <p class="attention">IMPORTANT!  If a required field is left blank, you will have to re-upload all documents and drop-down field information.</p>
  898.                     <input type="submit" value="Submit Application"  tabindex="31"/>
  899.             </form>
  900.         </div>         
  901.     </cfoutput>
  902.     </cfif>
  903.   </cfif>
  904.   </div>
  905.        
  906. </body>
  907. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement