added badge and improved styling on order status, fixed profile size on new customers and new vendors

This commit is contained in:
jouls 2024-05-15 18:14:16 +08:00
parent e1d31a0a47
commit a5b1d41094
1 changed files with 37 additions and 16 deletions

View File

@ -1078,21 +1078,40 @@ $allSignups = array_merge($all_customers, $all_vendors);
$orderStatus = strtoupper($val['status']);
$returnStatus = strtoupper($val['return_order']['status']);
$style = '';
$textColor = '';
$backgroundColor = '';
$statusClass = '';
if ($orderStatus === 'UNPAID' || $orderStatus === 'RETURNED') {
$statusClass = '#cb3747';
} elseif ($orderStatus === 'TO PAY') {
$statusClass = '#50d7ab';
} elseif ($orderStatus === 'TO SHIP') {
$statusClass = '#9586cd';
}
elseif ($orderStatus === 'TO RECEIVE') {
$statusClass = '#ffc319';
} elseif ($orderStatus === 'COMPLETED') {
$statusClass = '#88aaf3';
switch ($orderStatus) {
case 'TO SHIP':
$backgroundColor = '#8061ef';
$textColor = 'white';
break;
case 'TO PAY':
$backgroundColor = '#1E6E58';
$textColor = 'white';
break;
case 'TO RECEIVE':
$backgroundColor = '#FFD700';
$textColor = 'black';
break;
case 'COMPLETED':
$backgroundColor = '#4c84ff';
$textColor = 'white';
break;
case 'RETURNED':
$backgroundColor = '#ff7b7b';
$textColor = 'white';
break;
default:
$backgroundColor = '#464646';
$textColor = 'white';
}
$style = "display: flex; height: 15px; font-weight: bold;
width: 90px; font-size: 10px !important; padding: 10px;
justify-content: center; align-items: center;
background-color: $backgroundColor; border-radius: 30px; color: $textColor;";
if ($formattedOrderDate == $currentDate) {
$ordersDisplayed = true;
@ -1105,7 +1124,7 @@ $allSignups = array_merge($all_customers, $all_vendors);
<td><?php echo $vendorName ?></td>
<td> <?php echo number_format($totalAmount, 2, '.', ',') ?></td>
<td><?php echo $displayDate ?></td>
<td><span style="color: <?php echo $statusClass; ?>"><?php echo $orderStatus ?></span></td>
<td><span style="<?php echo $style; ?>"><?php echo $orderStatus ?></span></td>
<td><?php echo $returnStatus?: "NONE" ?></td>
</tr>
@ -1180,7 +1199,8 @@ $allSignups = array_merge($all_customers, $all_vendors);
<div class="media">
<div class="media-image mr-3 rounded-circle">
<img loading="lazy"
class="profile-img rounded-circle w-45"
class="profile-img rounded-circle"
style="width: 50px; height: 50px; border-style: solid; border-color: #FFAA00;"
src="<?php echo $imageUrl !== null ? $imageUrl : 'assets/img/user/u1.jpg'; ?>"
alt="customer image">
</div>
@ -1259,7 +1279,8 @@ $allSignups = array_merge($all_customers, $all_vendors);
<div class="media">
<div class="media-image mr-3 rounded-circle">
<img loading="lazy"
class="profile-img rounded-circle w-45"
class="profile-img rounded-circle"
style="width: 50px; height: 50px; border-style: solid; border-color: #FFAA00;"
src="<?php echo $imageUrl !== null ? $imageUrl : 'assets/img/user/u1.jpg'; ?>"
alt="customer image">
</div>