formatting
This commit is contained in:
@@ -18,8 +18,7 @@ function booking_variety_regn_form($node, &$form_state)
|
|||||||
|
|
||||||
|
|
||||||
$form['booking_variety_regn_feedback_wrapper'] = array(
|
$form['booking_variety_regn_feedback_wrapper'] = array(
|
||||||
'#markup' => '<div id="booking_variety_regn_feedback_wrapper">Please enter your booking number from your lanyard. ' .
|
'#markup' => '<div id="booking_variety_regn_feedback_wrapper" class="form-item">Please enter your booking number from your lanyard.</div>',
|
||||||
'</p></div><br />',
|
|
||||||
);
|
);
|
||||||
$form['booking_nid'] = array(
|
$form['booking_nid'] = array(
|
||||||
'#type' => 'textfield',
|
'#type' => 'textfield',
|
||||||
@@ -42,20 +41,6 @@ function booking_variety_regn_form($node, &$form_state)
|
|||||||
$result = $timeslot_query->execute();
|
$result = $timeslot_query->execute();
|
||||||
|
|
||||||
foreach($result as $timeslot) {
|
foreach($result as $timeslot) {
|
||||||
//reset the array
|
|
||||||
$options = array ();
|
|
||||||
$options[''] = '';
|
|
||||||
|
|
||||||
//query for variety sessions in the timeslot
|
|
||||||
$session_query = db_query("SELECT * from {booking_variety_options} WHERE booking_variety_timeslot_id = :id AND booking_variety_status = 1",
|
|
||||||
array(':id' => $timeslot->tid));
|
|
||||||
|
|
||||||
//add all the sessions to the select list
|
|
||||||
foreach($session_query as $session)
|
|
||||||
{
|
|
||||||
$options[$session->vid] = $session->booking_variety_descrip;
|
|
||||||
}
|
|
||||||
|
|
||||||
//create the form element for this timeslot
|
//create the form element for this timeslot
|
||||||
$form['select-variety-' . $timeslot->tid] = array(
|
$form['select-variety-' . $timeslot->tid] = array(
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
@@ -111,8 +96,8 @@ function booking_variety_regn_callback($form, &$form_state) {
|
|||||||
//verify that user-entered data is a number
|
//verify that user-entered data is a number
|
||||||
if (! preg_match('/^[0-9]+$/', $data['booking_nid'])) {
|
if (! preg_match('/^[0-9]+$/', $data['booking_nid'])) {
|
||||||
watchdog('booking_debug', "<pre>booking_variety_regn_callback non-numerical input</pre>");
|
watchdog('booking_debug', "<pre>booking_variety_regn_callback non-numerical input</pre>");
|
||||||
return '<div id="booking_variety_regn_feedback_wrapper"><span style="color:#8c2e0b;font-weight: bold;">' .
|
return '<div id="booking_variety_regn_feedback_wrapper" class="form-item"><span style="color:#8c2e0b;font-weight: bold;">' .
|
||||||
'You have not entered a valid booking reference number.</span><br /><br /></div>';
|
'You have not entered a valid booking reference number.</span></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform lookup on barcode to make sure it matches someone attending the current event
|
// Perform lookup on barcode to make sure it matches someone attending the current event
|
||||||
@@ -129,12 +114,12 @@ function booking_variety_regn_callback($form, &$form_state) {
|
|||||||
|
|
||||||
if ($person) {
|
if ($person) {
|
||||||
watchdog('booking_debug', "<pre>booking_variety_regn_callback found valid attendee</pre>");
|
watchdog('booking_debug', "<pre>booking_variety_regn_callback found valid attendee</pre>");
|
||||||
return '<div id="booking_variety_regn_feedback_wrapper"><span style="color:#234600;font-weight: bold;">' .
|
return '<div id="booking_variety_regn_feedback_wrapper" class="form-item"><span style="color:#234600;font-weight: bold;">' .
|
||||||
'Matched booking reference number.</span><br /><br /></div>';
|
'Matched booking reference number.</span></div>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
watchdog('booking_debug', "<pre>booking_variety_regn_callback did not find valid attendee</pre>");
|
watchdog('booking_debug', "<pre>booking_variety_regn_callback did not find valid attendee</pre>");
|
||||||
return '<div id="booking_variety_regn_feedback_wrapper"><span style="color:#8c2e0b;font-weight: bold;">' .
|
return '<div id="booking_variety_regn_feedback_wrapper" class="form-item"><span style="color:#8c2e0b;font-weight: bold;">' .
|
||||||
'You have not entered a valid booking reference number.</span><br /><br /></div>';
|
'You have not entered a valid booking reference number.</span></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user