subscribers list : ps
This commit is contained in:
parent
f05a7e4e28
commit
f6a085df58
@ -51,16 +51,26 @@
|
|||||||
$from_date = date('d/m/Y', strtotime($row['from_subscription']));
|
$from_date = date('d/m/Y', strtotime($row['from_subscription']));
|
||||||
$to_date = date('d/m/Y', strtotime($row['to_subscription']));
|
$to_date = date('d/m/Y', strtotime($row['to_subscription']));
|
||||||
$daysRemaining = (int)$row['subscription_in_days'];
|
$daysRemaining = (int)$row['subscription_in_days'];
|
||||||
if ($daysRemaining <= 0) {
|
$fromDateTime = (new DateTime($row['from_subscription']))->format('Y-m-d');
|
||||||
|
$toDateTime = (new DateTime($row['to_subscription']))->format('Y-m-d');
|
||||||
|
$currentDate = (new DateTime())->format('Y-m-d');
|
||||||
|
if ($currentDate === $toDateTime) {
|
||||||
|
$class = 'text-danger';
|
||||||
|
$message = "Expired on Today";
|
||||||
|
} elseif ($currentDate > $toDateTime) {
|
||||||
$class = 'text-danger';
|
$class = 'text-danger';
|
||||||
$message = "Expired";
|
$message = "Expired";
|
||||||
} elseif ($daysRemaining <= 7) {
|
|
||||||
$s = $daysRemaining == 1 ? "" : "s";
|
|
||||||
$class = 'text-warning';
|
|
||||||
$message = "Expire in $daysRemaining day".$s;
|
|
||||||
} else {
|
} else {
|
||||||
$class = 'text-success';
|
if ($daysRemaining == 1) {
|
||||||
$message = $daysRemaining ."days until Expiration";
|
$class = 'text-warning';
|
||||||
|
$message = "Expires in 1 day";
|
||||||
|
} elseif ($daysRemaining <= 7) {
|
||||||
|
$class = 'text-warning';
|
||||||
|
$message = "Expires in $daysRemaining days";
|
||||||
|
} else {
|
||||||
|
$class = 'text-success';
|
||||||
|
$message = "$daysRemaining days until expiration";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user