- $sql_recurring_expense_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_expense_amount) AS recurring_expense_monthly_total FROM recurring_expenses WHERE recurring_expense_status = 1 AND recurring_expense_frequency = 'month' AND YEAR(recurring_expense_created_at) <= $year");
- $row = mysqli_fetch_array($sql_recurring_expense_monthly_total);
- $recurring_expense_monthly_total = floatval($row['recurring_expense_monthly_total']) + ($recurring_expense_yearly_total / 12);
+ 0
+ || mysqli_num_rows($sql_certificates_expiring) > 0
+ || mysqli_num_rows($sql_asset_warranties_expiring) > 0
+ || mysqli_num_rows($sql_asset_retire) > 0
+ || mysqli_num_rows($sql_licenses_expiring) > 0
+ ) {
- if ($config_module_enable_ticketing && $config_module_enable_accounting) {
- $sql_unbilled_tickets = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS unbilled_tickets FROM tickets WHERE ticket_closed_at IS NOT NULL AND ticket_billable = 1 AND ticket_invoice_id = 0 AND YEAR(ticket_created_at) = $year");
- $row = mysqli_fetch_array($sql_unbilled_tickets);
- $unbilled_tickets = intval($row['unbilled_tickets']);
- } else {
- $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(recurring_id) AS recurring_invoices_added FROM recurring WHERE YEAR(recurring_created_at) = $year"));
- $recurring_invoices_added = intval($row['recurring_invoices_added']);
- }
+ while ($row = mysqli_fetch_array($sql_domains_expiring)) {
+ $domain_id = intval($row['domain_id']);
+ $client_id = intval($row['domain_client_id']);
+ $domain_name = nullable_htmlentities($row['domain_name']);
+ $domain_expire = nullable_htmlentities($row['domain_expire']);
+ $domain_expire_human = timeAgo($row['domain_expire']);
- $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(client_id) AS clients_added FROM clients WHERE YEAR(client_created_at) = $year AND client_archived_at IS NULL"));
- $clients_added = intval($row['clients_added']);
+ ?>
+
+
+
+ --
+
+
- $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(vendor_id) AS vendors_added FROM vendors WHERE YEAR(vendor_created_at) = $year AND vendor_client_id = 0 AND vendor_template = 0 AND vendor_archived_at IS NULL"));
- $vendors_added = intval($row['vendors_added']);
-?>
-
-
-
-
+ while ($row = mysqli_fetch_array($sql_certificates_expiring)) {
+ $certificate_id = intval($row['certificate_id']);
+ $client_id = intval($row['certificate_client_id']);
+ $certificate_name = nullable_htmlentities($row['certificate_name']);
+ $certificate_expire = nullable_htmlentities($row['certificate_expire']);
+ $certificate_expire_human = timeAgo($row['certificate_expire']);
-
-
+ ?>
+
+
+
+ --
+
+
-
-
+
-
-
-
-
-
Monthly Recurring Expense
-
-
-
-
-
-
-
+ while ($row = mysqli_fetch_array($sql_asset_warranties_expiring)) {
+ $asset_id = intval($row['asset_id']);
+ $client_id = intval($row['asset_client_id']);
+ $asset_name = nullable_htmlentities($row['asset_name']);
+ $asset_warranty_expire = nullable_htmlentities($row['asset_warranty_expire']);
+ $asset_warranty_expire_human = timeAgo($row['asset_warranty_expire']);
-
-
-
-
-
+ ?>
+
+
+
+ --
+
-
-
-
-
-
-
-
+
-
+ 0) {
+ echo "
Retired Assets
";
+ }
+ while ($row = mysqli_fetch_array($sql_asset_retire)) {
+ $asset_id = intval($row['asset_id']);
+ $client_id = intval($row['asset_client_id']);
+ $asset_name = nullable_htmlentities($row['asset_name']);
+ $asset_install_date = nullable_htmlentities($row['asset_install_date']);
+ $asset_install_date_human = timeAgo($row['asset_install_date']);
-
+ ?>
+
+
+
+ --
+
-
+
-
+
-
-
+ while ($row = mysqli_fetch_array($sql_licenses_expiring)) {
+ $software_id = intval($row['software_id']);
+ $client_id = intval($row['software_client_id']);
+ $software_name = nullable_htmlentities($row['software_name']);
+ $software_expire = nullable_htmlentities($row['software_expire']);
+ $software_expire_human = timeAgo($row['software_expire']);
-