LIMIT REGISTRATION QUANTITY BY CITY...

HyperOsmar

Member
Dear colleagues,

I have a registration form and I would like to restrict (limit) only two registrations per city...

Any suggestion!!!???...

Thanks...
 
Not without knowing much about your form and data(base), plus it would take a significant amount of time... so, I'd say that's custom work exceeding community support here in the forum.
 
Dear colleagues,

I used the following code in the PHP plugin of the DataBaseJoin element and it worked perfectly:

$db = JFactory::getDbo();
$query1 = $db
->getQuery(true)
->select('COUNT(*)')
->from($db->quoteName('cad_presenca_7_assembleia_ordinaria'))
->where($db->quoteName('cidade') . " = '{cad_presenca_7_assembleia_ordinaria___cidade}'");

$db->setQuery($query1);
$count = $db->loadResult();
echo "Contagem dos Municípios: " . $count;
var_dump(); exit;
if ($count > 3){
echo "True1";
var_dump(); exit;
if ('{cad_presenca_7_assembleia_ordinaria___local_trabalho}' != "COSEMS"){
echo '{cad_presenca_7_assembleia_ordinaria___local_trabalho}';
echo "True2";
var_dump(); exit;
return true;
} else {
echo "False_2";
var_dump(); exit;
return false;
}
} else {
echo "False_1";
var_dump(); exit;
return false;
}
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top