4 function check_date_format ($date) {
5 $pat="^(19[0-9]{2}|20[0-1]{1}[0-9]{1})-(0[1-9]|1[0-2])-(0[1-9]{1}|1[0-9]{1}|2[0-9]{1}|3[0-1]{1})$";
6 if (ereg ($pat, $date) OR $date=='' OR $date=='0000-00-00') { return TRUE ; } else { RETURN FALSE; }
9 function check_age ($age) {
12 if (ereg ($pat, $age) OR $age=='') { return TRUE ; } else { RETURN FALSE; }
15 function check_select ($select, $array) {
16 if (array_search($select,$array) OR 0===array_search($select,$array) ) { return TRUE ; } else { RETURN FALSE; }
19 function check_yes_no ($option) {
20 if ($option=='AND' OR $option=='OR') { return TRUE ; } else { RETURN FALSE; }
23 function where_or_and ($and) {
26 } elseif ($and=='WHERE '){
34 function register_email($patient_id, $sent_by, $msg_type, $msg_subject, $msg_text) {
36 $sql="INSERT INTO batchcom SET ";
37 $sql.=" patient_id='$patient_id', ";
38 $sql.="sent_by='$sent_by', ";
39 $sql.="msg_type='$msg_type', ";
40 $sql.="msg_subject='$msg_subject', ";
41 $sql.="msg_text='$msg_text', ";
42 $sql.="msg_date_sent=NOW() ";
46 $res = sqlStatement($sql);