if a client form is filled out but there EEE is not filled out and i visit there page... how can i write a variable that says ... check the field 'EEENUMBER' in the input and if it's blank than echo an alert Must have EEE NUMBER...
PHP Code:
<tr><td>EEE</td><td><?php inp('EEENUMBER'); ?></td></tr> <?php if ($EEENUMBER <= 0) {
echo "Must have EEE NUMBER.";
}
?>
please help on this easy task.. I've gone brain dead today. Thanks in adavance.
First, just want to mention that this little bit is sort of non-code: it does not do anything (unless it might throw a notice-level warning if $_GET['DEANUMBER'] is not set):
PHP Code:
$_GET["DEANUMBER"];
If we want to get really defensive about things:
PHP Code:
$errors = array();
if( ! isset($_GET['DEANUMBER']) or trim($_GET['DEANUMBER'] === '') {
$errors[] = "DEA Nbr. must be entered.";
}
$deaNbr = trim($_GET['DEANUMBER'];
if( ! ctype_digit($deaNbr) {
$errors[] = 'DEA Nbr. must be all numbers.';
}
if( ! empty($errors)) {
// output error page, using $errors[] to get error message(s)
}
else {
// go ahead and process request
}
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Another question... it's a mix of jquery and php strings..
I have 5 sql tables that i'm displaying results from, I've written a jquery statement that calls out the div parent and first children and parents table .siblings..
like so:
Code:
$("#phone_book tr").click(function(){
var id = $(this).children().first().html();
var type = $(this).parents('table').siblings('div.module_header').html();
//alert(type);
window.location.href='index.php?q=patient/demographics/armdme&'+ patient + '=<?php $patient_id; ?>' '+ doctors + ' '+referral+ ' etc etc.... <confused on the url string here.
});
});
So when users hover it allows them to know what div category they're searching... well the window.location.href event needs to visit the correct card based on their selection..
my categories are patients, doctors, alt doctors, referral, pharmacys...
here's my code:
HTML Code:
<div id='phone_book'><?php
echo "<div>";
echo "<div class='module_header'> Patients</div>";
echo lookup_gen::query_results_table("Select TOP 10 code, last + ', ' + first as name, phoneday, phonenight, cellnumber as Cell_Phone FROM " . event_table('patient_dg()') . " WHERE (phoneday is not null and phoneday <> '') or (phonenight is not null and phonenight <> '')");
echo "</div>";
echo "<br /><br />";
echo "<div class='module_header'> Doctors</div>";
echo lookup_gen::query_results_table ("Select TOP 10 CODE_, Last_ + ', ' + First_ as name, phone, fax FROM WARE.APS.FDME");
echo "<div class='fj'> - Alternative Address - </div>";
echo lookup_gen::query_results_table ("Select TOP 10 doctor_id, phone, fax FROM event.dbo.docr_alt_address WHERE (phone is not null and phone <> '') or (fax is not null and fax <> '')");
echo "<div>";
echo "<br /><br />";
echo "<div class='module_header'> Referral</div>";
echo lookup_gen::query_results_table ("Select TOP 10 CODE_,NAME_ as name, phone, fax FROM ARE.APS.RFDM");
echo "</div>";
echo "<div>";
echo "<br /><br />";
echo "<div class='module_header'> Pharmacy</div>";
echo lookup_gen::query_results_table ("Select TOP 10 id, name, call_back as Phone, fax_back as Fax FROM phar.dbo.chain");
echo "</div>";
?></div>
Bookmarks