In my system, I have a section for membership details. I want to be able to display a membership expiry status (eg. Current, Due to expire, and Expired) for each member. I already have expiry dates for each of them. I just need a way for the system to check what the expiry date is and display the membership status, and I have no idea how to do it.
Will be great if someone could post a detailed explanation on how to do this.
Member model:
<?php
App::uses('AppModel', 'Model');
class Member extends AppModel {
public $displayField = 'id';
public $belongsTo = array(
'Contact' => array(
'className' => 'Contact',
'foreignKey' => 'contact_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
}
Member table has:
id
member_type
year_joined
date_renewed
card_issue_date
renewal_due
contact_id
Membership goes by a yearly basis. And functions just like any club membership. I need the index page and the view page to display the status of each membership by checking the "renewal_due" which is the expiry date for the membership. The status of the membership should show "Current" for membership that are still valid/not expired, "Due to Expire" for membership that is due to expiry in a month's time, and "Expired" for those that have expired.
If you need any further information, please feel free to ask. I'm not sure what kind of information is needed for this to work.