} elseif (xsrf_guard()) { init_var($_POST['btn_cancel']); init_var($_POST['btn_submit']); require 'components/query_string_standard.php'; require 'subclasses/eval_hdr.php'; $dbh_eval_hdr = new eval_hdr(); $object_name = 'dbh_eval_hdr'; require 'components/create_form_data.php'; extract($arr_form_data); if ($_POST['btn_cancel']) { log_action('Pressed cancel button', $_SERVER['PHP_SELF']); redirect("listview_eval_hdr.php?{$query_string}"); } if ($_POST['btn_submit']) { log_action('Pressed submit button', $_SERVER['PHP_SELF']); $message .= $dbh_eval_hdr->sanitize($arr_form_data)->lst_error; extract($arr_form_data); if ($dbh_eval_hdr->check_uniqueness_for_editing($arr_form_data)->is_unique) { //Good, no duplicate in database } else { $message = "Record already exists with the same primary identifiers!"; } if ($message == "") { $dbh_eval_hdr->edit($arr_form_data); require_once 'subclasses/eval_dtl.php'; $dbh_eval_hdr = new eval_dtl(); $dbh_eval_hdr->del($arr_form_data); for ($a = 0; $a < $eval_dtl_count; $a++) { $param = array('id' => $id, 'questionnaire_id' => $cf_eval_dtl_questionnaire_id[$a], 'eval_hdr_id' => $id, 'response_rating' => $cf_eval_dtl_response_rating[$a], 'response_detail' => $cf_eval_dtl_response_detail[$a]); $dbh_eval_hdr->add($param); }