<?php
include("../../connect.php");
date_default_timezone_set ("Singapore"); 
$ldate=date("d-m-Y", time());

$query=mysql_query("select * from company where id='C0000001'");
$display=mysql_fetch_array($query);
$old=$display['expireDate'];

list($aaa1, $bbb1, $ccc1) = split('[/.-]', $old);
list($aaa2, $bbb2, $ccc2) = split('[/.-]', $ldate);
if ((strtotime($ccc1."-".$bbb1."-".$aaa1)) > (strtotime($ccc2."-".$bbb2."-".$aaa2))){
	$expire = $old;	
}else{
	$expire = $ldate;
}

echo $expire;


include("../../closeconnection.php");
?>