summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202023-01-02 13:30:51 +0530
committerGitHub2023-01-02 13:30:51 +0530
commite0ab72777bf14d9d6a62b4170f3c32eb9686537a (patch)
tree974128ab37f2bee985a58cb1bfd9b8eb882521b5
parent203522336e16b16f4bed3e01ce6ca0fbde6fd1e4 (diff)
parent82d124d177ae35da90fab83c48660d798bdf0858 (diff)
downloadfellowship_testimonials-e0ab72777bf14d9d6a62b4170f3c32eb9686537a.tar.gz
fellowship_testimonials-e0ab72777bf14d9d6a62b4170f3c32eb9686537a.tar.bz2
fellowship_testimonials-e0ab72777bf14d9d6a62b4170f3c32eb9686537a.zip
Merge pull request #10 from Sashi20/master
Allow registration once per participant
-rw-r--r--vle_registration.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/vle_registration.inc b/vle_registration.inc
index e59886e..6bf5618 100644
--- a/vle_registration.inc
+++ b/vle_registration.inc
@@ -337,6 +337,19 @@ function ajax_get_district_list_callback($form, $form_state)
function animation_hackathon_vle_registration_form_validate($form, &$form_state) {
$v = $form_state['values']['team_member_2'];
+ $team_lead_email = $form_state['values']['team_member_1']['email'];
+ $query = db_select('animation_hackathon_vle_registration');
+ $query->fields('animation_hackathon_vle_registration');
+ $query->condition('team_member_1_email', $team_lead_email);
+ $result = $query->execute();
+ $row = $result->fetchObject();
+ if($row){
+ drupal_set_message('You have already registered', 'error');
+ drupal_goto('animation-hackathon/vle-registration');
+ }
+ /*if (!valid_email_address($form_state['values']['team_member_1']['mail'])) {
+ form_set_error('submitted][email_address', t('The email address appears to be invalid.'));
+}*/
if($form_state['values']['team_size'] == 'Yes'){
if($v['name'] == '')
form_set_error('team_member_2][name', 'Enter name of team member 2');
@@ -350,6 +363,9 @@ function animation_hackathon_vle_registration_form_validate($form, &$form_state)
form_set_error('team_member_2][category', 'Enter category of team member 2');
if($v['institution'] == '')
form_set_error('team_member_2][institution', 'Enter institution id of team member 2');
+ /*else if (!valid_email_address($v['email'])) {
+ form_set_error('team_member_2][email', 'The email address appears to be invalid.');
+ }*/
}
}