以下是我的源码
<?
$duedate="05-03-2007";
$date=split("-",$duedate);
$todaydate=date("d-m-Y");
$firstreminder=date("d-m-Y",mktime(0,0,0,$date[1],$date[0]+7,$date[2]));
$secondreminder=date("d-m-Y",mktime(0,0,0,$date[1]+1,$date[0]+7,$date[2]));
$finalnotice=date("d-m-Y",mktime(0,0,0,$date[1]+1,$date[0]+14,$date[2]));
$forthsche=date("d-m-Y",mktime(0,0,0,$date[1]+1,$date[0]+21,$date[2]));
echo "<table>";
echo "<tr><td>Date name</td><td>Date</td><td>Strtotime</td></tr>";
echo "<tr><td>Duedate</td><td>".$duedate." </td><td> ". strtotime($duedate)."</td></tr>";
echo "<tr><td>Today</td><td>".$todaydate." </td><td> ". strtotime($todaydate)."</td></tr>";
echo "<tr><td>Firstreminder</td><td>". $firstreminder." </td><td> ". strtotime($firstreminder)."</td></tr>";
echo "<tr><td>Secondreminder</td><td>".$secondreminder." </td><td> ". strtotime($secondreminder)."</td></tr>";
echo "<tr><td>Finalnotice</td><td>".$finalnotice." </td><td> ". strtotime($finalnotice)."</td></tr>";
echo "<tr><td>Forthsche</td><td>".$forthsche." </td><td> ". strtotime($forthsche)."</td></tr>";
if(strtotime($todaydate)>strtotime($firstreminder) && strtotime($todaydate)<strtotime($secondreminder))
{
echo"<tr><td>Status</td><td>First reminder</td></tr>";
}
elseif(strtotime($todaydate)>strtotime($secondreminder) && strtotime($todaydate)<strtotime($finalnotice))
{
echo"<tr><td>Status</td><td>Second reminder</td></tr>";
}
elseif(strtotime($todaydate)>strtotime($finalnotice) && strtotime($todaydate)<strtotime($forthsche))
{
echo"<tr><td>Status</td><td>final notice</td></tr>";
}
elseif(strtotime($todaydate)>strtotime($forthsche))
{
echo"<tr><td>Status</td><td>forth schedule</td></tr>";
}
else
{
echo"<tr><td>Status</td><td>Not yet expired</td></tr>";
} |