application/controllers/Tools.php
/**
     * Check if it's time to send an email service reminder for each record
     * 
     * @param type $reminder
     * @return int
     */
Check if it's time to send an email service reminder for each record

@param type $reminder
@return int
Check if it ' s time to send an email service reminder for each record @param type $reminder @return int
protected function isTimeToPMSendServiceEmailReminder($reminder) {
        $send_email = 0;
        if($reminder['reminder_date_sent']==0 &&
            $reminder['warn_on_units']=="Days" &&
            date("Y-m-d") >= date('Y-m-d', strtotime($reminder['reminder_date_created']. ' + ' . $reminder['warn_on_quantity'] . ' days'))) {
             $send_email = 1;
         }
         if($reminder['reminder_date_sent']==0 &&
            $reminder['warn_on_units']=="SMR" &&
            $reminder['last_smr_recorded'] >= $reminder['warn_on_quantity']) {
             $send_email = 1;
         }
         if($reminder['reminder_date_sent']==0 &&
            $reminder['warn_on_units']=="Miles" &&
            $reminder['last_smr_recorded'] >= $reminder['warn_on_quantity']) {
             $send_email = 1;
         }
         return $send_email;
    }
protected function isTimeToPMSendServiceEmailReminder ( $ reminder ) { $ send_email = 0 ; if ( $ reminder [ 'reminder_date_sent' ] == 0 && $ reminder [ 'warn_on_units' ] == " Days " && date ( " Y-m-d " ) >= date ( 'Y-m-d' , strtotime ( $ reminder [ 'reminder_date_created' ] . ' + ' . $ reminder [ 'warn_on_quantity' ] . ' days' ) ) ) { $ send_email = 1 ; } if ( $ reminder [ 'reminder_date_sent' ] == 0 && $ reminder [ 'warn_on_units' ] == " SMR " && $ reminder [ 'last_smr_recorded' ] >= $ reminder [ 'warn_on_quantity' ] ) { $ send_email = 1 ; } if ( $ reminder [ 'reminder_date_sent' ] == 0 && $ reminder [ 'warn_on_units' ] == " Miles " && $ reminder [ 'last_smr_recorded' ] >= $ reminder [ 'warn_on_quantity' ] ) { $ send_email = 1 ; } return $ send_email ; }
Check if it's time to send an email service reminder for each record
Check if it ' s time to send an email service reminder for each record