<HTML>
<HEAD><TITLE>New Film</TITLE></HEAD>
<BODY>
<H2>Adding New Film</H2>

<!--- If User is Submitting the Form --->
<CFIF IsDefined("FORM.MovieTitle")>
  <!--- Insert new record into Films table in database --->
  <CFINSERT
    DATASOURCE="#REQUEST.DataSource#"
    TABLENAME="Films">
    
  <!--- Display success message --->
  <CFOUTPUT>
    <B>#FORM.MovieTitle#</B> was added.<BR>
  </CFOUTPUT>
</CFIF>

<!--- Self-submitting data-entry form --->
<CFFORM ACTION="#CGI.SCRIPT_NAME#" METHOD="POST">
  <TABLE>
    <!--- Text entry field for: MovieTitle --->
    <TR>
      <TH>Film Title:</TH>
      <TD>
        <CFINPUT 
          NAME="MovieTitle" 
          SIZE="30"
          MAXLENGTH="50"
          REQUIRED="Yes" 
          MESSAGE="You may not leave the title blank.">
      </TD>    
    </TR>

    <!--- Text entry field for: MovieTitle --->
    <TR>
      <TH>One-Liner:</TH>
      <TD>
        <CFINPUT 
          NAME="PitchText" 
          SIZE="60"
          MAXLENGTH="200"
          REQUIRED="Yes"
          MESSAGE="You may not leave the One-Liner blank.">        
      </TD>    
    </TR>

    <!--- Text entry field for: AmountBudgeted --->
    <TR>
      <TH>Film Budget:</TH>
      <TD>
        <CFINPUT 
          NAME="AmountBudgeted" 
          SIZE="10"
          MAXLENGTH="200"
          VALIDATE="float"
          REQUIRED="Yes"
          MESSAGE="You may not leave the Film Budget blank.">  
      </TD>    
    </TR>
    
    <!--- Text entry field for: DateInTheaters --->
    <!--- Augmented with Flash Calendar component from FCK --->
    <TR>
      <TH>Release Date:</TH>
      <TD>
        <CF_uicalendar
          FORMFIELD="DateInTheaters"
          WIDTH="200"
          HEIGHT="200"
          POPUP="Yes"
          SELBDRCOLOR="##FFFF00"
          REQUIRED="Yes"
          MESSAGE="You must provide a release date.">
      </TD>    
    </TR>

  </TABLE>
  
  <!--- Submit Button to create new film record --->
  <P><INPUT TYPE="Submit" VALUE="Insert New Film Record Now">
</CFFORM>

</BODY>
</HTML>