File manager - Edit - /home/custbahd/irungikitchen.com/admin/earnings/modal.php
Back
<?php $sql = "SELECT order_code, COUNT(DISTINCT order_code), COUNT(DISTINCT email), quantity, SUM(quantity), name, price, subtotal, SUM(subtotal), total, timestamp FROM checkout WHERE YEAR(timestamp)='$year' GROUP BY MONTH(timestamp) ORDER BY MONTH(timestamp) ASC"; //use for MySQLi-OOP $query = $conn->query($sql); while($row = $query->fetch_assoc()){ echo '<tr>'; echo '<td>'.number_format($top_count++).'</td>'; echo '<td>'.date("M", strtotime($row["timestamp"])).'</td>'; echo '<td>'; echo ''.$row["COUNT(DISTINCT order_code)"].''; if ($row["COUNT(DISTINCT order_code)"]==1) { echo ' order'; } else { echo ' orders'; } echo '</td>'; echo '<td>'; echo ''.$row["SUM(quantity)"].''; if ($row["SUM(quantity)"]==1) { echo ' item'; } else { echo ' items'; } echo '</td>'; echo '<td>'; echo ''.$row["COUNT(DISTINCT email)"].''; if ($row["COUNT(DISTINCT email)"]==1) { echo ' client'; } else { echo ' clients'; } echo '</td>'; echo '<td>UGX '.number_format($row["SUM(subtotal)"]).'</td>'; echo '<td class="text-center"><a href="../orders/history/month/?month='.date("M", strtotime($row["timestamp"])).'"><i class="fa fa-caret-right"></i></a></td>'; echo '</tr>'; } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 2.6 |
proxy
|
phpinfo
|
Settings