1. <!--- Kill extra output. --->
  2.  
  3. <cfsilent>
  4.  
  5. <!--- Param FORM variables. --->
  6.  
  7. <cfparam
  8. name="FORM.eventType"
  9. type="string"
  10. default=""
  11. />
  12.  
  13. <cfparam
  14. name="FORM.location"
  15. type="string"
  16. default=""
  17. />
  18.  
  19. <cfparam
  20. name="FORM.date"
  21. type="string"
  22. default=""
  23. />
  24.  
  25. <cfparam
  26. name="FORM.deadline"
  27. type="string"
  28. default=""
  29. />
  30.  
  31. <cfparam
  32. name="FORM.description"
  33. type="string"
  34. default=""
  35. />
  36.  
  37. <cfparam
  38. name="FORM.website"
  39. type="string"
  40. default=""
  41. />
  42.  
  43. <cfparam
  44.  
  45. name="FORM.name"
  46. type="string"
  47. default=""
  48. />
  49.  
  50. <cfparam
  51. name="FORM.email"
  52. type="string"
  53. default=""
  54. />
  55.  
  56.  
  57. <cfparam
  58. name="FORM.altName"
  59. type="string"
  60. default=""
  61. />
  62.  
  63.  
  64. <cfparam
  65. name="FORM.altEmail"
  66. type="string"
  67. default=""
  68. />
  69.  
  70. <cfparam
  71. name="FORM.flyer"
  72. type="string"
  73. default=""
  74. />
  75. <!---
  76.  
  77. For the form submission flag, since we are asking
  78.  
  79. it to be of type numeric, we have to catch the
  80.  
  81. CFParam in case someone has hacked the HTML and
  82.  
  83. altered the value being sent (a non-numeric value
  84.  
  85. will throw a ColdFusion error).
  86.  
  87. --->
  88.  
  89. <cftry>
  90.  
  91. <cfparam
  92. name="FORM.submitted"
  93. type="numeric"
  94. default="0"
  95. />
  96.  
  97. <!--- Catch CFParam data type errors. --->
  98.  
  99. <cfcatch>
  100. <cfset FORM.submitted = 0 />
  101. </cfcatch>
  102.  
  103. </cftry>
  104.  
  105.  
  106.  
  107.  
  108.  
  109. <!--- Define an array to catch the form errors. --->
  110.  
  111. <cfset arrErrors = ArrayNew( 1 ) />
  112.  
  113.  
  114.  
  115.  
  116.  
  117. <!--- Check to see if the form has been submitted. --->
  118.  
  119. <cfif FORM.submitted>
  120.  
  121.  
  122.  
  123. <!---
  124.  
  125. Now that the form has been submitted, we need
  126.  
  127. to validate the data.
  128.  
  129. --->
  130.  
  131. <cfif NOT Len( FORM.eventType )>
  132.  
  133.  
  134.  
  135. <cfset ArrayAppend(
  136.  
  137. arrErrors,
  138.  
  139. "Please select the event type."
  140.  
  141. ) />
  142.  
  143.  
  144.  
  145. </cfif>
  146.  
  147. <!--- Validate location. --->
  148.  
  149. <cfif NOT Len( FORM.location )>
  150.  
  151.  
  152.  
  153. <cfset ArrayAppend(
  154.  
  155. arrErrors,
  156.  
  157. "Please enter event location."
  158.  
  159. ) />
  160.  
  161.  
  162.  
  163. </cfif>
  164.  
  165. <!--- Validate date. --->
  166.  
  167. <cfif NOT Len( FORM.date )>
  168.  
  169.  
  170.  
  171. <cfset ArrayAppend(
  172.  
  173. arrErrors,
  174.  
  175. "Please enter event date."
  176.  
  177. ) />
  178.  
  179.  
  180.  
  181. </cfif>
  182.  
  183. <!--- Validate deadline. --->
  184.  
  185. <cfif NOT Len( FORM.deadline )>
  186.  
  187.  
  188.  
  189. <cfset ArrayAppend(
  190.  
  191. arrErrors,
  192.  
  193. "Please enter event deadline."
  194.  
  195. ) />
  196.  
  197.  
  198.  
  199. </cfif>
  200.  
  201. <!--- Validate description. --->
  202.  
  203. <cfif NOT Len( FORM.description )>
  204.  
  205.  
  206.  
  207. <cfset ArrayAppend(
  208.  
  209. arrErrors,
  210.  
  211. "Please enter event description"
  212.  
  213. ) />
  214.  
  215.  
  216.  
  217. </cfif>
  218.  
  219. <!--- Validate name. --->
  220.  
  221. <cfif NOT Len( FORM.name )>
  222.  
  223.  
  224.  
  225. <cfset ArrayAppend(
  226.  
  227. arrErrors,
  228.  
  229. "Please enter contact name."
  230.  
  231. ) />
  232.  
  233.  
  234.  
  235. </cfif>
  236.  
  237.  
  238. </cfif>
  239. <!--- Validate email. --->
  240.  
  241. <cfif NOT IsValid( "email", FORM.email )>
  242.  
  243.  
  244.  
  245. <cfset ArrayAppend(
  246.  
  247. arrErrors,
  248.  
  249. "Please enter a valid email address"
  250.  
  251. ) />
  252.  
  253.  
  254.  
  255. </cfif>
  256.  
  257. <!--- Validate alt contact name. --->
  258.  
  259. <cfif NOT Len( FORM.altName )>
  260.  
  261.  
  262.  
  263. <cfset ArrayAppend(
  264.  
  265. arrErrors,
  266.  
  267. "Please enter an alternate contact name"
  268.  
  269. ) />
  270.  
  271.  
  272.  
  273. </cfif>
  274.  
  275. <!--- Validate altemail. --->
  276.  
  277. <cfif NOT IsValid( "email", FORM.altEmail )>
  278.  
  279.  
  280.  
  281. <cfset ArrayAppend(
  282.  
  283. arrErrors,
  284.  
  285. "Please enter a valid alternate contact email address"
  286.  
  287. ) />
  288.  
  289.  
  290.  
  291. </cfif>
  292.  
  293.  
  294.  
  295. <!---
  296.  
  297. When it comes to validating the resume, we want to
  298.  
  299. check to see if they selected one. Then, once they
  300.  
  301. selected one, we ONLY want to mess with it if there
  302.  
  303. are no errors caused by other form fields.
  304.  
  305. --->
  306.  
  307. <cfif NOT Len( FORM.flyer )>
  308.  
  309.  
  310.  
  311. <cfset ArrayAppend(
  312.  
  313. arrErrors,
  314.  
  315. "Please select a file to upload"
  316.  
  317. ) />
  318.  
  319.  
  320.  
  321. <cfelseif ArrayLen( arrErrors )>
  322.  
  323.  
  324.  
  325. <!---
  326.  
  327. The file has been selected, but there are errors
  328.  
  329. caused by other parts of the form validation.
  330.  
  331. Therefore, we now have a file that is just
  332.  
  333. sitting in our temp folder. Delete this file to
  334.  
  335. keep a clean server.
  336.  
  337. --->
  338.  
  339. <cftry>
  340.  
  341. <cffile
  342.  
  343. action="DELETE"
  344.  
  345. file="#FORM.flyer#"
  346.  
  347. />
  348.  
  349.  
  350.  
  351. <cfcatch>
  352.  
  353. <!--- File delete error. --->
  354.  
  355. </cfcatch>
  356.  
  357. </cftry>
  358.  
  359.  
  360.  
  361. <cfelse>
  362.  
  363.  
  364.  
  365. <!---
  366.  
  367. The resume has been selected and there are no
  368.  
  369. other errors caused by Form validation.
  370.  
  371. Therefore, we can now deal with the file upload.
  372.  
  373. There is a chance that the file upload will
  374.  
  375. cause an error, so be sure to wrap all file
  376.  
  377. actions in CFTry / CFCatch blocks.
  378.  
  379. --->
  380.  
  381. <cftry>
  382.  
  383. <cffile
  384.  
  385. action="UPLOAD"
  386.  
  387. filefield="flyer"
  388.  
  389. destination="#GetTempDirectory()#"
  390.  
  391. nameconflict="MAKEUNIQUE"
  392.  
  393. />
  394.  
  395.  
  396.  
  397. <!---
  398.  
  399. Now that we have the file uploaded, let's
  400.  
  401. check the file extension. I find this to be
  402.  
  403. better than checking the MIME type as that
  404.  
  405. can be inaccurate (so can this, but at least
  406.  
  407. it doesn't throw a ColdFusion error).
  408.  
  409. --->
  410.  
  411. <cfif NOT ListFindNoCase(
  412.  
  413. "pdf,doc,jpg,gif,rtf",
  414.  
  415. CFFILE.ServerFileExt
  416.  
  417. )>
  418.  
  419.  
  420.  
  421. <cfset ArrayAppend(
  422.  
  423. arrErrors,
  424.  
  425. "Only PDF, DOC, JPG, GIF and RTF file formats are accepted"
  426.  
  427. ) />
  428.  
  429.  
  430.  
  431. <!---
  432.  
  433. Since this was not an acceptable file,
  434.  
  435. let's delete the one that was uploaded.
  436.  
  437. --->
  438.  
  439. <cftry>
  440.  
  441. <cffile
  442.  
  443. action="DELETE"
  444.  
  445. file="#CFFILE.ServerDirectory#\#CFFILE.ServerFile#"
  446.  
  447. />
  448.  
  449.  
  450.  
  451. <cfcatch>
  452.  
  453. <!--- File Delete Error. --->
  454.  
  455. </cfcatch>
  456.  
  457. </cftry>
  458.  
  459.  
  460.  
  461. </cfif>
  462.  
  463.  
  464.  
  465. <!--- Catch any file errors. --->
  466.  
  467. <cfcatch>
  468.  
  469.  
  470.  
  471. <!---
  472.  
  473. There was some sort of error with the
  474.  
  475. file upload. Set the error and then try
  476.  
  477. to delete the file.
  478.  
  479. --->
  480.  
  481. <cfset ArrayAppend(
  482.  
  483. arrErrors,
  484.  
  485. "There was a problem uploading your file"
  486.  
  487. ) />
  488.  
  489.  
  490.  
  491. <!---
  492.  
  493. Try to delete the file. Again, we want
  494.  
  495. to use CFTry / CFCatch whenever dealing
  496.  
  497. with files, especially if we don't know
  498.  
  499. if the file is even at the given path.
  500.  
  501. --->
  502.  
  503. <cftry>
  504.  
  505. <cffile
  506.  
  507. action="DELETE"
  508.  
  509. file="#CFFILE.ServerDirectory#\#CFFILE.ServerFile#"
  510.  
  511. />
  512.  
  513.  
  514.  
  515. <cfcatch>
  516.  
  517. <!--- File delete errors. --->
  518.  
  519. </cfcatch>
  520.  
  521. </cftry>
  522.  
  523.  
  524.  
  525. </cfcatch>
  526.  
  527. </cftry>
  528.  
  529.  
  530.  
  531. </cfif>
  532.  
  533.  
  534.  
  535.  
  536.  
  537. <!---
  538.  
  539. Now that we have validated our form data, let's
  540.  
  541. check to see if there are any form validation
  542.  
  543. errors. Only if there are no errors do w want to
  544.  
  545. continue processing the data - otherwise, we want
  546.  
  547. to skip this next part and let the form re-render.
  548.  
  549. --->
  550.  
  551. <cfif NOT ArrayLen( arrErrors )>
  552.  
  553.  
  554.  
  555. <!--- Create a short hand for the file. --->
  556.  
  557. <cfset strFilePath = (
  558.  
  559. CFFILE.ServerDirectory & "\" &
  560.  
  561. CFFILE.ServerFile
  562.  
  563. ) />
  564.  
  565.  
  566.  
  567.  
  568.  
  569. <cfmail
  570.  
  571. to="jegsmith@iupui.edu"
  572.  
  573. from="#FORM.email#"
  574.  
  575. subject="Bizbeat Event Submission"
  576.  
  577. type="html">
  578.  
  579.  
  580.  
  581. <p>
  582.  
  583. The following file has been
  584.  
  585. submitted through the web site on
  586.  
  587. #DateFormat( Now(), "mmm d, yyyy" )# at
  588.  
  589. #TimeFormat( Now(), "h:mm TT" )#.
  590.  
  591. </p>
  592.  
  593.  
  594.  
  595. <p>Event Type: #FORM.eventType#</p>
  596. <p>Location: #FORM.Location#</p>
  597. <p>Event Date: #FORM.Date#</p>
  598. <p>Deadline: #FORM.Deadline#</p>
  599. <p>Description: #FORM.description#</p>
  600. <p>website: #FORM.website#</p>
  601. <p>Contact Name: #FORM.Name#</p>
  602. <p>Contact Email: #FORM.Email#</p>
  603. <p>Alternate Contact Name: #FORM.altName#</p>
  604. <p>Alternate Contact Email: #FORM.altEmail#</p>
  605. <p>Flyer or Graphic: <em>See attached file</em></p>
  606.  
  607.  
  608.  
  609.  
  610. <!--- Attach the file. --->
  611.  
  612. <cfmailparam
  613.  
  614. file="#strFilePath#"
  615.  
  616. />
  617.  
  618.  
  619.  
  620. </cfmail>
  621.  
  622.  
  623.  
  624.  
  625.  
  626. <!---
  627.  
  628. Delete the resume file since we no longer need
  629.  
  630. it on the server. HOWEVER, this will only work
  631.  
  632. if the emails are NOT getting spooled. If the
  633.  
  634. email is getting spooled, then we will end up
  635.  
  636. deleting the file before it had a chance to get
  637.  
  638. attached to the outgoing email and the mail
  639.  
  640. will end up failing after it leaves ColdFusion.
  641.  
  642.  
  643.  
  644. *** Put back in ONLY if SpoolEnable="no" in
  645.  
  646. your CFMail tag.
  647.  
  648. --->
  649.  
  650. <!---
  651.  
  652. <cftry>
  653.  
  654. <cffile
  655.  
  656. action="DELETE"
  657.  
  658. file="#strFilePath#"
  659.  
  660. />
  661.  
  662.  
  663.  
  664. <cfcatch></cfcatch>
  665.  
  666. </cftry>
  667.  
  668. --->
  669.  
  670.  
  671.  
  672.  
  673.  
  674. <!---
  675.  
  676. At this point, you would probably forward
  677.  
  678. the user to another page using something
  679.  
  680. like CFLocation.
  681.  
  682. --->
  683.  
  684.  
  685.  
  686. </cfif>
  687.  
  688. </cfif>
  689.  
  690. </cfsilent>
  691.  
  692. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  693. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/iupui_global.dwt.cfm" codeOutsideHTMLIsLocked="false" -->
  694. <head>
  695. <!-- InstanceBeginEditable name="Meta Data" -->
  696. <title>Prospective Students: Admissions: Undergraduate Programs:Kelley School of Business: IUPUI Indianapolis</title>
  697. <meta name="Keywords" content="about, us, Kelley, School, of, Business, IU, Indiana, Purdue, University, Indianapolis, IUPUI" />
  698. <meta name="Description" content="Description goes here." />
  699. <!-- InstanceEndEditable -->
  700. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  701. <meta name="author" content="IU Office of Creative Services, iuweb @ indiana.edu" />
  702. <link rel="icon" href="http://www.indiana.edu/favicon.ico" />
  703. <link rel="shortcut icon" href="http://www.indiana.edu/favicon.ico" />
  704. <style type="text/css" media="screen">
  705. <!--
  706. @import url("../../global/css/global.css");
  707. @import url("../../global/css/tier.css");
  708. @import url("../../global/css/widgets.css");
  709. @import url("../../css/styles.css");
  710. -->
  711. </style>
  712. <link href="../../global/css/print.css" rel="stylesheet" type="text/css" media="print" />
  713. <script src="../../js/breadcrumbs.js" type="text/javascript"></script>
  714. <script src="../../global/js/spamspan.js" type="text/javascript"></script>
  715. <script src="../../global/js/swfobject.js" type="text/javascript"></script>
  716. <script src="/js/includes.js" type="text/javascript"></script>
  717. <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  718. </script>
  719. <script type="text/javascript">
  720. _uacct = "UA-3947246-1";
  721. urchinTracker();
  722. </script>
  723.  
  724. <!-- InstanceBeginEditable name="Page-Specific Items" -->
  725.  
  726. <!-- InstanceEndEditable -->
  727. <!-- InstanceParam name="Navigation Location" type="URL" value="../../ssi/_nav.html" --><!-- InstanceParam name="Notables" type="boolean" value="true" --><!-- InstanceParam name="Widgets" type="boolean" value="true" --><!-- InstanceParam name="Section ID" type="text" value="undergrad" --><!-- InstanceParam name="Header Location" type="URL" value="../../ssi/_header.html" --><!-- InstanceParam name="Breadcrumb Location" type="URL" value="../../ssi/_breadcrumb.html" --><!-- InstanceParam name="Local Styles Location" type="URL" value="../../css/styles.css" -->
  728. </head>
  729. <body id="undergrad">
  730. <!-- BEGIN SKIP NAVIGATION ANCHORS -->
  731. <div id="skipnav">
  732. <p>Skip to: <a href="#search">search</a>, <a href="#links">navigation</a>, or <a href="#body">content</a>.</p>
  733. <hr />
  734. </div>
  735. <!-- END SKIP NAVIGATION ANCHORS -->
  736. <cfinclude template="../../global/ssi/_branding.html">
  737. <cfinclude template="../../ssi/_header.html">
  738. <div id="wrapper">
  739. <div id="shadow">
  740. <div id="shadow_left"></div>
  741. <div id="main">
  742. <div id="column">
  743. <a name="links" id="links"></a>
  744. <div id="nav">
  745. <cfinclude template="../../ssi/_nav.html">
  746. </div>
  747.  
  748. <!-- InstanceBeginEditable name="Notable" -->
  749.  
  750. <!-- InstanceEndEditable -->
  751.  
  752. </div>
  753. <div id="content_wrap">
  754. <a name="body" id="body"></a>
  755. <div id="toolbar">
  756. <cfinclude template="../../ssi/_breadcrumb.html">
  757. </div>
  758. <div id="title">
  759. <h2><!-- InstanceBeginEditable name="Page Title" -->Undergraduate Programs<!-- InstanceEndEditable --></h2>
  760. </div>
  761.  
  762. <!-- BEGIN WIDGET COLUMN -->
  763. <div id="widget_column">
  764. <!-- InstanceBeginRepeat name="Widgets" --><!-- InstanceBeginRepeatEntry -->
  765. <div class="widget">
  766. <!-- InstanceBeginEditable name="Widget Content" -->
  767. <!-- BEGIN SPOTLIGHT -->
  768.  
  769. <!-- END SPOTLIGHT -->
  770. <!-- InstanceEndEditable -->
  771. </div>
  772. <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
  773. </div>
  774. <!-- END WIDGET COLUMN -->
  775.  
  776. <!-- BEGIN CONTENT -->
  777. <div id="content">
  778. <!-- InstanceBeginEditable name="Content" -->
  779. <cfoutput>
  780.  
  781.  
  782.  
  783. <!--- Check to see if we have any form errors. --->
  784.  
  785. <cfif ArrayLen( arrErrors )>
  786.  
  787.  
  788.  
  789. <h3>
  790.  
  791. Please review the following:
  792.  
  793. </h3>
  794.  
  795.  
  796.  
  797. <ul>
  798.  
  799. <cfloop
  800.  
  801. index="intError"
  802.  
  803. from="1"
  804.  
  805. to="#ArrayLen( arrErrors )#"
  806.  
  807. step="1">
  808.  
  809.  
  810.  
  811. <li>
  812.  
  813. #arrErrors[ intError ]#
  814.  
  815. </li>
  816.  
  817.  
  818.  
  819. </cfloop>
  820.  
  821. </ul>
  822.  
  823.  
  824.  
  825. </cfif>
  826.  
  827.  
  828.  
  829.  
  830.  
  831. <form action="#CGI.script_name#" method="post" enctype="multipart/form-data">
  832. <!--- Our form submission flag. --->
  833. <table class="tbl_rankings" border="0" cellpadding="0" cellspacing="3">
  834. <input type="hidden" name="submitted" value="1" />
  835.  
  836. <tr>
  837. <td>Event Type:</td><td><select name="eventType" value="#FORM.eventType#">
  838. <option value="">--select event type--</option>
  839. <option value="Financial">Financial</option>
  840. <option value="Academic">Academic</option>
  841. <option value="Leadership">Leadership</option>
  842. <option value="Involvement">Involvement</option>
  843. <option value="Fun">Fun</option>
  844. </select>
  845. </td>
  846. </tr>
  847. <tr>
  848. <td>Event Location:</td><td><input type="text" name="location" value="#FORM.location#"/></td>
  849. </tr>
  850. <tr>
  851. <td>Event Date:</td><td><input type="text" name="date" value="#FORM.date#"/></td>
  852. </tr>
  853. <tr>
  854. <td>Event Deadline:</td><td><input type="text" name="deadline" value="#FORM.deadline#"/></td>
  855. </tr>
  856.  
  857. <tr>
  858. <td>Event Description:</td><td><textarea name="description" rows="10" value="#FORM.description#"></textarea></td>
  859. </tr>
  860. <tr>
  861. <td>Website:</td><td><input type="text" name="website" value="#FORM.website#"/></td>
  862. </tr>
  863. <tr>
  864. <td>Contact Name:</td><td><input type="text" name="Name" value="#FORM.name#"/></td>
  865. </tr>
  866. <tr>
  867. <td>Contact Email:</td><td><input type="text" name="email" value="#FORM.email#"/></td>
  868. </tr>
  869. <tr>
  870. <td>Alternate Contact Name:</td><td><input type="text" name="altName"value="#FORM.altName#"/></td>
  871. </tr>
  872. <tr>
  873. <td>Alternate Contact Email:</td><td><input type="text" name="altEmail" value="#FORM.altEmail#"/></td>
  874. </tr>
  875.  
  876. <tr>
  877. <td>Flyer or Graphic Upload: <br /><p class="caption">PDF, RTF, JPG, GIF or DOC</p></td><td><input type="file" name="flyer" id="flyer" value="#FORM.flyer#"/></td>
  878. </tr>
  879.  
  880.  
  881. <tr><td><input type="submit" value="Submit Application" /></td></tr>
  882. </table>
  883. </form>
  884.  
  885. </cfoutput>
  886.  
  887.  
  888. <!-- InstanceEndEditable -->
  889. </div>
  890. <!-- END CONTENT -->
  891. </div>
  892. </div>
  893. <div id="shadow_right"></div>
  894. <div class="clear"></div>
  895. </div>
  896. </div>
  897. <cfinclude template="../../global/ssi/_footer.html">
  898. </body>
  899. <!-- InstanceEnd --></html>