//Iterate through possible responses if (isset($_SESSION[$value]) && isset($fieldexists) && $_SESSION[$value] != '') { if ($fieldexists['type'] == 'D' && isset($_POST[$value])) { $dateformatdatat = getDateFormatData($thissurvey['surveyls_dateformat']); $datetimeobj = new Date_Time_Converter($_SESSION[$value], $dateformatdatat['phpdate']); $_SESSION[$value] = $datetimeobj->convert("Y-m-d"); $_SESSION[$value] = $connect->BindDate($_SESSION[$value]); } } } } } // CREATE SAVED CONTROL RECORD USING SAVE FORM INFORMATION if (isset($_POST['saveprompt'])) { if ($thissurvey['active'] == "Y") { $flashmessage = savedcontrol(); if (isset($errormsg) && $errormsg != "") { showsaveform(); } } else { $_SESSION['scid'] = 0; // If not active set to a dummy value to save form does not continue to show. } } // DISPLAY SAVE FORM // Displays even if not active just to show how it would look when active (for testing purposes) // Show 'SAVE FORM' only when click the 'Save so far' button the first time if ($thissurvey['allowsave'] == "Y" && isset($_POST['saveall']) && !isset($_SESSION['scid'])) { showsaveform(); } elseif ($thissurvey['allowsave'] == "Y" && isset($_POST['saveall']) && isset($_SESSION['scid'])) { $connect->Execute("update " . db_table_name("saved_control") . " set saved_thisstep=" . db_quoteall($thisstep) . " where scid=" . $_SESSION['scid']);
} buildsurveysession(); loadanswers(); } } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'previewgroup') { $thissurvey['format'] = 'G'; buildsurveysession(true); } sendcacheheaders(); //CALL APPROPRIATE SCRIPT require_once "group.php"; // works for all survey styles - rename to navigation_controller.php? //queXS Addition if (isset($_POST['move']) || isset($_POST['saveprompt'])) { savedcontrol(); } /* queXS Removal if (isset($_POST['saveall']) || isset($flashmessage)) { echo "<script language='JavaScript'> $(document).ready( function() {alert('".$clang->gT("Your responses were successfully saved.","js")."');}) </script>"; } end queXS Removal */ function loadanswers() { global $dbprefix, $surveyid, $errormsg; global $thissurvey, $thisstep, $clang; global $databasetype, $clienttoken; $scid = returnglobal('scid'); if (isset($_POST['loadall']) && $_POST['loadall'] == "reload") { $query = "SELECT * FROM " . db_table_name('saved_control') . " INNER JOIN {$thissurvey['tablename']}\n ON " . db_table_name('saved_control') . ".srid = {$thissurvey['tablename']}.id\n WHERE " . db_table_name('saved_control') . ".sid={$surveyid}\n";