Hi all,
I have a form that I wish to display CONDITIONALLY...
I have this logic in a custom code event block before any other events.
I thought that the "return;" would stop further processing, but I was wrong! The events following this code still fire.
How do I prevent the events that follow this code from continuing when a "$rex_card" value exists? I ONLY want the events to fire if there is a NULL value for the "$rex_card".
Thanks in advance for your help.
MrFitz
I have a form that I wish to display CONDITIONALLY...
I have this logic in a custom code event block before any other events.
<?php
$user =& JFactory::getUser();
$curr_id = $user->id;
$form->data['curr_id'];
$db =& JFactory::getDBO();
$query = "SELECT cf_id, secret_question, secret_answer, rm_id_link from jml_rex_registration WHERE cf_user_id = $curr_id";
$db->setQuery($query);
$reg_list = $db->loadAssoc();
$cf_id = $reg_list['cf_id'];
$rm_id_link = $reg_list['rm_id_link'];
$secret_question = $reg_list['secret_question'];
$secret_answer = $reg_list['secret_answer'];
$form->data['cf_id'] = $cf_id;
$query = "SELECT rex_card from jml_rex_main where rm_id = $rm_id_link ";
$db->setQuery($query);
$rex_main = $db->loadAssoc();
$rex_card = $rex_main['rex_card'];
if(!empty($rex_card)){
echo "<div align='center'><h2>Link Card to My Account</h2>Card Number ". $rex_card." already is linked to an account. </div>";
return; // I WANT TO STOP PROCESSING HERE
}
// I WANT TO CONTINUE PROCESSING HERE
?>
I thought that the "return;" would stop further processing, but I was wrong! The events following this code still fire.
How do I prevent the events that follow this code from continuing when a "$rex_card" value exists? I ONLY want the events to fire if there is a NULL value for the "$rex_card".
Thanks in advance for your help.
MrFitz