[Mydatabasepilot-cvs] MyDatabasePilot/dbProcessBody AddField.cfm,1.1,1.2
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-05-27 04:15:48
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessBody In directory sc8-pr-cvs1:/tmp/cvs-serv17372/dbProcessBody Modified Files: AddField.cfm Log Message: Functionality Added: [ 744013 ] Developed large portion of AddField FORM in dbProcessBody/AddField.cfm Some work still remains Index: AddField.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessBody/AddField.cfm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AddField.cfm 25 May 2003 16:19:00 -0000 1.1 --- AddField.cfm 27 May 2003 04:15:39 -0000 1.2 *************** *** 4,9 **** * Purpose: Displays the Body Content for the AddField Database Process * * Requiremets: -fieldList Query must be run on same page prior to including this template * ! * -FORM.table (table name) must have been passed from calling template * ********************************************************************************************---> ! Add Field \ No newline at end of file --- 4,128 ---- * Purpose: Displays the Body Content for the AddField Database Process * * Requiremets: -fieldList Query must be run on same page prior to including this template * ! * -URL.table (table name) must have been passed from calling template * ********************************************************************************************---> ! <!---||| Set Default Values |||---> ! <cfparam name="FORM.numberOfFields" default="1" /> ! <cfparam name="FORM.locationOfFields" default="End" /> ! <cfdump var="number of fields: #FORM.numberOfFields# location of fields: #FORM.locationOfFields#"> ! ! <!---||| Initiate a Read Only lock to ensure the integrity of session variables |||---> ! <cflock timeout = "30" throwontimeout="no" type = "readonly" scope = "session"> ! <!---||| Create AddField FORM |||---> ! <cfform action="#currentPath#?#SESSION.URLToken#&dbProcess=AddField&table=#URL.table#" method="post" name="FORM_AddField" enablecab="yes" class="Fancy"> ! <!---||| General Settings (number of new fields, location of new fields) |||---> ! <fieldset class="Fancy"> ! <legend class="Fancy">Add New Field(s) to Table <cfoutput>#URL.table#</cfoutput></legend> ! ! <!---||| Allow User to Specify the Number of New Fields |||---> ! <!---||| Set the default value to the last requested value |||---> ! <label for="numberOfFields" class="Fancy">Number of New Fields:</label> ! <cfinput name="numberOfFields" type="text" value="#FORM.numberOfFields#" size="2" maxlength="2" range="1,99" required="yes" message="You must enter an interger between 1 and 99 for the number of records field." validate="integer" class="Fancy" /> ! <br /> ! ! <!---||| Allow User to Specify the Location for the New Fields |||---> ! <!---||| Set the selected option to the last requested value |||---> ! <label for="locationOfFields" class="Fancy">Location of New Fields:</label> ! <cfselect name="locationOfFields" size="1" required="yes" class="Fancy"> ! <!---||| Create options for adding the new field(s) at the beginning and at the end of the current table |||---> ! <cfif FORM.locationOfFields IS "End"> ! <option value="End" selected class="Fancy">At End of Table <cfoutput>#URL.table#</cfoutput></option> ! <cfelse> ! <option value="End" class="Fancy">At End of Table <cfoutput>#URL.table#</cfoutput></option> ! </cfif> ! <cfif FORM.locationOfFields IS "Beginning"> ! <option value="Beginning" selected class="Fancy">At Beginning of Table <cfoutput>#URL.table#</cfoutput></option> ! <cfelse> ! <option value="Beginning" class="Fancy">At Beginning of Table <cfoutput>#URL.table#</cfoutput></option> ! </cfif> ! ! <!---||| Create options for adding the new field(s) after each of the current fields |||---> ! <cfoutput query="fieldList"> ! <cfif FORM.locationOfFields IS fieldList.FIELD> ! <option value="#fieldList.FIELD#" selected class="Fancy">After #fieldList.FIELD#</option> ! <cfelse> ! <option value="#fieldList.FIELD#" class="Fancy">After #fieldList.FIELD#</option> ! </cfif> ! </cfoutput> ! </cfselect> ! </fieldset> ! ! <!---||| Field Definitions |||---> ! <fieldset class="Fancy"> ! <legend class="Fancy">Field Definitions</legend> ! <table width="100%" border="1" cellpadding="2" cellspacing="0"> ! <!---||| Create Header |||---> ! <tr> ! <td><label class="Fancy">Field No:</label></td> ! <td><label class="Fancy">Field Name:</label></td> ! <td><label class="Fancy">Field Type:</label></td> ! ! </tr> ! ! <!---||| Set up a new table row for each field user needs to define |||---> ! <cfloop from="1" to="#FORM.numberOfFields#" index="i"> ! <cfoutput> ! <!--- Alternate the Row Colours from class style Odd to class style Even ---> ! <tr class="#IIF(i MOD 2, DE('Odd'), DE('Even'))#"> ! <!--- Print Row Number ---> ! <td><label class="Fancy">#i#</label></td> ! <!--- Allow User to Specify the Fields Name ---> ! <!---***Add validate="regular_expression" to above, to ensure user entered a valid field name***---> ! <td><cfinput name="fieldName#i#" type="text" value="" size="40" required="yes" message="You must enter a valid field name for New Field number #i#." class="Fancy" /></td> ! <!--- Allow User to Select Field Type ---> ! <td> ! <cfselect name="fieldType#i#" size="1" required="yes" class="Fancy"> ! <option value="Empty" selected class="Fancy"></option> ! <optgroup label="String" class="Fancy"> ! <option value="VARCHAR" class="Fancy">VARCHAR(m)</option> ! <option value="CHAR" class="Fancy">CHAR(m)</option> ! <option value="TINYBLOB" class="Fancy">TINYBLOB</option> ! <option value="BLOB" class="Fancy">BLOB</option> ! <option value="MEDIUMBLOB" class="Fancy">MEDIUMBLOB</option> ! <option value="LONGBLOB" class="Fancy">LONGBLOB</option> ! <option value="TINYTEXT" class="Fancy">TINYTEXT</option> ! <option value="TEXT" class="Fancy">TEXT</option> ! <option value="MEDIUMTEXT" class="Fancy">MEDIUMTEXT</option> ! <option value="LONGTEXT" class="Fancy">LONGTEXT</option> ! <option value="ENUM" class="Fancy">ENUM(v1,v2,...)</option> ! <option value="SET" class="Fancy">SET(v1,v2,...)</option> ! </optgroup> ! <optgroup label="Numeric" class="Fancy"> ! <option value="TINYINT" class="Fancy">TINYINT(m)</option> ! <option value="SMALLINT" class="Fancy">SMALLINT(m)</option> ! <option value="MEDIUMINT" class="Fancy">MEDIUMINT(m)</option> ! <option value="INT" class="Fancy">INT(m)</option> ! <option value="BIGINT" class="Fancy">BIGINT(m)</option> ! <option value="FLOAT" class="Fancy">FLOAT(m,d)</option> ! <option value="DOUBLE" class="Fancy">DOUBLE(m,d)</option> ! <option value="DECIMAL" class="Fancy">DECIMAL(m,d)</option> ! </optgroup> ! <optgroup label="Date Time" class="Fancy"> ! <option value="DATE" class="Fancy">DATE</option> ! <option value="TIME" class="Fancy">TIME</option> ! <option value="DATETIME" class="Fancy">DATETIME</option> ! <option value="YEAR" class="Fancy">YEAR</option> ! <option value="TIMESTAMP" class="Fancy">TIMESTAMP(m)</option> ! </optgroup> ! </cfselect> ! </td> ! ! </tr> ! </cfoutput> ! </cfloop> ! </table> ! </fieldset> ! ! <!---||| Submit Request |||---> ! <fieldset class="Fancy"> ! <legend class="Fancy">Run Alter Table Query</legend> ! <!---***Insert a query box of the SQL that is about to be executed***---> ! <input name="AddFields" type="submit" value="Add Fields as Defined Above"> ! </fieldset> ! </cfform> ! </cflock> \ No newline at end of file |