$includedByFuneralProgram=true;
require_once ZDEF_PATH_TO_HUB_ACCOUNT.'pdserver/funeral.def.inc.php'; // this connects to the database, does equivalent of dbIni();
$pathToImages='/funeralhome/i/';
if(ZDEF_REQUEST_FROM_HUB_DOMAIN==1)$pathToImages='/'.ORG_HANDLE.$pathToImages;
$today=date('Y-m-d',strtotime('-41 day', time())); // this is for testing
$today=date("Y-m-d");
if($cln_searchterm=='Type Last Name Here')$cln_searchterm='';
$interimHTML=ob_get_contents();
$div=explode('
1){
$fx='?fx='.explode(' ',$fx[1])[0];
}else{
$fx='';
}
$limit='';
$a=explode('gc_',$class);
if(count($a)>1){
$limit=' LIMIT '.explode(' ',$a[1])[0];
}
if(strlen($cln_searchterm)>0){//
$getObituaries=true;
//$sql is for upcoming services
//$sql = 'SELECT *,IF(notice_funeral_date = \'\', notice_create_date, notice_funeral_date) as theDate FROM '.$funDataBase.'.notice WHERE notice_enabled=\'Y\' AND (notice_funeral_date >= \''.$today.'\') AND ((notice_last_name = \''.$cln_searchterm.'\') OR (notice_soundex = \''.soundex($cln_searchterm).'\')) ORDER BY theDate'.$limit;
//$sqlP is for previous services (obituaries)
$sqlP = 'SELECT notice_id,notice_last_name,notice_first_name,notice_middle_name,notice_date_of_birth,notice_date_of_death,notice_funeral_date,notice_funeral_time,notice_photo_large FROM '.$funDataBase.'.notice WHERE notice_enabled=\'Y\' AND ((notice_last_name LIKE \'%'.$cln_searchterm.'%\') OR (notice_soundex = \''.soundex($cln_searchterm).'\')) ORDER BY notice_date_of_death DESC'.$limit;
//echo '';
}else{
$ninetyDaysAgo=date('Y-m-d',strtotime('-120 day', time())); // we don't use this because we are limiting by the number of tiles we want to produce
//$sql is for upcoming services
$sql= 'SELECT * ,IF(notice_funeral_date = \'\', notice_create_date, notice_funeral_date) as theDate FROM '.$funDataBase.'.notice WHERE notice_enabled=\'Y\' AND (notice_funeral_date >= \''.$today.'\') ORDER BY theDate'.$limit;
//$sqlP is for previous services (obituaries)
$sqlP='SELECT notice_id,notice_date_of_birth,notice_date_of_death,notice_last_name,notice_first_name,notice_middle_name,notice_photo_large FROM '.$funDataBase.'.notice WHERE notice_enabled=\'Y\' ORDER BY notice_date_of_death DESC'.$limit;
}
if(!function_exists('displayResults')){
function displayResults($r){
global $mapaddress;
while ( $a = mysql_fetch_array($r) ) {
echo '
| ';echo $a['notice_last_name'].', '.$a['notice_first_name'].' '.$a['notice_middle_name'].' | ';
$src='funeralhome';
if(D567_TEST==1)$src.='.test941a';
$src.='/i/'.$a['notice_id'].'.nophoto_small.'.$a['notice_photo_small'];
if(file_exists($src)){
echo '  ';
}else{
if($a['notice_id']=='bxdwl6lgnpc'){
$src1.='funeralhome/i/chamberszara.nophoto_small.'.$a['notice_photo_small'];
$src2.='funeralhome/i/chambersbridget.nophoto_small.'.$a['notice_photo_small'];
echo '   ';
}
}
echo ' | ';
$datetime='';
if(strlen($a['notice_funeral_date'].$a['notice_funeral_time'])>0){
$datetime=strtotime($a['notice_funeral_date'].' '.$a['notice_funeral_time']);
}
if(strlen($a['notice_funeral_date'].$a['notice_funeral_time'].$a['notice_service_location'])>0){
echo 'Service:';
if(strlen($a['notice_funeral_date'])>0)echo ''.date('l, F j, Y',$datetime).' ';
if(strlen($a['notice_funeral_time'])>0)echo ''.date('g:i a',$datetime).' ';
echo '0) echo' class="nserv">';else echo '> '; echo nl2br($a['notice_service_location']).' | ';
}
if(strlen($a['notice_internment'])>0){
echo '| Interment: '.$a['notice_internment'].' | ';
}
echo '| View Obituary and Condolences | ';
if(strlen($a['notice_funeral_date'].$a['notice_funeral_time'])==0)echo '
| ';
if(strlen($a['notice_internment'])==0)echo '
| ';
echo ' ';
echo ' | ';
echo '
';
}
}
}
if($getServices){
$r=dbQry($fdb,$sql,'fw976',true);// the funeral database has no org id's
if(dbNR($r)==0){
echo '
There are no services scheduled at this time
';
}else {
foreach($r as $row){
echo '
';
}
}
}
if($getObituaries){
$r=dbQry($fdb,$sqlP,'fw977',true);
if(dbNR($r)==0){
echo '
There is no Obituary for anyone with a last name of '.$cln_searchterm.'
';
}else {
foreach($r as $row){
echo '
';
}
}
}
$getServices=false;
$getObituaries=false;
return;
?>
if(strlen($cln_searchterm)>0 && dbNR($r)==0 && dbNR($rr)==0){
echo '
There are no services for persons with a last name the same as the one you searched for.
';
echo '
Please change the name you are searching for and try again.
';
}else{
if(dbNR($r)!=0){
?>
Schedule of Services
}
if(dbNR($rr)!=0){
?>
Recent Obituaries
}
}
?>