cakephp - Check the expire date of every rows -


i'll try explain problem:

i have 1 model attorney have many rows. every attorney have date expire in date coloumn. ex: 15/09/2013

i need check, every day, if attorney expire in 30 days.

in other words, need check, every day, date of every attorney registered , if date of expire less 30 days, , grab id of attorney in situation , execute action.

i have nothing. how this?

you need use cron job execute these task every day.

to check if record expire in 30 days, use php strtotime calc final date. then, should compare if expire date lower or equals:

date('y-m-d', strtotime( date('y-m-d') . ' +30 day' )); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -