mirror of
https://github.com/itflow-org/itflow
synced 2026-03-20 20:54:50 +00:00
Compare commits
225 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed8a576ac3 | ||
|
|
5c6a7acb7d | ||
|
|
850db54a3b | ||
|
|
985593b7c2 | ||
|
|
857b5d1bfd | ||
|
|
498e86aa7a | ||
|
|
79d0fd28b0 | ||
|
|
426ca90515 | ||
|
|
e7328f1be5 | ||
|
|
baccc8051e | ||
|
|
f1c7690270 | ||
|
|
d700d1530b | ||
|
|
b60f44eede | ||
|
|
54ab788e93 | ||
|
|
ac2dd04959 | ||
|
|
9a449c35ac | ||
|
|
2ff5d2f87c | ||
|
|
8f704dade8 | ||
|
|
3b3e323ce5 | ||
|
|
43ec144bf0 | ||
|
|
d5f94819d0 | ||
|
|
98aa7e4993 | ||
|
|
7c61911dba | ||
|
|
2bb107a5d7 | ||
|
|
0c4a2aedb7 | ||
|
|
e7e7272002 | ||
|
|
f672991089 | ||
|
|
473fa2671d | ||
|
|
85e1515080 | ||
|
|
84437a2732 | ||
|
|
71911f418f | ||
|
|
2741f78bd8 | ||
|
|
012e54161a | ||
|
|
409084c499 | ||
|
|
27595b2c4a | ||
|
|
62b6535625 | ||
|
|
e593f438b3 | ||
|
|
44d46a2cc5 | ||
|
|
66e30dd1a8 | ||
|
|
4c74351d21 | ||
|
|
5d2b14259c | ||
|
|
878d5444e1 | ||
|
|
ec24ec60c6 | ||
|
|
9c096d1f65 | ||
|
|
dba3e895da | ||
|
|
07726322df | ||
|
|
bef18c0d72 | ||
|
|
7c3332570a | ||
|
|
a3d4a52188 | ||
|
|
5530e89f41 | ||
|
|
a3554b3dfd | ||
|
|
674da36cd1 | ||
|
|
18ce12f60d | ||
|
|
a462ab36f8 | ||
|
|
8aa41edc3e | ||
|
|
4e0252553a | ||
|
|
8745d09890 | ||
|
|
ac3a02baea | ||
|
|
f2bbc170da | ||
|
|
d79a17adb0 | ||
|
|
680dbb04ce | ||
|
|
6c8403fa09 | ||
|
|
fec8eaef70 | ||
|
|
5f007029b4 | ||
|
|
4e76ceaa0f | ||
|
|
08e467baa9 | ||
|
|
f78a2250f1 | ||
|
|
84e8a459c8 | ||
|
|
b777f80249 | ||
|
|
73da203dbb | ||
|
|
55a31865d0 | ||
|
|
350697869b | ||
|
|
939b07422d | ||
|
|
88369d480a | ||
|
|
cf083e94e6 | ||
|
|
11e8f5acfc | ||
|
|
77b3a89eb2 | ||
|
|
f572f4265a | ||
|
|
0b66c8e1be | ||
|
|
a8328a3f56 | ||
|
|
8b42b17121 | ||
|
|
db418ce662 | ||
|
|
96fe566e08 | ||
|
|
a00f26d8a4 | ||
|
|
eeef63d1c3 | ||
|
|
0b88ea85ae | ||
|
|
c564118156 | ||
|
|
01a7dc2068 | ||
|
|
bb44ecec3f | ||
|
|
b7b24d7de6 | ||
|
|
dcca93e34f | ||
|
|
4124188505 | ||
|
|
eb5d59623b | ||
|
|
8631c06731 | ||
|
|
40eb40fd86 | ||
|
|
c486682a0e | ||
|
|
336da073f1 | ||
|
|
d2e187a239 | ||
|
|
f69de29353 | ||
|
|
61de8bc792 | ||
|
|
d31f19707b | ||
|
|
811312466f | ||
|
|
5ecfb3e962 | ||
|
|
77be5af4e5 | ||
|
|
c512a716d2 | ||
|
|
14f5630caf | ||
|
|
8532bdc172 | ||
|
|
9d74bf8e19 | ||
|
|
f75445b4d0 | ||
|
|
e04fa1b696 | ||
|
|
e07dfb5f67 | ||
|
|
3d1af05fc2 | ||
|
|
0e38925d74 | ||
|
|
c0f3343412 | ||
|
|
6a368840fa | ||
|
|
5361391b3b | ||
|
|
b80662bb24 | ||
|
|
4c272b6b8d | ||
|
|
96abdef3ad | ||
|
|
0b04bc79e9 | ||
|
|
cefbbdc3a8 | ||
|
|
83ffe05a99 | ||
|
|
b6f73083ef | ||
|
|
693736023e | ||
|
|
fed87c93ab | ||
|
|
f53b77b556 | ||
|
|
b858d82b0b | ||
|
|
ccb2af6d17 | ||
|
|
8d937ac8f5 | ||
|
|
2786fb65ed | ||
|
|
025532f579 | ||
|
|
5bd03be1ad | ||
|
|
40086f1ce0 | ||
|
|
be66ad9a4c | ||
|
|
0df5c01bb7 | ||
|
|
b85fa38b67 | ||
|
|
546246d7c5 | ||
|
|
d5536e78f4 | ||
|
|
908738b7ca | ||
|
|
797e02bffa | ||
|
|
d856685782 | ||
|
|
1400983d8c | ||
|
|
2a43c5d868 | ||
|
|
a67675c649 | ||
|
|
fc344ef636 | ||
|
|
2ffb2be083 | ||
|
|
069772f27d | ||
|
|
241ec50802 | ||
|
|
b943c9cd89 | ||
|
|
80625f8c3f | ||
|
|
58435d3460 | ||
|
|
7a7ac4a47f | ||
|
|
429dfa5ca4 | ||
|
|
e1f212d30d | ||
|
|
670450bcfb | ||
|
|
83e15e9e4a | ||
|
|
b309081d75 | ||
|
|
f1a7b35aa6 | ||
|
|
469c5ef06d | ||
|
|
07cbe561bd | ||
|
|
b69a70cfc3 | ||
|
|
923001928c | ||
|
|
75ed461c67 | ||
|
|
691aebce91 | ||
|
|
846947ff49 | ||
|
|
65e107d154 | ||
|
|
19b809b699 | ||
|
|
60fe02bb47 | ||
|
|
3e708059c6 | ||
|
|
424104bb66 | ||
|
|
62696b9ebe | ||
|
|
87403e8c2d | ||
|
|
7a5a607ff6 | ||
|
|
a195774726 | ||
|
|
8d0da7b55b | ||
|
|
58c315cd09 | ||
|
|
dd6c4602db | ||
|
|
d413e0c8ff | ||
|
|
b356658635 | ||
|
|
d92f0fc49b | ||
|
|
f206a28cf7 | ||
|
|
70cb0ac635 | ||
|
|
a0ece18876 | ||
|
|
4a22b03952 | ||
|
|
5ebf797c90 | ||
|
|
a20759f1f2 | ||
|
|
c273cab36e | ||
|
|
8306a04eda | ||
|
|
f078203136 | ||
|
|
15e89c3c4e | ||
|
|
595c4f1440 | ||
|
|
91a523dc23 | ||
|
|
8567c97c09 | ||
|
|
3621e99c61 | ||
|
|
d99b9cbe68 | ||
|
|
e319768fd3 | ||
|
|
c30ffcf096 | ||
|
|
7286248fef | ||
|
|
dc49f80cc3 | ||
|
|
1ae2da8054 | ||
|
|
090f4cb560 | ||
|
|
0914716b8e | ||
|
|
ab463c1773 | ||
|
|
36af4d11fc | ||
|
|
14d8dc6fa6 | ||
|
|
2032b48ad3 | ||
|
|
2af795f548 | ||
|
|
7b4edb2948 | ||
|
|
17a906fd03 | ||
|
|
af46a1fd96 | ||
|
|
393c0b8c11 | ||
|
|
e92f2f714d | ||
|
|
42606067c0 | ||
|
|
98bb65509d | ||
|
|
a2599e5d43 | ||
|
|
0390b1bc2a | ||
|
|
531f3ec741 | ||
|
|
127afdca0d | ||
|
|
c4df5bf988 | ||
|
|
30234e044d | ||
|
|
1e98ee8916 | ||
|
|
d5665c2577 | ||
|
|
762ec51a19 | ||
|
|
309ad724ec | ||
|
|
a5f7b7fa9c |
141
CHANGELOG.md
141
CHANGELOG.md
@@ -2,6 +2,147 @@
|
||||
|
||||
This file documents all notable changes made to ITFlow.
|
||||
|
||||
## [25.06]
|
||||
|
||||
### Breaking CHANGES
|
||||
- Old Document Verions will be deleted due to the major backend rewrite how document versions work.
|
||||
|
||||
### Added / Changed
|
||||
- Improved function for retrieving remote IP address for logging purposes.
|
||||
- Ticket categories are now sorted alphabetically.
|
||||
- Visiting a deleted invoice or recurring invoice now redirects to the listing page; delete option added to invoice details page.
|
||||
- Added "Mark as Sent" and "Make Payment" actions directly on the invoice listing page.
|
||||
- Introduced Ticket Category UI for recurring tickets.
|
||||
- In Project Details, bulk actions and sorting are now available for tickets.
|
||||
- Updated ticket details UI to use full card stacks with edit icons for stackable items (e.g., asset, watchers, contact).
|
||||
- Added a new setting to toggle AutoStart Timer in ticket details (disabled by default).
|
||||
- Applied gray accent theme in the client section to visually distinguish from the global view.
|
||||
- Introduced Ticket Due Date functionality (currently supports add/edit only; more updates coming next release).
|
||||
- Added settings option to display Company Tax ID on invoices.
|
||||
- Client overview now displays badge counts for all entities.
|
||||
- Overhauled UI for Invoice, Quote, and Recurring Invoice details; switched PDF generation to TCPDF PHP from PDFMake JS.
|
||||
- Document versioning has been moved to a separate backend table to resolve permanent link issues -- SEE Breaking CHANGES.
|
||||
- Migrated Document Templates, Vendor Templates, and Software/License Templates to dedicated tables.
|
||||
- Added functionality to mark all tasks in a ticket as complete or incomplete.
|
||||
- Asset CSV import now supports a purchase date field.
|
||||
- Recurring Payments have been restructured to auto-charge on the invoice due date instead of at generation time.
|
||||
- Added "Base Template" label for vendor templates when available.
|
||||
- Backup and restore processes now use a temporary directory; files are cleaned up automatically if operations fail.
|
||||
- Added confirmation prompt when accepting or declining a quote.
|
||||
- Other minor code UI/UX cleanups and refactoring throughout the app.
|
||||
|
||||
### Fixed
|
||||
- Resolved issue with enabling MFA.
|
||||
- Fixed UI regression where ticket listing columns would misalign.
|
||||
- Non-billable invoices are no longer included in calculations.
|
||||
- Addressed multiple minor reported security vulnerabilities.
|
||||
- Tickets with open tasks are no longer resolved in bulk; a warning is shown along with a count of affected tickets.
|
||||
|
||||
|
||||
## [25.05.1]
|
||||
|
||||
### Added / Changed
|
||||
- Added Domain Expiring Card to Client Portal Dashboard for Primary and Technical Users.
|
||||
- Added Balance and Monthly Recurring Amount to Client Portal Dahboard for Primary and Technical Users.
|
||||
- Added Archive Searching to network and certificates also added unarchive capabilities to them as well.
|
||||
|
||||
### Fixed
|
||||
- Add Payment not showing in Invoice.
|
||||
- Updated Client Overview Entities to not show archived client's Entities even though the entity may not be archived.
|
||||
|
||||
|
||||
## [25.05]
|
||||
|
||||
### Added / Changed
|
||||
- Expanded file upload allow-list to include .bat and .stk file types.
|
||||
- Added full backup/restore functionality. Backup downloads a zip that includes the SQL dump and uploads folder, setup now has option to restore from zip backup.
|
||||
- Migrated Asset and Contact Links to modals to resolve variable overlap issue.
|
||||
- Added Pagination to Notification Modal.
|
||||
- Removed 500 Records Per Page option.
|
||||
- Removed unused old DB checks in the top nav.
|
||||
- Clients can now use the portal to setup Stripe automatic payments themselves for recurring invoices
|
||||
- Automatic payments are now disabled for all recurring invoices if the saved payment method is removed
|
||||
- Added Card Details and Payment added to Client Stripe.
|
||||
- UI / UX updates to guest pay Make use of cards.
|
||||
- Don't show Checkbox columns when ticket is closed, compact ticket list now matches round pills for status and priority.
|
||||
- Ticket UI/UX update allow the ticket toolbar to be a little more mobile-friendly
|
||||
- UI / UX Updates to Expenses - Combine Category and Description into 1 column.
|
||||
- Country information is now displayed in Invoices, Quotes, Recurring Invoices, Clients, Locations, and the client top header.
|
||||
- Added country-based search filters in Locations and Clients sections.
|
||||
- Changed the settings name from Integrations to Identity Providers to make room for future iDPs (e.g. Google).
|
||||
- Bump FullCalendar from 6.1.15 to 6.1.17.
|
||||
- Bump DataTables from 2.2.2 to 2.3.1.
|
||||
- Bump TCPDF from 6.8.2 to 6.9.4.
|
||||
- Bump tinyMCE from 7.7.1 to 7.9.0.
|
||||
- Bump phpMailer from 6.9.2 to 6.10.0.
|
||||
- Bump stripe-php from 16.4.0 to 17.2.1.
|
||||
|
||||
|
||||
### Fixed
|
||||
- "None" option for SMTP encryption now functions correctly.
|
||||
- Debug table row counts now reflect actual counts instead of relying on SHOW TABLE STATUS.
|
||||
- Archived Categories now display properly.
|
||||
- Stripe saved payment methods are now limited to credit/debit cards only.
|
||||
|
||||
## [25.03.6]
|
||||
|
||||
### Fixed
|
||||
- Set default to date to 2035-12-31 as 9999-12-31 and 2999-12-31 broke certain browsers.
|
||||
- Update Client PDF Export, add header added company logo.
|
||||
- Present Larger clearer Warning about updates on update page.
|
||||
- Allow to search by project reference.
|
||||
|
||||
## [25.03.5]
|
||||
|
||||
### Fixed
|
||||
- Fixed the user listing issue when copying a trip.
|
||||
- Corrected the display of recurring invoice amounts on the dashboard.
|
||||
- Fixed the linking of entities with assets and contacts.
|
||||
- Resolved the issue with displaying the correct mobile country code in the contact listing.
|
||||
- Set the default date to `9999-12-31` to ensure future items (like invoices) are displayed by default.
|
||||
- Fixed the display issue where file folders were not showing properly during document creation.
|
||||
- Migrated from Dragula to SortableJS for a more modern, mobile-friendly solution.
|
||||
- Added Handlebars icons for drag-and-drop items.
|
||||
- Changed behavior to open Contact and Asset Details pages directly instead of using a modal.
|
||||
|
||||
## [25.03.4]
|
||||
|
||||
### Fixed
|
||||
- Ability to remove additional assets from the ticket details screen.
|
||||
- Fix the ability to remove assets from edit ticket not working when only 1 asset exists.
|
||||
- Fix Database Backup corruption.
|
||||
- Client Portal - show ticket number instead of ticket id in ticket listing.
|
||||
- Add Purchase Reference to copy asset.
|
||||
- Add Link to asset details from the global search.
|
||||
- Fix Bulk assign ticket only showing contacts instead of ITFlow users.
|
||||
|
||||
|
||||
## [25.03.3]
|
||||
|
||||
### Fixed
|
||||
- Fix adding ITFlow user.
|
||||
- Do not alert on inactive recurring invoices.
|
||||
- Fix ticket user assignment including bulk assignment.
|
||||
- Fix adding a location phone extension.
|
||||
- Do not default to +1 Country code, instead default to null.
|
||||
- Do not format numbers unless a country code is entered.
|
||||
- Fix editing network location.
|
||||
- Fix ticket redaction on client replies.
|
||||
- Remove more from user activity as it requires admin privledges.
|
||||
- Fix MFA Enforcement page.
|
||||
|
||||
## [25.03.2]
|
||||
|
||||
### Fixed
|
||||
- Revert DB.sql change
|
||||
|
||||
## [25.03.1]
|
||||
|
||||
### Fixed
|
||||
- Phone number missing in various sections.
|
||||
- Match Database.
|
||||
- Client Export Only display licenses users and assets from the selected client only.
|
||||
|
||||
## [25.03]
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -93,6 +93,7 @@ If you want to improve ITFlow, feel free to fork the repo and create a pull requ
|
||||
We’re incredibly grateful to the organizations and individuals who support the project - a big thank you to:
|
||||
- CompuMatter
|
||||
- F1 for HELP
|
||||
- JetBrains (PhpStorm)
|
||||
|
||||
## License
|
||||
ITFlow is distributed "as is" under the GPL License, WITHOUT WARRANTY OF ANY KIND. See [`LICENSE`](https://github.com/itflow-org/itflow/blob/master/LICENSE) for details.
|
||||
|
||||
@@ -12,10 +12,8 @@
|
||||
We operate a rolling release model. Any bug fixes will be released into latest version of ITFlow, so you must stay up-to-date.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| Beta | :x: |
|
||||
| 24.12 | :white_check_mark: |
|
||||
| 25.1 | :white_check_mark: (When released) |
|
||||
|---------| ------------------ |
|
||||
| 25.05 | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability via GitHub Security Advisories
|
||||
|
||||
|
||||
@@ -9,9 +9,6 @@ require_once "includes/inc_all.php";
|
||||
// Perms
|
||||
enforceUserPermission('module_financial');
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM accounts
|
||||
|
||||
@@ -6,10 +6,6 @@ $order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM api_keys
|
||||
|
||||
@@ -26,9 +26,6 @@ if (isset($_GET['category']) & !empty($_GET['catergory'])) {
|
||||
$category_filter = '';
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM app_logs
|
||||
@@ -48,14 +45,16 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-history mr-2"></i>App Logs</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<form autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search app logs">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search app logs">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -46,9 +46,6 @@ if (isset($_GET['action']) & !empty($_GET['action'])) {
|
||||
$action_filter = '';
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM logs
|
||||
@@ -75,7 +72,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search audit logs">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
@@ -85,7 +82,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="">- All Clients -</option>
|
||||
|
||||
@@ -105,7 +102,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="user" onchange="this.form.submit()">
|
||||
<option value="">- All Users -</option>
|
||||
|
||||
@@ -125,7 +122,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="type" onchange="this.form.submit()">
|
||||
<option value="">- All Types -</option>
|
||||
|
||||
@@ -144,7 +141,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="action" onchange="this.form.submit()">
|
||||
<option value="">- All Actions -</option>
|
||||
|
||||
@@ -198,7 +195,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<hr>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-sm table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=log_created_at&order=<?php echo $disp; ?>">
|
||||
|
||||
@@ -8,7 +8,7 @@ require_once "includes/inc_all_admin.php";
|
||||
</div>
|
||||
<div class="card-body" style="text-align: center;">
|
||||
<div class="alert alert-secondary">If you are unable to back up the entire VM, you'll need to back up the files & database individually. There is no built-in restore. See the <a href="https://docs.itflow.org/backups" target="_blank">docs here</a>.</div>
|
||||
<a class="btn btn-primary btn-lg p-3" href="post.php?download_database&csrf_token=<?php echo $_SESSION['csrf_token'] ?>"><i class="fas fa-fw fa-4x fa-download"></i><br><br>Download database</a>
|
||||
<a class="btn btn-primary btn-lg p-3" href="post.php?download_backup&csrf_token=<?php echo $_SESSION['csrf_token'] ?>"><i class="fas fa-fw fa-4x fa-download"></i><br><br>Download Backup</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,12 +20,12 @@ require_once "includes/inc_all_admin.php";
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="input-group col-4">
|
||||
<div class="input-group-prepend">
|
||||
<input type="password" class="form-control" placeholder="Enter your account password" name="password" autocomplete="new-password" required>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group col-sm-4">
|
||||
<input type="password" class="form-control" placeholder="Enter your account password" name="password" autocomplete="new-password" required>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary" type="submit" name="backup_master_key"><i class="fas fa-key"></i></button>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit" name="backup_master_key"><i class="fas fa-fw fa-key mr-2"></i>Get Master Key</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -13,10 +13,6 @@ if (isset($_GET['category'])) {
|
||||
$category = "Expense";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM categories
|
||||
@@ -27,10 +23,6 @@ $sql = mysqli_query(
|
||||
);
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
if (isset($_GET['archived'])) {
|
||||
$category = "Archived";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
@@ -98,7 +90,7 @@ if (isset($_GET['archived'])) {
|
||||
} else {
|
||||
echo 'btn-default';
|
||||
} ?>">Ticket</a>
|
||||
<a href="?archived=1"
|
||||
<a href="?<?php echo $url_query_strings_sort ?>&archived=1"
|
||||
class="btn <?php if (isset($_GET['archived'])) {
|
||||
echo 'btn-primary';
|
||||
} else {
|
||||
@@ -150,7 +142,7 @@ if (isset($_GET['archived'])) {
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<?php
|
||||
if ($category == "Archived") {
|
||||
if ($archived) {
|
||||
?>
|
||||
<a class="dropdown-item text-success confirm-link"
|
||||
href="post.php?unarchive_category=<?php echo $category_id; ?>">
|
||||
|
||||
@@ -6,10 +6,6 @@ $order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM custom_links
|
||||
|
||||
400
admin_debug.php
400
admin_debug.php
@@ -296,7 +296,13 @@ if ($tablesResult) {
|
||||
|
||||
while ($table = $tablesResult->fetch_assoc()) {
|
||||
$tableName = $table['Name'];
|
||||
$tableRows = $table['Rows'];
|
||||
|
||||
// Accurate row count
|
||||
$countResult = $mysqli->query("SELECT COUNT(*) AS cnt FROM `$tableName`");
|
||||
$countRow = $countResult->fetch_assoc();
|
||||
$tableRows = $countRow['cnt'];
|
||||
$countResult->free();
|
||||
|
||||
$dataLength = $table['Data_length'];
|
||||
$indexLength = $table['Index_length'];
|
||||
$tableSize = ($dataLength + $indexLength) / (1024 * 1024); // Size in MB
|
||||
@@ -336,11 +342,6 @@ if ($tablesResult) {
|
||||
'name' => 'Total database size (MB)',
|
||||
'value' => round($totalSize, 2) . ' MB',
|
||||
];
|
||||
} else {
|
||||
$databaseStats[] = [
|
||||
'name' => 'Database connection error',
|
||||
'value' => $mysqli->error,
|
||||
];
|
||||
}
|
||||
|
||||
// Section: Database Structure Comparison
|
||||
@@ -518,24 +519,26 @@ $mysqli->close();
|
||||
</ul>
|
||||
<hr>
|
||||
|
||||
<table class="table table-bordered mb-3">
|
||||
<tr>
|
||||
<th>ITFlow release version</th>
|
||||
<th><?php echo APP_VERSION; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current DB Version</td>
|
||||
<td><?php echo CURRENT_DATABASE_VERSION; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current Code Commit</td>
|
||||
<td><?php echo $commitHash; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current Branch</td>
|
||||
<td><?php echo $gitBranch; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered mb-3">
|
||||
<tr>
|
||||
<th>ITFlow release version</th>
|
||||
<th><?php echo APP_VERSION; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current DB Version</td>
|
||||
<td><?php echo CURRENT_DATABASE_VERSION; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current Code Commit</td>
|
||||
<td><?php echo $commitHash; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Current Branch</td>
|
||||
<td><?php echo $gitBranch; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- System Information Table -->
|
||||
<h3>System Information</h3>
|
||||
@@ -552,200 +555,209 @@ $mysqli->close();
|
||||
|
||||
<!-- PHP Extensions and Configuration Table -->
|
||||
<h3 class="mt-3">PHP Extensions and Configuration</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<!-- PHP Extensions Section -->
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">PHP Extensions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($phpExtensions as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<!-- PHP Extensions Section -->
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">PHP Extensions</th>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<!-- PHP Configuration Section -->
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">PHP Configuration</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($phpConfig as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($phpExtensions as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<!-- PHP Configuration Section -->
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">PHP Configuration</th>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">Shell Commands</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($shellCommands as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($phpConfig as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">Shell Commands</th>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">SSL Checks</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($sslChecks as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($shellCommands as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">SSL Checks</th>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">Domain Checks</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($domainChecks as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($sslChecks as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">Domain Checks</th>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($domainChecks as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
<!-- File Permissions Table -->
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">File Permissions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($filePermissions as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
<!-- File Permissions Table -->
|
||||
<thead>
|
||||
<tr class="table-secondary">
|
||||
<th colspan="3">File Permissions</th>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($filePermissions as $check): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($check['name']); ?></td>
|
||||
<td class="text-center">
|
||||
<?php if ($check['passed']): ?>
|
||||
<i class="fas fa-check" style="color:green"></i>
|
||||
<?php else: ?>
|
||||
<i class="fas fa-times" style="color:red"></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= htmlspecialchars($check['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Database Structure Comparison Table -->
|
||||
<h3 class="mt-3">Database Structure Comparison</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php if (!empty($dbComparison)): ?>
|
||||
<?php foreach ($dbComparison as $issue): ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php if (!empty($dbComparison)): ?>
|
||||
<?php foreach ($dbComparison as $issue): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($issue['name']); ?></td>
|
||||
<td colspan="2"><?= htmlspecialchars($issue['status']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($issue['name']); ?></td>
|
||||
<td colspan="2"><?= htmlspecialchars($issue['status']); ?></td>
|
||||
<td colspan="3">No discrepancies found between the database and db.sql file.</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="3">No discrepancies found between the database and db.sql file.</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Uploads Directory Stats Table -->
|
||||
<h3 class="mt-3">Uploads Directory Stats</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php foreach ($uploadsStats as $stat): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($stat['name']); ?></td>
|
||||
<td colspan="2"><?= htmlspecialchars($stat['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php foreach ($uploadsStats as $stat): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($stat['name']); ?></td>
|
||||
<td colspan="2"><?= htmlspecialchars($stat['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Database Stats Table -->
|
||||
<h3 class="mt-3">Database Stats</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php foreach ($databaseStats as $stat): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($stat['name']); ?></td>
|
||||
<td colspan="2"><?= htmlspecialchars($stat['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<?php foreach ($databaseStats as $stat): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($stat['name']); ?></td>
|
||||
<td colspan="2"><?= htmlspecialchars($stat['value']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Table Stats Table -->
|
||||
<h3 class="mt-3">Table Stats</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Table Name</th>
|
||||
<th>Fields / Rows</th>
|
||||
<th>Size (MB)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableDetails as $table): ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($table['name']); ?></td>
|
||||
<td><?= htmlspecialchars("Fields: {$table['fields']}, Rows: {$table['rows']}"); ?></td>
|
||||
<td><?= htmlspecialchars($table['size'] . ' MB'); ?></td>
|
||||
<th>Table Name</th>
|
||||
<th>Fields / Rows</th>
|
||||
<th>Size (MB)</th>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableDetails as $table): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($table['name']); ?></td>
|
||||
<td><?= htmlspecialchars("Fields: {$table['fields']}, Rows: {$table['rows']}"); ?></td>
|
||||
<td><?= htmlspecialchars($table['size'] . ' MB'); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,27 +1,16 @@
|
||||
<?php
|
||||
|
||||
// Default Column Sort by Filter
|
||||
$sort = "document_name";
|
||||
$sort = "document_template_name";
|
||||
$order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
// Search query SQL snippet
|
||||
if (!empty($q)) {
|
||||
$query_snippet = "AND (MATCH(document_content_raw) AGAINST ('$q') OR document_name LIKE '%$q%')";
|
||||
} else {
|
||||
$query_snippet = ""; // empty
|
||||
}
|
||||
|
||||
// Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM documents
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE document_template = 1
|
||||
$query_snippet
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM document_templates
|
||||
LEFT JOIN users ON document_template_created_by = user_id
|
||||
WHERE user_name LIKE '%$q%' OR document_template_name LIKE '%$q%'
|
||||
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
@@ -55,18 +44,18 @@
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=document_name&order=<?php echo $disp; ?>">
|
||||
Template Name <?php if ($sort == 'document_name') { echo $order_icon; } ?>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=document_template_name&order=<?php echo $disp; ?>">
|
||||
Template Name <?php if ($sort == 'document_template_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=document_created_at&order=<?php echo $disp; ?>">
|
||||
Created <?php if ($sort == 'document_created_at') { echo $order_icon; } ?>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=document_template_created_at&order=<?php echo $disp; ?>">
|
||||
Created <?php if ($sort == 'document_template_created_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=document_updated_at&order=<?php echo $disp; ?>">
|
||||
Updated <?php if ($sort == 'document_updated_at') { echo $order_icon; } ?>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=document_template_updated_at&order=<?php echo $disp; ?>">
|
||||
Updated <?php if ($sort == 'document_template_updated_at') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
@@ -78,27 +67,26 @@
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
$document_content = nullable_htmlentities($row['document_content']);
|
||||
$document_created_by_name = nullable_htmlentities($row['user_name']);
|
||||
$document_created_at = nullable_htmlentities($row['document_created_at']);
|
||||
$document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
||||
$document_folder_id = intval($row['document_folder_id']);
|
||||
$document_template_id = intval($row['document_template_id']);
|
||||
$document_template_name = nullable_htmlentities($row['document_template_name']);
|
||||
$document_template_description = nullable_htmlentities($row['document_template_description']);
|
||||
$document_template_content = nullable_htmlentities($row['document_template_content']);
|
||||
$document_template_created_by_name = nullable_htmlentities($row['user_name']);
|
||||
$document_template_created_at = nullable_htmlentities($row['document_template_created_at']);
|
||||
$document_template_updated_at = nullable_htmlentities($row['document_template_updated_at']);
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<a class="text-bold" href="admin_document_template_details.php?document_id=<?php echo $document_id; ?>"><i class="fas fa-fw fa-file-alt text-dark"></i> <?php echo $document_name; ?></a>
|
||||
<div class="mt-1 text-secondary"><?php echo $document_description; ?></div>
|
||||
<a class="text-bold" href="admin_document_template_details.php?document_template_id=<?php echo $document_template_id; ?>"><i class="fas fa-fw fa-file-alt text-dark"></i> <?php echo $document_template_name; ?></a>
|
||||
<div class="mt-1 text-secondary"><?php echo $document_template_description; ?></div>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $document_created_at; ?>
|
||||
<div class="text-secondary"><?php echo $document_created_by_name; ?></div>
|
||||
<?php echo $document_template_created_at; ?>
|
||||
<div class="text-secondary"><?php echo $document_template_created_by_name; ?></div>
|
||||
</td>
|
||||
<td><?php echo $document_updated_at; ?></td>
|
||||
<td><?php echo $document_template_updated_at; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
@@ -109,12 +97,12 @@
|
||||
data-toggle="ajax-modal"
|
||||
data-modal-size="xl"
|
||||
data-ajax-url="ajax/ajax_document_template_edit.php"
|
||||
data-ajax-id="<?php echo $document_id; ?>"
|
||||
data-ajax-id="<?php echo $document_template_id; ?>"
|
||||
>
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_document=<?php echo $document_id; ?>">
|
||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_document_template=<?php echo $document_template_id; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -11,19 +11,19 @@ $purifier_config->set('Cache.DefinitionImpl', null); // Disable cache by setting
|
||||
$purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'http' => true, 'https' => true]);
|
||||
$purifier = new HTMLPurifier($purifier_config);
|
||||
|
||||
if (isset($_GET['document_id'])) {
|
||||
$document_id = intval($_GET['document_id']);
|
||||
if (isset($_GET['document_template_id'])) {
|
||||
$document_template_id = intval($_GET['document_template_id']);
|
||||
}
|
||||
|
||||
$sql_document = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_template = 1 AND document_id = $document_id");
|
||||
$sql_document = mysqli_query($mysqli, "SELECT * FROM document_templates WHERE document_template_id = $document_template_id");
|
||||
|
||||
$row = mysqli_fetch_array($sql_document);
|
||||
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
$document_content = $purifier->purify($row['document_content']);
|
||||
$document_created_at = nullable_htmlentities($row['document_created_at']);
|
||||
$document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
||||
$document_template_name = nullable_htmlentities($row['document_template_name']);
|
||||
$document_template_description = nullable_htmlentities($row['document_template_description']);
|
||||
$document_template_content = $purifier->purify($row['document_template_content']);
|
||||
$document_template_created_at = nullable_htmlentities($row['document_template_created_at']);
|
||||
$document_template_updated_at = nullable_htmlentities($row['document_template_updated_at']);
|
||||
|
||||
?>
|
||||
|
||||
@@ -37,27 +37,27 @@ $document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_document_template.php">Document Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-file mr-2"></i><?php echo $document_name; ?></li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-file mr-2"></i><?php echo $document_template_name; ?></li>
|
||||
</ol>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-file mr-2"></i><?php echo $document_name; ?></h3>
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-file mr-2"></i><?php echo $document_template_name; ?></h3>
|
||||
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary"
|
||||
data-toggle="ajax-modal"
|
||||
data-modal-size="xl"
|
||||
data-ajax-url="ajax/ajax_document_template_edit.php"
|
||||
data-ajax-id="<?php echo $document_id; ?>"
|
||||
data-ajax-id="<?php echo $document_template_id; ?>"
|
||||
>
|
||||
<i class="fas fa-edit mr-2"></i>Edit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body prettyContent">
|
||||
<?php echo $document_content; ?>
|
||||
<?php echo $document_template_content; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,13 +4,29 @@ require_once "includes/inc_all_admin.php";
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-plug mr-2"></i>Integration Settings</h3>
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-fingerprint mr-2"></i>Identity Providers</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<h4>Client Portal SSO via Microsoft Entra</h4>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Identity Provider <small class='text-secondary'>(Currently only works with Microsft Entra)</small></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-fingerprint"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" readonly>
|
||||
<option <?php if (empty($config_azure_client_id)) { echo "selected"; } ?>>Disabled</option>
|
||||
<option <?php if ($config_azure_client_id) { echo "selected"; } ?>>Microsoft Entra</option>
|
||||
<option>Google (WIP)</option>
|
||||
<option>Custom SSO (WIP)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>MS Entra OAuth App (Client) ID</label>
|
||||
<div class="input-group">
|
||||
@@ -33,11 +49,10 @@ require_once "includes/inc_all_admin.php";
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_integrations_settings" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
<button type="submit" name="edit_identity_provider" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once "includes/footer.php";
|
||||
|
||||
@@ -6,9 +6,6 @@ $order = "DESC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM email_queue
|
||||
|
||||
@@ -6,10 +6,6 @@ $order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM project_templates
|
||||
|
||||
@@ -6,10 +6,6 @@ $order = "DESC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM user_roles
|
||||
@@ -50,7 +46,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<hr>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=role_name&order=<?php echo $disp; ?>">
|
||||
|
||||
@@ -19,6 +19,7 @@ $company_website = nullable_htmlentities($row['company_website']);
|
||||
$company_logo = nullable_htmlentities($row['company_logo']);
|
||||
$company_locale = nullable_htmlentities($row['company_locale']);
|
||||
$company_currency = nullable_htmlentities($row['company_currency']);
|
||||
$company_tax_id = nullable_htmlentities($row['company_tax_id']);
|
||||
|
||||
$company_initials = nullable_htmlentities(initials($company_name));
|
||||
|
||||
@@ -113,13 +114,13 @@ $company_initials = nullable_htmlentities(initials($company_name));
|
||||
|
||||
<label>Phone</label>
|
||||
<div class="form-row">
|
||||
<div class="col-9">
|
||||
<div class="col-md-9">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="tel" class="form-control col-2" name="phone_country_code" value="+<?php echo $company_phone_country_code; ?>" placeholder="Code" maxlength="4">
|
||||
<input type="tel" class="form-control col-2" name="phone_country_code" value="<?php echo $company_phone_country_code; ?>" placeholder="+" maxlength="4">
|
||||
<input type="tel" class="form-control" name="phone" value="<?php echo $company_phone; ?>" placeholder="Phone Number" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,6 +147,16 @@ $company_initials = nullable_htmlentities(initials($company_name));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Tax ID</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-balance-scale"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="tax_id" value="<?php echo $company_tax_id; ?>" placeholder="Tax ID" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_company" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Save</button>
|
||||
|
||||
@@ -13,9 +13,6 @@ if (isset($_GET['table'])) {
|
||||
$table = "client_assets";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM custom_fields
|
||||
|
||||
@@ -37,12 +37,21 @@ require_once "includes/inc_all_admin.php";
|
||||
<textarea class="form-control" rows="4" name="config_invoice_footer"><?php echo nullable_htmlentities($config_invoice_footer); ?></textarea>
|
||||
</div>
|
||||
|
||||
<h5>Show Tax ID On Invoices</h5>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_invoice_show_tax_id" <?php if ($config_invoice_show_tax_id == 1) { echo "checked"; } ?> value="1" id="customSwitch1">
|
||||
<label class="custom-control-label" for="customSwitch1">Show Tax ID</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5>Invoice Late Fees</h5>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_invoice_late_fee_enable" <?php if ($config_invoice_late_fee_enable == 1) { echo "checked"; } ?> value="1" id="customSwitch1">
|
||||
<label class="custom-control-label" for="customSwitch1">Enable Late Fee</label>
|
||||
<input type="checkbox" class="custom-control-input" name="config_invoice_late_fee_enable" <?php if ($config_invoice_late_fee_enable == 1) { echo "checked"; } ?> value="1" id="customSwitch2">
|
||||
<label class="custom-control-label" for="customSwitch2">Enable Late Fee</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ require_once "includes/inc_all_admin.php";
|
||||
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="test_email_imap" class="btn btn-success"><i class="fas fa-fw fa-inbox mr-2"></i>Test</button>
|
||||
<button type="submit" name="test_email_imap" class="btn btn-success" disabled><i class="fas fa-fw fa-inbox mr-2"></i>Test (WIP)</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -18,158 +18,159 @@ require_once "includes/inc_all_admin.php";
|
||||
<label class="custom-control-label" for="enableCronSwitch">Enable Cron (recommended) <small>(several cron scripts must also be added to cron with correct schedules, <a href="https://docs.itflow.org/cron">docs</a>)</small></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Notification</th>
|
||||
<th>App Notify</th>
|
||||
<th>Tech Email Notify</th>
|
||||
<th>Client Email Notify</th>
|
||||
<th>Create Ticket</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=5>Expirations</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-globe mr-2"></i>Domain Expiration Notice</div>
|
||||
<small class="text-muted">
|
||||
(This setting triggers a notification when a domain is approaching its expiration date, specifically at 1, 7 and 45 days prior to expiry.)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox text-center">
|
||||
<input type="checkbox" class="custom-control-input" name="config_enable_alert_domain_expire" id="customCheck1" <?php if ($config_enable_alert_domain_expire == 1) { echo "checked"; } ?> value="1">
|
||||
<label class="custom-control-label" for="customCheck1"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-lock mr-2"></i>Certificate Expiration Notice</div>
|
||||
<small class="text-muted">
|
||||
(This setting triggers a notification when a certificate is approaching its expiration date, specifically at 1, 7 and 45 days prior to expiry.)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-desktop mr-2"></i>Asset Warranty Expiration Notice</div>
|
||||
<small class="text-muted">
|
||||
(This setting triggers a notification when an asset is approaching its expiration date, specifically at 1, 7 and 45 days prior to expiry.)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan=5>Billing</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-file-invoice mr-2"></i>Invoice Reminders</div>
|
||||
<small class="text-muted">
|
||||
(This will automatically dispatch a reminder email for the invoice to the primary contact's email every 30 days following the invoice's due date.)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Notification</th>
|
||||
<th>App Notify</th>
|
||||
<th>Tech Email Notify</th>
|
||||
<th>Client Email Notify</th>
|
||||
<th>Create Ticket</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan=5>Expirations</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-globe mr-2"></i>Domain Expiration Notice</div>
|
||||
<small class="text-muted">
|
||||
(This setting triggers a notification when a domain is approaching its expiration date, specifically at 1, 7 and 45 days prior to expiry.)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox text-center">
|
||||
<input type="checkbox" class="custom-control-input" name="config_enable_alert_domain_expire" id="customCheck1" <?php if ($config_enable_alert_domain_expire == 1) { echo "checked"; } ?> value="1">
|
||||
<label class="custom-control-label" for="customCheck1"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-lock mr-2"></i>Certificate Expiration Notice</div>
|
||||
<small class="text-muted">
|
||||
(This setting triggers a notification when a certificate is approaching its expiration date, specifically at 1, 7 and 45 days prior to expiry.)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-desktop mr-2"></i>Asset Warranty Expiration Notice</div>
|
||||
<small class="text-muted">
|
||||
(This setting triggers a notification when an asset is approaching its expiration date, specifically at 1, 7 and 45 days prior to expiry.)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan=5>Billing</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-file-invoice mr-2"></i>Invoice Reminders</div>
|
||||
<small class="text-muted">
|
||||
(This will automatically dispatch a reminder email for the invoice to the primary contact's email every 30 days following the invoice's due date.)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox text-center">
|
||||
<input type="checkbox" class="custom-control-input" name="config_send_invoice_reminders" <?php if ($config_send_invoice_reminders == 1) { echo "checked"; } ?> value="1" id="sendInvoiceRemindersSwitch">
|
||||
<label class="custom-control-label" for="sendInvoiceRemindersSwitch"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-redo-alt mr-2"></i>Send Recurring Invoice</div>
|
||||
<small class="text-muted">
|
||||
(This will notify all primary and billing contacts of a client that a new invoice was generated from recurring invoices)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox text-center">
|
||||
<input type="checkbox" class="custom-control-input" name="config_send_invoice_reminders" <?php if ($config_send_invoice_reminders == 1) { echo "checked"; } ?> value="1" id="sendInvoiceRemindersSwitch">
|
||||
<label class="custom-control-label" for="sendInvoiceRemindersSwitch"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-redo-alt mr-2"></i>Send Recurring Invoice</div>
|
||||
<small class="text-muted">
|
||||
(This will notify all primary and billing contacts of a client that a new invoice was generated from recurring invoices)
|
||||
</small>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox text-center">
|
||||
<input type="checkbox" class="custom-control-input" name="config_recurring_auto_send_invoice" <?php if ($config_recurring_auto_send_invoice == 1) { echo "checked"; } ?> value="1" id="sendRecurringSwitch">
|
||||
<label class="custom-control-label" for="sendRecurringSwitch"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan=5>Operational</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-bell mr-2"></i>Send clients general notification emails</div>
|
||||
<small class="text-secondary">(Should clients receive automatic emails when tickets are raised/closed?)</small>
|
||||
</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox text-center">
|
||||
<input type="checkbox" class="custom-control-input" name="config_ticket_client_general_notifications" <?php if($config_ticket_client_general_notifications == 1){ echo "checked"; } ?> value="1" id="ticketNotificationSwitch">
|
||||
<label class="custom-control-label" for="ticketNotificationSwitch"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-link mr-2"></i>Shared Item View</div>
|
||||
<small class="text-secondary">(Notify when Shared items are viewed)</small>
|
||||
</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-clock mr-2"></i>Cron Execution</div>
|
||||
<small class="text-secondary">(Notify when the nightly cron job ran)</small>
|
||||
</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-download mr-2"></i>ITFlow Updates</div>
|
||||
<small class="text-secondary">(Notify when ITFlow has an update)</small>
|
||||
</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox text-center">
|
||||
<input type="checkbox" class="custom-control-input" name="config_recurring_auto_send_invoice" <?php if ($config_recurring_auto_send_invoice == 1) { echo "checked"; } ?> value="1" id="sendRecurringSwitch">
|
||||
<label class="custom-control-label" for="sendRecurringSwitch"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan=5>Operational</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-bell mr-2"></i>Send clients general notification emails</div>
|
||||
<small class="text-secondary">(Should clients receive automatic emails when tickets are raised/closed?)</small>
|
||||
</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox text-center">
|
||||
<input type="checkbox" class="custom-control-input" name="config_ticket_client_general_notifications" <?php if($config_ticket_client_general_notifications == 1){ echo "checked"; } ?> value="1" id="ticketNotificationSwitch">
|
||||
<label class="custom-control-label" for="ticketNotificationSwitch"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-link mr-2"></i>Shared Item View</div>
|
||||
<small class="text-secondary">(Notify when Shared items are viewed)</small>
|
||||
</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-clock mr-2"></i>Cron Execution</div>
|
||||
<small class="text-secondary">(Notify when the nightly cron job ran)</small>
|
||||
</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<div><i class="fas fa-fw fa-download mr-2"></i>ITFlow Updates</div>
|
||||
<small class="text-secondary">(Notify when ITFlow has an update)</small>
|
||||
</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ require_once "includes/inc_all_admin.php";
|
||||
<option value="">- Do not expense Stripe fees -</option>
|
||||
<?php
|
||||
|
||||
$sql_select = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND vendor_template = 0 AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
$sql_select = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_select)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
|
||||
@@ -11,56 +11,63 @@ $stripe_clients_sql = mysqli_query($mysqli, "SELECT * FROM client_stripe LEFT JO
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<table class="table border border-dark">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Client</th>
|
||||
<th>Stripe Customer ID</th>
|
||||
<th>Stripe Payment ID</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($stripe_clients_sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$stripe_id = nullable_htmlentities($row['stripe_id']);
|
||||
$stripe_pm = nullable_htmlentities($row['stripe_pm']);
|
||||
|
||||
?>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table border border-dark">
|
||||
<thead class="thead-dark text-nowrap">
|
||||
<tr>
|
||||
<td><?php echo "$client_name ($client_id)" ?></td>
|
||||
<td><?php echo $stripe_id; ?></td>
|
||||
<td><?php echo $stripe_pm ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<?php if (!empty($stripe_pm)) { ?>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?stripe_remove_pm&client_id=<?php echo $client_id ?>&pm=<?php echo $stripe_pm ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-credit-card mr-2"></i>Delete payment method
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<a data-toggle="tooltip" data-placement="left" title="May result in duplicate customer records in Stripe" class="dropdown-item text-danger confirm-link" href="post.php?stripe_reset_customer&client_id=<?php echo $client_id ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Reset Stripe
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<th>Client</th>
|
||||
<th>Stripe Customer ID</th>
|
||||
<th>Stripe Payment ID</th>
|
||||
<th>Payment Details</th>
|
||||
<th>Created</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php } ?>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($stripe_clients_sql)) {
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$stripe_id = nullable_htmlentities($row['stripe_id']);
|
||||
$stripe_pm = nullable_htmlentities($row['stripe_pm']);
|
||||
$stripe_pm_details = nullable_htmlentities($row['stripe_pm_details']);
|
||||
$stripe_pm_created_at = nullable_htmlentities($row['stripe_pm_created_at']);
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo "$client_name ($client_id)"; ?></td>
|
||||
<td><?php echo $stripe_id; ?></td>
|
||||
<td><?php echo $stripe_pm; ?></td>
|
||||
<td><?php echo $stripe_pm_details; ?></td>
|
||||
<td><?php echo $stripe_pm_created_at; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<?php if (!empty($stripe_pm)) { ?>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?stripe_remove_pm&client_id=<?php echo $client_id ?>&pm=<?php echo $stripe_pm ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-credit-card mr-2"></i>Delete payment method
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<a data-toggle="tooltip" data-placement="left" title="May result in duplicate customer records in Stripe" class="dropdown-item text-danger confirm-link" href="post.php?stripe_reset_customer&client_id=<?php echo $client_id ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Reset Stripe
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -53,6 +53,13 @@ require_once "includes/inc_all_admin.php";
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_ticket_timer_autostart" <?php if ($config_ticket_timer_autostart == 1) { echo "checked"; } ?> value="1" id="ticketTimerSwitch">
|
||||
<label class="custom-control-label" for="ticketTimerSwitch">Autostart Ticket Timer <small class="text-secondary">(This option will control if the timer starts automatically or manually)</small></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Number of hours to auto close resolved tickets</label>
|
||||
<div class="input-group">
|
||||
@@ -73,6 +80,31 @@ require_once "includes/inc_all_admin.php";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Tickets Default View</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_ticket_default_view">
|
||||
<option value=0 <?php if ($config_ticket_default_view == 0) { echo "selected"; } ?>>List</option>
|
||||
<option value=1 <?php if ($config_ticket_default_view == 1) { echo "selected"; } ?>>Compact</option>
|
||||
<option value=2 <?php if ($config_ticket_default_view == 2) { echo "selected"; } ?>>Kanban</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Kanban Settings</label>
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_ticket_ordering" <?php if ($config_ticket_ordering == 1) { echo "checked"; } ?> value="1" id="ticketOrderingSwitch">
|
||||
<label class="custom-control-label" for="ticketOrderingSwitch">Allow ticket ordering within its column<small class="text-secondary">(uncheked will result in ordering it by priority and id)</small></label>
|
||||
</div>
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_ticket_moving_columns" <?php if ($config_ticket_moving_columns == 1) { echo "checked"; } ?> value="1" id="ticketMovingColumnsSwitch">
|
||||
<label class="custom-control-label" for="ticketMovingColumnsSwitch">Allow moving columns</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_ticket_settings" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Save</button>
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
<?php
|
||||
|
||||
// Default Column Sortby Filter
|
||||
$sort = "software_name";
|
||||
$sort = "software_template_name";
|
||||
$order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM software
|
||||
WHERE software_template = 1
|
||||
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%')
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM software_templates
|
||||
WHERE software_template_name LIKE '%$q%' OR software_template_type LIKE '%$q%'
|
||||
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
@@ -53,18 +48,18 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_name&order=<?php echo $disp; ?>">
|
||||
Template <?php if ($sort == 'software_name') { echo $order_icon; } ?>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_template_name&order=<?php echo $disp; ?>">
|
||||
Template <?php if ($sort == 'software_template_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_type&order=<?php echo $disp; ?>">
|
||||
Type <?php if ($sort == 'software_type') { echo $order_icon; } ?>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_template_type&order=<?php echo $disp; ?>">
|
||||
Type <?php if ($sort == 'software_template_type') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_license_type&order=<?php echo $disp; ?>">
|
||||
License Type <?php if ($sort == 'software_license_type') { echo $order_icon; } ?>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=software_template_license_type&order=<?php echo $disp; ?>">
|
||||
License Type <?php if ($sort == 'software_template_license_type') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th class="text-center">Action</th>
|
||||
@@ -74,41 +69,41 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
$software_version = nullable_htmlentities($row['software_version']);
|
||||
$software_description = nullable_htmlentities($row['software_description']);
|
||||
$software_type = nullable_htmlentities($row['software_type']);
|
||||
$software_license_type = nullable_htmlentities($row['software_license_type']);
|
||||
$software_notes = nullable_htmlentities($row['software_notes']);
|
||||
$software_template_id = intval($row['software_template_id']);
|
||||
$software_template_name = nullable_htmlentities($row['software_template_name']);
|
||||
$software_template_version = nullable_htmlentities($row['software_template_version']);
|
||||
$software_template_description = nullable_htmlentities($row['software_template_description']);
|
||||
$software_template_type = nullable_htmlentities($row['software_template_type']);
|
||||
$software_template_license_type = nullable_htmlentities($row['software_template_license_type']);
|
||||
$software_template_notes = nullable_htmlentities($row['software_template_notes']);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a class="text-dark" href="#" data-toggle="ajax-modal" data-ajax-url="ajax/ajax_software_template_edit.php" data-ajax-id="<?php echo $software_id; ?>">
|
||||
<a class="text-dark" href="#" data-toggle="ajax-modal" data-ajax-url="ajax/ajax_software_template_edit.php" data-ajax-id="<?php echo $software_template_id; ?>">
|
||||
<div class="media">
|
||||
<i class="fa fa-fw fa-2x fa-cube mr-3"></i>
|
||||
<div class="media-body">
|
||||
<div><?php echo "$software_name <span>$software_version</span>"; ?></div>
|
||||
<div><small class="text-secondary"><?php echo $software_description; ?></small></div>
|
||||
<div><?php echo "$software_template_name <span>$software_template_version</span>"; ?></div>
|
||||
<div><small class="text-secondary"><?php echo $software_template_description; ?></small></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $software_type; ?></td>
|
||||
<td><?php echo $software_license_type; ?></td>
|
||||
<td><?php echo $software_template_type; ?></td>
|
||||
<td><?php echo $software_template_license_type; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="ajax-modal" data-ajax-url="ajax/ajax_software_template_edit.php" data-ajax-id="<?php echo $software_id; ?>">
|
||||
<a class="dropdown-item" href="#" data-toggle="ajax-modal" data-ajax-url="ajax/ajax_software_template_edit.php" data-ajax-id="<?php echo $software_template_id; ?>">
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<?php if($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_software=<?php echo $software_id; ?>">
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_software_template=<?php echo $software_template_id; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
@@ -6,10 +6,6 @@ $order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM tags
|
||||
|
||||
@@ -6,10 +6,6 @@ $order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM taxes
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
<?php
|
||||
|
||||
// Default Column Sortby Filter
|
||||
$sort = "ticket_status_name";
|
||||
$sort = "ticket_status_order";
|
||||
$order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM ticket_statuses
|
||||
@@ -79,7 +75,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
if ($ticket_status_active) {
|
||||
$ticket_status_display = "<div class='text-success text-bold'>Active</div>";
|
||||
} else {
|
||||
$ticket_status_display = "<div class='text-secondary'>Disabled</div>";
|
||||
$ticket_status_display = "<div class='text-secondary'>Inactive</div>";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -97,7 +93,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<span class='badge badge-pill text-light p-2' style="background-color: <?php echo $ticket_status_color; ?>"><?php echo $ticket_status_name; ?></span>
|
||||
<td><?php echo $ticket_status_display; ?></td>
|
||||
<td>
|
||||
<?php if ( $ticket_status_id > 5 ) { ?>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
@@ -106,13 +101,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<a class="dropdown-item" href="#" data-toggle="ajax-modal" data-ajax-url="ajax/ajax_custom_ticket_status_edit.php" data-ajax-id="<?php echo $ticket_status_id; ?>">
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_ticket_status=<?php echo $ticket_status_id; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
<?php if (!$ticket_status_active) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_ticket_status=<?php echo $ticket_status_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token']; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -6,10 +6,6 @@ $order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM ticket_templates
|
||||
|
||||
@@ -20,7 +20,7 @@ $sql_ticket_templates = mysqli_query($mysqli, "SELECT * FROM ticket_templates WH
|
||||
$row = mysqli_fetch_array($sql_ticket_templates);
|
||||
|
||||
$ticket_template_name = nullable_htmlentities($row['ticket_template_name']);
|
||||
$ticket_template_description = nullable_htmlentities($row['ticket_template_description']);
|
||||
//$ticket_template_description = nullable_htmlentities($row['ticket_template_description']);
|
||||
$ticket_template_subject = nullable_htmlentities($row['ticket_template_subject']);
|
||||
$ticket_template_details = $purifier->purify($row['ticket_template_details']);
|
||||
$ticket_template_created_at = nullable_htmlentities($row['ticket_template_created_at']);
|
||||
@@ -30,156 +30,135 @@ $ticket_template_updated_at = nullable_htmlentities($row['ticket_template_update
|
||||
$sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE task_template_ticket_template_id = $ticket_template_id ORDER BY task_template_order ASC, task_template_id ASC");
|
||||
|
||||
?>
|
||||
<link rel="stylesheet" href="plugins/dragula/dragula.min.css">
|
||||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_user.php">Admin</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_ticket_template.php">Ticket Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-life-ring mr-2"></i><?php echo $ticket_template_name; ?></li>
|
||||
</ol>
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_user.php">Admin</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_ticket_template.php">Ticket Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-life-ring mr-2"></i><?php echo $ticket_template_name; ?></li>
|
||||
</ol>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="row">
|
||||
<div class="col-9">
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title mt-2">
|
||||
<div class="media">
|
||||
<i class="fa fa-fw fa-2x fa-life-ring mr-3"></i>
|
||||
<div class="media-body">
|
||||
<h3 class="mb-0"><?php echo $ticket_template_name; ?></h3>
|
||||
<div><small class="text-secondary"><?php echo $ticket_template_description; ?></small></div>
|
||||
</div>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title mt-2">
|
||||
<div class="media">
|
||||
<i class="fa fa-fw fa-2x fa-life-ring mr-3"></i>
|
||||
<div class="media-body">
|
||||
<h3 class="mb-0"><?php echo $ticket_template_name; ?></h3>
|
||||
<div><small class="text-secondary"><?php //echo $ticket_template_description; ?></small></div>
|
||||
</div>
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#editTicketTemplateModal">
|
||||
<i class="fas fa-edit"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<h5><?php echo $ticket_template_subject; ?></h5>
|
||||
<div class="card-body prettyContent">
|
||||
<?php echo $ticket_template_details; ?>
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#editTicketTemplateModal">
|
||||
<i class="fas fa-edit"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="fa fa-fw fa-tasks mr-2"></i>Tasks</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="ticket_template_id" value="<?php echo $ticket_template_id; ?>">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tasks"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="task_name" placeholder="Create a task" required>
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="add_ticket_template_task" class="btn btn-primary"><i class="fas fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table class="table table-striped table-sm">
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_task_templates)){
|
||||
$task_id = intval($row['task_template_id']);
|
||||
$task_name = nullable_htmlentities($row['task_template_name']);
|
||||
$task_completion_estimate = intval($row['task_template_completion_estimate']);
|
||||
$task_description = nullable_htmlentities($row['task_template_description']);
|
||||
?>
|
||||
<tr data-task-id="<?php echo $task_id; ?>">
|
||||
<td><i class="far fa-fw fa-square text-secondary"></i></td>
|
||||
<td>
|
||||
<a href="#" class="grab-cursor">
|
||||
<span class="text-secondary"><?php echo $task_completion_estimate; ?>m</span>
|
||||
<span class="text-dark"> - <?php echo $task_name; ?></span>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="float-right">
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-link text-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#"
|
||||
data-toggle = "ajax-modal"
|
||||
data-ajax-url = "ajax/ajax_ticket_template_task_edit.php"
|
||||
data-ajax-id = "<?php echo $task_id; ?>"
|
||||
>
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_task_template=<?php echo $task_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-trash-alt mr-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<h5><?php echo $ticket_template_subject; ?></h5>
|
||||
<div class="card-body prettyContent">
|
||||
<?php echo $ticket_template_details; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="js/pretty_content.js"></script>
|
||||
<script src="plugins/dragula/dragula.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var container = $('.table tbody')[0];
|
||||
<div class="col-3">
|
||||
|
||||
dragula([container])
|
||||
.on('drop', function (el, target, source, sibling) {
|
||||
// Handle the drop event to update the order in the database
|
||||
var rows = $(container).children();
|
||||
var positions = rows.map(function(index, row) {
|
||||
return {
|
||||
id: $(row).data('taskId'),
|
||||
order: index
|
||||
};
|
||||
}).get();
|
||||
|
||||
// Send the new order to the server
|
||||
$.ajax({
|
||||
url: 'ajax.php',
|
||||
method: 'POST',
|
||||
data: {
|
||||
update_task_templates_order: true, // Adjust the parameter name if needed
|
||||
ticket_template_id: <?php echo $ticket_template_id; ?>,
|
||||
positions: positions
|
||||
},
|
||||
success: function(data) {
|
||||
// Handle success
|
||||
},
|
||||
error: function(error) {
|
||||
console.error('Error updating order:', error);
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="fa fa-fw fa-tasks mr-2"></i>Tasks</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="ticket_template_id" value="<?php echo $ticket_template_id; ?>">
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" name="task_name" placeholder="Create a task" required maxlength="200">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="add_ticket_template_task" class="btn btn-primary"><i class="fas fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table class="table table-sm" id="tasks">
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_task_templates)){
|
||||
$task_id = intval($row['task_template_id']);
|
||||
$task_name = nullable_htmlentities($row['task_template_name']);
|
||||
$task_completion_estimate = intval($row['task_template_completion_estimate']);
|
||||
//$task_description = nullable_htmlentities($row['task_template_description']);
|
||||
?>
|
||||
<tr data-task-id="<?php echo $task_id; ?>">
|
||||
<td>
|
||||
<a href="#" class="drag-handle"><i class="fas fa-bars text-muted mr-2"></i></a>
|
||||
<span class="text-dark"><?php echo $task_name; ?></span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="float-right">
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-light text-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#"
|
||||
data-toggle = "ajax-modal"
|
||||
data-ajax-url = "ajax/ajax_ticket_template_task_edit.php"
|
||||
data-ajax-id = "<?php echo $task_id; ?>"
|
||||
>
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_task_template=<?php echo $task_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-trash-alt mr-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="js/pretty_content.js"></script>
|
||||
|
||||
<script src="plugins/SortableJS/Sortable.min.js"></script>
|
||||
<script>
|
||||
new Sortable(document.querySelector('table#tasks tbody'), {
|
||||
handle: '.drag-handle',
|
||||
animation: 150,
|
||||
onEnd: function (evt) {
|
||||
const rows = document.querySelectorAll('table#tasks tbody tr');
|
||||
const positions = Array.from(rows).map((row, index) => ({
|
||||
id: row.dataset.taskId,
|
||||
order: index
|
||||
}));
|
||||
|
||||
$.post('ajax.php', {
|
||||
update_task_templates_order: true,
|
||||
ticket_template_id: <?php echo $ticket_template_id; ?>,
|
||||
positions: positions
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -32,8 +32,11 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format
|
||||
<?php } ?>
|
||||
|
||||
<?php if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { ?>
|
||||
<div class="alert alert-warning">
|
||||
<strong>Ensure you have a current <a href="https://docs.itflow.org/backups">app & database backup</a> before updating!</strong>
|
||||
<div class="alert alert-danger">
|
||||
<h1 class="font-weight-bold text-center">⚠️ DANGER ⚠️</h1>
|
||||
<h2 class="font-weight-bold text-center">Do NOT run updates without first taking a backup</h2>
|
||||
<p>VM Snapshots are highly recommended over other methods - see the <a href="https://docs.itflow.org/backups" class="alert-link" target="_blank">docs</a>. Review the <a href="https://github.com/itflow-org/itflow/blob/master/CHANGELOG.md" class="alert-link" target="_blank">changelog</a> for breaking changes that may require manual remediation.</p>
|
||||
<p class="text-center font-weight-bold">Ignore this warning at your own risk.</p>
|
||||
</div>
|
||||
<br>
|
||||
<a class="btn btn-dark btn-lg my-4" href="post.php?update_db"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update Database</h5></a>
|
||||
@@ -46,9 +49,17 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format
|
||||
|
||||
<?php } else {
|
||||
if (!empty($git_log)) { ?>
|
||||
<div class="alert alert-danger">
|
||||
<h1 class="font-weight-bold text-center">⚠️ DANGER ⚠️</h1>
|
||||
<h2 class="font-weight-bold text-center">Do NOT run updates without first taking a backup</h2>
|
||||
<p>VM Snapshots are highly recommended over other methods - see the <a href="https://docs.itflow.org/backups" class="alert-link" target="_blank">docs</a>. Review the <a href="https://github.com/itflow-org/itflow/blob/master/CHANGELOG.md" class="alert-link" target="_blank">changelog</a> for breaking changes that may require manual remediation.</p>
|
||||
<p class="text-center font-weight-bold">Ignore this warning at your own risk.</p>
|
||||
</div>
|
||||
|
||||
<a class="btn btn-primary btn-lg my-4" href="post.php?update"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update App</h5></a>
|
||||
<a class="btn btn-danger btn-lg" href="post.php?update&force_update=1"><i class="fas fa-fw fa-4x fa-hammer mb-1"></i><h5>FORCE Update App</h5></a>
|
||||
<a class="btn btn-primary btn-lg my-4 confirm-link" href="post.php?no"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>TEST</h5></a>
|
||||
|
||||
<a class="btn btn-primary btn-lg my-4 confirm-link" href="post.php?update"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update App</h5></a>
|
||||
<a class="btn btn-danger btn-lg confirm-link" href="post.php?update&force_update=1"><i class="fas fa-fw fa-4x fa-hammer mb-1"></i><h5>FORCE Update App</h5></a>
|
||||
|
||||
<?php } else { ?>
|
||||
<p><strong>Application Release Version:<br><strong class="text-dark"><?php echo APP_VERSION; ?></strong></p>
|
||||
@@ -56,6 +67,17 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format
|
||||
<p class="text-secondary">Code Commit:<br><strong class="text-dark"><?php echo $current_version; ?></strong></p>
|
||||
<p class="text-muted">You are up to date!<br>Everything is going to be alright</p>
|
||||
<i class="far fa-3x text-dark fa-smile-wink"></i><br>
|
||||
|
||||
<?php if (rand(1,10) == 1) { ?>
|
||||
<br>
|
||||
<div class="alert alert-info alert-dismissible fade show" role="alert">
|
||||
You're up to date, but when was the last time you checked your ITFlow backup works?
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
<?php
|
||||
|
||||
// Default Column Sortby Filter
|
||||
$sort = "vendor_name";
|
||||
$sort = "vendor_template_name";
|
||||
$order = "ASC";
|
||||
|
||||
require_once "includes/inc_all_admin.php";
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||
WHERE vendor_template = 1
|
||||
AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%' OR vendor_website LIKE '%$q%' OR vendor_contact_name LIKE '%$q%' OR vendor_email LIKE '%$q%' OR vendor_phone LIKE '%$phone_query%') ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM vendor_templates
|
||||
WHERE vendor_template_name LIKE '%$q%' OR vendor_template_description LIKE '%$q%' OR vendor_template_account_number LIKE '%$q%' OR vendor_template_website LIKE '%$q%' OR vendor_template_contact_name LIKE '%$q%' OR vendor_template_email LIKE '%$q%' OR vendor_template_phone LIKE '%$phone_query%' ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
@@ -53,13 +48,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=vendor_name&order=<?php echo $disp; ?>">
|
||||
Vendor <?php if ($sort == 'vendor_name') { echo $order_icon; } ?>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=vendor_template_name&order=<?php echo $disp; ?>">
|
||||
Vendor <?php if ($sort == 'vendor_template_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=vendor_description&order=<?php echo $disp; ?>">
|
||||
Description <?php if ($sort == 'vendor_description') { echo $order_icon; } ?>
|
||||
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=vendor_template_description&order=<?php echo $disp; ?>">
|
||||
Description <?php if ($sort == 'vendor_template_description') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>Contact</th>
|
||||
@@ -70,30 +65,29 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
$vendor_description = nullable_htmlentities($row['vendor_description']);
|
||||
if (empty($vendor_description)) {
|
||||
$vendor_description_display = "-";
|
||||
$vendor_template_id = intval($row['vendor_template_id']);
|
||||
$vendor_template_name = nullable_htmlentities($row['vendor_template_name']);
|
||||
$vendor_template_description = nullable_htmlentities($row['vendor_template_description']);
|
||||
if (empty($vendor_template_description)) {
|
||||
$vendor_template_description_display = "-";
|
||||
} else {
|
||||
$vendor_description_display = $vendor_description;
|
||||
$vendor_template_description_display = $vendor_template_description;
|
||||
}
|
||||
$vendor_account_number = nullable_htmlentities($row['vendor_account_number']);
|
||||
$vendor_contact_name = nullable_htmlentities($row['vendor_contact_name']);
|
||||
if (empty($vendor_contact_name)) {
|
||||
$vendor_contact_name_display = "-";
|
||||
$vendor_template_account_number = nullable_htmlentities($row['vendor_template_account_number']);
|
||||
$vendor_template_contact_name = nullable_htmlentities($row['vendor_template_contact_name']);
|
||||
if (empty($vendor_template_contact_name)) {
|
||||
$vendor_template_contact_name_display = "-";
|
||||
} else {
|
||||
$vendor_contact_name_display = $vendor_contact_name;
|
||||
$vendor_template_contact_name_display = $vendor_template_contact_name;
|
||||
}
|
||||
$vendor_phone = formatPhoneNumber($row['vendor_phone']);
|
||||
$vendor_extension = nullable_htmlentities($row['vendor_extension']);
|
||||
$vendor_email = nullable_htmlentities($row['vendor_email']);
|
||||
$vendor_website = nullable_htmlentities($row['vendor_website']);
|
||||
$vendor_hours = nullable_htmlentities($row['vendor_hours']);
|
||||
$vendor_sla = nullable_htmlentities($row['vendor_sla']);
|
||||
$vendor_code = nullable_htmlentities($row['vendor_code']);
|
||||
$vendor_notes = nullable_htmlentities($row['vendor_notes']);
|
||||
$vendor_template = intval($row['vendor_template']);
|
||||
$vendor_template_phone = formatPhoneNumber($row['vendor_template_phone']);
|
||||
$vendor_template_extension = nullable_htmlentities($row['vendor_template_extension']);
|
||||
$vendor_template_email = nullable_htmlentities($row['vendor_template_email']);
|
||||
$vendor_template_website = nullable_htmlentities($row['vendor_template_website']);
|
||||
$vendor_template_hours = nullable_htmlentities($row['vendor_template_hours']);
|
||||
$vendor_template_sla = nullable_htmlentities($row['vendor_template_sla']);
|
||||
$vendor_template_code = nullable_htmlentities($row['vendor_template_code']);
|
||||
$vendor_template_notes = nullable_htmlentities($row['vendor_template_notes']);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
@@ -101,38 +95,38 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<a class="text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_vendor_template_edit.php"
|
||||
data-ajax-id="<?php echo $vendor_id; ?>"
|
||||
data-ajax-id="<?php echo $vendor_template_id; ?>"
|
||||
>
|
||||
<i class="fa fa-fw fa-building text-secondary mr-2"></i><?php echo $vendor_name; ?>
|
||||
<i class="fa fa-fw fa-building text-secondary mr-2"></i><?php echo $vendor_template_name; ?>
|
||||
</a>
|
||||
<?php
|
||||
if (!empty($vendor_account_number)) {
|
||||
if (!empty($vendor_template_account_number)) {
|
||||
?>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $vendor_account_number; ?></small>
|
||||
<small class="text-secondary"><?php echo $vendor_template_account_number; ?></small>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</th>
|
||||
<td><?php echo $vendor_description_display; ?></td>
|
||||
<td><?php echo $vendor_template_description_display; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if (!empty($vendor_contact_name)) {
|
||||
if (!empty($vendor_template_contact_name)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_contact_name_display; ?>
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_template_contact_name_display; ?>
|
||||
<br>
|
||||
<?php
|
||||
} else {
|
||||
echo $vendor_contact_name_display;
|
||||
echo $vendor_template_contact_name_display;
|
||||
}
|
||||
|
||||
if (!empty($vendor_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?>
|
||||
if (!empty($vendor_template_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_template_phone; ?>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
if (!empty($vendor_email)) { ?>
|
||||
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
||||
if (!empty($vendor_template_email)) { ?>
|
||||
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_template_email; ?>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
||||
@@ -146,13 +140,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<a class="dropdown-item" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_vendor_template_edit.php"
|
||||
data-ajax-id="<?php echo $vendor_id; ?>"
|
||||
data-ajax-id="<?php echo $vendor_template_id; ?>"
|
||||
>
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_vendor=<?php echo $vendor_id; ?>">
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_vendor=<?php echo $vendor_template_id; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
7
ajax.php
7
ajax.php
@@ -294,6 +294,7 @@ if (isset($_GET['get_active_clients'])) {
|
||||
$mysqli,
|
||||
"SELECT client_id, client_name FROM clients
|
||||
WHERE client_archived_at IS NULL
|
||||
$access_permission_query
|
||||
ORDER BY client_accessed_at DESC"
|
||||
);
|
||||
|
||||
@@ -315,7 +316,9 @@ if (isset($_GET['get_client_contacts'])) {
|
||||
$contact_sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT contact_id, contact_name, contact_primary, contact_important, contact_technical FROM contacts
|
||||
LEFT JOIN clients on contact_client_id = client_id
|
||||
WHERE contacts.contact_archived_at IS NULL AND contact_client_id = $client_id
|
||||
$access_permission_query
|
||||
ORDER BY contact_primary DESC, contact_technical DESC, contact_important DESC, contact_name"
|
||||
);
|
||||
|
||||
@@ -586,13 +589,13 @@ if (isset($_POST['update_recurring_invoice_items_order'])) {
|
||||
enforceUserPermission('module_sales', 2);
|
||||
|
||||
$positions = $_POST['positions'];
|
||||
$recurring_id = intval($_POST['recurring_id']);
|
||||
$recurring_invoice_id = intval($_POST['recurring_invoice_id']);
|
||||
|
||||
foreach ($positions as $position) {
|
||||
$id = intval($position['id']);
|
||||
$order = intval($position['order']);
|
||||
|
||||
mysqli_query($mysqli, "UPDATE invoice_items SET item_order = $order WHERE item_recurring_id = $recurring_id AND item_id = $id");
|
||||
mysqli_query($mysqli, "UPDATE invoice_items SET item_order = $order WHERE item_recurring_invoice_id = $recurring_invoice_id AND item_id = $id");
|
||||
}
|
||||
|
||||
// return a response
|
||||
|
||||
@@ -341,7 +341,7 @@ ob_start();
|
||||
<option value="">- Select Vendor -</option>
|
||||
<?php
|
||||
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id AND vendor_template = 0 ORDER BY vendor_name ASC");
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
@@ -364,6 +364,16 @@ ob_start();
|
||||
</div>
|
||||
|
||||
<?php if ($asset_type !== 'Virtual Machine') { ?>
|
||||
<div class="form-group">
|
||||
<label>Purchase Reference</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-shopping-cart"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="purchase_reference" placeholder="eg. Invoice, PO Number" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Purchase Date</label>
|
||||
<div class="input-group">
|
||||
|
||||
@@ -24,8 +24,8 @@ $asset_make = nullable_htmlentities($row['asset_make']);
|
||||
$asset_model = nullable_htmlentities($row['asset_model']);
|
||||
$asset_serial = nullable_htmlentities($row['asset_serial']);
|
||||
$asset_os = nullable_htmlentities($row['asset_os']);
|
||||
$asset_uri = nullable_htmlentities($row['asset_uri']);
|
||||
$asset_uri_2 = nullable_htmlentities($row['asset_uri_2']);
|
||||
$asset_uri = sanitize_url($row['asset_uri']);
|
||||
$asset_uri_2 = sanitize_url($row['asset_uri_2']);
|
||||
$asset_status = nullable_htmlentities($row['asset_status']);
|
||||
$asset_purchase_reference = nullable_htmlentities($row['asset_purchase_reference']);
|
||||
$asset_purchase_date = nullable_htmlentities($row['asset_purchase_date']);
|
||||
@@ -262,25 +262,25 @@ ob_start();
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if ($asset_type) { ?>
|
||||
<div><i class="fa fa-fw fa-tag text-secondary mr-3"></i><?php echo $asset_type; ?></div>
|
||||
<div><i class="fa fa-fw fa-tag text-secondary mr-2"></i><?php echo $asset_type; ?></div>
|
||||
<?php }
|
||||
if ($asset_make) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-circle text-secondary mr-3"></i><?php echo "$asset_make $asset_model"; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-circle text-secondary mr-2"></i><?php echo "$asset_make $asset_model"; ?></div>
|
||||
<?php }
|
||||
if ($asset_os) { ?>
|
||||
<div class="mt-2"><i class="fab fa-fw fa-windows text-secondary mr-3"></i><?php echo "$asset_os"; ?></div>
|
||||
<div class="mt-2"><i class="fab fa-fw fa-windows text-secondary mr-2"></i><?php echo "$asset_os"; ?></div>
|
||||
<?php }
|
||||
if ($asset_serial) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-barcode text-secondary mr-3"></i><?php echo $asset_serial; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-barcode text-secondary mr-2"></i><?php echo $asset_serial; ?></div>
|
||||
<?php }
|
||||
if ($asset_purchase_date) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-shopping-cart text-secondary mr-3"></i><?php echo date('Y-m-d', strtotime($asset_purchase_date)); ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-shopping-cart text-secondary mr-2"></i><?php echo date('Y-m-d', strtotime($asset_purchase_date)); ?></div>
|
||||
<?php }
|
||||
if ($asset_install_date) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-calendar-check text-secondary mr-3"></i><?php echo date('Y-m-d', strtotime($asset_install_date)); ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-calendar-check text-secondary mr-2"></i><?php echo date('Y-m-d', strtotime($asset_install_date)); ?></div>
|
||||
<?php }
|
||||
if ($asset_warranty_expire) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-exclamation-triangle text-secondary mr-3"></i><?php echo date('Y-m-d', strtotime($asset_warranty_expire)); ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-exclamation-triangle text-secondary mr-2"></i><?php echo date('Y-m-d', strtotime($asset_warranty_expire)); ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -291,19 +291,19 @@ ob_start();
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if ($asset_ip) { ?>
|
||||
<div><i class="fa fa-fw fa-globe text-secondary mr-3"></i><?php echo $asset_ip; ?></div>
|
||||
<div><i class="fa fa-fw fa-globe text-secondary mr-2"></i><?php echo $asset_ip; ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($asset_nat_ip) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-random text-secondary mr-3"></i><?php echo $asset_nat_ip; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-random text-secondary mr-2"></i><?php echo $asset_nat_ip; ?></div>
|
||||
<?php }
|
||||
if ($asset_mac) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-ethernet text-secondary mr-3"></i><?php echo $asset_mac; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-ethernet text-secondary mr-2"></i><?php echo $asset_mac; ?></div>
|
||||
<?php }
|
||||
if ($asset_uri) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-3"></i><a href="<?php echo $asset_uri; ?>" target="_blank">Link</a></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-2"></i><a href="<?php echo $asset_uri; ?>" target="_blank" title="<?php echo $asset_uri; ?>"><?php echo truncate($asset_uri, 20); ?></a></div>
|
||||
<?php }
|
||||
if ($asset_uri_2) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-3"></i><a href="<?php echo $asset_uri_2; ?>" target="_blank">Link 2</a></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-2"></i><a href="<?php echo $asset_uri_2; ?>" target="_blank" title="<?php echo $asset_uri_2; ?>"><?php echo truncate($asset_uri_2, 20); ?></a></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -315,19 +315,19 @@ ob_start();
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if ($location_name) { ?>
|
||||
<div><i class="fa fa-fw fa-map-marker-alt text-secondary mr-3"></i><?php echo $location_name_display; ?></div>
|
||||
<div><i class="fa fa-fw fa-map-marker-alt text-secondary mr-2"></i><?php echo $location_name_display; ?></div>
|
||||
<?php }
|
||||
if ($contact_name) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-user text-secondary mr-3"></i><?php echo $contact_name_display; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-user text-secondary mr-2"></i><?php echo $contact_name_display; ?></div>
|
||||
<?php }
|
||||
if ($contact_email) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-envelope text-secondary mr-3"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-envelope text-secondary mr-2"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<?php }
|
||||
if ($contact_phone) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-phone text-secondary mr-3"></i><?php echo formatPhoneNumber($contact_phone); echo " $contact_extension"; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-phone text-secondary mr-2"></i><?php echo formatPhoneNumber($contact_phone); echo " $contact_extension"; ?></div>
|
||||
<?php }
|
||||
if ($contact_mobile) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-3"></i><?php echo formatPhoneNumber($contact_mobile); ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-2"></i><?php echo formatPhoneNumber($contact_mobile); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
69
ajax/ajax_asset_link_credential.php
Normal file
69
ajax/ajax_asset_link_credential.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i>Link Credential to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="credential_id">
|
||||
<option value="">- Select a Credential -</option>
|
||||
<?php
|
||||
$sql_credentials_select = mysqli_query($mysqli, "
|
||||
SELECT credentials.credential_id, credentials.credential_name
|
||||
FROM credentials
|
||||
LEFT JOIN assets ON credentials.credential_asset_id = assets.asset_id
|
||||
AND credentials.credential_asset_id = $asset_id
|
||||
WHERE credentials.credential_client_id = $client_id
|
||||
AND credentials.credential_asset_id = 0
|
||||
AND credentials.credential_archived_at IS NULL
|
||||
ORDER BY credentials.credential_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_credentials_select)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
?>
|
||||
<option value="<?php echo $credential_id ?>"><?php echo $credential_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_credential" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
?>
|
||||
70
ajax/ajax_asset_link_document.php
Normal file
70
ajax/ajax_asset_link_document.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-folder mr-2"></i>Link Document to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="document_id">
|
||||
<option value="">- Select a Document -</option>
|
||||
<?php
|
||||
$sql_documents_select = mysqli_query($mysqli, "
|
||||
SELECT documents.document_id, documents.document_name
|
||||
FROM documents
|
||||
LEFT JOIN asset_documents
|
||||
ON documents.document_id = asset_documents.document_id
|
||||
AND asset_documents.asset_id = $asset_id
|
||||
WHERE documents.document_client_id = $client_id
|
||||
AND documents.document_archived_at IS NULL
|
||||
AND asset_documents.asset_id IS NULL
|
||||
ORDER BY documents.document_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
?>
|
||||
<option value="<?php echo $document_id ?>"><?php echo $document_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_document" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
?>
|
||||
73
ajax/ajax_asset_link_file.php
Normal file
73
ajax/ajax_asset_link_file.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-paperclip mr-2"></i>Link File to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paperclip"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="file_id">
|
||||
<option value="">- Select a File -</option>
|
||||
<?php
|
||||
$sql_files_select = mysqli_query($mysqli, "
|
||||
SELECT files.file_id, files.file_name, folders.folder_name
|
||||
FROM files
|
||||
LEFT JOIN asset_files
|
||||
ON files.file_id = asset_files.file_id
|
||||
AND asset_files.asset_id = $asset_id
|
||||
LEFT JOIN folders
|
||||
ON folders.folder_id = files.file_folder_id
|
||||
WHERE files.file_client_id = $client_id
|
||||
AND asset_files.asset_id IS NULL
|
||||
ORDER BY folders.folder_name ASC, files.file_name ASC
|
||||
");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
?>
|
||||
<option value="<?php echo $file_id ?>"><?php echo "$folder_name/$file_name"; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_asset_to_file" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
?>
|
||||
68
ajax/ajax_asset_link_service.php
Normal file
68
ajax/ajax_asset_link_service.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-stream mr-2"></i>Link Service to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="service_id">
|
||||
<option value="">- Select a Service -</option>
|
||||
<?php
|
||||
$sql_services_select = mysqli_query($mysqli, "
|
||||
SELECT services.service_id, services.service_name
|
||||
FROM services
|
||||
LEFT JOIN service_assets
|
||||
ON services.service_id = service_assets.service_id
|
||||
AND service_assets.asset_id = $asset_id
|
||||
WHERE services.service_client_id = $client_id
|
||||
AND service_assets.asset_id IS NULL
|
||||
ORDER BY services.service_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
?>
|
||||
<option value="<?php echo $service_id ?>"><?php echo $service_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_service_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
73
ajax/ajax_asset_link_software.php
Normal file
73
ajax/ajax_asset_link_software.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$asset_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets
|
||||
WHERE asset_id = $asset_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$client_id = intval($row['asset_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>License Software to <strong><?php echo $asset_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="asset_id" value="<?php echo $asset_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="software_id">
|
||||
<option value="">- Select a Device Software License -</option>
|
||||
<?php
|
||||
$sql_software_select = mysqli_query($mysqli, "
|
||||
SELECT software.software_id, software.software_name
|
||||
FROM software
|
||||
LEFT JOIN software_assets
|
||||
ON software.software_id = software_assets.software_id
|
||||
AND software_assets.asset_id = $asset_id
|
||||
WHERE software.software_client_id = $client_id
|
||||
AND software.software_archived_at IS NULL
|
||||
AND software.software_license_type = 'Device'
|
||||
AND software_assets.asset_id IS NULL
|
||||
ORDER BY software.software_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $software_id ?>"><?php echo $software_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_software_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
@@ -22,7 +22,7 @@ $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_
|
||||
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
|
||||
$contact_extension = nullable_htmlentities($row['contact_extension']);
|
||||
$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']);
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code));
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code));
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_photo = nullable_htmlentities($row['contact_photo']);
|
||||
$contact_pin = nullable_htmlentities($row['contact_pin']);
|
||||
@@ -125,7 +125,6 @@ $sql_linked_documents = mysqli_query($mysqli, "SELECT * FROM contact_documents,
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE contact_documents.contact_id = $contact_id
|
||||
AND contact_documents.document_id = documents.document_id
|
||||
AND document_template = 0
|
||||
AND document_archived_at IS NULL
|
||||
ORDER BY document_name ASC"
|
||||
);
|
||||
|
||||
@@ -19,7 +19,7 @@ $contact_extension = nullable_htmlentities($row['contact_extension']);
|
||||
$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']);
|
||||
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
|
||||
$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']);
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code));
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code));
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_pin = nullable_htmlentities($row['contact_pin']);
|
||||
$contact_photo = nullable_htmlentities($row['contact_photo']);
|
||||
@@ -121,7 +121,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="tel" class="form-control col-2" name="phone_country_code" value="<?php echo "+$contact_phone_country_code"; ?>" placeholder="Code" maxlength="4">
|
||||
<input type="tel" class="form-control col-2" name="phone_country_code" value="<?php echo "$contact_phone_country_code"; ?>" placeholder="+" maxlength="4">
|
||||
<input type="tel" class="form-control" name="phone" value="<?php echo $contact_phone; ?>" placeholder="Phone Number" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
@@ -141,7 +141,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-mobile-alt"></i></span>
|
||||
</div>
|
||||
<input type="tel" class="form-control col-2" name="mobile_country_code" value="<?php echo "+$contact_mobile_country_code"; ?>" placeholder="Code" maxlength="4">
|
||||
<input type="tel" class="form-control col-2" name="mobile_country_code" value="<?php echo "$contact_mobile_country_code"; ?>" placeholder="+" maxlength="4">
|
||||
<input type="tel" class="form-control" name="mobile" value="<?php echo $contact_mobile; ?>" placeholder="Phone Number">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
67
ajax/ajax_contact_link_asset.php
Normal file
67
ajax/ajax_contact_link_asset.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-desktop mr-2"></i>Link Asset to <strong><?php echo $contact_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="asset_id">
|
||||
<option value="">- Select an Asset -</option>
|
||||
<?php
|
||||
$sql_assets_select = mysqli_query($mysqli, "
|
||||
SELECT asset_id, asset_name
|
||||
FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_contact_id = 0
|
||||
AND asset_archived_at IS NULL
|
||||
ORDER BY asset_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_assets_select)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
?>
|
||||
<option value="<?php echo $asset_id ?>"><?php echo $asset_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_asset" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
?>
|
||||
67
ajax/ajax_contact_link_credential.php
Normal file
67
ajax/ajax_contact_link_credential.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key mr-2"></i>Link Credential to <strong><?php echo $contact_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="credential_id">
|
||||
<option value="">- Select a Credential -</option>
|
||||
<?php
|
||||
$sql_credentials_select = mysqli_query($mysqli, "
|
||||
SELECT credential_id, credential_name
|
||||
FROM credentials
|
||||
WHERE credential_client_id = $client_id
|
||||
AND credential_contact_id = 0
|
||||
AND credential_archived_at IS NULL
|
||||
ORDER BY credential_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_credentials_select)) {
|
||||
$credential_id = intval($row['credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
?>
|
||||
<option value="<?php echo $credential_id ?>"><?php echo $credential_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_credential" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
?>
|
||||
70
ajax/ajax_contact_link_document.php
Normal file
70
ajax/ajax_contact_link_document.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-folder mr-2"></i>Link Document to <strong><?php echo $contact_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="document_id">
|
||||
<option value="">- Select a Document -</option>
|
||||
<?php
|
||||
$sql_documents_select = mysqli_query($mysqli, "
|
||||
SELECT documents.document_id, documents.document_name
|
||||
FROM documents
|
||||
LEFT JOIN contact_documents
|
||||
ON documents.document_id = contact_documents.document_id
|
||||
AND contact_documents.contact_id = $contact_id
|
||||
WHERE documents.document_client_id = $client_id
|
||||
AND documents.document_archived_at IS NULL
|
||||
AND contact_documents.contact_id IS NULL
|
||||
ORDER BY documents.document_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_documents_select)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
?>
|
||||
<option value="<?php echo $document_id ?>"><?php echo $document_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_document" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
?>
|
||||
72
ajax/ajax_contact_link_file.php
Normal file
72
ajax/ajax_contact_link_file.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-paperclip mr-2"></i>Link File to <strong><?php echo $contact_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-paperclip"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="file_id">
|
||||
<option value="">- Select a File -</option>
|
||||
<?php
|
||||
$sql_files_select = mysqli_query($mysqli, "
|
||||
SELECT files.file_id, files.file_name, folders.folder_name
|
||||
FROM files
|
||||
LEFT JOIN contact_files
|
||||
ON files.file_id = contact_files.file_id
|
||||
AND contact_files.contact_id = $contact_id
|
||||
LEFT JOIN folders
|
||||
ON folders.folder_id = files.file_folder_id
|
||||
WHERE files.file_client_id = $client_id
|
||||
AND contact_files.contact_id IS NULL
|
||||
ORDER BY folders.folder_name ASC, files.file_name ASC
|
||||
");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_files_select)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$folder_name = nullable_htmlentities($row['folder_name']);
|
||||
?>
|
||||
<option value="<?php echo $file_id ?>"><?php echo "$folder_name/$file_name"; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_contact_to_file" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
68
ajax/ajax_contact_link_service.php
Normal file
68
ajax/ajax_contact_link_service.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-stream mr-2"></i>Link Service to <strong><?php echo $contact_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-stream"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="service_id">
|
||||
<option value="">- Select a Service -</option>
|
||||
<?php
|
||||
$sql_services_select = mysqli_query($mysqli, "
|
||||
SELECT services.service_id, services.service_name
|
||||
FROM services
|
||||
LEFT JOIN service_contacts
|
||||
ON services.service_id = service_contacts.service_id
|
||||
AND service_contacts.contact_id = $contact_id
|
||||
WHERE services.service_client_id = $client_id
|
||||
AND service_contacts.contact_id IS NULL
|
||||
ORDER BY services.service_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_services_select)) {
|
||||
$service_id = intval($row['service_id']);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
?>
|
||||
<option value="<?php echo $service_id ?>"><?php echo $service_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_service_to_contact" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
71
ajax/ajax_contact_link_software.php
Normal file
71
ajax/ajax_contact_link_software.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$contact_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts
|
||||
WHERE contact_id = $contact_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$client_id = intval($row['contact_client_id']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-cube mr-2"></i>License Software to <strong><?php echo $contact_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-cube"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="software_id">
|
||||
<option value="">- Select a User Software License -</option>
|
||||
<?php
|
||||
$sql_software_select = mysqli_query($mysqli, "
|
||||
SELECT software.software_id, software.software_name
|
||||
FROM software
|
||||
LEFT JOIN software_contacts
|
||||
ON software.software_id = software_contacts.software_id
|
||||
AND software_contacts.contact_id = $contact_id
|
||||
WHERE software.software_client_id = $client_id
|
||||
AND software.software_archived_at IS NULL
|
||||
AND software.software_license_type = 'User'
|
||||
AND software_contacts.contact_id IS NULL
|
||||
ORDER BY software.software_name ASC
|
||||
");
|
||||
while ($row = mysqli_fetch_array($sql_software_select)) {
|
||||
$software_id = intval($row['software_id']);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
?>
|
||||
<option value="<?php echo $software_id ?>"><?php echo $software_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="link_software_to_contact" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Link</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
?>
|
||||
@@ -12,6 +12,8 @@ $credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
$credential_uri = nullable_htmlentities($row['credential_uri']);
|
||||
$credential_uri_2 = nullable_htmlentities($row['credential_uri_2']);
|
||||
$credential_uri_link = sanitize_url($row['credential_uri']);
|
||||
$credential_uri_2_link = sanitize_url($row['credential_uri_2']);
|
||||
$credential_username = nullable_htmlentities(decryptCredentialEntry($row['credential_username']));
|
||||
$credential_password = nullable_htmlentities(decryptCredentialEntry($row['credential_password']));
|
||||
$credential_otp_secret = nullable_htmlentities($row['credential_otp_secret']);
|
||||
@@ -137,7 +139,7 @@ ob_start();
|
||||
<input type="text" class="form-control" name="uri" placeholder="ex. http://192.168.1.1" maxlength="500" value="<?php echo $credential_uri; ?>">
|
||||
<div class="input-group-append">
|
||||
|
||||
<a href="<?php echo $credential_uri; ?>" class="input-group-text"><i class="fa fa-fw fa-link"></i></a>
|
||||
<a href="<?php echo $credential_uri_link; ?>" target="_blank" class="input-group-text"><i class="fa fa-fw fa-link"></i></a>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="input-group-text clipboardjs" type="button" data-clipboard-text="<?php echo $credential_uri; ?>"><i class="fa fa-fw fa-copy"></i></button>
|
||||
@@ -153,7 +155,7 @@ ob_start();
|
||||
</div>
|
||||
<input type="text" class="form-control" name="uri_2" placeholder="ex. https://server.company.com:5001" maxlength="500" value="<?php echo $credential_uri_2; ?>">
|
||||
<div class="input-group-append">
|
||||
<a href="<?php echo $credential_uri_2; ?>" class="input-group-text"><i class="fa fa-fw fa-link"></i></a>
|
||||
<a href="<?php echo $credential_uri_2_link; ?>" target="_blank" class="input-group-text"><i class="fa fa-fw fa-link"></i></a>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="input-group-text clipboardjs" type="button" data-clipboard-text="<?php echo $credential_uri_2; ?>"><i class="fa fa-fw fa-copy"></i></button>
|
||||
|
||||
@@ -8,6 +8,7 @@ $sql = mysqli_query($mysqli, "SELECT * FROM ticket_statuses WHERE ticket_status_
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$ticket_status_name = nullable_htmlentities($row['ticket_status_name']);
|
||||
$ticket_status_color = nullable_htmlentities($row['ticket_status_color']);
|
||||
$ticket_status_order = intval($row['ticket_status_order']);
|
||||
$ticket_status_active = intval($row['ticket_status_active']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
@@ -30,7 +31,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" maxlength="200" value="<?php echo $ticket_status_name; ?>" required>
|
||||
<input type="text" class="form-control" name="name" maxlength="200" value="<?php echo $ticket_status_name; ?>" required <?php if ($ticket_status_id <= 5) { echo "readonly"; } ?>>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,6 +45,16 @@ ob_start();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Order</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-sort-numeric-down"></i></span>
|
||||
</div>
|
||||
<input type="number" class="form-control" name="order" placeholder="Leave blank for no order" value="<?php echo $ticket_status_order; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Status <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
@@ -52,7 +63,7 @@ ob_start();
|
||||
</div>
|
||||
<select class="form-control select2" name="status" required>
|
||||
<option <?php if ($ticket_status_active == 1) { echo "selected"; } ?> value="1">Active</option>
|
||||
<option <?php if ($ticket_status_active == 0) { echo "selected"; } ?> value="0">Disabled</option>
|
||||
<option <?php if ($ticket_status_active == 0) { echo "selected"; } ?> value="0" <?php if ($ticket_status_id <= 5) { echo "disabled"; } ?>>Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,12 +10,7 @@ $row = mysqli_fetch_array($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
$document_content = nullable_htmlentities($row['document_content']);
|
||||
$document_created_by_id = intval($row['document_created_by']);
|
||||
$document_created_at = nullable_htmlentities($row['document_created_at']);
|
||||
$document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
||||
$document_archived_at = nullable_htmlentities($row['document_archived_at']);
|
||||
$document_folder_id = intval($row['document_folder_id']);
|
||||
$document_parent = intval($row['document_parent']);
|
||||
$document_client_visible = intval($row['document_client_visible']);
|
||||
$client_id = intval($row['document_client_id']);
|
||||
|
||||
@@ -30,10 +25,8 @@ ob_start();
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="document_id" value="<?php if($document_parent == 0){ echo $document_id; } else { echo $document_parent; } ?>">
|
||||
<input type="hidden" name="document_parent" value="<?php echo $document_parent; ?>">
|
||||
<input type="hidden" name="document_id" value="<?php echo $document_id; ?>">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<input type="hidden" name="created_by" value="<?php echo $document_created_by_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -2,38 +2,38 @@
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$document_id = intval($_GET['id']);
|
||||
$document_template_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = $document_id LIMIT 1");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM document_templates WHERE document_template_id = $document_template_id LIMIT 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
$document_content = nullable_htmlentities($row['document_content']);
|
||||
$document_template_name = nullable_htmlentities($row['document_template_name']);
|
||||
$document_template_description = nullable_htmlentities($row['document_template_description']);
|
||||
$document_template_content = nullable_htmlentities($row['document_template_content']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-file-alt mr-2"></i>Editing template: <strong><?php echo $document_name; ?></strong></h5>
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-file-alt mr-2"></i>Editing template: <strong><?php echo $document_template_name; ?></strong></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="document_id" value="<?php echo $document_id; ?>">
|
||||
<input type="hidden" name="document_template_id" value="<?php echo $document_template_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" maxlength="200" value="<?php echo $document_name; ?>" placeholder="Name" required>
|
||||
<input type="text" class="form-control" name="name" maxlength="200" value="<?php echo $document_template_name; ?>" placeholder="Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control tinymce" name="content"><?php echo $document_content; ?></textarea>
|
||||
<textarea class="form-control tinymce" name="content"><?php echo $document_template_content; ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="description" value="<?php echo $document_description; ?>" placeholder="Short summary">
|
||||
<input type="text" class="form-control" name="description" value="<?php echo $document_template_description; ?>" placeholder="Short summary">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
39
ajax/ajax_document_version_view.php
Normal file
39
ajax/ajax_document_version_view.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
// Initialize the HTML Purifier to prevent XSS
|
||||
require_once "../plugins/htmlpurifier/HTMLPurifier.standalone.php";
|
||||
|
||||
$purifier_config = HTMLPurifier_Config::createDefault();
|
||||
$purifier_config->set('Cache.DefinitionImpl', null); // Disable cache by setting a non-existent directory or an invalid one
|
||||
$purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'http' => true, 'https' => true]);
|
||||
$purifier = new HTMLPurifier($purifier_config);
|
||||
|
||||
$document_version_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM document_versions WHERE document_version_id = $document_version_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$document_version_name = nullable_htmlentities($row['document_version_name']);
|
||||
$document_version_content = $purifier->purify($row['document_version_content']);
|
||||
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title text-white"><i class="fa fa-fw fa-file-alt mr-2"></i><?php echo $document_version_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body bg-white prettyContent">
|
||||
<?php echo $document_version_content; ?>
|
||||
</div>
|
||||
|
||||
<script src="../js/pretty_content.js"></script>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
@@ -33,5 +33,8 @@ ob_start();
|
||||
<?php echo $document_content; ?>
|
||||
</div>
|
||||
|
||||
<script src="../js/pretty_content.js"></script>
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ ob_start();
|
||||
<select class="form-control select2" name="vendor" required>
|
||||
<?php
|
||||
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND vendor_template = 0 ORDER BY vendor_name ASC");
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
|
||||
@@ -119,7 +119,7 @@ ob_start();
|
||||
<select class="form-control select2" name="vendor" required>
|
||||
<?php
|
||||
|
||||
$sql_select = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND vendor_template = 0 AND (vendor_archived_at > '$expense_created_at' OR vendor_archived_at IS NULL) ORDER BY vendor_name ASC");
|
||||
$sql_select = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND (vendor_archived_at > '$expense_created_at' OR vendor_archived_at IS NULL) ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_select)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
|
||||
182
ajax/ajax_invoice_pay.php
Normal file
182
ajax/ajax_invoice_pay.php
Normal file
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$invoice_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM invoices
|
||||
LEFT JOIN clients ON invoice_client_id = client_id
|
||||
LEFT JOIN contacts ON client_id = contact_client_id AND contact_primary = 1
|
||||
WHERE invoice_id = $invoice_id
|
||||
LIMIT 1"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$invoice_id = intval($row['invoice_id']);
|
||||
$invoice_prefix = nullable_htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = intval($row['invoice_number']);
|
||||
$invoice_amount = floatval($row['invoice_amount']);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$client_currency_code = nullable_htmlentities($row['client_currency_code']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
|
||||
|
||||
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||
$sql_amount_paid = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS amount_paid FROM payments WHERE payment_invoice_id = $invoice_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
$amount_paid = floatval($row['amount_paid']);
|
||||
|
||||
$balance = $invoice_amount - $amount_paid;
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-credit-card mr-2"></i><?php echo "$invoice_prefix$invoice_number"; ?>: Make Payment</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||
<input type="hidden" name="balance" value="<?php echo $balance; ?>">
|
||||
<input type="hidden" name="currency_code" value="<?php echo $client_currency_code; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Date <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="date" max="2999-12-31" value="<?php echo date("Y-m-d"); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Amount <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($balance, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Account <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="account" required>
|
||||
<option value="">- Select an Account -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM accounts WHERE account_archived_at IS NULL ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$account_id = intval($row['account_id']);
|
||||
$account_name = nullable_htmlentities($row['account_name']);
|
||||
$opening_balance = floatval($row['opening_balance']);
|
||||
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$total_payments = floatval($row['total_payments']);
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli, "SELECT SUM(revenue_amount) AS total_revenues FROM revenues WHERE revenue_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$total_revenues = floatval($row['total_revenues']);
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE expense_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$account_balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
|
||||
|
||||
?>
|
||||
<option <?php if ($config_default_payment_account == $account_id) { echo "selected"; } ?>
|
||||
value="<?php echo $account_id; ?>">
|
||||
<?php echo $account_name; ?> [$<?php echo number_format($account_balance, 2); ?>]
|
||||
</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Payment Method <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-money-check-alt"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="payment_method" required>
|
||||
<option value="">- Method of Payment -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Payment Method' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
?>
|
||||
<option <?php if ($config_default_payment_method == $category_name) {
|
||||
echo "selected";
|
||||
} ?>><?php echo $category_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Reference</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-file-alt"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="reference" placeholder="Check #, Trans #, etc" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($config_smtp_host) && !empty($contact_email)) { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Email Receipt</label>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="customControlAutosizing" name="email_receipt" value="1" checked>
|
||||
<label class="custom-control-label" for="customControlAutosizing"><?php echo $contact_email; ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="add_payment" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Pay</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
require_once "../includes/ajax_footer.php";
|
||||
@@ -209,7 +209,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="tel" class="form-control col-2" name="phone_country_code" value="<?php echo "+$location_phone_country_code"; ?>" placeholder="Code" maxlength="4">
|
||||
<input type="tel" class="form-control col-2" name="phone_country_code" value="<?php echo $location_phone_country_code; ?>" placeholder="+" maxlength="4">
|
||||
<input type="tel" class="form-control" name="phone" value="<?php echo $location_phone; ?>" placeholder="Phone Number" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
@@ -229,7 +229,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-fax"></i></span>
|
||||
</div>
|
||||
<input type="tel" class="form-control col-2" name="fax_country_code" value="<?php echo "+$location_fax_country_code"; ?>" placeholder="Code" maxlength="4">
|
||||
<input type="tel" class="form-control col-2" name="fax_country_code" value="<?php echo $location_fax_country_code; ?>" placeholder="+" maxlength="4">
|
||||
<input type="tel" class="form-control" name="fax" value="<?php echo $location_fax; ?>" placeholder="Phone Number" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -90,7 +90,7 @@ ob_start();
|
||||
$location_id = intval($row['location_id']);
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
?>
|
||||
<option value="<?php echo $location_id; ?>" <?php if ($location_id = $network_location_id) { echo "selected"; } ?>>
|
||||
<option value="<?php echo $location_id; ?>" <?php if ($location_id == $network_location_id) { echo "selected"; } ?>>
|
||||
<?php echo $location_name; ?>
|
||||
</option>
|
||||
<?php
|
||||
|
||||
@@ -25,46 +25,56 @@ ob_start();
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
<?php if ($num_notifications) { ?>
|
||||
<table class="table table-sm table-hover table-borderless">
|
||||
|
||||
<?php while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
$notification_id = intval($row["notification_id"]);
|
||||
$notification_type = nullable_htmlentities($row["notification_type"]);
|
||||
$notification_details = nullable_htmlentities($row["notification"]);
|
||||
$notification_action = nullable_htmlentities(
|
||||
$row["notification_action"]
|
||||
);
|
||||
$notification_timestamp_formated = date(
|
||||
"M d g:ia",
|
||||
strtotime($row["notification_timestamp"])
|
||||
);
|
||||
$notification_client_id = intval($row["notification_client_id"]);
|
||||
if (empty($notification_action)) {
|
||||
$notification_action = "#";
|
||||
<?php while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
$notification_id = intval($row["notification_id"]);
|
||||
$notification_type = nullable_htmlentities($row["notification_type"]);
|
||||
$notification_details = nullable_htmlentities($row["notification"]);
|
||||
$notification_action = nullable_htmlentities(
|
||||
$row["notification_action"]
|
||||
);
|
||||
$notification_timestamp_formated = date(
|
||||
"M d g:ia",
|
||||
strtotime($row["notification_timestamp"])
|
||||
);
|
||||
$notification_client_id = intval($row["notification_client_id"]);
|
||||
if (empty($notification_action)) {
|
||||
$notification_action = "#";
|
||||
}
|
||||
?>
|
||||
|
||||
<tr class="notification-item">
|
||||
<th>
|
||||
<a class="text-dark" href="<?php echo $notification_action; ?>">
|
||||
<i class="fas fa-bullhorn mr-2"></i><?php echo $notification_type; ?>
|
||||
<small class="text-muted float-right">
|
||||
<?php echo $notification_timestamp_formated; ?>
|
||||
</small>
|
||||
<br>
|
||||
<small class="text-secondary text-wrap"><?php echo $notification_details; ?></small>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<a class="text-dark dropdown-item px-1" href="<?php echo $notification_action; ?>">
|
||||
<div>
|
||||
<span class="text-bold">
|
||||
<i class="fas fa-bullhorn mr-2"></i><?php echo $notification_type; ?>
|
||||
</span>
|
||||
<small class="text-muted float-right">
|
||||
<?php echo $notification_timestamp_formated; ?>
|
||||
</small>
|
||||
</table>
|
||||
<div class="text-center mt-2">
|
||||
<button id="prev-btn" class="btn btn-sm btn-outline-secondary mr-2"><i class="fas fa-caret-left"></i></button>
|
||||
<button id="next-btn" class="btn btn-sm btn-outline-secondary"><i class="fas fa-caret-right"></i></button>
|
||||
</div>
|
||||
<small class="text-secondary text-wrap"><?php echo $notification_details; ?></small>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
}} else { ?>
|
||||
<div class="text-center text-secondary py-5">
|
||||
<?php } else { ?>
|
||||
<div class="text-center text-secondary pt-3">
|
||||
<i class='far fa-6x fa-bell-slash'></i>
|
||||
<h3 class="mt-3">No Notifications</h3>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="modal-footer bg-white justify-content-end">
|
||||
<div class="modal-footer bg-white">
|
||||
<?php if ($num_notifications) { ?>
|
||||
|
||||
<a href="post.php?dismiss_all_notifications&csrf_token=<?php echo $_SESSION[
|
||||
@@ -85,4 +95,41 @@ ob_start();
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var perPage = 8;
|
||||
var $items = $(".notification-item");
|
||||
var totalItems = $items.length;
|
||||
var totalPages = Math.ceil(totalItems / perPage);
|
||||
var currentPage = 0;
|
||||
|
||||
function showPage(page) {
|
||||
$items.hide().slice(page * perPage, (page + 1) * perPage).show();
|
||||
$("#prev-btn").prop("disabled", page === 0);
|
||||
$("#next-btn").prop("disabled", page >= totalPages - 1);
|
||||
$("#page-indicator").text(`Page ${page + 1} of ${totalPages} (${totalItems} total)`);
|
||||
}
|
||||
|
||||
$("#prev-btn").on("click", function () {
|
||||
if (currentPage > 0) {
|
||||
currentPage--;
|
||||
showPage(currentPage);
|
||||
}
|
||||
});
|
||||
|
||||
$("#next-btn").on("click", function () {
|
||||
if (currentPage < totalPages - 1) {
|
||||
currentPage++;
|
||||
showPage(currentPage);
|
||||
}
|
||||
});
|
||||
|
||||
if (totalItems <= perPage) {
|
||||
$("#prev-btn, #next-btn, #page-indicator").hide();
|
||||
}
|
||||
|
||||
showPage(currentPage);
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php require_once "../includes/ajax_footer.php";
|
||||
|
||||
@@ -85,6 +85,25 @@ ob_start();
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Client</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="client_id">
|
||||
<option value="0">- No Client -</option>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients WHERE client_archived_at IS NULL $access_permission_query ORDER BY client_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$select_client_id = intval($row['client_id']);
|
||||
$select_client_name = nullable_htmlentities($row['client_name']);
|
||||
?>
|
||||
<option value="<?php echo $select_client_id; ?>" <?php if ($client_id == $select_client_id) { echo "selected"; } ?>><?php echo $select_client_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="edit_project" class="btn btn-primary text-bold">
|
||||
|
||||
@@ -157,7 +157,7 @@ ob_start();
|
||||
<select class="form-control select2" name="vendor" required>
|
||||
<?php
|
||||
|
||||
$sql_select = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND vendor_template = 0 AND (vendor_archived_at > '$recurring_expense_created_at' OR vendor_archived_at IS NULL) ORDER BY vendor_name ASC");
|
||||
$sql_select = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = 0 AND (vendor_archived_at > '$recurring_expense_created_at' OR vendor_archived_at IS NULL) ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_select)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
|
||||
@@ -16,6 +16,7 @@ $recurring_ticket_next_run = nullable_htmlentities($row['recurring_ticket_next_r
|
||||
$recurring_ticket_assigned_to = intval($row['recurring_ticket_assigned_to']);
|
||||
$recurring_ticket_contact_id = intval($row['recurring_ticket_contact_id']);
|
||||
$recurring_ticket_asset_id = intval($row['recurring_ticket_asset_id']);
|
||||
$recurring_ticket_category = intval($row['recurring_ticket_category']);
|
||||
$recurring_ticket_billable = intval($row['recurring_ticket_billable']);
|
||||
|
||||
// Additional Assets Selected
|
||||
@@ -75,17 +76,53 @@ ob_start();
|
||||
<textarea class="form-control tinymce" name="details"><?php echo $recurring_ticket_details; ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Priority <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label>Priority <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="priority" required>
|
||||
<option <?php if ($recurring_ticket_priority == "Low") { echo "selected"; } ?> >Low</option>
|
||||
<option <?php if ($recurring_ticket_priority == "Medium") { echo "selected"; } ?> >Medium</option>
|
||||
<option <?php if ($recurring_ticket_priority == "High") { echo "selected"; } ?> >High</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label>Category</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-layer-group"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="category">
|
||||
<option value="0">- Uncategorized -</option>
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
|
||||
?>
|
||||
<option <?php if ($recurring_ticket_category == $category_id) {echo "selected";} ?> value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button"
|
||||
data-toggle="ajax-modal"
|
||||
data-modal-size="sm"
|
||||
data-ajax-url="ajax/ajax_category_add.php?category=Ticket">
|
||||
<i class="fas fa-fw fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<select class="form-control select2" name="priority" required>
|
||||
<option <?php if ($recurring_ticket_priority == "Low") { echo "selected"; } ?> >Low</option>
|
||||
<option <?php if ($recurring_ticket_priority == "Medium") { echo "selected"; } ?> >Medium</option>
|
||||
<option <?php if ($recurring_ticket_priority == "High") { echo "selected"; } ?> >High</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ require_once '../includes/ajax_header.php';
|
||||
$service_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM services WHERE service_id = $service_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$service_name = nullable_htmlentities($row['service_name']);
|
||||
$service_description = nullable_htmlentities($row['service_description']);
|
||||
@@ -17,6 +16,7 @@ $service_created_at = nullable_htmlentities($row['service_created_at']);
|
||||
$service_updated_at = nullable_htmlentities($row['service_updated_at']);
|
||||
$service_review_due = nullable_htmlentities($row['service_review_due']);
|
||||
$client_id = intval($row['service_client_id']);
|
||||
|
||||
// Service Importance
|
||||
if ($service_importance == "High") {
|
||||
$service_importance_display = "<span class='p-2 badge badge-danger'>$service_importance</span>";
|
||||
@@ -55,6 +55,7 @@ $sql_domains = mysqli_query(
|
||||
LEFT JOIN domains ON service_domains.domain_id = domains.domain_id
|
||||
WHERE service_id = $service_id"
|
||||
);
|
||||
|
||||
// Associated Certificates
|
||||
$sql_certificates = mysqli_query(
|
||||
$mysqli,
|
||||
@@ -63,10 +64,6 @@ $sql_certificates = mysqli_query(
|
||||
WHERE service_id = $service_id"
|
||||
);
|
||||
|
||||
// Associated URLs ---- REMOVED for now
|
||||
//$sql_urls = mysqli_query($mysqli, "SELECT * FROM service_urls
|
||||
//WHERE service_id = '$service_id'");
|
||||
|
||||
// Associated Vendors
|
||||
$sql_vendors = mysqli_query(
|
||||
$mysqli,
|
||||
@@ -116,149 +113,99 @@ ob_start();
|
||||
|
||||
<!-- Assets -->
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_assets) > 0) { ?>
|
||||
<h5><i class="fas fa-fw fa-desktop mr-2"></i>Assets</h5>
|
||||
<ul>
|
||||
<?php
|
||||
// Reset the $sql_assets pointer to the start - as we've already cycled through once
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
if (!empty($row['interface_ip'])) {
|
||||
$ip = '('.nullable_htmlentities($row["interface_ip"]).')';
|
||||
} else {
|
||||
$ip = '';
|
||||
}
|
||||
echo "<li><a href='#' data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-ajax-url='ajax/ajax_asset_details.php'
|
||||
data-ajax-id='$asset_id'>$asset_name</a>$ip</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_assets) > 0) {
|
||||
echo "<h5><i class='fas fa-fw fa-desktop mr-2'></i>Assets</h5><ul>";
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$ip = !empty($row['interface_ip']) ? '(' . nullable_htmlentities($row['interface_ip']) . ')' : '';
|
||||
echo "<li><a href='#' data-toggle='ajax-modal' data-modal-size='lg' data-ajax-url='ajax/ajax_asset_details.php' data-ajax-id='$asset_id'>$asset_name</a>$ip</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Networks -->
|
||||
<?php
|
||||
$networks = [];
|
||||
if ($sql_assets) {
|
||||
|
||||
$networks = [];
|
||||
|
||||
// Reset the $sql_assets pointer to the start
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
|
||||
// Get networks linked to assets - push name to array
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
if (!empty($row['network_name'])) {
|
||||
$network_data = nullable_htmlentities("$row[network_name]:$row[network_vlan]");
|
||||
array_push($networks, $network_data);
|
||||
$network_data = nullable_htmlentities($row["network_name"]) . ':' . nullable_htmlentities($row["network_vlan"]);
|
||||
$networks[] = $network_data;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove duplicates
|
||||
$networks = array_unique($networks);
|
||||
|
||||
// Display
|
||||
if (!empty($networks)) { ?>
|
||||
<h5><i class="fas fa-fw fa-network-wired mr-2"></i>Networks</h5>
|
||||
<ul>
|
||||
<?php
|
||||
if (!empty($networks)) {
|
||||
echo "<h5><i class='fas fa-fw fa-network-wired mr-2'></i>Networks</h5><ul>";
|
||||
foreach ($networks as $network) {
|
||||
$network_parts = explode(":", $network);
|
||||
$network_name = $network_parts[0];
|
||||
$network_vlan = $network_parts[1] ?? '';
|
||||
echo "<li><a href='networks.php?client_id=$client_id&q=$network_name'>$network_name</a> (VLAN $network_vlan)</li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
foreach($networks as $network) {
|
||||
$network = explode(":", $network);
|
||||
echo "<li><a href=\"networks.php?client_id=$client_id&q=$network[0]\">$network[0] </a>(VLAN $network[1])</li>";
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Locations -->
|
||||
<?php
|
||||
$location_names = [];
|
||||
if ($sql_assets) {
|
||||
|
||||
$location_names = [];
|
||||
|
||||
// Reset the $sql_assets pointer to the start - as we've already cycled through once
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
|
||||
// Get locations linked to assets - push their name and vlan to arrays
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
if (!empty($row['location_name'])) {
|
||||
array_push($location_names, $row['location_name']);
|
||||
$location_names[] = nullable_htmlentities($row['location_name']);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove duplicates
|
||||
$location_names = array_unique($location_names);
|
||||
|
||||
// Display
|
||||
if (!empty($location_names)) { ?>
|
||||
<h5><i class="fas fa-fw fa-map-marker-alt mr-2"></i>Locations</h5>
|
||||
<ul>
|
||||
<?php
|
||||
if (!empty($location_names)) {
|
||||
echo "<h5><i class='fas fa-fw fa-map-marker-alt mr-2'></i>Locations</h5><ul>";
|
||||
foreach ($location_names as $location) {
|
||||
echo "<li><a href='locations.php?client_id=$client_id&q=$location'>$location</a></li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
foreach($location_names as $location) {
|
||||
echo "<li><a href=\"locations.php?client_id=$client_id&q=$location\">$location</a></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Domains -->
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_domains) > 0) { ?>
|
||||
<h5><i class="fas fa-fw fa-globe mr-2"></i>Domains</h5>
|
||||
<ul>
|
||||
<?php
|
||||
// Reset the $sql_domains pointer to the start
|
||||
mysqli_data_seek($sql_domains, 0);
|
||||
|
||||
// Showing linked domains
|
||||
while ($row = mysqli_fetch_array($sql_domains)) {
|
||||
if (!empty($row['domain_name'])) {
|
||||
echo "<li><a href=\"domains.php?client_id=$client_id&q=$row[domain_name]\">$row[domain_name]</a></li>";
|
||||
}
|
||||
if (mysqli_num_rows($sql_domains) > 0) {
|
||||
echo "<h5><i class='fas fa-fw fa-globe mr-2'></i>Domains</h5><ul>";
|
||||
mysqli_data_seek($sql_domains, 0);
|
||||
while ($row = mysqli_fetch_array($sql_domains)) {
|
||||
if (!empty($row['domain_name'])) {
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
echo "<li><a href='domains.php?client_id=$client_id&q=$domain_name'>$domain_name</a></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Certificates -->
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_certificates) > 0) { ?>
|
||||
<h5><i class="fas fa-fw fa-lock mr-2"></i>Certificates</h5>
|
||||
<ul>
|
||||
<?php
|
||||
// Reset the $sql_certificates pointer to the start
|
||||
mysqli_data_seek($sql_certificates, 0);
|
||||
|
||||
// Showing linked certs
|
||||
while ($row = mysqli_fetch_array($sql_certificates)) {
|
||||
if (!empty($row['certificate_name'])) {
|
||||
echo "<li><a href=\"certificates.php?client_id=$client_id&q=$row[certificate_name]\">$row[certificate_name] ($row[certificate_domain])</a></li>";
|
||||
}
|
||||
if (mysqli_num_rows($sql_certificates) > 0) {
|
||||
echo "<h5><i class='fas fa-fw fa-lock mr-2'></i>Certificates</h5><ul>";
|
||||
mysqli_data_seek($sql_certificates, 0);
|
||||
while ($row = mysqli_fetch_array($sql_certificates)) {
|
||||
if (!empty($row['certificate_name'])) {
|
||||
$certificate_name = nullable_htmlentities($row['certificate_name']);
|
||||
$certificate_domain = nullable_htmlentities($row['certificate_domain']);
|
||||
echo "<li><a href='certificates.php?client_id=$client_id&q=$certificate_name'>$certificate_name ($certificate_domain)</a></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Right side -->
|
||||
<div class="col-4">
|
||||
<div class="col-12">
|
||||
@@ -267,148 +214,96 @@ ob_start();
|
||||
|
||||
<!-- Vendors -->
|
||||
<?php
|
||||
// Reset the $sql_vendors pointer to the start
|
||||
mysqli_data_seek($sql_vendors, 0);
|
||||
|
||||
if (mysqli_num_rows($sql_vendors) > 0) { ?>
|
||||
<h5><i class="fas fa-fw fa-building mr-2"></i>Vendors</h5>
|
||||
<ul>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
echo "<li><a href='#' data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-ajax-url='ajax/ajax_vendor_details.php'
|
||||
data-ajax-id='$vendor_id'>
|
||||
$vendor_name
|
||||
</a>
|
||||
</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_vendors) > 0) {
|
||||
echo "<h5><i class='fas fa-fw fa-building mr-2'></i>Vendors</h5><ul>";
|
||||
mysqli_data_seek($sql_vendors, 0);
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
echo "<li><a href='#' data-toggle='ajax-modal' data-modal-size='lg' data-ajax-url='ajax/ajax_vendor_details.php' data-ajax-id='$vendor_id'>$vendor_name</a></li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Contacts -->
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_contacts) > 0) { ?>
|
||||
<h5><i class="fas fa-fw fa-users mr-2"></i>Contacts</h5>
|
||||
<ul>
|
||||
<?php
|
||||
// Reset the $sql_contacts pointer to the start
|
||||
mysqli_data_seek($sql_contacts, 0);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
echo "<li><a href='#' data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-ajax-url='ajax/ajax_contact_details.php'
|
||||
data-ajax-id='$contact_id'>
|
||||
$contact_name
|
||||
</a>
|
||||
</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_contacts) > 0) {
|
||||
echo "<h5><i class='fas fa-fw fa-users mr-2'></i>Contacts</h5><ul>";
|
||||
mysqli_data_seek($sql_contacts, 0);
|
||||
while ($row = mysqli_fetch_array($sql_contacts)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
echo "<li><a href='#' data-toggle='ajax-modal' data-modal-size='lg' data-ajax-url='ajax/ajax_contact_details.php' data-ajax-id='$contact_id'>$contact_name</a></li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Credentials -->
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_assets) > 0 || mysqli_num_rows($sql_credentials) > 0) { ?>
|
||||
<h5><i class="fas fa-fw fa-key mr-2"></i>Credentials</h5>
|
||||
<ul>
|
||||
<?php
|
||||
// Reset the $sql_assets/credentials pointer to the start
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
mysqli_data_seek($sql_credentials, 0);
|
||||
|
||||
// Showing credentials linked to assets
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
if (!empty($row['credential_name'])) {
|
||||
echo "<li><a href=\"credentials.php?client_id=$client_id&q=$row[credential_name]\">$row[credential_name]</a></li>";
|
||||
}
|
||||
if (mysqli_num_rows($sql_assets) > 0 || mysqli_num_rows($sql_credentials) > 0) {
|
||||
echo "<h5><i class='fas fa-fw fa-key mr-2'></i>Credentials</h5><ul>";
|
||||
// Credentials linked to assets
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
if (!empty($credential_name)) {
|
||||
echo "<li><a href='credentials.php?client_id=$client_id&q=$credential_name'>$credential_name</a></li>";
|
||||
}
|
||||
|
||||
// Showing explicitly linked credentials
|
||||
while ($row = mysqli_fetch_array($sql_credentials)) {
|
||||
if (!empty($row['credential_name'])) {
|
||||
echo "<li><a href=\"credentials.php?client_id=$client_id&q=$row[credential_name]\">$row[credential_name]</a></li>";
|
||||
}
|
||||
}
|
||||
// Explicitly linked credentials
|
||||
mysqli_data_seek($sql_credentials, 0);
|
||||
while ($row = mysqli_fetch_array($sql_credentials)) {
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
if (!empty($credential_name)) {
|
||||
echo "<li><a href='credentials.php?client_id=$client_id&q=$credential_name'>$credential_name</a></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- URLs -->
|
||||
<?php
|
||||
if ($sql_credentials || $sql_assets) { ?>
|
||||
<h5><i class="fas fa-fw fa-link mr-2"></i>URLs</h5>
|
||||
<ul>
|
||||
<?php
|
||||
// Reset the $sql_credentials pointer to the start
|
||||
mysqli_data_seek($sql_credentials, 0);
|
||||
|
||||
// Showing URLs linked to credentials
|
||||
while ($row = mysqli_fetch_array($sql_credentials)) {
|
||||
if (!empty($row['credential_uri'])) {
|
||||
echo "<li><a href=\"https://$row[credential_uri]\">$row[credential_uri]</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
// Reset the $sql_assets pointer to the start
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
|
||||
// Show URLs linked to assets, that also have credentials
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
if (!empty($row['credential_uri'])) {
|
||||
echo "<li><a href=\"https://$row[credential_uri]\">$row[credential_uri]</a></li>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
$urls = [];
|
||||
mysqli_data_seek($sql_credentials, 0);
|
||||
while ($row = mysqli_fetch_array($sql_credentials)) {
|
||||
if (!empty($row['credential_uri'])) {
|
||||
$urls[] = sanitize_url($row['credential_uri']);
|
||||
}
|
||||
}
|
||||
mysqli_data_seek($sql_assets, 0);
|
||||
while ($row = mysqli_fetch_array($sql_assets)) {
|
||||
if (!empty($row['asset_uri'])) {
|
||||
$urls[] = sanitize_url($row['asset_uri']);
|
||||
}
|
||||
}
|
||||
$urls = array_unique($urls);
|
||||
if (!empty($urls)) {
|
||||
echo "<h5><i class='fas fa-fw fa-link mr-2'></i>URLs</h5><ul>";
|
||||
foreach ($urls as $url) {
|
||||
$label = htmlspecialchars(parse_url($url, PHP_URL_HOST) ?: $url);
|
||||
echo "<li><a href='$url' target='_blank'>$label</a></li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Documents -->
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_docs) > 0) { ?>
|
||||
<h5><i class="fas fa-fw fa-file-alt mr-2"></i>Documents</h5>
|
||||
<ul>
|
||||
<?php
|
||||
// Reset the $sql_docs pointer to the start
|
||||
mysqli_data_seek($sql_docs, 0);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_docs)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
echo "<li><a href='#' data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-ajax-url='ajax/ajax_document_view.php'
|
||||
data-ajax-id='$document_id'>
|
||||
$document_name
|
||||
</a>
|
||||
</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
if (mysqli_num_rows($sql_docs) > 0) {
|
||||
echo "<h5><i class='fas fa-fw fa-file-alt mr-2'></i>Documents</h5><ul>";
|
||||
mysqli_data_seek($sql_docs, 0);
|
||||
while ($row = mysqli_fetch_array($sql_docs)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
echo "<li><a href='#' data-toggle='ajax-modal' data-modal-size='lg' data-ajax-url='ajax/ajax_document_view.php' data-ajax-id='$document_id'>$document_name</a></li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- <h5><i class="nav-icon fas fa-file-alt"></i> Services</h5>-->
|
||||
<!-- <ul>-->
|
||||
<!-- <li>Related Service - Coming soon!</li>-->
|
||||
<!-- </ul>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -416,3 +311,4 @@ ob_start();
|
||||
|
||||
<?php
|
||||
require_once "../includes/ajax_footer.php";
|
||||
?>
|
||||
|
||||
@@ -211,7 +211,7 @@ ob_start();
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_vendors, MYSQLI_ASSOC), "vendor_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM vendors WHERE (vendor_archived_at > '$service_created_at' OR vendor_archived_at IS NULL) AND vendor_template = 0 AND vendor_client_id = $client_id");
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM vendors WHERE (vendor_archived_at > '$service_created_at' OR vendor_archived_at IS NULL) AND vendor_client_id = $client_id");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$vendor_id = intval($row_all['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row_all['vendor_name']);
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$software_id = intval($_GET['id']);
|
||||
$software_template_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM software WHERE software_id = $software_id LIMIT 1");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM software_templates WHERE software_template_id = $software_template_id LIMIT 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$software_name = nullable_htmlentities($row['software_name']);
|
||||
$software_version = nullable_htmlentities($row['software_version']);
|
||||
$software_description = nullable_htmlentities($row['software_description']);
|
||||
$software_type = nullable_htmlentities($row['software_type']);
|
||||
$software_license_type = nullable_htmlentities($row['software_license_type']);
|
||||
$software_notes = nullable_htmlentities($row['software_notes']);
|
||||
$software_name = nullable_htmlentities($row['software_template_name']);
|
||||
$software_version = nullable_htmlentities($row['software_template_version']);
|
||||
$software_description = nullable_htmlentities($row['software_template_description']);
|
||||
$software_type = nullable_htmlentities($row['software_template_type']);
|
||||
$software_license_type = nullable_htmlentities($row['software_template_license_type']);
|
||||
$software_notes = nullable_htmlentities($row['software_template_notes']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
@@ -24,7 +24,7 @@ ob_start();
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="software_id" value="<?php echo $software_id; ?>">
|
||||
<input type="hidden" name="software_template_id" value="<?php echo $software_template_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -18,6 +18,8 @@ $ticket_priority = nullable_htmlentities($row['ticket_priority']);
|
||||
$ticket_billable = intval($row['ticket_billable']);
|
||||
$ticket_vendor_ticket_number = nullable_htmlentities($row['ticket_vendor_ticket_number']);
|
||||
$ticket_created_at = nullable_htmlentities($row['ticket_created_at']);
|
||||
$ticket_due_at = nullable_htmlentities($row['ticket_due_at']);
|
||||
$ticket_assigned_to = intval($row['ticket_assigned_to']);
|
||||
$contact_id = intval($row['ticket_contact_id']);
|
||||
$asset_id = intval($row['ticket_asset_id']);
|
||||
$location_id = intval($row['ticket_location_id']);
|
||||
@@ -105,7 +107,7 @@ ob_start();
|
||||
<select class="form-control select2" name="category">
|
||||
<option value="0">- Uncategorized -</option>
|
||||
<?php
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL");
|
||||
$sql_categories = mysqli_query($mysqli, "SELECT category_id, category_name FROM categories WHERE category_type = 'Ticket' AND category_archived_at IS NULL ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_categories)) {
|
||||
$category_id = intval($row['category_id']);
|
||||
$category_name = nullable_htmlentities($row['category_name']);
|
||||
@@ -128,6 +130,49 @@ ob_start();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label>Assign to</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user-check"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="assigned_to">
|
||||
<option value="0">Not Assigned</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT user_id, user_name FROM users
|
||||
WHERE user_role_id > 1
|
||||
AND user_type = 1
|
||||
AND user_status = 1
|
||||
AND user_archived_at IS NULL
|
||||
ORDER BY user_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$user_id = intval($row['user_id']);
|
||||
$user_name = nullable_htmlentities($row['user_name']); ?>
|
||||
<option <?php if ($ticket_assigned_to === $user_id) { echo "selected"; } ?> value="<?php echo $user_id; ?>"><?php echo $user_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label>Due</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar-check"></i></span>
|
||||
</div>
|
||||
<input type="datetime-local" class="form-control" name="due" value="<?php echo $ticket_due_at; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($config_module_enable_accounting && lookupUserPermission("module_sales") >= 2) { ?>
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
@@ -283,7 +328,7 @@ ob_start();
|
||||
<option value="0">- None -</option>
|
||||
<?php
|
||||
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_template = 0 AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
$sql_vendors = mysqli_query($mysqli, "SELECT vendor_id, vendor_name FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
$vendor_id_select = intval($row['vendor_id']);
|
||||
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
|
||||
|
||||
@@ -11,9 +11,6 @@ $sql = mysqli_query($mysqli, "SELECT * FROM ticket_replies
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$ticket_reply_type = nullable_htmlentities($row['ticket_reply_type']);
|
||||
$ticket_reply_time_worked = date_create($row['ticket_reply_time_worked']);
|
||||
$ticket_reply_time_worked_formatted = date_format($ticket_reply_time_worked, 'H:i:s');
|
||||
$ticket_reply = nullable_htmlentities($row['ticket_reply']);
|
||||
$client_id = intval($row['ticket_client_id']);
|
||||
|
||||
@@ -31,10 +28,6 @@ ob_start();
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="ticket_reply_id" value="<?php echo $ticket_reply_id; ?>">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<input type="hidden" name="ticket_reply_type" value="<?php echo $ticket_reply_type; ?>">
|
||||
<?php if (!empty($ticket_reply_time_worked)) { ?>
|
||||
<input type="hidden" name="time" value="<?php echo $ticket_reply_time_worked_formatted; ?>">
|
||||
<?php } ?>
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
@@ -44,7 +37,7 @@ ob_start();
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="edit_ticket_reply" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
<button type="submit" name="redact_ticket_reply" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -10,7 +10,7 @@ $row = mysqli_fetch_array($sql);
|
||||
$task_template_name = nullable_htmlentities($row['task_template_name']);
|
||||
$task_template_order = intval($row['task_template_order']);
|
||||
$task_template_completion_estimate = intval($row['task_template_completion_estimate']);
|
||||
$task_template_description = nullable_htmlentities($row['task_template_description']);
|
||||
//$task_template_description = nullable_htmlentities($row['task_template_description']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
|
||||
@@ -115,7 +115,7 @@ ob_start();
|
||||
|
||||
$sql_users = mysqli_query($mysqli, "SELECT users.user_id, user_name FROM users
|
||||
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
||||
WHERE user_role > 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||
WHERE user_role_id > 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_users)) {
|
||||
$user_id_select = intval($row['user_id']);
|
||||
|
||||
@@ -104,10 +104,10 @@ ob_start();
|
||||
<option value="0">- None -</option>
|
||||
<?php
|
||||
|
||||
$sql_vendor_templates = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_template = 1 AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
|
||||
$sql_vendor_templates = mysqli_query($mysqli, "SELECT * FROM vendor_templates WHERE vendor_template_archived_at IS NULL ORDER BY vendor_template_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_vendor_templates)) {
|
||||
$vendor_template_id_select = $row['vendor_id'];
|
||||
$vendor_template_name_select = nullable_htmlentities($row['vendor_name']); ?>
|
||||
$vendor_template_id_select = $row['vendor_template_id'];
|
||||
$vendor_template_name_select = nullable_htmlentities($row['vendor_template_name']); ?>
|
||||
<option <?php if ($vendor_template_id == $vendor_template_id_select) { echo "selected"; } ?> value="<?php echo $vendor_template_id_select; ?>"><?php echo $vendor_template_name_select; ?></option>
|
||||
|
||||
<?php } ?>
|
||||
@@ -127,7 +127,7 @@ ob_start();
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="tel" class="form-control col-2" name="phone_country_code" value="<?php echo "+$vendor_phone_country_code"; ?>" placeholder="Code" maxlength="4">
|
||||
<input type="tel" class="form-control col-2" name="phone_country_code" value="<?php echo $vendor_phone_country_code; ?>" placeholder="+" maxlength="4">
|
||||
<input type="tel" class="form-control" name="phone" value="<?php echo $vendor_phone; ?>" placeholder="Phone Number" maxlength="200">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,23 +2,22 @@
|
||||
|
||||
require_once '../includes/ajax_header.php';
|
||||
|
||||
$vendor_id = intval($_GET['id']);
|
||||
$vendor_template_id = intval($_GET['id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_id = $vendor_id LIMIT 1");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendor_templates WHERE vendor_template_id = $vendor_template_id LIMIT 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
$vendor_description = nullable_htmlentities($row['vendor_description']);
|
||||
$vendor_account_number = nullable_htmlentities($row['vendor_account_number']);
|
||||
$vendor_contact_name = nullable_htmlentities($row['vendor_contact_name']);
|
||||
$vendor_phone = formatPhoneNumber($row['vendor_phone']);
|
||||
$vendor_extension = nullable_htmlentities($row['vendor_extension']);
|
||||
$vendor_email = nullable_htmlentities($row['vendor_email']);
|
||||
$vendor_website = nullable_htmlentities($row['vendor_website']);
|
||||
$vendor_hours = nullable_htmlentities($row['vendor_hours']);
|
||||
$vendor_sla = nullable_htmlentities($row['vendor_sla']);
|
||||
$vendor_code = nullable_htmlentities($row['vendor_code']);
|
||||
$vendor_notes = nullable_htmlentities($row['vendor_notes']);
|
||||
$vendor_template = intval($row['vendor_template']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_template_name']);
|
||||
$vendor_description = nullable_htmlentities($row['vendor_template_description']);
|
||||
$vendor_account_number = nullable_htmlentities($row['vendor_template_account_number']);
|
||||
$vendor_contact_name = nullable_htmlentities($row['vendor_template_contact_name']);
|
||||
$vendor_phone = formatPhoneNumber($row['vendor_template_phone']);
|
||||
$vendor_extension = nullable_htmlentities($row['vendor_template_extension']);
|
||||
$vendor_email = nullable_htmlentities($row['vendor_template_email']);
|
||||
$vendor_website = nullable_htmlentities($row['vendor_template_website']);
|
||||
$vendor_hours = nullable_htmlentities($row['vendor_template_hours']);
|
||||
$vendor_sla = nullable_htmlentities($row['vendor_template_sla']);
|
||||
$vendor_code = nullable_htmlentities($row['vendor_template_code']);
|
||||
$vendor_notes = nullable_htmlentities($row['vendor_template_notes']);
|
||||
|
||||
// Generate the HTML form content using output buffering.
|
||||
ob_start();
|
||||
@@ -31,18 +30,18 @@ ob_start();
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="vendor_id" value="<?php echo $vendor_id; ?>">
|
||||
<input type="hidden" name="vendor_template_id" value="<?php echo $vendor_template_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="pill" href="#pills-details<?php echo $vendor_id; ?>">Details</a>
|
||||
<a class="nav-link active" data-toggle="pill" href="#pills-details<?php echo $vendor_template_id; ?>">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-support<?php echo $vendor_id; ?>">Support</a>
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-support<?php echo $vendor_template_id; ?>">Support</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-notes<?php echo $vendor_id; ?>">Notes</a>
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-notes<?php echo $vendor_template_id; ?>">Notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -52,7 +51,7 @@ ob_start();
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade show active" id="pills-details<?php echo $vendor_id; ?>">
|
||||
<div class="tab-pane fade show active" id="pills-details<?php echo $vendor_template_id; ?>">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
@@ -117,14 +116,14 @@ ob_start();
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="updateVendorsCheckbox<?php echo $vendor_id; ?>" name="update_base_vendors" value="1" >
|
||||
<label class="custom-control-label" for="updateVendorsCheckbox<?php echo $vendor_id; ?>">Update All Base Vendors</label>
|
||||
<input type="checkbox" class="custom-control-input" id="updateVendorsCheckbox<?php echo $vendor_template_id; ?>" name="update_base_vendors" value="1" >
|
||||
<label class="custom-control-label" for="updateVendorsCheckbox<?php echo $vendor_template_id; ?>">Update All Base Vendors</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-support<?php echo $vendor_id; ?>">
|
||||
<div class="tab-pane fade" id="pills-support<?php echo $vendor_template_id; ?>">
|
||||
|
||||
<label>Support Phone</label>
|
||||
<div class="form-row">
|
||||
@@ -225,7 +224,7 @@ ob_start();
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes<?php echo $vendor_id; ?>">
|
||||
<div class="tab-pane fade" id="pills-notes<?php echo $vendor_template_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" placeholder="Enter some notes" name="notes"><?php echo $vendor_notes; ?></textarea>
|
||||
|
||||
@@ -13,15 +13,12 @@ $insert_id = false;
|
||||
if (!empty($name) && !(empty($content))) {
|
||||
|
||||
// Create document
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_template = 0, document_folder_id = $folder, document_created_by = 0, document_client_id = $client_id");
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_folder_id = $folder, document_created_by = 0, document_client_id = $client_id");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($insert_sql) {
|
||||
$insert_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Update field document_parent to be the same id as document ID as this is the only version of the document.
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_parent = $insert_id WHERE document_id = $insert_id");
|
||||
|
||||
// Logging
|
||||
logAction("Document", "Create", "$name via API ($api_key_name)", $client_id, $insert_id);
|
||||
logAction("API", "Success", "Created document $name via API ($api_key_name)", $client_id);
|
||||
|
||||
@@ -18,34 +18,12 @@ if (!empty($document_id)) {
|
||||
require_once 'document_model.php';
|
||||
|
||||
// Documents are a little weird as we update them by *inserting* a new document row
|
||||
$update_insert_sql = mysqli_query($mysqli,"INSERT INTO documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_template = 0, document_folder_id = $folder, document_created_by = 0, document_client_id = $client_id");
|
||||
$update_insert_sql = mysqli_query($mysqli,"INSERT INTO documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_folder_id = $folder, document_created_by = 0, document_client_id = $client_id");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($update_insert_sql) {
|
||||
$insert_id = $new_document_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Update the parent ID of the new document to match its new document ID
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_parent = $new_document_id WHERE document_id = $new_document_id");
|
||||
|
||||
// Link all existing links with old document with new document
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_parent = $new_document_id, document_archived_at = NOW() WHERE document_parent = $document_id");
|
||||
|
||||
// Update Links to the new parent document:-
|
||||
// Document files
|
||||
mysqli_query($mysqli,"UPDATE document_files SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Contact documents
|
||||
mysqli_query($mysqli,"UPDATE contact_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Asset documents
|
||||
mysqli_query($mysqli,"UPDATE asset_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Software documents
|
||||
mysqli_query($mysqli,"UPDATE software_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Vendor documents
|
||||
mysqli_query($mysqli,"UPDATE vendor_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Logging
|
||||
logAction("Document", "Edit", "$name via API ($api_key_name) previous version kept", $client_id, $insert_id);
|
||||
logAction("API", "Success", "Edited document $name via API ($api_key_name)", $client_id);
|
||||
|
||||
@@ -39,7 +39,7 @@ if (!empty($subject)) {
|
||||
|
||||
// Insert ticket
|
||||
$url_key = randomString(156);
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $billable, ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_vendor_id = $vendor_id, ticket_created_by = 0, ticket_assigned_to = $assigned_to, ticket_contact_id = $contact, ticket_url_key = '$url_key', ticket_client_id = $client_id");
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_source = 'API', ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $billable, ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_vendor_id = $vendor_id, ticket_created_by = 0, ticket_assigned_to = $assigned_to, ticket_contact_id = $contact, ticket_url_key = '$url_key', ticket_client_id = $client_id");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($insert_sql) {
|
||||
|
||||
@@ -34,8 +34,8 @@ if (isset($_GET['asset_id'])) {
|
||||
$asset_model = nullable_htmlentities($row['asset_model']);
|
||||
$asset_serial = nullable_htmlentities($row['asset_serial']);
|
||||
$asset_os = nullable_htmlentities($row['asset_os']);
|
||||
$asset_uri = nullable_htmlentities($row['asset_uri']);
|
||||
$asset_uri_2 = nullable_htmlentities($row['asset_uri_2']);
|
||||
$asset_uri = sanitize_url($row['asset_uri']);
|
||||
$asset_uri_2 = sanitize_url($row['asset_uri_2']);
|
||||
$asset_status = nullable_htmlentities($row['asset_status']);
|
||||
$asset_purchase_reference = nullable_htmlentities($row['asset_purchase_reference']);
|
||||
$asset_purchase_date = nullable_htmlentities($row['asset_purchase_date']);
|
||||
@@ -94,7 +94,7 @@ if (isset($_GET['asset_id'])) {
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
|
||||
// Related Recurring Tickets Query
|
||||
$sql_related_recurring_tickets = mysqli_query($mysqli, "SELECT * FROM recurring_tickets
|
||||
$sql_related_recurring_tickets = mysqli_query($mysqli, "SELECT recurring_tickets.* FROM recurring_tickets
|
||||
LEFT JOIN recurring_ticket_assets ON recurring_tickets.recurring_ticket_id = recurring_ticket_assets.recurring_ticket_id
|
||||
WHERE recurring_ticket_asset_id = $asset_id OR recurring_ticket_assets.asset_id = $asset_id
|
||||
GROUP BY recurring_tickets.recurring_ticket_id
|
||||
@@ -177,7 +177,6 @@ if (isset($_GET['asset_id'])) {
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE asset_documents.asset_id = $asset_id
|
||||
AND asset_documents.document_id = documents.document_id
|
||||
AND document_template = 0
|
||||
AND document_archived_at IS NULL
|
||||
ORDER BY document_name ASC"
|
||||
);
|
||||
@@ -244,7 +243,7 @@ if (isset($_GET['asset_id'])) {
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fas fa-fw fa-edit"></i>
|
||||
</button>
|
||||
<h3 class="text-bold"><i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-3"></i><?php echo $asset_name; ?></h3>
|
||||
<h4 class="text-bold"><i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-3"></i><?php echo $asset_name; ?></h4>
|
||||
<?php if ($asset_photo) { ?>
|
||||
<img class="img-fluid img-circle p-3" alt="asset_photo" src="<?php echo "uploads/clients/$client_id/$asset_photo"; ?>">
|
||||
<?php } ?>
|
||||
@@ -283,19 +282,19 @@ if (isset($_GET['asset_id'])) {
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if ($asset_ip) { ?>
|
||||
<div><i class="fa fa-fw fa-globe text-secondary mr-3"></i><?php echo $asset_ip; ?></div>
|
||||
<div><i class="fa fa-fw fa-globe text-secondary mr-2"></i><?php echo $asset_ip; ?></div>
|
||||
<?php } ?>
|
||||
<?php if ($asset_nat_ip) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-random text-secondary mr-3"></i><?php echo $asset_nat_ip; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-random text-secondary mr-2"></i><?php echo $asset_nat_ip; ?></div>
|
||||
<?php }
|
||||
if ($asset_mac) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-ethernet text-secondary mr-3"></i><?php echo $asset_mac; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-ethernet text-secondary mr-2"></i><?php echo $asset_mac; ?></div>
|
||||
<?php }
|
||||
if ($asset_uri) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-3"></i><a href="<?php echo $asset_uri; ?>" target="_blank">Link</a></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-2"></i><a href="<?php echo $asset_uri; ?>" target="_blank" title="<?php echo $asset_uri; ?>"><?php echo truncate($asset_uri, 20); ?></a></div>
|
||||
<?php }
|
||||
if ($asset_uri_2) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-3"></i><a href="<?php echo $asset_uri_2; ?>" target="_blank">Link 2</a></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-link text-secondary mr-2"></i><a href="<?php echo $asset_uri_2; ?>" target="_blank" title="<?php echo $asset_uri_2; ?>"><?php echo truncate($asset_uri_2, 20); ?></a></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -307,19 +306,19 @@ if (isset($_GET['asset_id'])) {
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if ($location_name) { ?>
|
||||
<div><i class="fa fa-fw fa-map-marker-alt text-secondary mr-3"></i><?php echo $location_name_display; ?></div>
|
||||
<div><i class="fa fa-fw fa-map-marker-alt text-secondary mr-2"></i><?php echo $location_name_display; ?></div>
|
||||
<?php }
|
||||
if ($contact_name) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-user text-secondary mr-3"></i><?php echo $contact_name_display; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-user text-secondary mr-2"></i><?php echo $contact_name_display; ?></div>
|
||||
<?php }
|
||||
if ($contact_email) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-envelope text-secondary mr-3"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-envelope text-secondary mr-2"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<?php }
|
||||
if ($contact_phone) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-phone text-secondary mr-3"></i><?php echo formatPhoneNumber($contact_phone); echo " $contact_extension"; ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-phone text-secondary mr-2"></i><?php echo formatPhoneNumber($contact_phone); echo " $contact_extension"; ?></div>
|
||||
<?php }
|
||||
if ($contact_mobile) { ?>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-3"></i><?php echo formatPhoneNumber($contact_mobile); ?></div>
|
||||
<div class="mt-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-2"></i><?php echo formatPhoneNumber($contact_mobile); ?></div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
@@ -378,34 +377,47 @@ if (isset($_GET['asset_id'])) {
|
||||
<div class="dropdown dropleft">
|
||||
<button type="button" class="btn btn-outline-primary" data-toggle="dropdown"><i class="fas fa-link mr-2"></i>Link</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkSoftwareModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_software.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-cube mr-2"></i>License
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkCredentialModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_credential.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-key mr-2"></i>Credential
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkServiceModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_service.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-stream mr-2"></i>Service
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkDocumentModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_document.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-folder mr-2"></i>Document
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkFileModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_asset_link_file.php"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<i class="fa fa-fw fa-paperclip mr-2"></i>File
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-ethernet mr-2"></i><?php echo $asset_name; ?> Network Interfaces</h3>
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-ethernet mr-2"></i>Interfaces</h3>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addAssetInterfaceModal">
|
||||
@@ -1193,10 +1205,4 @@ require_once "modals/credential_add_modal.php";
|
||||
require_once "modals/client_document_add_modal.php";
|
||||
require_once "modals/client_file_upload_modal.php";
|
||||
|
||||
require_once "modals/asset_link_software_modal.php";
|
||||
require_once "modals/asset_link_credential_modal.php";
|
||||
require_once "modals/asset_link_service_modal.php";
|
||||
require_once "modals/asset_link_document_modal.php";
|
||||
require_once "modals/asset_link_file_modal.php";
|
||||
|
||||
require_once "includes/footer.php";
|
||||
|
||||
36
assets.php
36
assets.php
@@ -9,10 +9,26 @@ if (isset($_GET['client_id'])) {
|
||||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND asset_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "asset_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "asset_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR asset_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND asset_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Perms
|
||||
@@ -71,7 +87,7 @@ $row = mysqli_fetch_assoc(mysqli_query($mysqli, "
|
||||
LEFT JOIN contacts ON asset_contact_id = contact_id
|
||||
LEFT JOIN locations ON asset_location_id = location_id
|
||||
LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
|
||||
WHERE asset_$archive_query
|
||||
WHERE $archive_query
|
||||
$access_permission_query
|
||||
$client_query
|
||||
) AS filtered_assets;
|
||||
@@ -105,7 +121,7 @@ $sql = mysqli_query(
|
||||
LEFT JOIN contacts ON asset_contact_id = contact_id
|
||||
LEFT JOIN locations ON asset_location_id = location_id
|
||||
LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
|
||||
WHERE asset_$archive_query
|
||||
WHERE $archive_query
|
||||
AND (asset_name LIKE '%$q%' OR asset_description LIKE '%$q%' OR asset_type LIKE '%$q%' OR interface_ip LIKE '%$q%' OR interface_ipv6 LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR contact_name LIKE '%$q%' OR location_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
AND ($type_query)
|
||||
$access_permission_query
|
||||
@@ -205,7 +221,7 @@ if (mysqli_num_rows($os_sql) > 0) {
|
||||
</div>
|
||||
<?php if ($client_url) { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="location" onchange="this.form.submit()">
|
||||
<option value="">- All Locations -</option>
|
||||
|
||||
@@ -233,7 +249,7 @@ if (mysqli_num_rows($os_sql) > 0) {
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
@@ -338,7 +354,7 @@ if (mysqli_num_rows($os_sql) > 0) {
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table border table-hover">
|
||||
<thead class="thead-light <?php if (!$num_rows[0]) { echo "d-none"; } ?>">
|
||||
<thead class="thead-light <?php if (!$num_rows[0]) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<td class="bg-light pr-0">
|
||||
<div class="form-check">
|
||||
@@ -470,8 +486,8 @@ if (mysqli_num_rows($os_sql) > 0) {
|
||||
$asset_ipv6 = nullable_htmlentities($row['interface_ipv6']);
|
||||
$asset_nat_ip = nullable_htmlentities($row['interface_nat_ip']);
|
||||
$asset_mac = nullable_htmlentities($row['interface_mac']);
|
||||
$asset_uri = nullable_htmlentities($row['asset_uri']);
|
||||
$asset_uri_2 = nullable_htmlentities($row['asset_uri_2']);
|
||||
$asset_uri = sanitize_url($row['asset_uri']);
|
||||
$asset_uri_2 = sanitize_url($row['asset_uri_2']);
|
||||
$asset_status = nullable_htmlentities($row['asset_status']);
|
||||
$asset_purchase_reference = nullable_htmlentities($row['asset_purchase_reference']);
|
||||
$asset_purchase_date = nullable_htmlentities($row['asset_purchase_date']);
|
||||
@@ -550,11 +566,7 @@ if (mysqli_num_rows($os_sql) > 0) {
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a class="text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-modal-size="lg"
|
||||
data-ajax-url="ajax/ajax_asset_details.php?<?php echo $client_url; ?>"
|
||||
data-ajax-id="<?php echo $asset_id; ?>">
|
||||
<a class="text-dark" href="asset_details.php?client_id=<?php echo $client_id; ?>&asset_id=<?php echo $asset_id; ?>">
|
||||
<div class="media">
|
||||
<i class="fa fa-fw fa-2x fa-<?php echo $device_icon; ?> mr-3 mt-1"></i>
|
||||
<div class="media-body">
|
||||
|
||||
@@ -303,7 +303,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
}
|
||||
|
||||
//Vendors Added Created
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN vendors ON client_id = vendor_client_id $client_query AND vendor_template = 0 ");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN vendors ON client_id = vendor_client_id $client_query");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$event_id = intval($row['vendor_id']);
|
||||
$client_id = intval($row['client_id']);
|
||||
|
||||
@@ -9,10 +9,26 @@ if (isset($_GET['client_id'])) {
|
||||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND certificate_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "certificate_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "certificate_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR certificate_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND certificate_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Perms
|
||||
@@ -32,7 +48,7 @@ if (!$client_url) {
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM certificates
|
||||
LEFT JOIN clients ON client_id = certificate_client_id
|
||||
WHERE certificate_archived_at IS NULL
|
||||
WHERE $archive_query
|
||||
AND (certificate_name LIKE '%$q%' OR certificate_domain LIKE '%$q%' OR certificate_issued_by LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$access_permission_query
|
||||
$client_query
|
||||
@@ -65,6 +81,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<?php if ($client_url) { ?>
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<input type="hidden" name="archived" value="<?php echo $archived; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
@@ -109,6 +126,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="btn-group float-right">
|
||||
<a href="?<?php echo $client_url; ?>archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
||||
class="btn btn-<?php if($archived == 1){ echo "primary"; } else { echo "default"; } ?>">
|
||||
<i class="fa fa-fw fa-archive mr-2"></i>Archived
|
||||
</a>
|
||||
<div class="dropdown ml-2" id="bulkActionButton" hidden>
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-layer-group mr-2"></i>Bulk Action (<span id="selectedCount">0</span>)
|
||||
@@ -182,6 +203,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$certificate_issued_by = nullable_htmlentities($row['certificate_issued_by']);
|
||||
$certificate_expire = nullable_htmlentities($row['certificate_expire']);
|
||||
$certificate_created_at = nullable_htmlentities($row['certificate_created_at']);
|
||||
$certificate_archived_at = nullable_htmlentities($row['certificate_archived_at']);
|
||||
|
||||
$certificate_expire_ago = timeAgo($certificate_expire);
|
||||
// Convert the expiry date to a timestamp
|
||||
@@ -250,14 +272,22 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<?php if ($certificate_archived_at) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_certificate=<?php echo $certificate_id; ?>">
|
||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||
<a class="dropdown-item text-info confirm-link" href="post.php?unarchive_certificate=<?php echo $certificate_id; ?>">
|
||||
<i class="fas fa-fw fa-redo mr-2"></i>Restore
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_certificate=<?php echo $certificate_id; ?>">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?archive_certificate=<?php echo $certificate_id; ?>">
|
||||
<i class="fas fa-fw fa-archive mr-2"></i>Archive
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,6 +56,7 @@ header("X-Frame-Options: DENY"); // Legacy
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown1">
|
||||
<a class="dropdown-item" href="invoices.php">Invoices</a>
|
||||
<a class="dropdown-item" href="recurring_invoices.php">Recurring Invoices</a>
|
||||
<a class="dropdown-item" href="quotes.php">Quotes</a>
|
||||
<a class="dropdown-item" href="autopay.php">Auto Payment</a>
|
||||
</div>
|
||||
|
||||
228
client/index.php
228
client/index.php
@@ -8,7 +8,235 @@ header("Content-Security-Policy: default-src 'self'");
|
||||
|
||||
require_once "includes/inc_all.php";
|
||||
|
||||
|
||||
// Billing Card Queries
|
||||
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||
$sql_invoice_amounts = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE invoice_client_id = $session_client_id AND invoice_status != 'Draft' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable'");
|
||||
$row = mysqli_fetch_array($sql_invoice_amounts);
|
||||
|
||||
$invoice_amounts = floatval($row['invoice_amounts']);
|
||||
|
||||
$sql_amount_paid = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS amount_paid FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_client_id = $session_client_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
|
||||
$amount_paid = floatval($row['amount_paid']);
|
||||
|
||||
$balance = $invoice_amounts - $amount_paid;
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_invoice_amount) AS recurring_monthly_total FROM recurring_invoices WHERE recurring_invoice_status = 1 AND recurring_invoice_frequency = 'month' AND recurring_invoice_client_id = $session_client_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
|
||||
$recurring_monthly_total = floatval($row['recurring_monthly_total']);
|
||||
|
||||
//Get Yearly Recurring Total
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_invoice_amount) AS recurring_yearly_total FROM recurring_invoices WHERE recurring_invoice_status = 1 AND recurring_invoice_frequency = 'year' AND recurring_invoice_client_id = $session_client_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
|
||||
$recurring_yearly_total = floatval($row['recurring_yearly_total']) / 12;
|
||||
|
||||
$recurring_monthly = $recurring_monthly_total + $recurring_yearly_total;
|
||||
|
||||
// Technical Card Queries
|
||||
// 8 - 45 Day Warning
|
||||
|
||||
// Get Domains Expiring
|
||||
$sql_domains_expiring = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM domains
|
||||
WHERE domain_client_id = $session_client_id
|
||||
AND domain_expire IS NOT NULL
|
||||
AND domain_archived_at IS NULL
|
||||
AND domain_expire > CURRENT_DATE
|
||||
AND domain_expire < CURRENT_DATE + INTERVAL 45 DAY
|
||||
ORDER BY domain_expire ASC"
|
||||
);
|
||||
|
||||
// Get Certificates Expiring
|
||||
$sql_certificates_expiring = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM certificates
|
||||
WHERE certificate_client_id = $session_client_id
|
||||
AND certificate_expire IS NOT NULL
|
||||
AND certificate_archived_at IS NULL
|
||||
AND certificate_expire > CURRENT_DATE
|
||||
AND certificate_expire < CURRENT_DATE + INTERVAL 45 DAY
|
||||
ORDER BY certificate_expire ASC"
|
||||
);
|
||||
|
||||
// Get Licenses Expiring
|
||||
$sql_licenses_expiring = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM software
|
||||
WHERE software_client_id = $session_client_id
|
||||
AND software_expire IS NOT NULL
|
||||
AND software_archived_at IS NULL
|
||||
AND software_expire > CURRENT_DATE
|
||||
AND software_expire < CURRENT_DATE + INTERVAL 45 DAY
|
||||
ORDER BY software_expire ASC"
|
||||
);
|
||||
|
||||
// Get Asset Warranties Expiring
|
||||
$sql_asset_warranties_expiring = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
WHERE asset_client_id = $session_client_id
|
||||
AND asset_warranty_expire IS NOT NULL
|
||||
AND asset_archived_at IS NULL
|
||||
AND asset_warranty_expire > CURRENT_DATE
|
||||
AND asset_warranty_expire < CURRENT_DATE + INTERVAL 45 DAY
|
||||
ORDER BY asset_warranty_expire ASC"
|
||||
);
|
||||
|
||||
// Get Assets Retiring 7 Year
|
||||
$sql_asset_retire = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
WHERE asset_client_id = $session_client_id
|
||||
AND asset_install_date IS NOT NULL
|
||||
AND asset_archived_at IS NULL
|
||||
AND asset_install_date + INTERVAL 7 YEAR > CURRENT_DATE
|
||||
AND asset_install_date + INTERVAL 7 YEAR <= CURRENT_DATE + INTERVAL 45 DAY
|
||||
ORDER BY asset_install_date ASC"
|
||||
);
|
||||
|
||||
/*
|
||||
* EXPIRED ITEMS
|
||||
*/
|
||||
|
||||
// Get Domains Expired
|
||||
$sql_domains_expired = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM domains
|
||||
WHERE domain_client_id = $session_client_id
|
||||
AND domain_expire IS NOT NULL
|
||||
AND domain_archived_at IS NULL
|
||||
AND domain_expire < CURRENT_DATE
|
||||
ORDER BY domain_expire ASC"
|
||||
);
|
||||
|
||||
// Get Certificates Expired
|
||||
$sql_certificates_expired = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM certificates
|
||||
WHERE certificate_client_id = $session_client_id
|
||||
AND certificate_expire IS NOT NULL
|
||||
AND certificate_archived_at IS NULL
|
||||
AND certificate_expire < CURRENT_DATE
|
||||
ORDER BY certificate_expire ASC"
|
||||
);
|
||||
|
||||
// Get Licenses Expired
|
||||
$sql_licenses_expired = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM software
|
||||
WHERE software_client_id = $session_client_id
|
||||
AND software_expire IS NOT NULL
|
||||
AND software_archived_at IS NULL
|
||||
AND software_expire < CURRENT_DATE
|
||||
ORDER BY software_expire ASC"
|
||||
);
|
||||
|
||||
// Get Asset Warranties Expired
|
||||
$sql_asset_warranties_expired = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
WHERE asset_client_id = $session_client_id
|
||||
AND asset_warranty_expire IS NOT NULL
|
||||
AND asset_archived_at IS NULL
|
||||
AND asset_warranty_expire < CURRENT_DATE
|
||||
ORDER BY asset_warranty_expire ASC"
|
||||
);
|
||||
|
||||
// Get Retired Assets
|
||||
$sql_asset_retired = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
WHERE asset_client_id = $session_client_id
|
||||
AND asset_install_date IS NOT NULL
|
||||
AND asset_archived_at IS NULL
|
||||
AND asset_install_date + INTERVAL 7 YEAR < CURRENT_DATE -- Assets retired (installed more than 7 years ago)
|
||||
ORDER BY asset_install_date ASC"
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Billing Cards
|
||||
if ($session_contact_primary == 1 || $session_contact_is_billing_contact) { ?>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<?php if ($balance > 0) { ?>
|
||||
<div class="col-sm-3 offset-1">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title text-bold">Account Balance</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="h4 text-danger"><b><?php echo numfmt_format_currency($currency_format, $balance, $session_company_currency); ?></b></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($recurring_monthly_total > 0) { ?>
|
||||
<div class="col-sm-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Recurring Monthly</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="h4"><b><?php echo numfmt_format_currency($currency_format, $recurring_monthly_total, $session_company_currency); ?></b></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } //End Billing Cards ?>
|
||||
|
||||
<?php
|
||||
// Technical Cards
|
||||
if ($session_contact_primary == 1 || $session_contact_is_technical_contact) {
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<?php if (mysqli_num_rows($sql_domains_expiring) > 0) { ?>
|
||||
<div class="col-sm-3 offset-1">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title text-bold">Domains Expiring</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_domains_expiring)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
$domain_expire = nullable_htmlentities($row['domain_expire']);
|
||||
$domain_expire_human = timeAgo($row['domain_expire']);
|
||||
|
||||
?>
|
||||
<p class="mb-1">
|
||||
<i class="fa fa-fw fa-globe text-secondary mr-1"></i>
|
||||
Domain: <?php echo $domain_name; ?>
|
||||
<span>-- <?php echo $domain_expire; ?> (<?php echo $domain_expire_human; ?>)</span>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="col-md-2 offset-1">
|
||||
<a href="ticket_add.php" class="btn btn-primary btn-block">New ticket</a>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,7 @@ if (isset($_POST['add_ticket'])) {
|
||||
$new_config_ticket_next_number = $config_ticket_next_number + 1;
|
||||
mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1");
|
||||
|
||||
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_category = $category, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $config_ticket_default_billable, ticket_created_by = 0, ticket_contact_id = $session_contact_id, ticket_url_key = '$url_key', ticket_client_id = $session_client_id");
|
||||
mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_source = 'Portal', ticket_category = $category, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $config_ticket_default_billable, ticket_created_by = $session_user_id, ticket_contact_id = $session_contact_id, ticket_url_key = '$url_key', ticket_client_id = $session_client_id");
|
||||
$ticket_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Notify agent DL of the new ticket, if populated with a valid email
|
||||
@@ -597,10 +597,22 @@ if (isset($_GET['stripe_save_card'])) {
|
||||
|
||||
// Get some card/payment method details for the email/logging
|
||||
$payment_method_details = $stripe->paymentMethods->retrieve($payment_method);
|
||||
$card_info = sanitizeInput($payment_method_details->card->display_brand) . " " . sanitizeInput($payment_method_details->card->last4);
|
||||
$card_type = sanitizeInput($payment_method_details->card->brand);
|
||||
$last4 = sanitizeInput($payment_method_details->card->last4);
|
||||
$expiry_month = sanitizeInput($payment_method_details->card->exp_month);
|
||||
$expiry_year = sanitizeInput($payment_method_details->card->exp_year);
|
||||
|
||||
// Format the payment details string (Visa - 4324 | Exp 12/25)
|
||||
$stripe_pm_details = "$card_type - $last4 | Exp $expiry_month/$expiry_year";
|
||||
|
||||
// Save the formatted payment details into stripe_pm_details
|
||||
$update_query = "
|
||||
UPDATE client_stripe
|
||||
SET stripe_pm_details = '$stripe_pm_details'
|
||||
WHERE client_id = $session_client_id LIMIT 1";
|
||||
mysqli_query($mysqli, $update_query);
|
||||
|
||||
// Send email confirmation
|
||||
|
||||
// Company Details & Settings
|
||||
$sql_settings = mysqli_query($mysqli, "SELECT * FROM companies, settings WHERE companies.company_id = settings.company_id AND companies.company_id = 1");
|
||||
$row = mysqli_fetch_array($sql_settings);
|
||||
@@ -617,7 +629,7 @@ if (isset($_GET['stripe_save_card'])) {
|
||||
|
||||
if (!empty($config_smtp_host)) {
|
||||
$subject = "Payment method saved";
|
||||
$body = "Hello $session_contact_name,<br><br>We’re writing to confirm that your payment details have been securely stored with Stripe, our trusted payment processor.<br><br>By agreeing to save your payment information, you have authorized us to automatically bill your card ($card_info) for any future invoices. The payment details you’ve provided are securely stored with Stripe and will be used solely for invoices. We do not have access to your full card details.<br><br>You may update or remove your payment information at any time using the portal.<br><br>Thank you for your business!<br><br>--<br>$company_name - Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
||||
$body = "Hello $session_contact_name,<br><br>We’re writing to confirm that your payment details have been securely stored with Stripe, our trusted payment processor.<br><br>By agreeing to save your payment information, you have authorized us to automatically bill your card ($stripe_pm_details) for any future invoices. The payment details you’ve provided are securely stored with Stripe and will be used solely for invoices. We do not have access to your full card details.<br><br>You may update or remove your payment information at any time using the portal.<br><br>Thank you for your business!<br><br>--<br>$company_name - Billing Department<br>$config_invoice_from_email<br>$company_phone";
|
||||
|
||||
$data = [
|
||||
[
|
||||
@@ -635,12 +647,11 @@ if (isset($_GET['stripe_save_card'])) {
|
||||
}
|
||||
|
||||
// Logging
|
||||
logAction("Stripe", "Update", "$session_contact_name saved payment method ($card_info) for future automatic payments (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
logAction("Stripe", "Update", "$session_contact_name saved payment method ($stripe_pm_details) for future automatic payments (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
|
||||
// Redirect
|
||||
$_SESSION['alert_message'] = "Payment method saved - thank you";
|
||||
header('Location: autopay.php');
|
||||
|
||||
}
|
||||
|
||||
if (isset($_GET['stripe_remove_pm'])) {
|
||||
@@ -677,7 +688,15 @@ if (isset($_GET['stripe_remove_pm'])) {
|
||||
}
|
||||
|
||||
// Remove payment method from ITFlow
|
||||
mysqli_query($mysqli, "UPDATE client_stripe SET stripe_pm = NULL WHERE client_id = $session_client_id LIMIT 1");
|
||||
mysqli_query($mysqli, "UPDATE client_stripe SET stripe_pm = NULL, stripe_pm_details = NULL WHERE client_id = $session_client_id LIMIT 1");
|
||||
|
||||
// Remove Auto Pay on recurring invoices that are stripe
|
||||
$sql_recurring_invoices = mysqli_query($mysqli, "SELECT recurring_invoice_id FROM recurring_invoices WHERE recurring_invoice_client_id = $session_client_id");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_recurring_invoices)) {
|
||||
$recurring_invoice_id = intval($row['recurring_invoice_id']);
|
||||
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_method = 'Stripe' AND recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||
}
|
||||
|
||||
// Logging & Redirect
|
||||
logAction("Stripe", "Update", "$session_contact_name deleted saved Stripe payment method (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
@@ -685,3 +704,49 @@ if (isset($_GET['stripe_remove_pm'])) {
|
||||
$_SESSION['alert_message'] = "Payment method removed";
|
||||
header('Location: autopay.php');
|
||||
}
|
||||
|
||||
if (isset($_POST['add_recurring_payment'])) {
|
||||
|
||||
$recurring_invoice_id = intval($_POST['recurring_invoice_id']);
|
||||
|
||||
// Get Recurring Info for logging and alerting
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM recurring_invoices WHERE recurring_invoice_id = $recurring_invoice_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$recurring_invoice_prefix = sanitizeInput($row['recurring_invoice_prefix']);
|
||||
$recurring_invoice_number = intval($row['recurring_invoice_number']);
|
||||
$recurring_invoice_amount = floatval($row['recurring_invoice_amount']);
|
||||
$recurring_invoice_currency_code = sanitizeInput($row['recurring_invoice_currency_code']);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO recurring_payments SET recurring_payment_currency_code = '$recurring_invoice_currency_code', recurring_payment_account_id = $config_stripe_account, recurring_payment_method = 'Stripe', recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||
|
||||
// Get Payment ID for reference
|
||||
$recurring_payment_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Logging
|
||||
logAction("Recurring Invoice", "Auto Payment", "$session_name created Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . numfmt_format_currency($currency_format, $recurring_invoice_amount, $recurring_invoice_currency_code), $session_client_id, $recurring_invoice_id);
|
||||
|
||||
|
||||
$_SESSION['alert_message'] = "Automatic Payment enabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}
|
||||
|
||||
if (isset($_POST['delete_recurring_payment'])) {
|
||||
$recurring_invoice_id = intval($_POST['recurring_invoice_id']);
|
||||
|
||||
// Get the invoice total and details
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM recurring_invoices WHERE recurring_invoice_id = $recurring_invoice_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$recurring_invoice_prefix = sanitizeInput($row['recurring_invoice_prefix']);
|
||||
$recurring_invoice_number = intval($row['recurring_invoice_number']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||
|
||||
// Logging
|
||||
logAction("Recurring Invoice", "Auto Payment", "$session_name removed auto Pay from Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number", $session_client_id, $recurring_invoice_id);
|
||||
|
||||
$_SESSION['alert_message'] = "Automatic Payment disabled for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
120
client/recurring_invoices.php
Normal file
120
client/recurring_invoices.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/*
|
||||
* Client Portal
|
||||
* Invoices for PTC
|
||||
*/
|
||||
|
||||
header("Content-Security-Policy: default-src 'self'");
|
||||
|
||||
require_once "includes/inc_all.php";
|
||||
|
||||
|
||||
if ($session_contact_primary == 0 && !$session_contact_is_billing_contact) {
|
||||
header("Location: post.php?logout");
|
||||
exit();
|
||||
}
|
||||
|
||||
// Get client's StripeID from database
|
||||
$stripe_client_details = mysqli_fetch_array(mysqli_query($mysqli, "SELECT * FROM client_stripe WHERE client_id = $session_client_id LIMIT 1"));
|
||||
if ($stripe_client_details) {
|
||||
$stripe_pm = sanitizeInput($stripe_client_details['stripe_pm']);
|
||||
}
|
||||
|
||||
$recurring_invoices_sql = mysqli_query($mysqli, "SELECT * FROM recurring_invoices
|
||||
LEFT JOIN recurring_payments ON recurring_payment_recurring_invoice_id = recurring_invoice_id
|
||||
WHERE recurring_invoice_client_id = $session_client_id
|
||||
AND recurring_invoice_status = 1
|
||||
ORDER BY recurring_invoice_next_date DESC"
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<h3>Recurring Invoices</h3>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-10">
|
||||
|
||||
<table class="table tabled-bordered border border-dark">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Scope</th>
|
||||
<th>Amount</th>
|
||||
<th>Next Bill Date</th>
|
||||
<th>Frequency</th>
|
||||
<?php if ($config_stripe_enable) { ?>
|
||||
<th>Auto Pay</th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($recurring_invoices_sql)) {
|
||||
$recurring_invoice_id = intval($row['recurring_invoice_id']);
|
||||
$recurring_invoice_prefix = nullable_htmlentities($row['recurring_invoice_prefix']);
|
||||
$recurring_invoice_number = intval($row['recurring_invoice_number']);
|
||||
$recurring_invoice_scope = nullable_htmlentities($row['recurring_invoice_scope']);
|
||||
$recurring_invoice_status = nullable_htmlentities($row['recurring_invoice_status']);
|
||||
$recurring_invoice_next_date = nullable_htmlentities($row['recurring_invoice_next_date']);
|
||||
$recurring_invoice_frequency = nullable_htmlentities($row['recurring_invoice_frequency']);
|
||||
$recurring_invoice_amount = floatval($row['recurring_invoice_amount']);
|
||||
$recurring_payment_id = intval($row['recurring_payment_id']);
|
||||
$recurring_payment_recurring_invoice_id = intval($row['recurring_payment_recurring_invoice_id']);
|
||||
if ($config_stripe_enable) {
|
||||
if ($recurring_payment_recurring_invoice_id) {
|
||||
$auto_pay_display = "
|
||||
Yes
|
||||
<a href='post.php?delete_recurring_payment=$recurring_payment_id' title='Remove'>
|
||||
<i class='fas fa-fw fa-times-circle'></i>
|
||||
</a>
|
||||
";
|
||||
} else {
|
||||
$auto_pay_display = "
|
||||
<a href='#' data-toggle='modal' data-target='#addRecurringPaymentModal$recurring_invoice_id'>
|
||||
Create
|
||||
</a>
|
||||
";
|
||||
//require "recurring_payment_add_modal.php";
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($recurring_invoice_scope)) {
|
||||
$recurring_invoice_scope_display = "-";
|
||||
} else {
|
||||
$recurring_invoice_scope_display = $recurring_invoice_scope;
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $recurring_invoice_scope_display; ?></td>
|
||||
<td><?php echo numfmt_format_currency($currency_format, $recurring_invoice_amount, $session_company_currency); ?></td>
|
||||
<td><?php echo $recurring_invoice_next_date; ?></td>
|
||||
<td><?php echo ucwords($recurring_invoice_frequency); ?>ly</td>
|
||||
<?php if ($config_stripe_enable) { ?>
|
||||
<td>
|
||||
<?php if ($stripe_pm) { ?>
|
||||
<form class="form" action="post.php" method="post">
|
||||
<input type="hidden" name="recurring_invoice_id" value="<?php echo $recurring_invoice_id; ?>">
|
||||
<?php if ($recurring_payment_recurring_invoice_id) { ?>
|
||||
<button type="submit" name="delete_recurring_payment" class="btn btn-outline-dark"><i class="fas fa-times mr-2"></i>Disable</button>
|
||||
<?php } else { ?>
|
||||
<button type="submit" name="add_recurring_payment" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Enable</button>
|
||||
<?php } ?>
|
||||
</form>
|
||||
<?php } else { ?>
|
||||
<a href="autopay.php">Add Card Details First</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once "includes/footer.php";
|
||||
@@ -62,7 +62,7 @@ $all_tickets = mysqli_query($mysqli, "SELECT ticket_id, ticket_prefix, ticket_nu
|
||||
$ticket_contact_name = nullable_htmlentities($row['contact_name']);
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td> <a href='ticket.php?id=$ticket_id'> $ticket_prefix$ticket_id</a></td>";
|
||||
echo "<td> <a href='ticket.php?id=$ticket_id'> $ticket_prefix$ticket_number</a></td>";
|
||||
echo "<td> <a href='ticket.php?id=$ticket_id'> $ticket_subject</a></td>";
|
||||
echo "<td>$ticket_contact_name</td>";
|
||||
echo "<td>$ticket_status</td>";
|
||||
|
||||
@@ -35,7 +35,6 @@ $document_created_at = nullable_htmlentities($row['document_created_at']);
|
||||
$document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
||||
$document_archived_at = nullable_htmlentities($row['document_archived_at']);
|
||||
$document_folder_id = intval($row['document_folder_id']);
|
||||
$document_parent = intval($row['document_parent']);
|
||||
$document_client_visible = intval($row['document_client_visible']);
|
||||
|
||||
// Override Tab Title // No Sanitizing needed as this var will opnly be used in the tab title
|
||||
@@ -115,45 +114,44 @@ $page_title = $row['document_name'];
|
||||
|
||||
<table class="table table-sm">
|
||||
<thead class="thead-light">
|
||||
<th>Revision</th>
|
||||
<th>Version</th>
|
||||
<th>Date</th>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Author</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql_document_revisions = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
LEFT JOIN users ON document_updated_by = user_id
|
||||
WHERE document_parent = $document_parent
|
||||
ORDER BY document_created_at ASC"
|
||||
$sql_document_versions = mysqli_query($mysqli, "SELECT * FROM document_versions
|
||||
LEFT JOIN users ON document_version_created_by = user_id
|
||||
WHERE document_version_document_id = $document_id
|
||||
ORDER BY document_version_created_at ASC"
|
||||
);
|
||||
|
||||
$revision_count = 1; // Initialize the revision counter
|
||||
$document_version_count = 1; // Initialize the document version counter
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_document_revisions)) {
|
||||
$revision_document_id = intval($row['document_id']);
|
||||
$revision_document_name = nullable_htmlentities($row['document_name']);
|
||||
$revision_document_description = nullable_htmlentities($row['document_description']);
|
||||
if ($revision_document_description ) {
|
||||
$revision_document_description_display = $revision_document_description;
|
||||
while ($row = mysqli_fetch_array($sql_document_versions)) {
|
||||
$document_version_id = intval($row['document_version_id']);
|
||||
$document_version_name = nullable_htmlentities($row['document_version_name']);
|
||||
$document_version_description = nullable_htmlentities($row['document_version_description']);
|
||||
if ($document_version_description ) {
|
||||
$document_version_description_display = $document_version_description;
|
||||
} else {
|
||||
$revision_document_description_display = "-";
|
||||
$document_version_description_display = "-";
|
||||
}
|
||||
$revision_document_author = nullable_htmlentities($row['user_name']);
|
||||
if (empty($revision_document_author)) {
|
||||
$revision_document_author = $document_created_by_name;
|
||||
}
|
||||
$revision_document_created_date = date('Y-m-d', strtotime($row['document_created_at']));
|
||||
$document_version_author = nullable_htmlentities($row['user_name']);
|
||||
$document_version_created_date = date('Y-m-d', strtotime($row['document_version_created_at']));
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo "$revision_count.0"; ?></td>
|
||||
<td><?php echo $revision_document_created_date; ?></td>
|
||||
<td><?php echo $revision_document_description_display; ?></td>
|
||||
<td><?php echo $revision_document_author; ?></td>
|
||||
<td><?php echo $document_version_count; ?></td>
|
||||
<td><?php echo $document_version_created_date; ?></td>
|
||||
<td><?php echo $document_version_name; ?></td>
|
||||
<td><?php echo $document_version_description_display; ?></td>
|
||||
<td><?php echo $document_version_author; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$revision_count++; // Increment the counter
|
||||
$document_version_count++; // Increment the counter
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
@@ -378,29 +376,30 @@ $page_title = $row['document_name'];
|
||||
<h6><i class="fas fa-history mr-2"></i>Revisions</h6>
|
||||
<?php
|
||||
|
||||
$sql_document_revisions = mysqli_query($mysqli, "SELECT * FROM documents
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE document_parent = $document_parent
|
||||
ORDER BY document_created_at DESC"
|
||||
$sql_document_versions = mysqli_query($mysqli, "SELECT * FROM document_versions
|
||||
LEFT JOIN users ON document_version_created_by = user_id
|
||||
WHERE document_version_document_id = $document_id
|
||||
ORDER BY document_version_created_at DESC"
|
||||
);
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_document_revisions)) {
|
||||
$revision_document_id = intval($row['document_id']);
|
||||
$revision_document_name = nullable_htmlentities($row['document_name']);
|
||||
$revision_document_description = nullable_htmlentities($row['document_description']);
|
||||
$revision_document_created_by_name = nullable_htmlentities($row['user_name']);
|
||||
$revision_document_created_date = nullable_htmlentities($row['document_created_at']);
|
||||
while ($row = mysqli_fetch_array($sql_document_versions)) {
|
||||
$document_version_id = intval($row['document_version_id']);
|
||||
$document_version_name = nullable_htmlentities($row['document_version_name']);
|
||||
$document_version_description = nullable_htmlentities($row['document_version_description']);
|
||||
$document_version_author = nullable_htmlentities($row['user_name']);
|
||||
$document_version_created_date = nullable_htmlentities($row['document_version_created_at']);
|
||||
|
||||
?>
|
||||
<div class="mt-1 <?php if($document_id == $revision_document_id){ echo "text-bold"; } ?>">
|
||||
<i class="fas fa-fw fa-history text-secondary mr-2"></i><a href="?client_id=<?php echo $client_id; ?>&document_id=<?php echo $revision_document_id; ?>"><?php echo " $revision_document_created_date"; ?></a><?php if($document_parent == $revision_document_id){ echo "<span class='float-right'>(Parent)</span>";
|
||||
} else { ?>
|
||||
<a class="confirm-link float-right" href="post.php?delete_document_version=<?php echo $revision_document_id; ?>">
|
||||
<i class="fas fa-fw fa-trash-alt text-secondary"></i>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="mt-1 <?php if($document_id === $document_version_id){ echo "text-bold"; } ?>">
|
||||
<i class="fas fa-fw fa-history text-secondary mr-2"></i>
|
||||
<a href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-modal-size="lg"
|
||||
data-ajax-url="ajax/ajax_document_version_view.php"
|
||||
data-ajax-id="<?php echo $document_version_id; ?>"><?php echo "$document_version_created_date | $document_version_author"; ?></a>
|
||||
<a class="confirm-link float-right" href="post.php?delete_document_version=<?php echo $document_version_id; ?>">
|
||||
<i class="fas fa-fw fa-trash-alt text-secondary"></i>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -41,8 +41,6 @@ if ($get_folder_id == 0 && $_GET["q"]) {
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM documents
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE document_client_id = $client_id
|
||||
AND document_template = 0
|
||||
|
||||
AND document_archived_at IS NULL
|
||||
$query_snippet
|
||||
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
@@ -53,7 +51,6 @@ if ($get_folder_id == 0 && $_GET["q"]) {
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM documents
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE document_client_id = $client_id
|
||||
AND document_template = 0
|
||||
AND document_folder_id = $folder
|
||||
AND document_archived_at IS NULL
|
||||
$query_snippet
|
||||
@@ -353,7 +350,11 @@ while ($folder_id > 0) {
|
||||
$document_content = nullable_htmlentities($row['document_content']);
|
||||
$document_created_by_name = nullable_htmlentities($row['user_name']);
|
||||
$document_created_at = date("m/d/Y",strtotime($row['document_created_at']));
|
||||
$document_updated_at = date("m/d/Y",strtotime($row['document_updated_at']));
|
||||
if ($row['document_updated_at']) {
|
||||
$document_updated_at_display = date("m/d/Y",strtotime($row['document_updated_at']));
|
||||
} else {
|
||||
$document_updated_at_display = "-";
|
||||
}
|
||||
$document_folder_id = intval($row['document_folder_id']);
|
||||
|
||||
// Check if shared
|
||||
@@ -398,7 +399,7 @@ while ($folder_id > 0) {
|
||||
<?php echo $document_created_at; ?>
|
||||
<div class="text-secondary mt-1"><?php echo $document_created_by_name; ?>
|
||||
</td>
|
||||
<td><?php echo $document_updated_at; ?></td>
|
||||
<td><?php echo $document_updated_at_display; ?></td>
|
||||
<td>
|
||||
<?php if (mysqli_num_rows($sql_shared) > 0) { ?>
|
||||
<div class="media" title="Expires <?php echo $item_expire_at_human; ?>">
|
||||
|
||||
@@ -193,7 +193,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<!-- Notes -->
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-8">
|
||||
|
||||
<div class="card card-dark mb-3">
|
||||
<div class="card-header">
|
||||
@@ -226,19 +226,42 @@ $sql_asset_retired = mysqli_query(
|
||||
$contact_extension = nullable_htmlentities($row['contact_extension']);
|
||||
$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']);
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code));
|
||||
$contact_photo = nullable_htmlentities($row['contact_photo']);
|
||||
$contact_initials = initials($contact_name);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="#" class="text-bold"
|
||||
data-toggle="ajax-modal"
|
||||
<a href="#" data-toggle="ajax-modal"
|
||||
data-modal-size="lg"
|
||||
data-ajax-url="ajax/ajax_contact_details.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<?php echo $contact_name; ?>
|
||||
<div class="media">
|
||||
<?php if ($contact_photo) { ?>
|
||||
<span class="fa-stack fa-2x mr-2 text-center">
|
||||
<img class="img-size-50 img-circle" src="<?php echo "uploads/clients/$client_id/$contact_photo"; ?>">
|
||||
</span>
|
||||
<?php } else { ?>
|
||||
<span class="fa-stack fa-2x mr-2">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
||||
</span>
|
||||
<?php } ?>
|
||||
|
||||
<div class="media-body">
|
||||
<div class="text-bold"><?php echo $contact_name; ?></div>
|
||||
<small class="text-secondary"><?php echo $contact_title; ?></small>
|
||||
<div><?php echo $contact_primary_display; ?></div>
|
||||
<?php
|
||||
if (!empty($contact_tags_display)) { ?>
|
||||
<div class="mt-1">
|
||||
<?php echo $contact_tags_display; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $contact_title; ?></small>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?php if (!empty($contact_phone)) { ?>
|
||||
@@ -613,7 +636,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
<!-- Recent Activities -->
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="card card-dark mb-3">
|
||||
<div class="card-header">
|
||||
@@ -631,7 +654,7 @@ $sql_asset_retired = mysqli_query(
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $log_created_at_time_ago; ?></td>
|
||||
<td class="text-nowrap text-secondary"><?php echo $log_created_at_time_ago; ?></td>
|
||||
<td><?php echo $log_description; ?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -9,9 +9,6 @@ require_once "includes/inc_all_client.php";
|
||||
// Perms
|
||||
enforceUserPermission('module_support');
|
||||
|
||||
// Rebuild URL
|
||||
$url_query_strings_sort = http_build_query($get_copy);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM racks
|
||||
@@ -323,7 +320,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
} else {
|
||||
// No device in this row
|
||||
?>
|
||||
<td class="text-center">No device</td>
|
||||
<td class="text-center text-secondary">--</td>
|
||||
<td></td>
|
||||
<?php
|
||||
}
|
||||
|
||||
18
clients.php
18
clients.php
@@ -62,7 +62,7 @@ $sql = mysqli_query(
|
||||
WHERE (client_name LIKE '%$q%' OR client_abbreviation LIKE '%$q%' OR client_type LIKE '%$q%' OR client_referral LIKE '%$q%'
|
||||
OR contact_email LIKE '%$q%' OR contact_name LIKE '%$q%' OR contact_phone LIKE '%$phone_query%'
|
||||
OR contact_mobile LIKE '%$phone_query%' OR location_address LIKE '%$q%'
|
||||
OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%'
|
||||
OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%' OR location_country LIKE '%$q%'
|
||||
OR tag_name LIKE '%$q%' OR client_tax_id_number LIKE '%$q%')
|
||||
AND client_$archive_query
|
||||
AND DATE(client_created_at) BETWEEN '$dtf' AND '$dtt'
|
||||
@@ -111,7 +111,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<input type="hidden" name="archived" value="<?php echo $archived; ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-sm-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search <?php if($leads_filter == 0){ echo "clients"; } else { echo "leads"; } ?>" autofocus>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
@@ -126,7 +126,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<a href="?leads=1" class="btn btn-<?php if ($leads_filter == 1){ echo "primary"; } else { echo "default"; } ?>"><i class="fa fa-fw fa-bullhorn mr-2"></i>Leads</a>
|
||||
</div>
|
||||
|
||||
<div class="btn-group mr-2">
|
||||
<div class="btn-group">
|
||||
<a href="?<?php echo $url_query_strings_sort ?>&archived=<?php if($archived == 1){ echo 0; } else { echo 1; } ?>"
|
||||
class="btn btn-<?php if ($archived == 1) { echo "primary"; } else { echo "default"; } ?>">
|
||||
<i class="fa fa-fw fa-archive mr-2"></i>Archived
|
||||
@@ -248,7 +248,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<hr>
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-hover table-borderless">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
||||
@@ -286,7 +286,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
if (empty($location_address) && empty($location_city) && empty($location_state) && empty($location_zip)) {
|
||||
$location_address_display = "-";
|
||||
} else {
|
||||
$location_address_display = "$location_address<br>$location_city $location_state $location_zip";
|
||||
$location_address_display = "<i class='fa fa-fw fa-map-marker-alt text-secondary mr-2'></i>$location_address<br><i class='fa fa-fw mr-2'></i>$location_city $location_state $location_zip<br><i class='fa fa-fw mr-2'></i><small>$location_country</small>";
|
||||
}
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
@@ -339,7 +339,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$client_tags_display = implode('', $client_tag_name_display_array);
|
||||
|
||||
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||
$sql_invoice_amounts = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE invoice_client_id = $client_id AND invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Cancelled' ");
|
||||
$sql_invoice_amounts = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE invoice_client_id = $client_id AND invoice_status != 'Draft' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable' ");
|
||||
$row = mysqli_fetch_array($sql_invoice_amounts);
|
||||
|
||||
$invoice_amounts = floatval($row['invoice_amounts']);
|
||||
@@ -404,13 +404,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
if (!empty($contact_name)) { ?>
|
||||
<div class="text-bold">
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i>
|
||||
<a href="#"
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><a href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-modal-size="lg"
|
||||
data-ajax-url="ajax/ajax_contact_details.php?client_id=<?php echo $client_id; ?>"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<?php echo $contact_name; ?>
|
||||
data-ajax-id="<?php echo $contact_id; ?>"><?php echo $contact_name; ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php } else {
|
||||
|
||||
@@ -32,7 +32,7 @@ if (isset($_GET['contact_id'])) {
|
||||
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
|
||||
$contact_extension = nullable_htmlentities($row['contact_extension']);
|
||||
$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']);
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code));
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code));
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
$contact_photo = nullable_htmlentities($row['contact_photo']);
|
||||
$contact_pin = nullable_htmlentities($row['contact_pin']);
|
||||
@@ -143,7 +143,6 @@ if (isset($_GET['contact_id'])) {
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE contact_documents.contact_id = $contact_id
|
||||
AND contact_documents.document_id = documents.document_id
|
||||
AND document_template = 0
|
||||
AND document_archived_at IS NULL
|
||||
ORDER BY document_name ASC"
|
||||
);
|
||||
@@ -294,31 +293,47 @@ if (isset($_GET['contact_id'])) {
|
||||
<div class="dropdown dropleft">
|
||||
<button type="button" class="btn btn-outline-primary" data-toggle="dropdown"><i class="fas fa-link mr-2"></i>Link</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkAssetModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_asset.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-desktop mr-2"></i>Asset
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkSoftwareModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_software.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-cube mr-2"></i>License
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkCredentialModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_credential.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-key mr-2"></i>Credential
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkServiceModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_service.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-stream mr-2"></i>Service
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkDocumentModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_document.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-folder mr-2"></i>Document
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkFileModal">
|
||||
<a class="dropdown-item text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-ajax-url="ajax/ajax_contact_link_file.php"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<i class="fa fa-fw fa-paperclip mr-2"></i>File
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1192,11 +1207,4 @@ require_once "modals/credential_add_modal.php";
|
||||
require_once "modals/client_document_add_modal.php";
|
||||
require_once "modals/client_file_upload_modal.php";
|
||||
|
||||
require_once "modals/contact_link_asset_modal.php";
|
||||
require_once "modals/contact_link_software_modal.php";
|
||||
require_once "modals/contact_link_credential_modal.php";
|
||||
require_once "modals/contact_link_service_modal.php";
|
||||
require_once "modals/contact_link_document_modal.php";
|
||||
require_once "modals/contact_link_file_modal.php";
|
||||
|
||||
require_once "includes/footer.php";
|
||||
|
||||
42
contacts.php
42
contacts.php
@@ -9,10 +9,26 @@ if (isset($_GET['client_id'])) {
|
||||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND contact_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "contact_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "contact_archived_at IS NULL";
|
||||
}
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR contact_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND contact_archived_at IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
// Tags Filter
|
||||
@@ -55,7 +71,7 @@ $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS contacts.*, clients.*,
|
||||
LEFT JOIN users ON user_id = contact_user_id
|
||||
LEFT JOIN contact_tags ON contact_tags.contact_id = contacts.contact_id
|
||||
LEFT JOIN tags ON tags.tag_id = contact_tags.tag_id
|
||||
WHERE contact_$archive_query
|
||||
WHERE $archive_query
|
||||
$tag_query
|
||||
AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR contact_department LIKE '%$q%' OR contact_phone LIKE '%$phone_query%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$phone_query%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$access_permission_query
|
||||
@@ -110,7 +126,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select onchange="this.form.submit()" class="form-control select2" name="tags[]" data-placeholder="- Select Tags -" multiple>
|
||||
|
||||
<?php
|
||||
@@ -137,7 +153,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php if ($client_url) { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="location" onchange="this.form.submit()">
|
||||
<option value="">- All Locations -</option>
|
||||
|
||||
@@ -165,7 +181,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
@@ -319,7 +335,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
} else {
|
||||
$contact_phone_display = "<div><i class='fas fa-fw fa-phone mr-2'></i><a href='tel:$contact_phone'>$contact_phone$contact_extension_display</a></div>";
|
||||
}
|
||||
$contact_mobile_country_code = nullable_htmlentities($row['contact_phone_country_code']);
|
||||
$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']);
|
||||
$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code));
|
||||
if (empty($contact_mobile)) {
|
||||
$contact_mobile_display = "";
|
||||
@@ -374,7 +390,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$sql_related_assets = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_contact_id = $contact_id ORDER BY asset_id DESC");
|
||||
$asset_count = mysqli_num_rows($sql_related_assets);
|
||||
if ($asset_count) {
|
||||
$asset_count_display = "<span class='mr-2 badge badge-pill badge-dark p-2' title='$asset_count Assets'><i class='fas fa-fw fa-desktop mr-2'></i>$asset_count</span>";
|
||||
$asset_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-dark p-2' title='$asset_count Assets'><i class='fas fa-fw fa-desktop mr-2'></i>$asset_count</span>";
|
||||
} else {
|
||||
$asset_count_display = '';
|
||||
}
|
||||
@@ -383,7 +399,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$sql_related_credentials = mysqli_query($mysqli, "SELECT * FROM credentials WHERE credential_contact_id = $contact_id ORDER BY credential_id DESC");
|
||||
$credential_count = mysqli_num_rows($sql_related_credentials);
|
||||
if ($credential_count) {
|
||||
$credential_count_display = "<span class='mr-2 badge badge-pill badge-secondary p-2' title='$credential_count Credentials'><i class='fas fa-fw fa-key mr-2'></i>$credential_count</span>";
|
||||
$credential_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$credential_count Credentials'><i class='fas fa-fw fa-key mr-2'></i>$credential_count</span>";
|
||||
} else {
|
||||
$credential_count_display = '';
|
||||
}
|
||||
@@ -392,7 +408,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$sql_related_software = mysqli_query($mysqli, "SELECT * FROM software, software_contacts WHERE software.software_id = software_contacts.software_id AND software_contacts.contact_id = $contact_id");
|
||||
$software_count = mysqli_num_rows($sql_related_software);
|
||||
if ($software_count) {
|
||||
$software_count_display = "<span class='mr-2 badge badge-pill badge-secondary p-2' title='$software_count Licenses'><i class='fas fa-fw fa-cube mr-2'></i>$software_count</span>";
|
||||
$software_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$software_count Licenses'><i class='fas fa-fw fa-cube mr-2'></i>$software_count</span>";
|
||||
} else {
|
||||
$software_count_display = '';
|
||||
}
|
||||
@@ -401,7 +417,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$sql_related_tickets = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_contact_id = $contact_id");
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
if ($ticket_count) {
|
||||
$ticket_count_display = "<span class='mr-2 badge badge-pill badge-secondary p-2' title='$ticket_count Tickets'><i class='fas fa-fw fa-life-ring mr-2'></i>$ticket_count</span>";
|
||||
$ticket_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$ticket_count Tickets'><i class='fas fa-fw fa-life-ring mr-2'></i>$ticket_count</span>";
|
||||
} else {
|
||||
$ticket_count_display = '';
|
||||
}
|
||||
@@ -410,7 +426,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$sql_related_documents = mysqli_query($mysqli, "SELECT * FROM documents, contact_documents WHERE documents.document_id = contact_documents.document_id AND contact_documents.contact_id = $contact_id");
|
||||
$document_count = mysqli_num_rows($sql_related_documents);
|
||||
if ($document_count) {
|
||||
$document_count_display = "<span class='mr-2 badge badge-pill badge-secondary p-2' title='$document_count Documents'><i class='fas fa-fw fa-file-alt mr-2'></i>$document_count</span>";
|
||||
$document_count_display = "<span class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$document_count Documents'><i class='fas fa-fw fa-file-alt mr-2'></i>$document_count</span>";
|
||||
} else {
|
||||
$document_count_display = '';
|
||||
}
|
||||
@@ -445,11 +461,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a class="text-dark" href="#"
|
||||
data-toggle="ajax-modal"
|
||||
data-modal-size="lg"
|
||||
data-ajax-url="ajax/ajax_contact_details.php?<?php echo $client_url; ?>"
|
||||
data-ajax-id="<?php echo $contact_id; ?>">
|
||||
<a class="text-dark" href="contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>">
|
||||
<div class="media">
|
||||
<?php if ($contact_photo) { ?>
|
||||
<span class="fa-stack fa-2x mr-3 text-center">
|
||||
|
||||
@@ -9,12 +9,30 @@ if (isset($_GET['client_id'])) {
|
||||
require_once "includes/inc_all_client.php";
|
||||
$client_query = "AND credential_client_id = $client_id";
|
||||
$client_url = "client_id=$client_id&";
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "c.credential_archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "c.credential_archived_at IS NULL";
|
||||
}
|
||||
|
||||
// Log when users load the Credentials page
|
||||
logAction("Credential", "View", "$session_name viewed the Credentials page for client", $client_id);
|
||||
|
||||
} else {
|
||||
require_once "includes/inc_client_overview_all.php";
|
||||
$client_query = '';
|
||||
$client_url = '';
|
||||
// Overide Filter Header Archived
|
||||
if (isset($_GET['archived']) && $_GET['archived'] == 1) {
|
||||
$archived = 1;
|
||||
$archive_query = "(client_archived_at IS NOT NULL OR c.credential_archived_at IS NOT NULL)";
|
||||
} else {
|
||||
$archived = 0;
|
||||
$archive_query = "(client_archived_at IS NULL AND c.credential_archived_at IS NULL)";
|
||||
}
|
||||
// Log when users load the Credentials page
|
||||
logAction("Credential", "View", "$session_name viewed the All Credentials page");
|
||||
}
|
||||
@@ -68,7 +86,7 @@ $sql = mysqli_query(
|
||||
LEFT JOIN contacts ON contact_id = credential_contact_id
|
||||
LEFT JOIN assets ON asset_id = credential_asset_id
|
||||
$location_query_innerjoin
|
||||
WHERE c.credential_$archive_query
|
||||
WHERE $archive_query
|
||||
$tag_query
|
||||
AND (c.credential_name LIKE '%$q%' OR c.credential_description LIKE '%$q%' OR c.credential_uri LIKE '%$q%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
$location_query
|
||||
@@ -124,7 +142,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select onchange="this.form.submit()" class="form-control select2" name="tags[]" data-placeholder="- Select Tags -" multiple>
|
||||
|
||||
<?php
|
||||
@@ -151,7 +169,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php if ($client_url) { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="location" onchange="this.form.submit()">
|
||||
<option value="">- All Asset Locations -</option>
|
||||
|
||||
@@ -171,7 +189,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
@@ -242,7 +260,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<td class="pr-0">
|
||||
<div class="form-check">
|
||||
@@ -282,13 +300,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$credential_id = intval($row['c_credential_id']);
|
||||
$credential_name = nullable_htmlentities($row['credential_name']);
|
||||
$credential_description = nullable_htmlentities($row['credential_description']);
|
||||
$credential_uri = nullable_htmlentities($row['credential_uri']);
|
||||
$credential_uri = sanitize_url($row['credential_uri']);
|
||||
if (empty($credential_uri)) {
|
||||
$credential_uri_display = "-";
|
||||
} else {
|
||||
$credential_uri_display = truncate($credential_uri,40) . "<button class='btn btn-sm clipboardjs' type='button' data-clipboard-text='$credential_uri'><i class='far fa-copy text-secondary'></i></button>";
|
||||
$credential_uri_display = "<a href='$credential_uri'>" . truncate($credential_uri,40) . "</a><button class='btn btn-sm clipboardjs' type='button' title='$credential_uri' data-clipboard-text='$credential_uri'><i class='far fa-copy text-secondary'></i></button>";
|
||||
}
|
||||
$credential_uri_2 = nullable_htmlentities($row['credential_uri_2']);
|
||||
$credential_uri_2 = sanitize_url($row['credential_uri_2']);
|
||||
$credential_username = nullable_htmlentities(decryptCredentialEntry($row['credential_username']));
|
||||
if (empty($credential_username)) {
|
||||
$credential_username_display = "-";
|
||||
@@ -335,7 +353,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$credential_tags_display = implode('', $credential_tag_name_display_array);
|
||||
|
||||
if ($credential_contact_id) {
|
||||
$credential_contact_display = "<a href='#' class='mr-2 badge badge-pill badge-dark p-2' title='$contact_name'
|
||||
$credential_contact_display = "<a href='#' class='mr-2 mb-1 badge badge-pill badge-dark p-2' title='$contact_name'
|
||||
data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-ajax-url='ajax/ajax_contact_details.php'
|
||||
@@ -346,7 +364,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
}
|
||||
|
||||
if ($credential_asset_id) {
|
||||
$credential_asset_display = "<a href='#' class='mr-2 badge badge-pill badge-secondary p-2' title='$asset_name' data-toggle='ajax-modal'
|
||||
$credential_asset_display = "<a href='#' class='mr-2 mb-1 badge badge-pill badge-secondary p-2' title='$asset_name' data-toggle='ajax-modal'
|
||||
data-modal-size='lg'
|
||||
data-ajax-url='ajax/ajax_asset_details.php'
|
||||
data-ajax-id='$credential_asset_id'>
|
||||
@@ -412,11 +430,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $credential_username_display; ?></td>
|
||||
<td>
|
||||
<td class="text-nowrap"><?php echo $credential_username_display; ?></td>
|
||||
<td class="text-nowrap">
|
||||
<button class="btn p-0" type="button" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $credential_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></button><button class="btn btn-sm clipboardjs" type="button" data-clipboard-text="<?php echo $credential_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
</td>
|
||||
<td><?php echo $otp_display; ?></td>
|
||||
<td class="text-nowrap"><?php echo $otp_display; ?></td>
|
||||
<td><?php echo $credential_uri_display; ?></td>
|
||||
<td>
|
||||
<?php echo "$credential_contact_display$credential_asset_display"; ?>
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.grab-cursor {
|
||||
cursor: grab;
|
||||
.drag-handle {
|
||||
cursor: grab !important;
|
||||
}
|
||||
|
||||
.grab-cursor:active {
|
||||
cursor: grabbing;
|
||||
.drag-handle:active {
|
||||
cursor: grabbing !important;
|
||||
}
|
||||
15
css/quote_dropdowns_fix.css
Normal file
15
css/quote_dropdowns_fix.css
Normal file
@@ -0,0 +1,15 @@
|
||||
/*!
|
||||
* AdminLTE 3.2.0 Specific Dropdown Fix
|
||||
* Targets .fix-quote-dropdown only
|
||||
* Prevents alignment bugs in split button dropdowns going too far left
|
||||
* (ChatGPT)
|
||||
*/
|
||||
|
||||
.fix-quote-dropdown .dropdown-menu {
|
||||
left: auto !important;
|
||||
right: 0 !important;
|
||||
top: calc(100% + 0.25rem) !important;
|
||||
transform: none !important;
|
||||
min-width: max-content;
|
||||
z-index: 1050;
|
||||
}
|
||||
@@ -1,41 +1,83 @@
|
||||
/* General Popover Styling */
|
||||
.popover {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
/* Kanban Board Container */
|
||||
#kanban-board {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
overflow-x: auto;
|
||||
box-sizing: border-box;
|
||||
min-width: 400px;
|
||||
height: calc(100vh - 210px);
|
||||
}
|
||||
|
||||
/* Kanban Column */
|
||||
.kanban-column {
|
||||
flex: 1; /* Allows columns to grow equally */
|
||||
margin: 0 10px; /* Space between columns */
|
||||
flex: 1;
|
||||
min-width: 300px;
|
||||
max-width: 300px;
|
||||
margin: 0 10px;
|
||||
background: #f4f4f4;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
min-height: calc(100vh - 230px);
|
||||
max-height: calc(100vh - 230px);
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.kanban-column div {
|
||||
max-height: calc(100vh - 280px); /* Set your desired max height */
|
||||
overflow-y: auto; /* Adds a scrollbar when content exceeds max height */
|
||||
/* Column Inner Scrollable Task Area */
|
||||
.kanban-status {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
min-height: 60px;
|
||||
position: relative;
|
||||
padding: 5px;
|
||||
background-color: #f9f9f9;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Individual Task Cards */
|
||||
.task {
|
||||
background: #fff;
|
||||
margin: 5px 0;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
user-select: none; /* Prevent text selection */
|
||||
border-radius: 4px;
|
||||
cursor: grab;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.drag-handle-class {
|
||||
touch-action: none;
|
||||
float: right;
|
||||
/* Grabbing Cursor State */
|
||||
.task:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* Drag Handle (shown on mobile or with class targeting) */
|
||||
.drag-handle-class {
|
||||
float: right;
|
||||
touch-action: none;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
/* Placeholder shown in empty columns */
|
||||
.empty-placeholder {
|
||||
border: 2px dashed #ccc;
|
||||
background-color: #fcfcfc;
|
||||
color: #999;
|
||||
font-style: italic;
|
||||
padding: 12px;
|
||||
margin: 10px 0;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Sortable drop zone feedback (optional visual cue) */
|
||||
.kanban-status.sortable-over {
|
||||
background-color: #eaf6ff;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ $sql_years_select = mysqli_query($mysqli, "
|
||||
<input type="hidden" name="enable_technical" value="0">
|
||||
|
||||
<label for="year" class="mr-sm-2">Select Year:</label>
|
||||
<select id="year" onchange="this.form.submit()" class="form-control mr-sm-3 col-sm-2" name="year">
|
||||
<select id="year" onchange="this.form.submit()" class="form-control mr-sm-3 col-sm-2 mb-3 mb-sm-0" name="year">
|
||||
<?php while ($row = mysqli_fetch_array($sql_years_select)) {
|
||||
$year_select = $row['all_years'];
|
||||
if (empty($year_select)) {
|
||||
@@ -55,7 +55,7 @@ $sql_years_select = mysqli_query($mysqli, "
|
||||
</select>
|
||||
|
||||
<?php if ($session_user_role == 1 || ($session_user_role == 3 && $config_module_enable_accounting == 1)) { ?>
|
||||
<div class="custom-control custom-switch mr-sm-3">
|
||||
<div class="custom-control custom-switch mr-3">
|
||||
<input type="checkbox" onchange="this.form.submit()" class="custom-control-input" id="customSwitch1" name="enable_financial" value="1" <?php if ($user_config_dashboard_financial_enable == 1) { echo "checked"; } ?>>
|
||||
<label class="custom-control-label" for="customSwitch1">Financial</label>
|
||||
</div>
|
||||
@@ -91,7 +91,7 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
$row = mysqli_fetch_array($sql_total_expenses);
|
||||
$total_expenses = floatval($row['total_expenses']);
|
||||
|
||||
$sql_invoice_totals = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_totals FROM invoices WHERE invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Cancelled' AND YEAR(invoice_date) = $year");
|
||||
$sql_invoice_totals = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_totals FROM invoices WHERE invoice_status != 'Draft' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable' AND YEAR(invoice_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_invoice_totals);
|
||||
$invoice_totals = floatval($row['invoice_totals']);
|
||||
|
||||
@@ -99,7 +99,7 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
$row = mysqli_fetch_array($sql_total_payments_to_invoices_all_years);
|
||||
$total_payments_to_invoices_all_years = floatval($row['total_payments_to_invoices_all_years']);
|
||||
|
||||
$sql_invoice_totals_all_years = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_totals_all_years FROM invoices WHERE invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Cancelled'");
|
||||
$sql_invoice_totals_all_years = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS invoice_totals_all_years FROM invoices WHERE invoice_status != 'Draft' AND invoice_status != 'Cancelled' AND invoice_status != 'Non-Billable'");
|
||||
$row = mysqli_fetch_array($sql_invoice_totals_all_years);
|
||||
$invoice_totals_all_years = floatval($row['invoice_totals_all_years']);
|
||||
|
||||
@@ -151,14 +151,14 @@ if ($user_config_dashboard_financial_enable == 1) {
|
||||
$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"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT(recurring_invoice_id) AS recurring_invoices_added FROM recurring_invoices WHERE YEAR(recurring_invoice_created_at) = $year"));
|
||||
$recurring_invoices_added = intval($row['recurring_invoices_added']);
|
||||
}
|
||||
|
||||
$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"));
|
||||
$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_archived_at IS NULL"));
|
||||
$vendors_added = intval($row['vendors_added']);
|
||||
?>
|
||||
<div class="card card-body">
|
||||
@@ -808,7 +808,7 @@ if ($user_config_dashboard_technical_enable == 1) {
|
||||
<?php
|
||||
$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'");
|
||||
$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 != 'Cancelled' AND invoice_status != 'Draft' AND invoice_status != 'Non-Billable'");
|
||||
$row = mysqli_fetch_array($sql_projected);
|
||||
$invoice_for_month = floatval($row['invoice_amount_for_month']);
|
||||
|
||||
|
||||
@@ -3424,10 +3424,256 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.2'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '2.1.2') {
|
||||
// // Insert queries here required to update to DB version 2.1.3
|
||||
if (CURRENT_DATABASE_VERSION == '2.1.2') {
|
||||
|
||||
// Update country_code to NULL for `contacts` table
|
||||
mysqli_query($mysqli, "ALTER TABLE `contacts` MODIFY `contact_phone_country_code` VARCHAR(10) DEFAULT NULL");
|
||||
mysqli_query($mysqli, "ALTER TABLE `contacts` MODIFY `contact_mobile_country_code` VARCHAR(10) DEFAULT NULL");
|
||||
|
||||
// Update country_code to NULL for `locations` table
|
||||
mysqli_query($mysqli, "ALTER TABLE `locations` MODIFY `location_phone_country_code` VARCHAR(10) DEFAULT NULL");
|
||||
mysqli_query($mysqli, "ALTER TABLE `locations` MODIFY `location_fax_country_code` VARCHAR(10) DEFAULT NULL");
|
||||
|
||||
// Update country_code to NULL for `vendors` table
|
||||
mysqli_query($mysqli, "ALTER TABLE `vendors` MODIFY `vendor_phone_country_code` VARCHAR(10) DEFAULT NULL");
|
||||
|
||||
// Update country_code to NULL for `companies` table
|
||||
mysqli_query($mysqli, "ALTER TABLE `companies` MODIFY `company_phone_country_code` VARCHAR(10) DEFAULT NULL");
|
||||
|
||||
// Set country_code to NULL for `contacts` table
|
||||
mysqli_query($mysqli, "UPDATE `contacts` SET `contact_phone_country_code` = NULL");
|
||||
mysqli_query($mysqli, "UPDATE `contacts` SET `contact_mobile_country_code` = NULL");
|
||||
|
||||
// Set country_code to NULL for `locations` table
|
||||
mysqli_query($mysqli, "UPDATE `locations` SET `location_phone_country_code` = NULL");
|
||||
mysqli_query($mysqli, "UPDATE `locations` SET `location_fax_country_code` = NULL");
|
||||
|
||||
// Set country_code to NULL for `vendors` table
|
||||
mysqli_query($mysqli, "UPDATE `vendors` SET `vendor_phone_country_code` = NULL");
|
||||
|
||||
// Set country_code to NULL for `companies` table
|
||||
mysqli_query($mysqli, "UPDATE `companies` SET `company_phone_country_code` = NULL");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.3'");
|
||||
}
|
||||
|
||||
if (CURRENT_DATABASE_VERSION == '2.1.3') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `client_stripe` ADD `stripe_pm_details` VARCHAR(200) DEFAULT NULL AFTER `stripe_pm`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `client_stripe` ADD `stripe_pm_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `stripe_pm_details`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.4'");
|
||||
}
|
||||
|
||||
if (CURRENT_DATABASE_VERSION == '2.1.4') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ticket_timer_autostart` TINYINT(1) NOT NULL DEFAULT '0' AFTER `config_ticket_default_billable`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `tickets` ADD `ticket_due_at` DATETIME DEFAULT NULL AFTER `ticket_updated_at`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `companies` ADD `company_tax_id` VARCHAR(200) DEFAULT NULL AFTER `company_currency`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_invoice_show_tax_id` TINYINT(1) NOT NULL DEFAULT '0' AFTER `config_invoice_paid_notification_email`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.5'");
|
||||
}
|
||||
|
||||
if (CURRENT_DATABASE_VERSION == '2.1.5') {
|
||||
|
||||
mysqli_query($mysqli, "CREATE TABLE `document_versions` (
|
||||
`document_version_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`document_version_name` VARCHAR(200) NOT NULL,
|
||||
`document_version_description` TEXT DEFAULT NULL,
|
||||
`document_version_content` LONGTEXT NOT NULL,
|
||||
`document_version_created_by` INT(11) DEFAULT 0,
|
||||
`document_version_created_at` DATETIME NOT NULL,
|
||||
`document_version_document_id` INT(11) NOT NULL,
|
||||
PRIMARY KEY (`document_version_id`)
|
||||
)");
|
||||
|
||||
// Delete all Current Document Versions
|
||||
mysqli_query($mysqli, "
|
||||
DELETE FROM `documents`
|
||||
WHERE `document_parent` > 0 AND `document_parent` != `document_id`
|
||||
");
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `documents` DROP `document_parent`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.6'");
|
||||
}
|
||||
|
||||
if (CURRENT_DATABASE_VERSION == '2.1.6') {
|
||||
mysqli_query($mysqli, "CREATE TABLE `document_templates` (
|
||||
`document_template_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`document_template_name` VARCHAR(200) NOT NULL,
|
||||
`document_template_description` TEXT DEFAULT NULL,
|
||||
`document_template_content` LONGTEXT NOT NULL,
|
||||
`document_template_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`document_template_updated_at` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`document_template_archived_at` DATETIME NULL DEFAULT NULL,
|
||||
`document_template_created_by` INT(11) NOT NULL DEFAULT 0,
|
||||
`document_template_updated_by` INT(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`document_template_id`)
|
||||
)");
|
||||
|
||||
// Copy Document Templates over to new document templates table
|
||||
mysqli_query($mysqli, "
|
||||
INSERT INTO document_templates (
|
||||
document_template_name,
|
||||
document_template_description,
|
||||
document_template_content,
|
||||
document_template_created_at,
|
||||
document_template_updated_at,
|
||||
document_template_archived_at,
|
||||
document_template_created_by,
|
||||
document_template_updated_by
|
||||
)
|
||||
SELECT
|
||||
document_name,
|
||||
document_description,
|
||||
document_content,
|
||||
document_created_at,
|
||||
document_updated_at,
|
||||
document_archived_at,
|
||||
document_created_by,
|
||||
document_updated_by
|
||||
FROM
|
||||
documents
|
||||
WHERE
|
||||
document_template = 1
|
||||
");
|
||||
|
||||
mysqli_query($mysqli, "DELETE FROM documents WHERE document_template = 1");
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `documents` DROP `document_template`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.7'");
|
||||
}
|
||||
|
||||
if (CURRENT_DATABASE_VERSION == '2.1.7') {
|
||||
mysqli_query($mysqli, "CREATE TABLE `software_templates` (
|
||||
`software_template_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`software_template_name` VARCHAR(200) NOT NULL,
|
||||
`software_template_description` TEXT DEFAULT NULL,
|
||||
`software_template_version` VARCHAR(200) DEFAULT NULL,
|
||||
`software_template_type` VARCHAR(200) NOT NULL,
|
||||
`software_template_license_type` VARCHAR(200) DEFAULT NULL,
|
||||
`software_template_notes` TEXT DEFAULT NULL,
|
||||
`software_template_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`software_template_updated_at` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`software_template_archived_at` DATETIME NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`software_template_id`)
|
||||
)");
|
||||
|
||||
// Copy software Templates over to new software templates table
|
||||
mysqli_query($mysqli, "
|
||||
INSERT INTO software_templates (
|
||||
software_template_name,
|
||||
software_template_description,
|
||||
software_template_version,
|
||||
software_template_type,
|
||||
software_template_license_type,
|
||||
software_template_notes,
|
||||
software_template_created_at,
|
||||
software_template_updated_at,
|
||||
software_template_archived_at
|
||||
)
|
||||
SELECT
|
||||
software_name,
|
||||
software_description,
|
||||
software_version,
|
||||
software_type,
|
||||
software_license_type,
|
||||
software_notes,
|
||||
software_created_at,
|
||||
software_updated_at,
|
||||
software_archived_at
|
||||
FROM
|
||||
software
|
||||
WHERE
|
||||
software_template = 1
|
||||
");
|
||||
|
||||
mysqli_query($mysqli, "DELETE FROM software WHERE software_template = 1");
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `software` DROP `software_template`");
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `software` DROP `software_template_id`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.8'");
|
||||
}
|
||||
|
||||
if (CURRENT_DATABASE_VERSION == '2.1.8') {
|
||||
mysqli_query($mysqli, "CREATE TABLE `vendor_templates` (
|
||||
`vendor_template_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`vendor_template_name` VARCHAR(200) NOT NULL,
|
||||
`vendor_template_description` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_contact_name` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_phone_country_code` VARCHAR(10) DEFAULT NULL,
|
||||
`vendor_template_phone` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_extension` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_email` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_website` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_hours` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_sla` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_code` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_account_number` VARCHAR(200) DEFAULT NULL,
|
||||
`vendor_template_notes` TEXT DEFAULT NULL,
|
||||
`vendor_template_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`vendor_template_updated_at` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`vendor_template_archived_at` DATETIME NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`vendor_template_id`)
|
||||
)");
|
||||
|
||||
// Copy Vendor Templates over to new vendor templates table
|
||||
mysqli_query($mysqli, "
|
||||
INSERT INTO vendor_templates (
|
||||
vendor_template_name,
|
||||
vendor_template_description,
|
||||
vendor_template_contact_name,
|
||||
vendor_template_phone_country_code,
|
||||
vendor_template_phone,
|
||||
vendor_template_extension,
|
||||
vendor_template_email,
|
||||
vendor_template_website,
|
||||
vendor_template_hours,
|
||||
vendor_template_sla,
|
||||
vendor_template_code,
|
||||
vendor_template_account_number,
|
||||
vendor_template_notes,
|
||||
vendor_template_created_at,
|
||||
vendor_template_updated_at,
|
||||
vendor_template_archived_at
|
||||
)
|
||||
SELECT
|
||||
vendor_name,
|
||||
vendor_description,
|
||||
vendor_contact_name,
|
||||
vendor_phone_country_code,
|
||||
vendor_phone,
|
||||
vendor_extension,
|
||||
vendor_email,
|
||||
vendor_website,
|
||||
vendor_hours,
|
||||
vendor_sla,
|
||||
vendor_code,
|
||||
vendor_account_number,
|
||||
vendor_notes,
|
||||
vendor_created_at,
|
||||
vendor_updated_at,
|
||||
vendor_archived_at
|
||||
FROM
|
||||
vendors
|
||||
WHERE
|
||||
vendor_template = 1
|
||||
");
|
||||
|
||||
mysqli_query($mysqli, "DELETE FROM vendors WHERE vendor_template = 1");
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `vendors` DROP `vendor_template`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.9'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '2.1.9') {
|
||||
// // Insert queries here required to update to DB version 2.2.0
|
||||
// // Then, update the database to the next sequential version
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.3'");
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.2.0'");
|
||||
// }
|
||||
|
||||
} else {
|
||||
|
||||
116
db.sql
116
db.sql
@@ -482,6 +482,8 @@ CREATE TABLE `client_stripe` (
|
||||
`client_id` int(11) NOT NULL,
|
||||
`stripe_id` varchar(255) NOT NULL,
|
||||
`stripe_pm` varchar(255) DEFAULT NULL,
|
||||
`stripe_pm_details` varchar(200) DEFAULT NULL,
|
||||
`stripe_pm_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (`client_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -546,13 +548,14 @@ CREATE TABLE `companies` (
|
||||
`company_state` varchar(200) DEFAULT NULL,
|
||||
`company_zip` varchar(200) DEFAULT NULL,
|
||||
`company_country` varchar(200) DEFAULT NULL,
|
||||
`company_phone_country_code` varchar(10) DEFAULT '1',
|
||||
`company_phone_country_code` varchar(10) DEFAULT NULL,
|
||||
`company_phone` varchar(200) DEFAULT NULL,
|
||||
`company_email` varchar(200) DEFAULT NULL,
|
||||
`company_website` varchar(200) DEFAULT NULL,
|
||||
`company_logo` varchar(250) DEFAULT NULL,
|
||||
`company_locale` varchar(200) DEFAULT NULL,
|
||||
`company_currency` varchar(200) NOT NULL,
|
||||
`company_tax_id` varchar(200) DEFAULT NULL,
|
||||
`company_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`company_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`company_id`)
|
||||
@@ -680,10 +683,10 @@ CREATE TABLE `contacts` (
|
||||
`contact_name` varchar(200) NOT NULL,
|
||||
`contact_title` varchar(200) DEFAULT NULL,
|
||||
`contact_email` varchar(200) DEFAULT NULL,
|
||||
`contact_phone_country_code` varchar(10) DEFAULT '1',
|
||||
`contact_phone_country_code` varchar(10) DEFAULT NULL,
|
||||
`contact_phone` varchar(200) DEFAULT NULL,
|
||||
`contact_extension` varchar(200) DEFAULT NULL,
|
||||
`contact_mobile_country_code` varchar(10) DEFAULT '1',
|
||||
`contact_mobile_country_code` varchar(10) DEFAULT NULL,
|
||||
`contact_mobile` varchar(200) DEFAULT NULL,
|
||||
`contact_photo` varchar(200) DEFAULT NULL,
|
||||
`contact_pin` varchar(255) DEFAULT NULL,
|
||||
@@ -827,6 +830,46 @@ CREATE TABLE `document_files` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `document_templates`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `document_templates`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `document_templates` (
|
||||
`document_template_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`document_template_name` varchar(200) NOT NULL,
|
||||
`document_template_description` text DEFAULT NULL,
|
||||
`document_template_content` longtext NOT NULL,
|
||||
`document_template_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`document_template_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`document_template_archived_at` datetime DEFAULT NULL,
|
||||
`document_template_created_by` int(11) NOT NULL DEFAULT 0,
|
||||
`document_template_updated_by` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`document_template_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `document_versions`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `document_versions`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `document_versions` (
|
||||
`document_version_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`document_version_name` varchar(200) NOT NULL,
|
||||
`document_version_description` text DEFAULT NULL,
|
||||
`document_version_content` longtext NOT NULL,
|
||||
`document_version_created_by` int(11) DEFAULT 0,
|
||||
`document_version_created_at` datetime NOT NULL,
|
||||
`document_version_document_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`document_version_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `documents`
|
||||
--
|
||||
@@ -841,13 +884,11 @@ CREATE TABLE `documents` (
|
||||
`document_content` longtext NOT NULL,
|
||||
`document_content_raw` longtext NOT NULL,
|
||||
`document_important` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`document_parent` int(11) NOT NULL DEFAULT 0,
|
||||
`document_client_visible` int(11) NOT NULL DEFAULT 1,
|
||||
`document_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`document_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`document_archived_at` datetime DEFAULT NULL,
|
||||
`document_accessed_at` datetime DEFAULT NULL,
|
||||
`document_template` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`document_folder_id` int(11) NOT NULL DEFAULT 0,
|
||||
`document_created_by` int(11) NOT NULL DEFAULT 0,
|
||||
`document_updated_by` int(11) NOT NULL DEFAULT 0,
|
||||
@@ -1115,10 +1156,10 @@ CREATE TABLE `locations` (
|
||||
`location_city` varchar(200) DEFAULT NULL,
|
||||
`location_state` varchar(200) DEFAULT NULL,
|
||||
`location_zip` varchar(200) DEFAULT NULL,
|
||||
`location_phone_country_code` varchar(10) DEFAULT '1',
|
||||
`location_phone_country_code` varchar(10) DEFAULT NULL,
|
||||
`location_phone` varchar(200) DEFAULT NULL,
|
||||
`location_phone_extension` varchar(10) DEFAULT NULL,
|
||||
`location_fax_country_code` varchar(10) DEFAULT '1',
|
||||
`location_fax_country_code` varchar(10) DEFAULT NULL,
|
||||
`location_fax` varchar(200) DEFAULT NULL,
|
||||
`location_hours` varchar(200) DEFAULT NULL,
|
||||
`location_photo` varchar(200) DEFAULT NULL,
|
||||
@@ -1792,6 +1833,7 @@ CREATE TABLE `settings` (
|
||||
`config_invoice_late_fee_enable` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`config_invoice_late_fee_percent` decimal(5,2) NOT NULL DEFAULT 0.00,
|
||||
`config_invoice_paid_notification_email` varchar(200) DEFAULT NULL,
|
||||
`config_invoice_show_tax_id` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`config_recurring_invoice_prefix` varchar(200) DEFAULT NULL,
|
||||
`config_recurring_invoice_next_number` int(11) NOT NULL DEFAULT 1,
|
||||
`config_quote_prefix` varchar(200) DEFAULT NULL,
|
||||
@@ -1810,6 +1852,7 @@ CREATE TABLE `settings` (
|
||||
`config_ticket_autoclose_hours` int(5) NOT NULL DEFAULT 72,
|
||||
`config_ticket_new_ticket_notification_email` varchar(200) DEFAULT NULL,
|
||||
`config_ticket_default_billable` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`config_ticket_timer_autostart` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`config_enable_cron` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`config_recurring_auto_send_invoice` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`config_enable_alert_domain_expire` tinyint(1) NOT NULL DEFAULT 1,
|
||||
@@ -1898,14 +1941,12 @@ CREATE TABLE `software` (
|
||||
`software_purchase` date DEFAULT NULL,
|
||||
`software_expire` date DEFAULT NULL,
|
||||
`software_notes` text DEFAULT NULL,
|
||||
`software_template` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`software_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`software_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`software_archived_at` datetime DEFAULT NULL,
|
||||
`software_accessed_at` datetime DEFAULT NULL,
|
||||
`software_vendor_id` int(11) DEFAULT 0,
|
||||
`software_client_id` int(11) NOT NULL,
|
||||
`software_template_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`software_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -1995,6 +2036,28 @@ CREATE TABLE `software_files` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `software_templates`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `software_templates`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `software_templates` (
|
||||
`software_template_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`software_template_name` varchar(200) NOT NULL,
|
||||
`software_template_description` text DEFAULT NULL,
|
||||
`software_template_version` varchar(200) DEFAULT NULL,
|
||||
`software_template_type` varchar(200) NOT NULL,
|
||||
`software_template_license_type` varchar(200) DEFAULT NULL,
|
||||
`software_template_notes` text DEFAULT NULL,
|
||||
`software_template_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`software_template_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`software_template_archived_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`software_template_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `tags`
|
||||
--
|
||||
@@ -2242,6 +2305,7 @@ CREATE TABLE `tickets` (
|
||||
`ticket_url_key` varchar(200) DEFAULT NULL,
|
||||
`ticket_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`ticket_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`ticket_due_at` datetime DEFAULT NULL,
|
||||
`ticket_resolved_at` datetime DEFAULT NULL,
|
||||
`ticket_archived_at` datetime DEFAULT NULL,
|
||||
`ticket_first_response_at` datetime DEFAULT NULL,
|
||||
@@ -2456,6 +2520,35 @@ CREATE TABLE `vendor_files` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `vendor_templates`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `vendor_templates`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `vendor_templates` (
|
||||
`vendor_template_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`vendor_template_name` varchar(200) NOT NULL,
|
||||
`vendor_template_description` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_contact_name` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_phone_country_code` varchar(10) DEFAULT NULL,
|
||||
`vendor_template_phone` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_extension` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_email` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_website` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_hours` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_sla` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_code` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_account_number` varchar(200) DEFAULT NULL,
|
||||
`vendor_template_notes` text DEFAULT NULL,
|
||||
`vendor_template_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`vendor_template_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`vendor_template_archived_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`vendor_template_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `vendors`
|
||||
--
|
||||
@@ -2468,7 +2561,7 @@ CREATE TABLE `vendors` (
|
||||
`vendor_name` varchar(200) NOT NULL,
|
||||
`vendor_description` varchar(200) DEFAULT NULL,
|
||||
`vendor_contact_name` varchar(200) DEFAULT NULL,
|
||||
`vendor_phone_country_code` varchar(10) DEFAULT '1',
|
||||
`vendor_phone_country_code` varchar(10) DEFAULT NULL,
|
||||
`vendor_phone` varchar(200) DEFAULT NULL,
|
||||
`vendor_extension` varchar(200) DEFAULT NULL,
|
||||
`vendor_email` varchar(200) DEFAULT NULL,
|
||||
@@ -2478,7 +2571,6 @@ CREATE TABLE `vendors` (
|
||||
`vendor_code` varchar(200) DEFAULT NULL,
|
||||
`vendor_account_number` varchar(200) DEFAULT NULL,
|
||||
`vendor_notes` text DEFAULT NULL,
|
||||
`vendor_template` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`vendor_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`vendor_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`vendor_archived_at` datetime DEFAULT NULL,
|
||||
@@ -2498,4 +2590,4 @@ CREATE TABLE `vendors` (
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-03-26 11:13:46
|
||||
-- Dump completed on 2025-06-17 22:44:10
|
||||
|
||||
@@ -92,7 +92,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<div class="col-md-2"></div>
|
||||
<?php } else { ?>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<select class="form-control select2" name="client" onchange="this.form.submit()">
|
||||
<option value="" <?php if ($client == "") { echo "selected"; } ?>>- All Clients -</option>
|
||||
|
||||
@@ -162,7 +162,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?> text-nowrap">
|
||||
<tr>
|
||||
<td class="pr-0">
|
||||
<div class="form-check">
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user