Example #1
0
        $content .= '--------------------------------------' . CR;
        $content .= $request->get('post', 'message') . CR;
        $content .= '--------------------------------------' . CR;
        $content .= 'Post from IP address: ' . $_SERVER['REMOTE_ADDR'] . CR;
        $content .= 'On: ' . date('D jS M Y H:i:s');
        $content .= CR . CR . 'Thank you.';
        mail($config->get('web', 'feedbackEmail'), $subject, $content, $headers);
        header('Location: ' . $config->get('web', 'root') . '/feedback/thankyou/');
        exit;
    }
    $form->addFieldsetOpen('Feedback');
    $form->addContent('<div><p class="fieldSubstitute"><span class="label">From:</span><span class="input">' . $user['firstname'] . ' ' . $user['lastname'] . '</span></p></div>');
    $form->addField('about', 'select');
    $form->addLabel('About');
    $form->addOptions(array('' => 'Select a subject', 'missbeer' => 'Missing Beer', 'missbrewery' => 'Missing Brewery', 'misspubs' => 'Missing Pub', 'misstowns' => 'Missing Town', 'newlandlord' => 'New Landlords', 'suggestion' => 'NBSS Suggestions', 'other' => 'Other'));
    $form->addFormValidationErrorMessage('required');
    $form->addField('message', 'textarea');
    $form->addLabel('Text');
    $form->addFormValidationErrorMessage('required');
    $form->addField('send', 'submit', 'Send');
    $form->addInputClass('btnSubmit');
    $form->addField('reset', 'reset', 'Clear');
    $form->addInputClass('btnReset');
    $form->addFieldsetClose();
    print $form->display();
} else {
    ?>
	<h2>Feedback disabled</h2>
	<p>The administrator has disabled feedback for this site.</p>
<?php 
}