grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026isValidId($_REQUEST['id'])) { $surveyId = $_REQUEST['id']; } else { LoggerManager::getLogger()->warn('Invalid survey ID.'); } $survey = BeanFactory::getBean('Surveys', $surveyId); if (empty($survey->id)) { header('HTTP/1.0 404 Not Found'); exit(); } if ($survey->status === 'Closed') { displayClosedPage($survey); exit(); } if ($survey->status !== 'Public') { header('HTTP/1.0 404 Not Found'); exit(); } $contactId = ''; if (!empty($_REQUEST['contact']) && $isValidator->isValidId($_REQUEST['contact'])) { $contactId = $_REQUEST['contact']; } else { LoggerManager::getLogger()->warn('Invalid contact ID in survey.'); } $trackerId = ''; if (!empty($_REQUEST['tracker']) && $isValidator->isValidId($_REQUEST['tracker'])) { $trackerId = $_REQUEST['tracker']; } else { LoggerManager::getLogger()->warn('Invalid tracker ID in survey.'); } $themeObject = SugarThemeRegistry::current(); $companyLogoURL = $themeObject->getImageURL('company_logo.png'); require_once 'modules/Campaigns/utils.php'; if ($trackerId) { $surveyLinkTracker = getSurveyLinkTracker($trackerId); log_campaign_activity($trackerId, 'link', true, $surveyLinkTracker); } function getSurveyLinkTracker($trackerId) { $db = DBManagerFactory::getInstance(); $trackerId = $db->quote($trackerId); $sql = <<fetchOne($sql); if ($row) { return $row['id']; } return false; } use SuiteCRM\Utility\SuiteValidator; ?> <?= $survey->name ?>

name ?>

get_linked_beans('surveys_surveyquestions', 'SurveyQuestions'); usort( $questions, function ($a, $b) { return $a->sort_order - $b->sort_order; } ); foreach ($questions as $question) { displayQuestion($survey, $question); } ?>

get_linked_beans( 'surveyquestions_surveyquestionoptions', 'SurveyQuestionOptions', 'sort_order' ) as $option) { $optionArr = array(); $optionArr['id'] = $option->id; $optionArr['name'] = $option->name; $options[] = $optionArr; } switch ($question->type) { case "Textbox": echo ""; break; case "Checkbox": echo "
"; break; case "Radio": foreach ($options as $option) { echo "
"; echo ""; echo "
"; } break; case "Dropdown": case "Multiselect": $multi = $question->type == 'Multiselect' ? ' multiple="true" ' : ''; $name = $question->type == 'Multiselect' ? "question[" . $question->id . "][]" : "question[" . $question->id . "]"; echo ""; break; case "Matrix": displayMatrixField($survey, $question, $options); break; case "Date": displayDateField($question); break; case "DateTime": displayDateTimeField($question); break; case "Rating": displayRatingField($question); break; case "Scale": displayScaleField($question); break; case "Text": default: displayTextField($question); break; } ?>
id . "' name='question[" . $question->id . "]' type='text'/>"; } function displayScaleField($question) { echo ""; $scaleMax = 10; for ($x = 1; $x <= $scaleMax; $x++) { echo ""; } echo ""; for ($x = 1; $x <= $scaleMax; $x++) { echo ""; } echo "
" . $x . "
"; } function displayRatingField($question) { $ratingMax = 5; echo "
"; for ($x = 1; $x <= $ratingMax; $x++) { echo ""; } echo "
"; } function displayMatrixField($survey, $question, $options) { $matrixOptions = $survey->getMatrixOptions(); echo ""; echo ""; echo ""; foreach ($matrixOptions as $matrixOption) { echo ""; } foreach ($options as $option) { echo ""; echo ""; foreach ($matrixOptions as $x => $matrixOption) { echo ""; } echo ""; } echo "
"; echo $matrixOption; echo "
"; echo $option['name']; echo "
"; } function displayDateTimeField($question) { echo "
"; echo ""; echo "
"; } function displayDateField($question) { echo "
"; echo ""; echo "
"; } function displayClosedPage($survey) { ?> <?= $survey->name ?>

name ?>

Thanks for your interest but this survey is now closed.