diff --git a/accounts.php b/accounts.php index 2a0f2019..4fe99e0e 100644 --- a/accounts.php +++ b/accounts.php @@ -1,110 +1,110 @@ - $sb, 'o' => $o))); -$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM accounts +$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM accounts WHERE account_name LIKE '%$q%' AND company_id = $session_company_id ORDER BY $sb $o LIMIT $record_from, $record_to"); -$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); +$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?> -
| Name | -Color | -Action | -
|---|---|---|
| - | - | - | -
| Name | - -Type | - - -Make/Model | - - -Serial Number | - - -Operating System | - -Install Date | - -Assigned To | - -Location | -Status | -Action | -
|---|---|---|---|---|---|---|---|---|---|
|
-
-
- 0) {
- ?>
-
-
-
-
-
-
-
-
-
-
-
- - -
-
-
-
-
-
-
-
-
-
+
+
+
+ s">
+
+
+
+
+
+
-
+ All Assets
+ 0) { ?>
+ Workstations
+
+ 0) { ?>
+ Servers
+
+ 0) { ?>
+ Virtual
+
+ 0) { ?>
+ Network
+
+ 0) { ?>
+ Other
+
-
-
-
-
-
-
-
- |
-
- - - - | - - - | - - - | - - | - - | - - | - | - |
-
-
-
-
- Interfaces
- Edit
- Copy
- 0) { ?>
- Documents ()
-
- 0) { ?>
- Tickets ()
-
-
-
- Archive
- Delete
-
-
- |
-
| Name | + +Type | + + +Make/Model | + + +Serial Number | + + +Operating System | + +Install Date | + +Assigned To | + +Location | +Status | +Action | +
|---|---|---|---|---|---|---|---|---|---|
|
+
+
+ 0) {
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ + + + | + + + | + + + | + + | + + | + + | + | + |
+
+
+
+
+ Interfaces
+ Edit
+ Copy
+ 0) { ?>
+ Documents ()
+
+ 0) { ?>
+ Tickets ()
+
+
+
+ Archive
+ Delete
+
+
+ |
+
| Name | -Type | -Make/Model | -Serial Number | -Operating System | -Install Date | -Status | -Action | -
|---|---|---|---|---|---|---|---|
| - - | -- | - | - | - | - | - |
-
-
-
-
- |
-
| Name | -Username | -Password | -OTP | -URI | -Action | -
|---|---|---|---|---|---|
| - - - - - | -- | - - | -- | - | - - | -
| Name | +Type | +Make/Model | +Serial Number | +Operating System | +Install Date | +Status | +Action | +
|---|---|---|---|---|---|---|---|
| + + | ++ | + | + | + | + | + |
+
+
+
+
+ |
+
| Name | +Username | +Password | +OTP | +URI | +Action | +
|---|---|---|---|---|---|
| + + + + + | ++ | + + | ++ | + | + + | +
| 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND company_id = $session_company_id"); + $sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenue_category_id > 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND company_id = $session_company_id"); $row = mysqli_fetch_array($sql_revenues); $revenues_for_month = $row['revenue_amount_for_month']; @@ -534,11 +532,11 @@ var myLineChart = new Chart(ctx, { data: [ 0 AND YEAR(revenue_date) = $year-1 AND MONTH(revenue_date) = $month AND company_id = $session_company_id"); + $sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenue_category_id > 0 AND YEAR(revenue_date) = $year-1 AND MONTH(revenue_date) = $month AND company_id = $session_company_id"); $row = mysqli_fetch_array($sql_revenues); $revenues_for_month = $row['revenue_amount_for_month']; @@ -576,7 +574,7 @@ var myLineChart = new Chart(ctx, { $largest_invoice_month = 0; for($month = 1; $month<=12; $month++) { - $sql_projected = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_amount_for_month FROM invoices WHERE YEAR(invoice_due) = $year AND MONTH(invoice_due) = $month AND invoice_status NOT LIKE 'Cancelled' AND invoice_status NOT LIKE 'Draft' AND company_id = $session_company_id"); + $sql_projected = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_amount_for_month FROM invoices WHERE YEAR(invoice_due) = $year AND MONTH(invoice_due) = $month AND invoice_status NOT LIKE 'Cancelled' AND invoice_status NOT LIKE 'Draft' AND company_id = $session_company_id"); $row = mysqli_fetch_array($sql_projected); $invoice_for_month = $row['invoice_amount_for_month']; @@ -612,7 +610,7 @@ var myLineChart = new Chart(ctx, { $largest_expense_month = 0; for($month = 1; $month<=12; $month++) { - $sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND expense_vendor_id > 0 AND expenses.company_id = $session_company_id"); + $sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND expense_vendor_id > 0 AND expenses.company_id = $session_company_id"); $row = mysqli_fetch_array($sql_expenses); $expenses_for_month = $row['expense_amount_for_month']; @@ -688,7 +686,7 @@ var myLineChart = new Chart(ctx, { data: [ 0 AND YEAR(expense_date) = $year AND categories.company_id = $session_company_id"); + $sql_categories = mysqli_query($mysqli, "SELECT DISTINCT category_name, categories.category_id FROM categories, expenses WHERE expense_category_id = category_id AND expense_vendor_id > 0 AND YEAR(expense_date) = $year AND categories.company_id = $session_company_id"); while ($row = mysqli_fetch_array($sql_categories)) { $category_name = json_encode($row['category_name']); echo "$category_name,"; @@ -820,11 +818,11 @@ var myPieChart = new Chart(ctx, { datasets: [{ data: [ 0 AND YEAR(expense_date) = $year AND categories.company_id = $session_company_id"); + $sql_categories = mysqli_query($mysqli, "SELECT DISTINCT category_name, categories.category_id FROM categories, expenses WHERE expense_category_id = category_id AND expense_vendor_id > 0 AND YEAR(expense_date) = $year AND categories.company_id = $session_company_id"); while ($row = mysqli_fetch_array($sql_categories)) { $category_id = $row['category_id']; - $sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_year FROM expenses WHERE expense_category_id = $category_id AND YEAR(expense_date) = $year"); + $sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS expense_amount_for_year FROM expenses WHERE expense_category_id = $category_id AND YEAR(expense_date) = $year"); $row = mysqli_fetch_array($sql_expenses); $expense_amount_for_year = $row['expense_amount_for_year']; echo "$expense_amount_for_year,"; @@ -835,7 +833,7 @@ var myPieChart = new Chart(ctx, { ], backgroundColor: [ 0 AND YEAR(expense_date) = $year AND categories.company_id = $session_company_id"); + $sql_categories = mysqli_query($mysqli, "SELECT DISTINCT category_name, category_color FROM categories, expenses WHERE expense_category_id = categories.category_id AND expense_vendor_id > 0 AND YEAR(expense_date) = $year AND categories.company_id = $session_company_id"); while ($row = mysqli_fetch_array($sql_categories)) { $category_color = json_encode($row['category_color']); echo "$category_color,"; @@ -861,7 +859,7 @@ var myPieChart = new Chart(ctx, { data: { labels: [ - - + //check to see if overdue + if ($invoice_status !== "Paid" && $invoice_status !== "Draft" && $invoice_status !== "Cancelled") { + $unixtime_invoice_due = strtotime($invoice_due) + 86400; + if ($unixtime_invoice_due < time()) { + $invoice_color = "text-danger"; + } + } - |
| Date | -- |
| Due | -- |
| Product | -Description | -Qty | -Price | -Tax | -Total | -
|---|---|---|---|---|---|
| - | - | - | - | - | - |
| Date | ++ |
| Due | ++ |
| Product | +Description | +Qty | +Price | +Tax | +Total | +
|---|---|---|---|---|---|
| + | + | + | + | + | + |
| Subtotal | ++ |
| Tax | ++ |
Paid |
+ + |
| Balance | ++ |
| Subtotal | -- |
| Tax | -- |
Paid |
- - |
| Balance | -- |
| Date | -- |
| Due | -- |
| Subtotal | -- |
| Tax | -- |
Paid |
- - |
| Balance | -- |
| Date | -Status | -Description | -
|---|---|---|
| - | - | - |
| Date | ++ |
| Due | ++ |
| Subtotal | ++ |
| Tax | ++ |
Paid |
+ + |
| Balance | ++ |
| Timestamp | -User | -Client | -Type | -Action | -Description | -IP Address | -User Agent | -
|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | - | $log_user_browser"; ?> | -
| Timestamp | +User | +Client | +Type | +Action | +Description | +IP Address | +User Agent | +
|---|
| Created | ++ |
| Next Date | ++ |
| Last Sent | ++ |
| Subtotal | ++ |
| Tax | ++ |
| Total | ++ |
| Created | -- |
| Next Date | -- |
| Last Sent | -- |
| Subtotal | -- |
| Tax | -- |
| Total | -- |
| Date | -Event | -
|---|---|
| - | - |
| Commit | +When | +Description | +
|---|
| Commit | -When | -Description | -
|---|
Note: You must log out and back in again for these changes take effect.
+You have set up 2FA. Your QR code is below.
+ + + +$session_token
"; + } + + ?> +Note: You must log out and back in again for these changes take effect.
-You have set up 2FA. Your QR code is below.
- - - -$session_token
"; - } - - ?> -| - | $log_user_os $log_user_browser $log_ip"; ?> |
+
| + | $log_user_os $log_user_browser $log_ip"; ?> |
-
| Name | -Role | -Status | -Last Login | -Action | -
|---|
| Name | +Role | +Status | +Last Login | +Action | +|||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
-
-
- $log_user_browser $log_ip"; + if (empty($last_login)) { + $last_login = "Never logged in"; + } + + ?> +
+
+
+ |
- - + + - - -
- |
- |
- |
-
- |
- - -
- |
-
-
-
-
- |
+ + | + | + |
+
+ + + |
+
+
+
+
+
+ |
+