" . $n . "
"; $m .= "An error occurred in " . $s . "
Description: " . $d . "
"; $m .= ""; die($m); } //function for formatting phone numbers function format_phone($data) { $tmpstr = $data; $leadchar = substr($tmpstr,0,1); switch($leadchar) { case '1': $tmpstr = str_replace('(','.',$tmpstr); break; case '(': $tmpstr = str_replace('(','',$tmpstr); break; } $tmpstr = str_replace(')','.',$tmpstr); $tmpstr = str_replace('-','.',$tmpstr); if(strpos($tmpstr,'.') == false || strpos($tmpstr,'.') == 0) { switch(strlen($tmpstr)) { case 7: $tmpstr = substr($tmpstr,0,3) . '.' . substr($tmpstr,3); break; case 10: $tmpstr = substr($tmpstr,0,3) . '.' . substr($tmpstr,3,3) . '.' . substr($tmpstr,6); break; case 11: $tmpstr = substr($tmpstr,0,1) . '.' . substr($tmpstr,1,3) . '.' . substr($tmpstr,4,3) . '.' . substr($tmpstr,7); break; } } return $tmpstr; } //end function //function for escaping and trimming form data function escape_data($data) { global $dbc; if (ini_get('magic_quotes_gpc')) { $data = stripslashes($data); } return mysql_real_escape_string(trim($data), $dbc); } //end function function dateadd($d,$i) { return date("m/d/Y",strtotime($i . " days", strtotime($d))); } //end function function fmtqrydte($d) { //incoming format is MM/DD/YYYY return "'" . date('Y',strtotime($d)) . "-" . date('m',strtotime($d)) . "-" . date('d',strtotime($d)) . "'"; } function dsplyqrydte($d) { //incoming format is YYYY-MM-DD $t = explode('-',$d); return $t[1] . "/" . $t[2] . "/" . $t[0]; } function dbmonth($d) { //incoming format is YYYY-MM-DD return date('m',strtotime(dsplyqrydte($d))); } function dbday($d) { //incoming format is YYYY-MM-DD $t = getdate(strtotime(dsplyqrydte($d))); return $t['mday']; } function dbyear($d) { //incoming format is YYYY-MM-DD return date('Y',strtotime(dsplyqrydte($d))); } function getthisurl() { //this will get the url for this page $ports = array('https' => 443, 'http' => 80); $prefix = empty($_SERVER['HTTPS']) ? 'http' : 'https'; $url = $prefix; $url .= $_SERVER['SERVER_PORT'] != $ports[$prefix] ? ':' . $_SERVER['SERVER_PORT'] : ''; $url .= '://'; $url .= $_SERVER['HTTP_HOST']; $url .= '/'; //$url .= $_SERVER['REQUEST_URI']; //commented out page name i.e. '/popup.php' return $url; } function getmeaDDL($name,$selval,$lowerlimit,$howmany) { $ddl = ""; for($i=$lowerlimit;$i<($howmany+1);$i++) { $ddl .= "