I created a variable to check and echo out results for a particular patient:
<?php
$ex = sql::value("select 1 email from " . event_table('email_rules') . " where patient_id={$patient->hex}");
if ($ex == 1) {echo "Records";} else {echo "None";}
?>
My html input is simple, cbox is checkbox:
<tr><td>Email</td><td><?php cbox('email'); ?></td></tr>
If someone checks the email box but there is no email in sql than i need to throw an alert saying there is no email associated.
I'm assuming I could use jquery or javascript to get this accomplished in a clean and concise manner. I hope I'm fairly clear on what i'm trying to accomplish. Help would be greatly appreciated. Thank you.