1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230:
<cfquery datasource="mmp"> Insert into people (employee, firstname, lastname, tdate, gender, dob, telephone, address, address2, city, state, zipecode, services, disability, income, notes) values ( <cfif IsDefined("Form.staffid") AND #Form.staffid# NEQ ""> #Form.staffid# <cfelse> NULL </cfif> , <cfif IsDefined("Form.firstname") AND #Form.firstname# NEQ ""> '#Form.firstname#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.lastname") AND #Form.lastname# NEQ ""> '#Form.lastname#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.tdate") AND #Form.tdate# NEQ ""> '#Form.tdate#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.gender") AND #Form.gender# NEQ ""> '#Form.gender#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.dob") AND #Form.dob# NEQ ""> #Form.dob# <cfelse> NULL </cfif> , <cfif IsDefined("Form.telephone") AND #Form.telephone# NEQ ""> '#Form.telephone#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.address") AND #Form.address# NEQ ""> '#Form.address#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.address2") AND #Form.address2# NEQ ""> '#Form.address2#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.city") AND #Form.city# NEQ ""> '#Form.city#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.state") AND #Form.state# NEQ ""> '#Form.state#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.zipecode") AND #Form.zipecode# NEQ ""> '#Form.zipecode#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.serviceid") AND #Form.serviceid# NEQ ""> '#Form.serviceid#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.disability") AND #Form.disability# NEQ ""> '#Form.disability#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.incomeid") AND #Form.incomeid# NEQ ""> '#Form.incomeid#' <cfelse> NULL </cfif> , <cfif IsDefined("Form.notes") AND #Form.notes# NEQ ""> '#Form.notes#' <cfelse> NULL </cfif> ) </cfquery> <cfquery name="qdisability" datasource="mmp"> Select disabilityid, disability from disa order by disability ASC </cfquery> <cfquery name="qservices" datasource="mmp"> Select serviceid, services from services order by services ASC </cfquery> <cfquery name="qstaff" datasource="mmp"> Select staffid, lastname+ ', ' +firstname as staffname from staff order by lastname ASC </cfquery> <cfquery name="qincome" datasource="mmp"> Select incomeid, income from income order by income ASC </cfquery> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <h1 align="center">MMP Entry Page </h1> <cfform name="insmmp"> <table width="389" border="0" align="center"> <tr> <td nowrap="nowrap"><div align="left">Staff:</div></td> <td> <cfselect name="staffid" query="qstaff" value="staffid" display="staffname"> </cfselect> </td> </tr> <tr> <td width="81" nowrap="nowrap">First Name:</td> <td width="292"> <cfinput type="text" name="firstname" maxlength="30" required="yes" message="You must enter consumers first name" > </td> </tr> <tr> <td nowrap="nowrap">Last Name:</td> <td><cfinput type="text" name="lastname" maxlength="30" required="yes" message="You must enter consumers last name" ></td> </tr> <tr> <td nowrap="nowrap">Date:</td> <td><CFINPUT TYPE="datefield" NAME="tdate" SIZE="10" REQUIRED="yes" VALIDATE="date" MESSAGE="Please enter date format mm/dd/yyyy."> </td> </tr> <tr> <td nowrap="nowrap">Gender:</td> <td> <input type="radio" name="gender" value="1" checked="checked">Male <input type="radio" name="gender" value="2">Female </td> </tr> <tr> <td nowrap="nowrap">Date of Birth:</td> <td> <CFINPUT TYPE="text" NAME="dob" SIZE="10" REQUIRED="yes" VALIDATE="date" MESSAGE= "Please enter date format mm/dd/yyyy"></td> </tr> <tr> <td nowrap="nowrap">Telephone:</td> <td><CFINPUT TYPE="text" NAME="telephone" SIZE="15" ></td> </tr> <tr> <td nowrap="nowrap">Address</td> <td><cfinput type="text" name="address" maxlength="100" required="yes" message="You must enter consumers address" ></td> </tr> <tr> <td nowrap="nowrap">Address 2</td> <td><cfinput type="text" name="address2" > </td> </tr> <tr> <td nowrap="nowrap">City</td> <td><cfinput type="text" name="city" maxlength="30" required="yes" message="You must enter consumers city" ></td> </tr> <tr> <td nowrap="nowrap">State</td> <td><cfinput type="text" name="state" maxlength="30" required="yes" message="Please enter abreviated state such as CA for California"> </td> </tr> <tr> <td nowrap="nowrap">Zip Code</td> <td><cfinput type="text" name="zipecode" maxlength="10" required="yes" message="You must enter consumers zip code"> </td> </tr> <tr> <td nowrap="nowrap"><div align="left">Services:</div></td> <td> <cfselect name="serviceid" query="qservices" value="serviceid" display="services"> </cfselect> </td> </tr> <tr> <td nowrap="nowrap"><div align="left">Disability:</div></td> <td> <cfselect name="disabilityid" query="qdisability" value="disabilityid" display="disability"> </cfselect></td> </tr> <tr> <td nowrap="nowrap">Income:</td> <td><cfselect name="incomeid" query="qincome" value="incomeid" display="income"> </cfselect> </td> </tr> <tr> <td nowrap="nowrap">Notes:</td> <td><textarea name="notes" id="notes" cols="45" rows="5"></textarea></td> </tr> <tr> <td> </td> <td> <!--- Reset button. ---> <cfinput type="Reset" name="ResetForm" value="Clear Form"> <!--- submit button ---> <cfinput type="Submit" name="SubmitForm" value="Submit"> </td> </tr> </table> <br /> </cfform> </body> </html>