Here's the code so far for the whole thing:
Code: Select all
$today = (date('Y-m-d'));
$regdate = strtotime($row->subscribed);
$regdatecomplete = date( "Y-m-d", ($regdate) );
$subDateMicrotime = strtotime($regdatecomplete);
$fortnight = date( "Y-m-d", ($subDateMicrotime + (86400*14)) );
$year = substr("$row->subscribed",-10,4);
$month = substr("$row->subscribed",-5,2);
$day = substr("$row->subscribed",-2,2);
$today = (date('Y-m-d'));
$sysyear = substr("$today",-10,4);
$sysmonth = substr("$today",-5,2);
$sysday = substr("$today",-2,2);
$endyear = $year;
$endmonth = ($month + 1);
$endday = $day;
if
(($month == "08" && $sysmonth == "08") ||
($today <= $fortnight) ||
($sysyear >= $endyear && $sysmonth <= $endmonth && $sysday >= $endday))
Here's the code.
It asks if they registered in August and if it is still Aug. That's simple.
At the end, it asks about the system day, that's fine.
It's the bit about the fortnight which is the pain here. I think I am grabbing the subcription date fromthe db wrong somehow.