SENDING INFORMATION UPDATE REMINDER EMAILS USING A CRON JOB - Feb 12th, 2023


The information in an on-line directory is only as good as that input by the organizations that are listed.
For that reason, my client wanted to hide any listing that has not been updated in either 6 month or a year intervals.
They also wanted to send emails to each listing organization 30 days before their update was due, another 10 days
before the update was due, and when their listing was automatically hidden form the search results.

This was accomplished by using a reminder email PHP script that is called once a day by a cron job.
My Cron job, executed at 5AM every day, looked like this:

php -q /home3/mrqsygmy/public_html/reminder_email.php

The actual hiding of listings is directly implemented on the search page which is documented at the end of this recipe.


THE INFORMATION UPDATE REMINDER SCRIPT
The script requires the following fields to be created in a single record editor (mine is called 'common_information'):
an 'are mandatory reminders active' checkbox called 'reminder' (checked = Yes, unchecked = No)
a mandatory update duration checkbox called ''mandatory_update_duration' (checked = one year, unchecked = 6 months)
a first reminder day text field called 'first_reminder_day' (for 30 days or your interval)
a second reminder day text field called 'second_reminder_day' (for 10 days or your interval)
a 'first reminder message' text box field called 'first_reminder_message' (for 30 days or your interval)
a 'second reminder message' text box field called 'second_reminder_message' (for 10 days or your interval)
a 'thiird reminder message 'text box field called 'third_reminder_message' (for hidden from directory message)
NOTE: *** It's important that your message includes that they need to log in to and RE-SAVE their account record.***
a 'send test emails only' checkbox called 'send_test_emails_only' (checked = Yes (test email), unchecked = No (live)
a 'test email' text field called 'test_email' (for the email address where you'd like to recieve tests)
a main box background color' text field called 'main_box_background_color' (for formatting the color of the emails)

and a 'test date' date field in the Account record called 'test_date' (the live script depends on the field
'updatedDate' to determine when emails are due. The 'test_email' field in the account record allows for testing
and a 'Hide This Account From Directory Searches and Email Lists' checkbox field in the Account record called 'notAdmin'


Here’s the PHP script that I run once a day to send a information update reminder emails to organizations:

?php $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home3/mrqsygmy/public_html/dbtproviders/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
if (empty($_SERVER['HTTP_HOST']) && isset( $_SERVER['argv'][1])) {
$_SERVER['SERVER_NAME'] = $_SERVER['argv'][1]; // set server name for SwiftMailer Message-ID in cron tasks
(https://forge.typo3.org/issues/24686)
}
// load records
list($common_informationRecords, $common_informationMetaData) = getRecords(array(
'tableName' => 'common_information',
'where' => '',
'allowSearch' => false,
'limit' => '1',
));
$common_informationRecord = @$common_informationRecords[0]; // get first record
<?php list($accountsRecords, $accountsMetaData) = getRecords(array(
'tableName' => 'accounts',
));
?>
<?php $color = $common_informationRecord['main_box_background_color'] ?>
<?php $currentUnixTime = strtotime(date('M jS, Y')); ?>
<?php // $timeGone = 0 ?>
<?php @$first_reminder_day = $common_informationRecord['first_reminder_day'] ;?>
<?php @$first_reminder_day_two = @$first_reminder_day * 86400 ?>
<?php @$second_reminder_day = $common_informationRecord['second_reminder_day'] ;?>
<?php @$second_reminder_day_two = @$second_reminder_day * 86400 ?>
<?php // $timeGone = 0 ?>
<?php $emailCountTwoFour = 0 ?>
<?php $emailCountOneThree = 0 ?>
<?php foreach($accountsRecords as $record) : ?>
<?php $timeGone = 0 ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['test_date'])) . " +6 month") ?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0
|| $common_informationRecord['send_test_emails_only'] == ''):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['updatedDate'])) . " +6 month") ?><?php endif ?>
<?php $sixMonthsFirst = ($sixMonths - $first_reminder_day_two) ?>
<?php $sixMonthsSecond = $sixMonths - $second_reminder_day_two ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $twelveMonths = strtotime(date("M jS, Y",
strtotime($record['test_date'])) . " +1 year") ?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0
|| $common_informationRecord['send_test_emails_only'] == ''):?><?php $twelveMonths = strtotime(date("M jS, Y",
strtotime($record['updatedDate'])) . " +1 year") ?><?php endif ?>
<?php $twelveMonthsFirst = ($twelveMonths - $first_reminder_day_two) ?>
<?php $twelveMonthsSecond = $twelveMonths - $second_reminder_day_two ?>
<?php if ($sixMonthsFirst == $currentUnixTime ):?>
<?php $timeGone = 1 ?>
<?php endif ?>
<?php if ($sixMonthsSecond == $currentUnixTime ):?>
<?php $timeGone = 2 ?>
<?php endif ?>
<?php // elseif ($common_informationRecord['mandatory_update_duration']=='1'):?>
<?php if ($twelveMonthsFirst == $currentUnixTime ):?>
<?php $timeGone = 3 ?>
<?php endif ?>
<?php if ($twelveMonthsSecond == $currentUnixTime ):?>
<?php $timeGone = 4 ?>
<?php endif ?>
<?php // endif?>
<?php if(!@$record['isAdmin'] && $common_informationRecord['reminder'] == 1): // live ?>
<?php if($timeGone==1 || $timeGone==3): ?>
<?php
@$first_reminder_message = $common_informationRecord['first_reminder_message']; // 10 calendar days
@$second_reminder_message = $common_informationRecord['second_reminder_message']; // 30 calendar days
@$practiceName = $record['practice_name'] ;
@
$firstName = $record['contact_first_name'] ;
@
$lastName = $record['contact_last_name'] ;?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $expires = date("M jS, Y",
strtotime($record['test_date'])) ;?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0 ||
$common_informationRecord['send_test_emails_only'] == ''):?><?php $expires = date("M jS, Y",
strtotime($record['updatedDate'])) ;?><?php endif ?>
<?php // ************** START SET PROVIDER VARIABLES AND OUTPUT ************************** ?>
<?php ob_start(); // start capturing output ?>
<?php $first_reminder_message = wordwrap( $first_reminder_message, 70); ?>
<?php echo $first_reminder_message ?>
<?php $output = ob_get_clean(); // stop capturing output ?>
<?php ob_start(); // start capturing output ?>
<?php $second_reminder_message = wordwrap( $second_reminder_message, 70); ?>
<?php echo $second_reminder_message ?>
<?php $output2 = ob_get_clean(); // stop capturing output ?>
<?php //************** END SET PROVIDER VARIABLES AND OUTPUT ************************** ?>
<?php // **************DETERMINE PROVIDER SATUS ******************* ?>
<?php // Send Test or Real emails? ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 0 || $common_informationRecord['send_test_emails_only']
==
''):?>
<?php $the_to = $record['email']; // live?>
<?php elseif ($common_informationRecord['send_test_emails_only'] == 1):?>
<?php @$the_to = $common_informationRecord['test_email']; ?>
<?php endif ?>
<?php
$message = <<<EOF
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type content='text/html; charset=utf-8" />
<style type="text/css">
.special {font-family:Arial; color: rgb(0,0,0); font-size: 1.0em; font-weight: bold; text-decoration: underline;}
.text_font {font-family:Arial; color: rgb(0,0,0); font-size: 1.0em;}
.heading_font {font-family:Arial; color: rgb(0,0,0); font-size: 1.3em;}
.heading_font_blue {font-family:Arial; color: rgb(0,0,255); font-size: 1.3em;}
</style>
</head>
<body bgcolor="#$color">
<table style='background-color: #$color;' width='100%' align='center' border='0' >
<tr>
<td align='left' >
<table style='background-color: #$color;' width='70%' align='center' border='0' >
<tr>
<td align='left' >
<div align='left'><img src='http://www.dbtproviders.com/images/DBT_email_masthead.png' style='border:hidden;
width:489px; height:88px;'/></div>
<div align='left' class='text_font'>
Hello $firstName $lastName,


$output \r\n
Best,

The DBT Provider Directory Team
\r\n\r\n</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
EOF;

$the_from = "no-reply@dbtproviders.com";
$the_subject = "A DBT Provider profile mandatory update for $practiceName is due about $first_reminder_day days from
now. You can update your profile at https://dbtproviders.com/provider_profile.php";

$mailArray = array(
'to' => $the_to,
'from' => $the_from,
'subject' => $the_subject,
'html' => $message
);
$errors = sendMessage($mailArray);
// delay execution by .2 sec
usleep(200000);
// reset max_execution_time to 30 sec
set_time_limit(30);
?>
<?php endif ;?>
<?php endif // end test timegone 1 or 3?>
<?php endforeach?>
<?php foreach($accountsRecords as $record) : ?>
<?php $timeGone = 0 ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['test_date'])) . " +6 month")?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0
|| $common_informationRecord['send_test_emails_only'] == ''):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['updatedDate'])) . " +6 month")?><?php endif ?>
<?php $sixMonthsFirst = ($sixMonths - $first_reminder_day_two) ?>
<?php $sixMonthsSecond = $sixMonths - $second_reminder_day_two ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $twelveMonths = strtotime(date("M jS, Y",
strtotime($record['test_date'])) . " +1 year") ?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0
|| $common_informationRecord['send_test_emails_only'] == ''):?><?php $twelveMonths = strtotime(date("M jS, Y",
strtotime($record['updatedDate'])) . " +1 year") ?><?php endif ?>
<?php $twelveMonthsFirst = ($twelveMonths - $first_reminder_day_two) ?>
<?php $twelveMonthsSecond = $twelveMonths - $second_reminder_day_two ?>
<?php if ($sixMonthsFirst == $currentUnixTime ):?>
<?php $timeGone = 1 ?>
<?php $timeGone = 5 ?>
<?php endif ?>
<?php if ($sixMonthsSecond == $currentUnixTime ):?>
<?php $timeGone = 2 ?>
<?php $timeGone = 5 ?>
<?php endif ?>
<?php if ($twelveMonthsFirst == $currentUnixTime ):?>
<?php $timeGone = 3 ?>
<?php $timeGone = 5 ?>
<?php endif ?>
<?php if ($twelveMonthsSecond == $currentUnixTime ):?>
<?php $timeGone = 4 ?>
<?php $timeGone = 5 ?>
<?php endif ?>
<?php if(!@$record['isAdmin'] && $common_informationRecord['reminder'] == 1):?>
<?php if($timeGone==2 || $timeGone==4):?>
<?php
@$first_reminder_message = $common_informationRecord['first_reminder_message']; // 10 calendar days
@$second_reminder_message = $common_informationRecord['second_reminder_message']; // 30 calendar days
@$practiceName = $record['practice_name'] ;
@
$firstName = $record['contact_first_name'] ;
@
$lastName = $record['contact_last_name'] ;?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $expires = date("M jS, Y",
strtotime($record['test_date'])) ;?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0 ||
$common_informationRecord['send_test_emails_only'] == ''):?><?php $expires = date("M jS, Y",
strtotime($record['updatedDate'])) ;?><?php endif ?>
<?php // ************** START SET PROVIDER VARIABLES AND OUTPUT ************************** ?>
<?php ob_start(); // start capturing output ?>
<?php $first_reminder_message = wordwrap( $first_reminder_message, 70); ?>
<?php echo $first_reminder_message ?>
<?php $output = ob_get_clean(); // stop capturing output ?>
<?php ob_start(); // start capturing output ?>
<?php $second_reminder_message = wordwrap( $second_reminder_message, 70); ?>
<?php echo $second_reminder_message ?>
<?php $output2 = ob_get_clean(); // stop capturing output ?>
<?php //************** END SET PROVIDER VARIABLES AND OUTPUT ************************** ?>
<?php // **************DETERMINE PROVIDER SATUS ******************* ?>
<?php // Send Test or Real emails? ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 0 || $common_informationRecord['send_test_emails_only']
==
''):?>
<?php $the_toa = $record['email']; // live?>
<?php elseif ($common_informationRecord['send_test_emails_only'] == 1):?>
<?php @$the_toa = $common_informationRecord['test_email']; ?>
<?php endif ?>
<?php
$message2 = <<<EOF
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type content='text/html; charset=utf-8" />
<style type="text/css">
.special {font-family:Arial; color: rgb(0,0,0); font-size: 1.0em; font-weight: bold; text-decoration: underline;}
.text_font {font-family:Arial; font-size: 1.0em;}
.text_font {font-family:Arial; color: rgb(0,0,0); font-size: 1.0em;}
.heading_font_red {font-family:Arial; color: rgb(255,0,0); font-size: 1.3em;}
.heading_font {font-family:Arial; color: rgb(0,0,0); font-size: 1.3em;}
.heading_font_blue {font-family:Arial; color: rgb(0,0,255); font-size: 1.3em;}
</style>
</head>
<body bgcolor="#$color">
<table style='background-color: #$color;' width='100%' align='center' border='0' >
<tr>
<td align='left' >
<table style='background-color: #$color;' width='70%' align='center' border='0' >
<tr>
<td align='left' >
<div align='left'><img src='http://www.dbtproviders.com/images/DBT_email_masthead.png' style='border:hidden;
width:489px; height:88px;'/></div>
<div align='left' class='text_font'>
Hello $firstName $lastName,

<span class='heading_font_blue'>This is your final courtesy reminder.</span>

<span class='heading_font'>You must verify/update the information in your DBT Provider profile within the next 10
days, or your listing will be hidden from the DBT Provider Directory.Your information is never deleted, and you can
reinstate your listing at any time by logging in to you provider profile at
https://dbtproviders.com/provider_profile.php and updating your information. </span>
$output2 \r\n
Best,

The DBT Provider Directory Team
\r\n
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
EOF;

$the_from = "no-reply@dbtproviders.com";
$the_subject = "A DBT Provider profile for $practiceName is due for a mandatory update about $second_reminder_day days
from now. You can update your profile at https://dbtproviders.com/provider_profile.php";

$mailArray = array(
'to' => $the_toa,
'from' => $the_from,
'subject' => $the_subject,
'html' => $message2
);
$errors = sendMessage($mailArray);
// delay execution by .2 sec
usleep(200000);
// reset max_execution_time to 30 sec
set_time_limit(30);
?>
<?php endif ?>
<?php endif // end test timegone 2 or 4?>
<?php endforeach ?>
<?php foreach($accountsRecords as $record) : ?>
<?php $timeGone = 0 ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['test_date'])) . " +6 month") ?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0
|| $common_informationRecord['send_test_emails_only'] == ''):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['updatedDate'])) . " +6 month") ?><?php endif ?>
<?php $sixMonthsFirst = ($sixMonths - $first_reminder_day_two) ?>
<?php $sixMonthsSecond = $sixMonths - $second_reminder_day_two ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $twelveMonths = strtotime(date("M jS, Y",
strtotime($record['test_date'])) . " +1 year")?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0 ||
$common_informationRecord['send_test_emails_only'] == ''):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['updatedDate'])) . " +6 month") ?><?php endif ?>
<?php $twelveMonthsFirst = ($twelveMonths - $first_reminder_day_two) ?>
<?php $twelveMonthsSecond = $twelveMonths - $second_reminder_day_two ?>
<?php if ($sixMonthsFirst == $currentUnixTime ):?>
<?php $timeGone = 1 ?>
<?php $timeGone = 5 ?>
<?php endif ?>
<?php if ($sixMonthsSecond == $currentUnixTime ):?>
<?php $timeGone = 2 ?>
<?php $timeGone = 5 ?>
<?php endif ?>
<?php if ($twelveMonthsFirst == $currentUnixTime ):?>
<?php $timeGone = 3 ?>

<?php endif ?>
<?php if ($twelveMonthsSecond == $currentUnixTime ):?>
<?php $timeGone = 4 ?>
<?php $timeGone = 5 ?>
<?php endif ?>
<?php if ($sixMonths == $currentUnixTime ):?>
<?php $timeGone = 5 ?>
<?php endif ?>
<?php if ($twelveMonths == $currentUnixTime ):?>
<?php $timeGone = 6 ?>
<?php endif ?>
<?php // endif?>
<?php if(!@$record['isAdmin'] && $common_informationRecord['reminder'] == 1):?>
<?php if($timeGone==5 || $timeGone==6):?>
<?php
@$first_reminder_message = $common_informationRecord['first_reminder_message']; // 10 calendar days
@$second_reminder_message = $common_informationRecord['second_reminder_message']; // 30 calendar days
@$third_reminder_message = $common_informationRecord['third_reminder_message']; // listing hidden
@$practiceName = $record['practice_name'] ;
@
$firstName = $record['contact_first_name'] ;
@
$lastName = $record['contact_last_name'] ;?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $expires = date("M jS, Y",
strtotime($record['test_date']));?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0 ||
$common_informationRecord['send_test_emails_only'] == ''):?><?php $expires = date("M jS, Y",
strtotime($record['updatedDate']));?><?php endif ?>
<?php // ************** START SET PROVIDER VARIABLES AND OUTPUT ************************** ?>
<?php ob_start(); // start capturing output ?>
<?php $first_reminder_message = wordwrap( $first_reminder_message, 70); ?>
<?php echo $first_reminder_message ?>
<?php $output = ob_get_clean(); // stop capturing output ?>
<?php ob_start(); // start capturing output ?>
<?php $second_reminder_message = wordwrap( $second_reminder_message, 70); ?>
<?php echo $second_reminder_message ?>
<?php $output2 = ob_get_clean(); // stop capturing output ?>
<?php ob_start(); // start capturing output ?>
<?php $third_reminder_message = wordwrap( $third_reminder_message, 70); ?>
<?php echo $third_reminder_message ?>
<?php $output3 = ob_get_clean(); // stop capturing output ?>
<?php //************** END SET PROVIDER VARIABLES AND OUTPUT ************************** ?>
<?php // **************DETERMINE PROVIDER SATUS ******************* ?>
<?php // Send Test or Real emails? ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 0 || $common_informationRecord['send_test_emails_only']
==
''):?>
<?php $the_tob = $record['email']; // live?>
<?php elseif ($common_informationRecord['send_test_emails_only'] == 1):?>
<?php @$the_tob = $common_informationRecord['test_email']; ?>
<?php endif ?>
<?php
$message3 = <<<EOF
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type content='text/html; charset=utf-8" />
<style type="text/css">
.special {font-family:Arial; color: rgb(0,0,0); font-size: 1.0em; font-weight: bold; text-decoration: underline;}
.text_font {font-family:Arial; font-size: 1.0em;}
.text_font {font-family:Arial; color: rgb(0,0,0); font-size: 1.0em;}
.heading_font_red {font-family:Arial; color: rgb(255,0,0); font-size: 1.3em;}
.heading_font {font-family:Arial; color: rgb(0,0,0); font-size: 1.3em;}
.heading_font_blue {font-family:Arial; color: rgb(0,0,255); font-size: 1.3em;}
</style>
</head>
<body bgcolor="#$color">
<table style='background-color: #$color;' width='100%' align='center' border='0' >
<tr>
<td align='left' >
<table style='background-color: #$color;' width='70%' align='center' border='0' >
<tr>
<td align='left' >
<div align='left'><img src='http://www.dbtproviders.com/images/DBT_email_masthead.png' style='border:hidden;
width:489px; height:88px;'/></div>
<div align='left' class='text_font'>
Hello $firstName $lastName,

<span class='heading_font_blue'>Your Directory listing has been hidden from the search results in the DBT Provider
Directory.</span>

<span class='heading_font'>Until you verify/update the information in your DBT Provider profile your listing will
remain hidden from the DBT Provider Directory.Your information is never deleted, and you can reinstate your listing at
any time by logging in to you provider profile at https://dbtproviders.com/provider_profile.php and updating your
information.</span>
$output3 \r\n
Best,

The DBT Provider Directory Team
\r\n
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
EOF;

$the_from = "no-reply@dbtproviders.com";
$the_subject = "The DBT Provider Directory Listing for $practiceName has been hidden from the Directory until update
your profile at https://dbtproviders.com/provider_profile.php";

$mailArray = array(
'to' => $the_tob,
'from' => $the_from,
'subject' => $the_subject,
'html' => $message3
);
$errors = sendMessage($mailArray);
// delay execution by .2 sec
usleep(200000);
// reset max_execution_time to 30 sec
set_time_limit(30);
?>
<?php endif ?>
<?php endif // end test timegone 2 or 4?>
<?php endforeach ?>
<?php
$crontext = "Reminder Run at ".date("r")."\n" ;
$folder = substr($_SERVER['SCRIPT_FILENAME'],0,strrpos($_SERVER['SCRIPT_FILENAME'],"/")+1);
$filename = $folder."cron_test.txt" ;
$fp = fopen($filename,"a") or die("Open error!");
fwrite($fp, $crontext) or die("Write error!");
fclose($fp);
echo
"Wrote to ".$filename."\n\n" ;
?>


The actual hiding of the listings is accomplished by the following code on the search page:


<?php // load records from 'accounts'
list($accountsRecords, $accountsMetaData) = getRecords(array(
'tableName' => 'accounts',
'loadUploads' => true,
'allowSearch' => true,

));

// load records from ''common_information'
list($common_informationRecords, $common_informationMetaData) = getRecords(array(
'tableName' => 'common_information',
'where' => '',
'allowSearch' => false,
'limit' => '1',
));
$common_informationRecord = @$common_informationRecords[0]; // get first record
?>
<?php $currentUnixTime = strtotime(date('M jS, Y')); ?>

<?php // if(@$_REQUEST['save']):?>
<?php foreach($accountsRecords as $record) : ?>
<?php $timeGone = 0 ?>
<?php $sixMonths = '0' ?>
<?php $twelveMonths = '0' ?>
<?php if(!@$record['isAdmin'] && $common_informationRecord['reminder'] == 1): // live ?>

<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['test_date'])). " +6 month" ) ?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0
|| $common_informationRecord['send_test_emails_only'] == ''):?><?php $sixMonths = strtotime(date("M jS, Y",
strtotime($record['updatedDate'])). " +6 month" ) ?>
<?php endif ?>
<?php if ($common_informationRecord['send_test_emails_only'] == 1 ):?><?php $twelveMonths = strtotime(date("M jS, Y",
strtotime($record['test_date'])). " +1 year" ) ?><?php elseif ($common_informationRecord['send_test_emails_only'] == 0
|| $common_informationRecord['send_test_emails_only'] == ''):?><?php $twelveMonths = strtotime(date("M jS, Y",
strtotime($record['updatedDate'])). " +1 year" ) ?><?php endif ?>
<?php endif ?>

<?php if ($common_informationRecord['mandatory_update_duration']=='1'): // 12 months?>
<?php if ($twelveMonths >= $currentUnixTime ):?>
<?php $timeGone = 2 ?>
<?php endif ?>
<?php endif ?>

<?php if ($common_informationRecord['mandatory_update_duration']=='0' ||
$common_informationRecord['mandatory_update_duration']==''): // 6 months?>
<?php if ($sixMonths >= $currentUnixTime ):?>
<?php $timeGone = 1 ?>
<?php endif ?>
<?php endif ?>

<?php if(!$record['isAdmin'] && !$record['notAdmin'] == '1' && ( $timeGone == 1) || ( $timeGone == 2) &&
(!empty((int)
$record['test_date'] ) || !empty((int)$record['updatedDate'] ))):?>
<?php echo htmlencode($record['practice_name']) ?>

Test Date = <?php echo date("M jS, Y ", strtotime($record['test_date'])) // hide and remove for live ?>
Current Date = <?php echo date("M jS, Y") // hide and remove for live ?>
Time Gone = <?php echo $timeGone // hide and remove for live ?>
<?php endif ?>
<?php endforeach ?>

<?php // endif ?>




The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service