"; //var_dump($_REQUEST); //echo "

incoming array
"; //var_dump($incoming); // ******** begin database manipulation ******** // determine today's date and make it the default $today=date("Y-m-d"); $now=date("H:i:s"); if (!$report_date || $report_date=="automatic") $report_date=$today; if (!$report_time || $report_time=="automatic") $report_time=$now; if ($create) { // add the entry if create is pressed if ($discrepancy_text && $reported_by && $device && $subsystem && $discovered) { // sanitize and fix blank date and time $report_date=mysqli_real_escape_string($drs_db,$report_date); $report_time=mysqli_real_escape_string($drs_db,$report_time); if (!$report_date) $report_date=$today; if (!$report_time) $report_time=$now; // remove html tags from discrepancy text and sanitize $discrepancy_text=strip_tags($discrepancy_text); $clean_discrepancy_text=mysqli_real_escape_string($drs_db,$discrepancy_text); $clean_reported_by=mysqli_real_escape_string($drs_db,$reported_by); // add the record to writeups mysqli_query($drs_db,"insert into writeups(device,discovered,functional,reported_by,report_date,report_time,subsystem,discrepancy_text,status) values (\"$device\",\"$discovered\",\"$functional\",\"$clean_reported_by\",\"$report_date\",\"$report_time\",\"$subsystem\",\"$clean_discrepancy_text\",\"$status\")"); } } // ******** end database manipulation ******** pagetable("begin"); if (!$print) { pageblock("left","begin"); sidemenu(); pageblock("left","end"); } pageblock("right","begin"); banner($print); echo "
"; // display the form if ($create) { if ($discrepancy_text && $reported_by) { format_message(0,"Writeup created. You may create another writeup or return to Open Writeups page."); $preserve=FALSE; } if (!$device) { format_message(1,"You didn't select a $device_term. Please try again."); $preserve=TRUE; } if (!$subsystem) { format_message(1,"You didn't select a subsystem. Please try again."); $preserve=TRUE; } if (!$discovered) { format_message(1,"You didn't select a $discovered_term. Please try again."); $preserve=TRUE; } if (!$discrepancy_text) { format_message(1,"You didn't enter any discrepancy text. Please try again."); $preserve=TRUE; } if (!$reported_by) { format_message(1,"You didn't enter your name in the Reported by: block. Please try again."); $preserve=TRUE; } } else { $preserve=FALSE; } echo "
"; // start writeup entry section if ($status==1) $statusind="OPEN"; if ($status==2) $statusind="CLSD"; if ($status==3) $statusind="DFRD"; echo "
$device_term
Subsystem
$discovered_term
Report Date
Report Time
Discrepancy (required)

Reported by (required)
$functional_term?  
Yes      No

"; banner($print); pageblock("right","end"); pagetable("end"); framework("end","","",$print); ?>