'; exit; } ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); require_once('includes/states_inc.php'); $IP = $_SERVER['REMOTE_ADDR']; $page = stripslashes(isset($_POST['page']) ? $_POST['page'] : '0'); $submit = stripslashes(isset($_POST['submit']) ? $_POST['submit'] : '0'); $page++; $vars = array( 'name', 'address', 'city', 'state', 'zip', 'phone_home', 'phone_other', 'age', 'sex', 'job', 'general_description', 'establishment', 'est_address', 'est_city', 'est_state', 'est_zip', 'meal_eaten', 'appetizer', 'main_course', 'desert', 'drinks', 'date_food_eaten1', 'date_food_eaten2', 'date_food_eaten3', 'time_food_eaten1', 'time_food_eaten2', 'time_food_eaten3', 'travel_location', 'travel_date1', 'travel_date2', 'travel_date3', 'swim_location', 'swim_date1', 'swim_date2', 'swim_date3', 'water', 'water_work', 'nausea', 'diarrhea', 'headache', 'bodyache', 'puke', 'fever', 'prostration', 'cramps', 'temperature', 'other_info', 'diarrhea_episodes', 'diarrhea_start_date1', 'diarrhea_start_date2', 'diarrhea_start_date3', 'diarrhea_start_time1', 'diarrhea_start_time2', 'diarrhea_start_time3', 'diarrhea_end_date1', 'diarrhea_end_date2', 'diarrhea_end_date3', 'diarrhea_end_time1', 'diarrhea_end_time2', 'diarrhea_end_time3', 'puke_episodes', 'puke_start_date1', 'puke_start_date2', 'puke_start_date3', 'puke_start_time1', 'puke_start_time2', 'puke_start_time3', 'puke_end_date1', 'puke_end_date2', 'puke_end_date3', 'puke_end_time1', 'puke_end_time2', 'puke_end_time3', 'doctor', 'doctor_name', 'diagnosis', 'emergency', 'hospital', 'hospital_city', 'hospitalized', 'hospitalized_name', 'hospitalized_city', 'hospitalized_admin1', 'hospitalized_admin2', 'hospitalized_admin3', 'hospitalized_release1', 'hospitalized_release2', 'hospitalized_release3', 'poop_submitted', 'willing_to_poop', 'allergies', 'allergies_list', 'day1_date1', 'day1_date2', 'day1_date3', 'day1_breakfast_time1', 'day1_breakfast_time2', 'day1_breakfast_time3', 'day1_breakfast_location', 'day1_breakfast', 'day1_lunch_time1', 'day1_lunch_time2', 'day1_lunch_time3', 'day1_lunch_location', 'day1_lunch', 'day1_dinner_time1', 'day1_dinner_time2', 'day1_dinner_time3', 'day1_dinner_location', 'day1_dinner', 'day1_snack_time1', 'day1_snack_time2', 'day1_snack_time3', 'day1_snack_location', 'day1_snack', 'day2_date1', 'day2_date2', 'day2_date3', 'day2_breakfast_time1', 'day2_breakfast_time2', 'day2_breakfast_time3', 'day2_breakfast_location', 'day2_breakfast', 'day2_lunch_time1', 'day2_lunch_time2', 'day2_lunch_time3', 'day2_lunch_location', 'day2_lunch', 'day2_dinner_time1', 'day2_dinner_time2', 'day2_dinner_time3', 'day2_dinner_location', 'day2_dinner', 'day2_snack_time1', 'day2_snack_time2', 'day2_snack_time3', 'day2_snack_location', 'day2_snack', 'day3_date1', 'day3_date2', 'day3_date3', 'day3_breakfast_time1', 'day3_breakfast_time2', 'day3_breakfast_time3', 'day3_breakfast_location', 'day3_breakfast', 'day3_lunch_time1', 'day3_lunch_time2', 'day3_lunch_time3', 'day3_lunch_location', 'day3_lunch', 'day3_dinner_time1', 'day3_dinner_time2', 'day3_dinner_time3', 'day3_dinner_location', 'day3_dinner', 'day3_snack_time1', 'day3_snack_time2', 'day3_snack_time3', 'day3_snack_location', 'day3_snack'); $var_values = array(); // make sure they have entered something if ($submit == 'Submit') { $blank = TRUE; foreach ($vars as $value) { if ($_POST[$value] != '' && $_POST[$value] != 'AM') { $blank = FALSE; } if (preg_match('/http:\/\//',$_POST[$value])) exit(); } } $i=0; foreach ($_POST as $key => $value) { $_POST[$key] = _sanitize($value); ++$i; } //for ($i=0;$i<154;++$i) { // echo $vars[$i]."=".$var_values[$i]."
"; // } function _sanitize($data) { // special cleanups, hex $data = preg_replace("/x1a/",'', $data); $data = preg_replace("/x00/",'', $data); // the 2 tests above may not be needed due to this more complete test $data = preg_replace('/([\x00-\x08][\x0b-\x0c][\x0e-\x20])/', '', $data); $data = preg_replace("|\.\./|",'', $data); // stop directory traversal $data = preg_replace("/--/",' - ', $data); // stop mySQL comments $data = preg_replace("/%3A%2F%2F/",'', $data); // stop B64 encoded '://' // Remove Null Characters // This prevents sandwiching null characters // between ascii characters, like Java\0script. $data = preg_replace('/\0+/', '', $data); $data = preg_replace('/(\\\\0)+/', '', $data); // Validate standard character entities // Add a semicolon if missing. We do this to enable // the conversion of entities to ASCII later. $data = preg_replace('#(&\#*\w+)[\x00-\x20]+;#u',"\\1;",$data); // Validate UTF16 two byte encoding (x00) // Just as above, adds a semicolon if missing. $data = preg_replace('#(&\#x*)([0-9A-F]+);*#iu',"\\1\\2;",$data); // URL Decode // Just in case stuff like this is submitted: // Google // Note: Normally urldecode() would be easier but it removes plus signs //$data = preg_replace("/([a-z0-9]{3})/i", "&#x\\1;", $data); //$data = preg_replace("/%([a-z0-9]{2})/i", "&#x\\1;", $data); // Convert character entities to ASCII // This permits our tests below to work reliably. // We only convert entities that are within tags since // these are the ones that will pose security problems. if (preg_match_all("/<(.+?)>/si", $data, $matches)) { for ($i = 0; $i < count($matches['0']); $i++) { $data = str_replace($matches['1'][$i], html_entity_decode($matches['1'][$i], ENT_COMPAT, $charset), $data); } } // Convert all tabs to spaces // This prevents strings like this: ja vascript // Note: we deal with spaces between characters later. $data = preg_replace("#\t+#", " ", $data); // Makes PHP tags safe // Note: XML tags are inadvertently replaced too: // '), array('<?php', '<?PHP', '<?', '?>'), $data); // Compact any exploded words // This corrects words like: j a v a s c r i p t // These words are compacted back to their correct state. $words = array('javascript', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); foreach ($words as $word) { $temp = ''; for ($i = 0; $i < strlen($word); $i++) { $temp .= substr($word, $i, 1)."\s*"; } $temp = substr($temp, 0, -3); $data = preg_replace('#'.$temp.'#s', $word, $data); $data = preg_replace('#'.ucfirst($temp).'#s', ucfirst($word), $data); } // Remove disallowed Javascript in links or img tags $data = preg_replace("#.*?#si", "", $data); $data = preg_replace("##si","", $data); $data = preg_replace("#<(script|xss).*?\>#si", "", $data); // Remove JavaScript Event Handlers // Note: This code is a little blunt. It removes // the event handler and anything up to the closing >, // but it's unlikely to be a problem. $data = preg_replace('#(<[^>]+.*?)(onabort|onactivate|onafterprint|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onblur|onbounce|oncellchange|onchange|onclick|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondblclick|ondeactivate|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|onerror|onerrorupdate|onfilterchange|onfinish|onfocus|onfocusin|onfocusout|onhelp|onkeydown|onkeypress|onkeyup|onlayoutcomplete|onload|onlosecapture|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onmove|onmoveend|onmovestart|onpaste|onpropertychange|onreadystatechange|onreset|onresize|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onselect|onselectionchange|onselectstart|onstart|onstop|onsubmit|onunload)[^>]*>#iU',"\\1>",$data); // Sanitize naughty HTML elements // If a tag containing any of the words in the list // below is found, the tag gets converted to entities. // So this: // Becomes: <blink> $data = preg_replace('#<(/*\s*)(alert|vbscript|javascript|applet|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|layer|link|meta|object|plaintext|style|script|textarea|title|xml|xss|lowsrc)([^>]*)>#is', "<\\1\\2\\3>", $data); // Sanitize naughty scripting elements // Similar to above, only instead of looking for // tags it looks for PHP and JavaScript commands // that are disallowed. Rather than removing the // code, it simply converts the parenthesis to entities // rendering the code un-executable. // For example: eval('some code') // Becomes: eval('some code') $data = preg_replace('#(alert|cmd|passthru|eval|exec|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $data); // Final clean up // This adds a bit of extra precaution in case // something got through the above filters $bad = array( 'document.cookie' => '', 'document.write' => '', 'window.location' => '', "javascript\s*:" => '', "Redirect\s+302" => '', '' => '-->' ); $data_array = array(); foreach ($bad as $key => $val) { $data_array[] = preg_replace("#".$key."#i", $val, $data); } $data = stripslashes($data); //echo "data=$data
"; // test return trim($data); } function add_zero($x) { if ($x<10) $x = '0'.$x; return (x); } if ($submit == 'Submit') { // begin submit sending of email if ($blank === TRUE && $_POST['submit'] == 'Submit') { echo "It would be helpful if you could enter some information.

"; echo "Please Go back and verify your information and resubmit the form.
"; exit(); } else { // test for wack but valid entries$field_error = array(0,0,0,0,0,); $bad_data = FALSE; $fields = array( "name", "age", "sex", "phone_home", "date_food_eaten", ); // notblank is for this array only, does not go in other two leave it last $test_pattern = array( "/^[a-zA-Z0-9\" \"\.-_\']{3,50}$/", "/^[0-9]{1,3}$/", "/[m|f|M|F]{1}/", "/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/", "/^[0-1]{0,1}[0-9]{1}-[0-3]{0,1}[0-9]{1}-20[0-9]{2}/", ); $error_msgs = array( "The information entered for your name is invalid.
", "Your age should be a realistic number
", "You must select \"m\" or \"f\" for the sex field.
", "The phone number entered is invalid, please use 000-000-0000 format.
", "The date is invalid.
", ); for ($i=0;$i<5;$i++) { if ($_POST[$fields[$i]] != '' && !preg_match($test_pattern[$i], $_POST[$fields[$i]])) { echo ''.$error_msgs[$i].'You entered: '.$_POST[$fields[$i]].'

'; $bad_data = TRUE; } } if ($bad_data == TRUE) { echo '

"Please Go back and verify your information and resubmit the form.
'; exit(); } } // end wack but valid data // concat $date_food_eaten = $_POST['date_food_eaten1'].'-'.$_POST['date_food_eaten2'].'-'.$_POST['date_food_eaten3']; $time_food_eaten = $_POST['time_food_eaten1'].':'.$_POST['time_food_eaten2'].' '.$_POST['time_food_eaten3']; $travel_date = $_POST['travel_date1'].'-'.$_POST['travel_date2'].'-'.$_POST['travel_date3']; $swim_date = $_POST['swim_date1'].'-'.$_POST['swim_date2'].'-'.$_POST['swim_date3']; $diarrhea_start_date = $_POST['diarrhea_start_date1'].'-'.$_POST['diarrhea_start_date2'].'-'.$_POST['diarrhea_start_date3']; $diarrhea_start_time = $_POST['diarrhea_start_time1'].':'.$_POST['diarrhea_start_time2'].' '.$_POST['diarrhea_start_time3']; $diarrhea_end_date = $_POST['diarrhea_end_date1'].'-'.$_POST['diarrhea_end_date2'].'-'.$_POST['diarrhea_end_date3']; $diarrhea_end_time = $_POST['diarrhea_end_time1'].':'.$_POST['diarrhea_end_time2'].' '.$_POST['diarrhea_end_time3']; $puke_start_date = $_POST['puke_start_date1'].'-'.$_POST['puke_start_date2'].'-'.$_POST['puke_start_date3']; $puke_start_time = $_POST['puke_start_time1'].':'.$_POST['puke_start_time2'].' '.$_POST['puke_start_time3']; $puke_end_date = $_POST['puke_end_date1'].'-'.$_POST['puke_end_date2'].'-'.$_POST['puke_end_date3']; $puke_end_time = $_POST['puke_end_time1'].':'.$_POST['puke_end_time2'].' '.$_POST['puke_end_time3']; $hospitalized_admin = $_POST['hospitalized_admin1'].'-'.$_POST['hospitalized_admin2'].'-'.$_POST['hospitalized_admin3']; $hospitalized_release = $_POST['hospitalized_release1'].'-'.$_POST['hospitalized_release2'].'-'.$_POST['hospitalized_release3']; $day1_date = $_POST['day1_date1'].'-'.$_POST['day1_date2'].'-'.$_POST['day1_date3']; $day1_breakfast_time = $_POST['day1_breakfast_time1'].':'.$_POST['day1_breakfast_time2'].' '.$_POST['day1_breakfast_time3']; $day1_lunch_time = $_POST['day1_lunch_time1'].':'.$_POST['day1_lunch_time2'].' '.$_POST['day1_lunch_time3']; $day1_dinner_time = $_POST['day1_dinner_time1'].':'.$_POST['day1_dinner_time2'].' '.$_POST['day1_dinner_time3']; $day1_snack_time = $_POST['day1_snack_time1'].':'.$_POST['day1_snack_time2'].' '.$_POST['day1_snack_time3']; $day2_date = $_POST['day2_date1'].'-'.$_POST['day2_date2'].'-'.$_POST['day2_date3']; $day2_date = mktime(0,0,0,$_POST['day1_date1'],$_POST['day1_date2']-1,$_POST['day1_date3']); $day2_date = date('n-j-Y',$day2_date); $day2_breakfast_time = $_POST['day2_breakfast_time1'].':'.$_POST['day2_breakfast_time2'].' '.$_POST['day2_breakfast_time3']; $day2_lunch_time = $_POST['day2_lunch_time1'].':'.$_POST['day2_lunch_time2'].' '.$_POST['day2_lunch_time3']; $day2_dinner_time = $_POST['day2_dinner_time1'].':'.$_POST['day2_dinner_time2'].' '.$_POST['day2_dinner_time3']; $day2_snack_time = $_POST['day2_snack_time1'].':'.$_POST['day2_snack_time2'].' '.$_POST['day2_snack_time3']; $day3_date = mktime(0,0,0,$_POST['day1_date1'],$_POST['day1_date2']-2,$_POST['day1_date3']); $day3_date = date('n-j-Y',$day3_date); $day3_breakfast_time = $_POST['day3_breakfast_time1'].':'.$_POST['day3_breakfast_time2'].' '.$_POST['day3_breakfast_time3']; $day3_lunch_time = $_POST['day3_lunch_time1'].':'.$_POST['day3_lunch_time2'].' '.$_POST['day3_lunch_time3']; $day3_dinner_time = $_POST['day3_dinner_time1'].':'.$_POST['day3_dinner_time2'].' '.$_POST['day3_dinner_time3']; $day3_snack_time = $_POST['day3_snack_time1'].':'.$_POST['day3_snack_time2'].' '.$_POST['day3_snack_time3']; // echo $header."
"; //test // echo $values."
"; //test $output = ' '; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= '
Name: '.$_POST['name'].' Age: '.$_POST['age'].' Sex: '.$_POST['sex'].'
Address: '.$_POST['address'].', '.$_POST['city'].', '.$_POST['state'].' '.$_POST['zip'].'
Home phone: '.$_POST['phone_home'].' Other phone: '.$_POST['phone_other'].'
Occupation: '.$_POST['job'].'
General description: '.$_POST['general_description'].'

'; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= '
Location of establishment: '.$_POST['establishment'].'
Address: '.$_POST['est_address'].' '.$_POST['est_city'].', '.$_POST['est_state'].' '.$_POST['est_zip'].'
Meal eaten: '.$_POST['meal_eaten'].'
Appetizer - '.$_POST['appetizer'].'
Main course - '.$_POST['main_course'].'
Desert - '.$_POST['desert'].'
Drinks - '.$_POST['drinks'].'
Date: '.$date_food_eaten.' Time: '.$time_food_eaten.'
Members of household sick the week before: '.$_POST['family_sick'].'
Travel the week before: '.$_POST['travel'].'
Travel location: '.$_POST['travel_location'].' Travel date: '.$travel_date.'
Swimming the week before: '.$_POST['swim'].'
Swim location: '.$_POST['swim_location'].' Swim date: '.$swim_date.'
Home water source: '.$_POST['water'].' Work water source: '.$_POST['water_work'].'
Allergies: '.$_POST['allergies'].'Allergic to: '.$_POST['allergies_list'].'

'; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; //echo ''; $output .= "
Day of illness: '.$day1_date.'
Breakfast prepared at: '.$_POST['day1_breakfast_location'].' Time: '.$day1_breakfast_time.'
Breakfast food/beverages: '.$_POST['day1_breakfast'].'
Lunch prepared at: '.$_POST['day1_lunch_location'].' Time: '.$day1_lunch_time.'
Lunch food/beverages: '.$_POST['day1_lunch'].'
Dinner prepared at: '.$_POST['day1_dinner_location'].' Time: '.$day1_dinner_time.'
Dinner food/beverages: '.$_POST['day1_dinner'].'
Snack prepared at: '.$_POST['day1_snack_location'].' Time: '.$day1_snack_time.'
Snack food/beverages: '.$_POST['day1_snack'].'
 
1 day before illness: '.$day2_date.'
Breakfast prepared at: '.$_POST['day2_breakfast_location'].' Time: '.$day2_breakfast_time.'
Breakfast food/beverages: '.$_POST['day2_breakfast'].'
Lunch prepared at: '.$_POST['day2_lunch_location'].' Time: '.$day2_lunch_time.'
Lunch food/beverages: '.$_POST['day2_lunch'].'
Dinner prepared at: '.$_POST['day2_dinner_location'].' Time: '.$day2_dinner_time.'
Dinner food/beverages: '.$_POST['day2_dinner'].'
Snack prepared at: '.$_POST['day2_snack_location'].' Time: '.$day2_snack_time.'
Snack food/beverages: '.$_POST['day2_snack'].'
 
2 days before illness: '.$day3_date.'
Breakfast prepared at: '.$_POST['day3_breakfast_location'].' Time: '.$day3_breakfast_time.'
Breakfast food/beverages: '.$_POST['day3_breakfast'].'
Lunch prepared at: '.$_POST['day3_lunch_location'].' Time: '.$day3_lunch_time.'
Lunch food/beverages: '.$_POST['day3_lunch'].'
Dinner prepared at: '.$_POST['day3_dinner_location'].' Time: '.$day3_dinner_time.'
Dinner food/beverages: '.$_POST['day3_dinner'].'
Snack prepared at: '.$_POST['day3_snack_location'].' Time: '.$day3_snack_time.'
Snack food/beverages: '.$_POST['day3_snack'].'

"; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= '
Nausea: '.$_POST['nausea'].'Vomiting: '.$_POST['puke'].'
Diarrhea: '.$_POST['diarrhea'].'Fever: '.$_POST['fever'].'
Headache: '.$_POST['headache'].'Prostration: '.$_POST['prostration'].'
Body aches: '.$_POST['bodyache'].'Abdominal cramps: '.$_POST['cramps'].'
Temperature: '.$_POST['temperature'].'
Other informatiom: '.$_POST['other_info'].'
Episodes of diarrhea: '.$_POST['diarrhea_episodes'].'   Eppisodes of vomiting: '.$_POST['puke_episodes'].'
First symptoms of diarrhea: '.$diarrhea_start_date.' Time: '.$diarrhea_start_time.'Last: '.$diarrhea_end_date.' Time: '.$diarrhea_end_time.'
First symptoms of vomiting: '.$puke_start_date.' Time: '.$puke_start_time.'Last: '.$puke_end_date.' Time: '.$puke_end_time.'
Physician: '.$_POST['doctor'].' Doctor\'s name: '.$_POST['doctor_name'].'
ER visit: '.$_POST['emergency'].' Hospital: '.$_POST['hospital'].' City: '.$_POST['hospital_city'].'
Hospitalized: '.$_POST['hospitalized'].' Hospital: '.$_POST['hospitalized_name'].' City: '.$_POST['hospitalized_city'].'
Hospital admission date: '.$hospitalized_admin.' Release date: '.$hospitalized_release.'
Stool submitted '.$_POST['poop_submitted'].' Willing to submit specimen: '.$_POST['willing_to_poop'].'
'; $header = 'Name,'. 'Address,'. 'City,'. 'State,'. 'Zip code,'. 'Home Phone,'. 'Other Phone,'. 'Age,'. 'Sex,'. 'Occupation,'. 'General Complaints,'. 'Establishment,'. 'Establishment Adr.,'. 'Establishment City,'. 'Establishment St.,'. 'Establishment Zip,'. 'Meal Eaten,'. 'Appetizer,'. 'Main course,'. 'Desert,'. 'Drinks,'. 'Date Eaten,'. 'Time Eaten,'. 'Family Sick,'. 'Travel,'. 'Travel Location,'. 'Travel Date,'. 'Swimming,'. 'Swimm Location,'. 'Swim Date,'. 'Water Source,'. 'Water Source work,'. 'Nausea,'. 'Diarrhea,'. 'Headache,'. 'Bodyache,'. 'Vomit,'. 'Fever,'. 'Prostration,'. 'Cramps,'. 'Temperature,'. 'Other Info,'. 'Diarrhea Episodes,'. 'Diarrhea Start Date,'. 'Diarrhea Start Time,'. 'Diarrhea End Date,'. 'Diarrhea End Time,'. 'Vomit Episodes,'. 'Vomit Start Date,'. 'Vomit Start Time,'. 'Vomit End Date,'. 'Vomit End Time,'. 'Doctor Visit,'. 'Doctor Name,'. 'Diagnosis,'. 'ER Visit,'. 'Hospital Name,'. 'Hospital City,'. 'Hospitalized,'. 'Hospitalized Name,'. 'Hospitalized City,'. 'Hospital Admit Date,'. 'Hospital Release Date,'. 'Stool Sample Taken,'. 'Will Give Sample,'. 'Allergies,'. 'Allergy List,'. 'Date of Illness,'. 'Day 1 Breakfast Time,'. 'Day 1 Breakfast Location,'. 'Day 1 Breakfast,'. 'Day 1 Lunch Time,'. 'Day 1 Lunch Location,'. 'Day 1 Lunch,'. 'Day 1 Dinner Time,'. 'Day 1 Dinner Location,'. 'Day 1 Dinner,'. 'Day 1 Snack Time,'. 'Day 1 Snack Location,'. 'Day 1 Snack,'. '1 Day Before Illness,'. 'Day 2 Breakfast Time,'. 'Day 2 Breakfast Location,'. 'Day 2 Breakfast,'. 'Day 2 Lunch Time,'. 'Day 2 Lunch Location,'. 'Day 2 Lunch,'. 'Day 2 Dinner Time,'. 'Day 2 Dinner Location,'. 'Day 2 Dinner,'. 'Day 2 Snack Time,'. 'Day 2 Snack Location,'. 'Day 2 Snack,'. '2 Days Before Illness,'. 'Day 3 Breakfast Time,'. 'Day 3 Breakfast Location,'. 'Day 3 Breakfast,'. 'Day 3 Lunch Time,'. 'Day 3 Lunch Location,'. 'Day 3 Lunch,'. 'Day 3 Dinner Time,'. 'Day 3 Dinner Location,'. 'Day 3 Dinner,'. 'Day 3 Snack Time,'. 'Day 3 Snack Location,'. 'Day 3 Snack'."\n"; foreach ($_POST as $key => $value) { $_POST[$key] = '"'.$value.'"'; } $values = $_POST['name'].','. $_POST['address'].','. $_POST['city'].','. $_POST['state'].','. $_POST['zip'].','. $_POST['phone_home'].','. $_POST['phone_other'].','. $_POST['age'].','. $_POST['sex'].','. $_POST['job'].','. $_POST['general_description'].','. $_POST['establishment'].','. $_POST['est_address'].','. $_POST['est_city'].','. $_POST['est_state'].','. $_POST['est_zip'].','. $_POST['meal_eaten'].','. $_POST['appetizer'].','. $_POST['main_course'].','. $_POST['desert'].','. $_POST['drinks'].','. $date_food_eaten.','. $time_food_eaten.','. $_POST['family_sick'].','. $_POST['travel'].','. $_POST['travel_location'].','. $travel_date.','. $_POST['swim'].','. $_POST['swim_location'].','. $swim_date.','. $_POST['water'].','. $_POST['water_work'].','. $_POST['nausea'].','. $_POST['diarrhea'].','. $_POST['headache'].','. $_POST['bodyache'].','. $_POST['puke'].','. $_POST['fever'].','. $_POST['prostration'].','. $_POST['cramps'].','. $_POST['temperature'].','. $_POST['other_info'].','. $_POST['diarrhea_episodes'].','. $diarrhea_start_date.','. $diarrhea_start_time.','. $diarrhea_end_date.','. $diarrhea_end_time.','. $_POST['puke_episodes'].','. $puke_start_date.','. $puke_start_time.','. $puke_end_date.','. $puke_end_time.','. $_POST['doctor'].','. $_POST['doctor_name'].','. $_POST['diagnosis'].','. $_POST['emergency'].','. $_POST['hospital'].','. $_POST['hospital_city'].','. $_POST['hospitalized'].','. $_POST['hospitalized_name'].','. $_POST['hospitalized_city'].','. $hospitalized_admin.','. $hospitalized_release.','. $_POST['poop_submitted'].','. $_POST['willing_to_poop'].','. $_POST['allergies'].','. $_POST['allergies_list'].','. $day1_date.','. $day1_breakfast_time.','. $_POST['day1_breakfast_location'].','. $_POST['day1_breakfast'].','. $day1_lunch_time.','. $_POST['day1_lunch_location'].','. $_POST['day1_lunch'].','. $day1_dinner_time.','. $_POST['day1_dinner_location'].','. $_POST['day1_dinner'].','. $day1_snack_time.','. $_POST['day1_snack_location'].','. $_POST['day1_snack'].','. $day2_date.','. $day2_breakfast_time.','. $_POST['day2_breakfast_location'].','. $_POST['day2_breakfast'].','. $day2_lunch_time.','. $_POST['day2_lunch_location'].','. $_POST['day2_lunch'].','. $day2_dinner_time.','. $_POST['day2_dinner_location'].','. $_POST['day2_dinner'].','. $day2_snack_time.','. $_POST['day2_snack_location'].','. $_POST['day2_snack'].','. $day3_date.','. $day3_breakfast_time.','. $_POST['day3_breakfast_location'].','. $_POST['day3_breakfast'].','. $day3_lunch_time.','. $_POST['day3_lunch_location'].','. $_POST['day3_lunch'].','. $day3_dinner_time.','. $_POST['day3_dinner_location'].','. $_POST['day3_dinner'].','. $day3_snack_time.','. $_POST['day3_snack_location'].','. $_POST['day3_snack']; $values=preg_replace('/\\r\\n/',' ',$values); // write csv file $fp = fopen ('illness.csv','w'); fwrite ($fp,$header); fwrite ($fp,$values); fclose ($fp); // Build email message $em_body = "Website Illness complaint.\nSent ".date('l F jS \a\t h:i:s a')."
Sent from ".$IP."

"; $em_body .= $output; require_once('includes/phpmail_lib/class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "192.168.10.8"; // SMTP server $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "phwebmaster"; // SMTP username $mail->Password = "88snake88"; // SMTP password $mail->From = "no-reply@c-uphd.org"; $mail->FromName = "no-reply@c-uphd.org"; $mail->AddBCC("sbrunkow@c-uphd.org", "sb"); $mail->AddAddress("avaid@c-uphd.org", "avaid"); //these people get the emails of complaints $mail->AddAddress("ccrause@c-uphd.org", "Candi"); $mail->AddAddress("jroberts@c-uphd.org", "Jim"); $mail->AddAddress("smichaels@c-uphd.org", "Sarah"); $mail->AddAddress("rthompson@c-uphd.org", "Rachella"); $mail->AddAddress("aelliott@c-uphd.org", "Anna"); // A little clean-up $mail->ContentType = "text/html"; $mail->Subject = stripslashes('CUPHD Illness Complaint'); $mail->Body = stripslashes($em_body); $mail->WordWrap = 0; $mail->AddAttachment("illness.csv"); if(!$mail->Send()) { echo "Message was not sent"; echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "
Thank you, your complaint has been submitted.

"; echo "Go back to web site.
"; } unlink('illness.csv'); // delete csv file } // end submit of email else { ?>

CUPHD - Illness Reporting Form

Please fill out this form if you have eaten at a public establishment (e.g. restaurant, wedding, cafe. etc); and had a gastroenteritis symptom such as diarrhea or vomiting.

If you wish to file a complaint regarding the cleanliness of the restaurant or against a specific employee at the restaurant, please use the Food Service Establishment complaint form.

  •    Date - - Pick a date.    Time :  
  • Appetizer:    
    Main course:
    Desert:         
    Drinks:         
  • Yes    No
  • Yes    No    Where did you travel:    Date - - Pick a date.
  • Yes    No    Where did you swim:    Date - - Pick a date.
  •    Home:    Work:
  • Yes    No    Food items you are allergic to:
  • Please complete your three day food history. The three day food history should include your suspected meal and the food you had consumed in the 72 hours prior to that.

    - - Pick a date.
  • MealWhere was meal preparedTime of mealFood items/beverages
    Breakfast : :
    Lunch : :
    Dinner : :
    Snack : :
  • MealWhere was meal preparedTime of mealFood items/beverages
    Breakfast : :
    Lunch : :
    Dinner : :
    Snack : :
  • MealWhere was meal preparedTime of mealFood items/beverages
    Breakfast : :
    Lunch : :
    Dinner : :
    Snack : :
  • (Enter 0 if you did not have a symptom and 1.5 for 1 and a half hours)

  • Prostration: extreme exhaustion, or lack of energy or power.
  •    Date: - - Pick a date.    Time: :  
  •    Date: - - Pick a date.    Time: :  
  •    Date: - - Pick a date.    Time: :  
  •    Date: - - Pick a date.    Time: :  
  • Yes    No    physician's name:    Diagnosis:
  • Yes    No    Hospital name:    Hospital city:
  • Yes    No    Hospital name:    Hospital city:
  • Admission Date: - - Pick a date.    Release date: - - Pick a date.
  • Yes    No
  • Yes    No
  • Thank you for taking the time to fill out this form. Once you click submit your information will be sent to our epidemiologist.

  • For further information and understanding of food borne illness or organisms visit this website at the CDC.