mirror of https://github.com/itflow-org/itflow
Adjust core files to 4 spaces
This commit is contained in:
parent
3f06c10997
commit
5bb4296f14
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
<!-- Breadcrumbs-->
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="index.html">Dashboard</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Blank Page</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="index.html">Dashboard</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Blank Page</li>
|
||||
</ol>
|
||||
|
||||
<!-- Page Content -->
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "certificate_name";
|
||||
$sb = "certificate_name";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
|
|
@ -20,92 +19,92 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-lock"></i> Certificates</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addCertificateModal"><i class="fas fa-fw fa-plus"></i> New Certificate</button>
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-lock"></i> Certificates</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addCertificateModal"><i class="fas fa-fw fa-plus"></i> New Certificate</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Certificates">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_certificates_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=certificate_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=certificate_domain&o=<?php echo $disp; ?>">Domain</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=certificate_issued_by&o=<?php echo $disp; ?>">Issued By</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=certificate_expire&o=<?php echo $disp; ?>">Expire</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$certificate_id = $row['certificate_id'];
|
||||
$certificate_name = htmlentities($row['certificate_name']);
|
||||
$certificate_domain = htmlentities($row['certificate_domain']);
|
||||
$certificate_issued_by = htmlentities($row['certificate_issued_by']);
|
||||
$certificate_expire = htmlentities($row['certificate_expire']);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><a class="text-dark" href="#" data-toggle="modal" onclick="populateCertificateEditModal(<?php echo $client_id, ",", $certificate_id ?>)" data-target="#editCertificateModal"><?php echo $certificate_name; ?></a></td>
|
||||
<td><?php echo $certificate_domain; ?></td>
|
||||
<td><?php echo $certificate_issued_by; ?></td>
|
||||
<td><?php echo $certificate_expire; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" onclick="populateCertificateEditModal(<?php echo $client_id, ",", $certificate_id ?>)" data-target="#editCertificateModal">Edit</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_certificate=<?php echo $certificate_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Certificates">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_certificates_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=certificate_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=certificate_domain&o=<?php echo $disp; ?>">Domain</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=certificate_issued_by&o=<?php echo $disp; ?>">Issued By</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=certificate_expire&o=<?php echo $disp; ?>">Expire</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$certificate_id = $row['certificate_id'];
|
||||
$certificate_name = htmlentities($row['certificate_name']);
|
||||
$certificate_domain = htmlentities($row['certificate_domain']);
|
||||
$certificate_issued_by = htmlentities($row['certificate_issued_by']);
|
||||
$certificate_expire = htmlentities($row['certificate_expire']);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><a class="text-dark" href="#" data-toggle="modal" onclick="populateCertificateEditModal(<?php echo $client_id, ",", $certificate_id ?>)" data-target="#editCertificateModal"><?php echo $certificate_name; ?></a></td>
|
||||
<td><?php echo $certificate_domain; ?></td>
|
||||
<td><?php echo $certificate_issued_by; ?></td>
|
||||
<td><?php echo $certificate_expire; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" onclick="populateCertificateEditModal(<?php echo $client_id, ",", $certificate_id ?>)" data-target="#editCertificateModal">Edit</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_certificate=<?php echo $certificate_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include("client_certificate_edit_modal.php");
|
||||
include("client_certificate_add_modal.php");
|
||||
require_once("client_certificate_edit_modal.php");
|
||||
require_once("client_certificate_add_modal.php");
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -34,194 +34,194 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-users"></i> Contacts</h3>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addContactModal">
|
||||
<i class="fas fa-fw fa-plus"></i> New Contact
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#contactInviteModal"><i class="fas fa-paper-plane mr-2"></i>Invite Contact</a>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-users"></i> Contacts</h3>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addContactModal">
|
||||
<i class="fas fa-fw fa-plus"></i> New Contact
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#contactInviteModal"><i class="fas fa-paper-plane mr-2"></i>Invite Contact</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Contacts">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Contacts">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_contacts_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#importContactModal"><i class="fa fa-fw fa-upload"></i> Import</button>
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_contacts_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#importContactModal"><i class="fa fa-fw fa-upload"></i> Import</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table border">
|
||||
<thead class="thead-light <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="text-center"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_department&o=<?php echo $disp; ?>">Department</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_email&o=<?php echo $disp; ?>">Email</a></th>
|
||||
<th>Phone</th>
|
||||
<th>Mobile</th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Location</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
if (empty($contact_title)) {
|
||||
$contact_title_display = "-";
|
||||
} else {
|
||||
$contact_title_display = "<small class='text-secondary'>$contact_title</small>";
|
||||
}
|
||||
$contact_department =htmlentities($row['contact_department']);
|
||||
if (empty($contact_department)) {
|
||||
$contact_department_display = "-";
|
||||
} else {
|
||||
$contact_department_display = $contact_department;
|
||||
}
|
||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
||||
if (empty($contact_phone)) {
|
||||
$contact_phone_display = "-";
|
||||
} else {
|
||||
$contact_phone_display = "$contact_phone";
|
||||
}
|
||||
$contact_extension = htmlentities($row['contact_extension']);
|
||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||
if (empty($contact_mobile)) {
|
||||
$contact_mobile_display = "-";
|
||||
} else {
|
||||
$contact_mobile_display = "$contact_mobile";
|
||||
}
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
if (empty($contact_email)) {
|
||||
$contact_email_display = "-";
|
||||
} else {
|
||||
$contact_email_display = "<a href='mailto:$contact_email'>$contact_email</a><button class='btn btn-sm clipboardjs' data-clipboard-text='$contact_email'><i class='far fa-copy text-secondary'></i></button>";
|
||||
}
|
||||
$contact_photo = htmlentities($row['contact_photo']);
|
||||
$contact_initials = initials($contact_name);
|
||||
$contact_notes = htmlentities($row['contact_notes']);
|
||||
$contact_important = intval($row['contact_important']);
|
||||
$contact_billing = intval($row['contact_billing']);
|
||||
$contact_technical = intval($row['contact_technical']);
|
||||
$contact_created_at = $row['contact_created_at'];
|
||||
if ($contact_id == $primary_contact) {
|
||||
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
||||
} else {
|
||||
$primary_contact_display = false;
|
||||
}
|
||||
$contact_location_id = $row['contact_location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
if (empty($location_name)) {
|
||||
$location_name_display = "-";
|
||||
} else {
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
$auth_method = htmlentities($row['contact_auth_method']);
|
||||
|
||||
// Related Assets Query
|
||||
$sql_related_assets = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_contact_id = $contact_id AND company_id = $session_company_id ORDER BY asset_id DESC");
|
||||
$asset_count = mysqli_num_rows($sql_related_assets);
|
||||
|
||||
// Related Logins Query
|
||||
$sql_related_logins = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_contact_id = $contact_id AND company_id = $session_company_id ORDER BY login_id DESC");
|
||||
$login_count = mysqli_num_rows($sql_related_logins);
|
||||
|
||||
// Related Software Query
|
||||
$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 AND software.company_id = $session_company_id ORDER BY software.software_id DESC");
|
||||
$software_count = mysqli_num_rows($sql_related_software);
|
||||
|
||||
// Related Tickets Query
|
||||
$sql_related_tickets = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_contact_id = $contact_id AND company_id = $session_company_id ORDER BY ticket_id DESC");
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
|
||||
?>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table border">
|
||||
<thead class="thead-light <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
<a class="text-dark" href="client_contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>">
|
||||
<?php if (!empty($contact_photo)) { ?>
|
||||
<th class="text-center"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_department&o=<?php echo $disp; ?>">Department</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=contact_email&o=<?php echo $disp; ?>">Email</a></th>
|
||||
<th>Phone</th>
|
||||
<th>Mobile</th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Location</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
<img class="img-size-50 img-circle" src="<?php echo "uploads/clients/$session_company_id/$client_id/$contact_photo"; ?>">
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
if (empty($contact_title)) {
|
||||
$contact_title_display = "-";
|
||||
} else {
|
||||
$contact_title_display = "<small class='text-secondary'>$contact_title</small>";
|
||||
}
|
||||
$contact_department =htmlentities($row['contact_department']);
|
||||
if (empty($contact_department)) {
|
||||
$contact_department_display = "-";
|
||||
} else {
|
||||
$contact_department_display = $contact_department;
|
||||
}
|
||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
||||
if (empty($contact_phone)) {
|
||||
$contact_phone_display = "-";
|
||||
} else {
|
||||
$contact_phone_display = "$contact_phone";
|
||||
}
|
||||
$contact_extension = htmlentities($row['contact_extension']);
|
||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||
if (empty($contact_mobile)) {
|
||||
$contact_mobile_display = "-";
|
||||
} else {
|
||||
$contact_mobile_display = "$contact_mobile";
|
||||
}
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
if (empty($contact_email)) {
|
||||
$contact_email_display = "-";
|
||||
} else {
|
||||
$contact_email_display = "<a href='mailto:$contact_email'>$contact_email</a><button class='btn btn-sm clipboardjs' data-clipboard-text='$contact_email'><i class='far fa-copy text-secondary'></i></button>";
|
||||
}
|
||||
$contact_photo = htmlentities($row['contact_photo']);
|
||||
$contact_initials = initials($contact_name);
|
||||
$contact_notes = htmlentities($row['contact_notes']);
|
||||
$contact_important = intval($row['contact_important']);
|
||||
$contact_billing = intval($row['contact_billing']);
|
||||
$contact_technical = intval($row['contact_technical']);
|
||||
$contact_created_at = $row['contact_created_at'];
|
||||
if ($contact_id == $primary_contact) {
|
||||
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
||||
} else {
|
||||
$primary_contact_display = false;
|
||||
}
|
||||
$contact_location_id = $row['contact_location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
if (empty($location_name)) {
|
||||
$location_name_display = "-";
|
||||
} else {
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
$auth_method = htmlentities($row['contact_auth_method']);
|
||||
|
||||
<?php } else { ?>
|
||||
// Related Assets Query
|
||||
$sql_related_assets = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_contact_id = $contact_id AND company_id = $session_company_id ORDER BY asset_id DESC");
|
||||
$asset_count = mysqli_num_rows($sql_related_assets);
|
||||
|
||||
<span class="fa-stack fa-2x">
|
||||
// Related Logins Query
|
||||
$sql_related_logins = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_contact_id = $contact_id AND company_id = $session_company_id ORDER BY login_id DESC");
|
||||
$login_count = mysqli_num_rows($sql_related_logins);
|
||||
|
||||
// Related Software Query
|
||||
$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 AND software.company_id = $session_company_id ORDER BY software.software_id DESC");
|
||||
$software_count = mysqli_num_rows($sql_related_software);
|
||||
|
||||
// Related Tickets Query
|
||||
$sql_related_tickets = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_contact_id = $contact_id AND company_id = $session_company_id ORDER BY ticket_id DESC");
|
||||
$ticket_count = mysqli_num_rows($sql_related_tickets);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
<a class="text-dark" href="client_contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>">
|
||||
<?php if (!empty($contact_photo)) { ?>
|
||||
|
||||
<img class="img-size-50 img-circle" src="<?php echo "uploads/clients/$session_company_id/$client_id/$contact_photo"; ?>">
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<span class="fa-stack fa-2x">
|
||||
<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>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<?php } ?>
|
||||
<div class="text-dark"><?php echo $contact_name; ?></div>
|
||||
<div><?php echo $contact_title_display; ?></div>
|
||||
<div><?php echo $primary_contact_display; ?></div>
|
||||
</a>
|
||||
</th>
|
||||
|
||||
<td><?php echo $contact_department_display; ?></td>
|
||||
<td><?php echo $contact_email_display; ?></td>
|
||||
<td><?php echo $contact_phone_display; ?> <?php if (!empty($contact_extension)) { echo "x$contact_extension"; } ?></td>
|
||||
<td><?php echo $contact_mobile_display; ?></td>
|
||||
<td><?php echo $location_name_display; ?></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">
|
||||
<a class="dropdown-item" href="client_contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>">View Details</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">Edit</a>
|
||||
<?php if ($session_user_role == 3 && $contact_id !== $primary_contact) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_contact=<?php echo $contact_id; ?>">Archive</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_contact=<?php echo $contact_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
<div class="text-dark"><?php echo $contact_name; ?></div>
|
||||
<div><?php echo $contact_title_display; ?></div>
|
||||
<div><?php echo $primary_contact_display; ?></div>
|
||||
</a>
|
||||
</th>
|
||||
|
||||
<td><?php echo $contact_department_display; ?></td>
|
||||
<td><?php echo $contact_email_display; ?></td>
|
||||
<td><?php echo $contact_phone_display; ?> <?php if (!empty($contact_extension)) { echo "x$contact_extension"; } ?></td>
|
||||
<td><?php echo $contact_mobile_display; ?></td>
|
||||
<td><?php echo $location_name_display; ?></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">
|
||||
<a class="dropdown-item" href="client_contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>">View Details</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">Edit</a>
|
||||
<?php if ($session_user_role == 3 && $contact_id !== $primary_contact) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_contact=<?php echo $contact_id; ?>">Archive</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_contact=<?php echo $contact_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
require("client_contact_edit_modal.php");
|
||||
require("client_contact_edit_modal.php");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -1,40 +1,37 @@
|
|||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<link href='plugins/fullcalendar/main.min.css' rel='stylesheet' />
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (isset($_GET['calendar_id'])) {
|
||||
$calendar_selected_id = intval($_GET['calendar_id']);
|
||||
$calendar_selected_id = intval($_GET['calendar_id']);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<link href='plugins/fullcalendar/main.min.css' rel='stylesheet' />
|
||||
|
||||
<div class="card">
|
||||
<div id='calendar'></div>
|
||||
<div id='calendar'></div>
|
||||
</div>
|
||||
|
||||
<?php include("calendar_event_add_modal.php"); ?>
|
||||
<?php include("calendar_add_modal.php"); ?>
|
||||
|
||||
<?php
|
||||
?>
|
||||
|
||||
<?php
|
||||
include("calendar_event_add_modal.php");
|
||||
include("calendar_add_modal.php");
|
||||
|
||||
//loop through IDs and create a modal for each
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendars LEFT JOIN events ON calendar_id = event_calendar_id WHERE event_client_id = $client_id AND calendars.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$event_id = $row['event_id'];
|
||||
$event_title = htmlentities($row['event_title']);
|
||||
$event_description = htmlentities($row['event_description']);
|
||||
$event_start = htmlentities($row['event_start']);
|
||||
$event_end = htmlentities($row['event_end']);
|
||||
$event_repeat = htmlentities($row['event_repeat']);
|
||||
$calendar_id = $row['calendar_id'];
|
||||
$calendar_name = htmlentities($row['calendar_name']);
|
||||
$calendar_color = htmlentities($row['calendar_color']);
|
||||
$event_id = $row['event_id'];
|
||||
$event_title = htmlentities($row['event_title']);
|
||||
$event_description = htmlentities($row['event_description']);
|
||||
$event_start = htmlentities($row['event_start']);
|
||||
$event_end = htmlentities($row['event_end']);
|
||||
$event_repeat = htmlentities($row['event_repeat']);
|
||||
$calendar_id = $row['calendar_id'];
|
||||
$calendar_name = htmlentities($row['calendar_name']);
|
||||
$calendar_color = htmlentities($row['calendar_color']);
|
||||
|
||||
include("calendar_event_edit_modal.php");
|
||||
require("calendar_event_edit_modal.php");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -45,54 +42,55 @@ while ($row = mysqli_fetch_array($sql)) {
|
|||
<script>
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
themeSystem: 'bootstrap',
|
||||
defaultView: 'dayGridMonth',
|
||||
customButtons: {
|
||||
addEvent: {
|
||||
bootstrapFontAwesome: 'fa fa-plus',
|
||||
click: function() {
|
||||
$("#addCalendarEventModal").modal();
|
||||
}
|
||||
},
|
||||
addCalendar: {
|
||||
bootstrapFontAwesome: 'fa fa-calendar-plus',
|
||||
click: function() {
|
||||
$("#addCalendarModal").modal();
|
||||
}
|
||||
}
|
||||
},
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth addEvent addCalendar'
|
||||
},
|
||||
events: [
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendars LEFT JOIN events ON calendar_id = event_calendar_id WHERE event_client_id = $client_id AND calendars.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$event_id = json_encode($row['event_id']);
|
||||
$event_title = json_encode($row['event_title']);
|
||||
$event_start = json_encode($row['event_start']);
|
||||
$event_end = json_encode($row['event_end']);
|
||||
$calendar_id = json_encode($row['calendar_id']);
|
||||
$calendar_name = json_encode($row['calendar_name']);
|
||||
$calendar_color = json_encode($row['calendar_color']);
|
||||
|
||||
echo "{ id: $event_id, title: $event_title, start: $event_start, end: $event_end, color: $calendar_color },";
|
||||
}
|
||||
?>
|
||||
],
|
||||
eventClick: function(editEvent) {
|
||||
$('#editEventModal'+editEvent.event.id).modal();
|
||||
}
|
||||
});
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
themeSystem: 'bootstrap',
|
||||
defaultView: 'dayGridMonth',
|
||||
customButtons: {
|
||||
addEvent: {
|
||||
bootstrapFontAwesome: 'fa fa-plus',
|
||||
click: function() {
|
||||
$("#addCalendarEventModal").modal();
|
||||
}
|
||||
},
|
||||
addCalendar: {
|
||||
bootstrapFontAwesome: 'fa fa-calendar-plus',
|
||||
click: function() {
|
||||
$("#addCalendarModal").modal();
|
||||
}
|
||||
}
|
||||
},
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth addEvent addCalendar'
|
||||
},
|
||||
events: [
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM calendars LEFT JOIN events ON calendar_id = event_calendar_id WHERE event_client_id = $client_id AND calendars.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$event_id = json_encode($row['event_id']);
|
||||
$event_title = json_encode($row['event_title']);
|
||||
$event_start = json_encode($row['event_start']);
|
||||
$event_end = json_encode($row['event_end']);
|
||||
$calendar_id = json_encode($row['calendar_id']);
|
||||
$calendar_name = json_encode($row['calendar_name']);
|
||||
$calendar_color = json_encode($row['calendar_color']);
|
||||
|
||||
calendar.render();
|
||||
echo "{ id: $event_id, title: $event_title, start: $event_start, end: $event_end, color: $calendar_color },";
|
||||
}
|
||||
?>
|
||||
],
|
||||
eventClick: function(editEvent) {
|
||||
$('#editEventModal'+editEvent.event.id).modal();
|
||||
}
|
||||
});
|
||||
|
||||
calendar.render();
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require("footer.php");
|
||||
|
|
|
|||
|
|
@ -1,159 +1,154 @@
|
|||
<?php require_once("inc_all_client.php"); ?>
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
<?php
|
||||
|
||||
if (isset($_GET['q'])) {
|
||||
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
||||
//Phone Numbers
|
||||
$phone_query = preg_replace("/[^0-9]/", '', $q);
|
||||
if (empty($phone_query)) {
|
||||
$phone_query = $q;
|
||||
}
|
||||
}else{
|
||||
$q = "";
|
||||
$phone_query = "";
|
||||
$q = strip_tags(mysqli_real_escape_string($mysqli, $_GET['q']));
|
||||
//Phone Numbers
|
||||
$phone_query = preg_replace("/[^0-9]/", '', $q);
|
||||
if (empty($phone_query)) {
|
||||
$phone_query = $q;
|
||||
}
|
||||
} else {
|
||||
$q = "";
|
||||
$phone_query = "";
|
||||
}
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
}else{
|
||||
$sb = "location_name";
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "location_name";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM locations
|
||||
WHERE location_client_id = $client_id
|
||||
AND location_archived_at IS NULL
|
||||
AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM locations
|
||||
WHERE location_client_id = $client_id
|
||||
AND location_archived_at IS NULL
|
||||
AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-map-marker-alt"></i> Locations</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addLocationModal"><i class="fas fa-fw fa-plus"></i> New Location</button>
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-map-marker-alt"></i> Locations</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addLocationModal"><i class="fas fa-fw fa-plus"></i> New Location</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Locations">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_locations_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#importLocationModal"><i class="fa fa-fw fa-upload"></i> Import</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_address&o=<?php echo $disp; ?>">Address</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_phone&o=<?php echo $disp; ?>">Phone</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_hours&o=<?php echo $disp; ?>">Hours</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$location_id = $row['location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
$location_country = htmlentities($row['location_country']);
|
||||
$location_address = htmlentities($row['location_address']);
|
||||
$location_city = htmlentities($row['location_city']);
|
||||
$location_state = htmlentities($row['location_state']);
|
||||
$location_zip = htmlentities($row['location_zip']);
|
||||
$location_phone = formatPhoneNumber($row['location_phone']);
|
||||
if (empty($location_phone)) {
|
||||
$location_phone_display = "-";
|
||||
}else{
|
||||
$location_phone_display = $location_phone;
|
||||
}
|
||||
$location_hours = htmlentities($row['location_hours']);
|
||||
if (empty($location_hours)) {
|
||||
$location_hours_display = "-";
|
||||
}else{
|
||||
$location_hours_display = $location_hours;
|
||||
}
|
||||
$location_photo = htmlentities($row['location_photo']);
|
||||
$location_notes = htmlentities($row['location_notes']);
|
||||
$location_created_at = $row['location_created_at'];
|
||||
$location_contact_id = $row['location_contact_id'];
|
||||
if ($location_id == $primary_location) {
|
||||
$primary_location_display = "<p class='text-success'>Primary Location</p>";
|
||||
}else{
|
||||
$primary_location_display = "";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw fa-map-marker-alt text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>"><?php echo $location_name; ?></a>
|
||||
<?php echo $primary_location_display; ?>
|
||||
</th>
|
||||
<td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"><?php echo $location_address; ?><br><?php echo "$location_city $location_state $location_zip"; ?></a></td>
|
||||
<td><?php echo $location_phone_display; ?></td>
|
||||
<td><?php echo $location_hours_display; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>">Edit</a>
|
||||
<?php if ($session_user_role == 3 && $location_id !== $primary_location) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_location=<?php echo $location_id; ?>">Archive</a>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_location=<?php echo $location_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Locations">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("client_location_edit_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_locations_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#importLocationModal"><i class="fa fa-fw fa-upload"></i> Import</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_address&o=<?php echo $disp; ?>">Address</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_phone&o=<?php echo $disp; ?>">Phone</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_hours&o=<?php echo $disp; ?>">Hours</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$location_id = $row['location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
$location_country = htmlentities($row['location_country']);
|
||||
$location_address = htmlentities($row['location_address']);
|
||||
$location_city = htmlentities($row['location_city']);
|
||||
$location_state = htmlentities($row['location_state']);
|
||||
$location_zip = htmlentities($row['location_zip']);
|
||||
$location_phone = formatPhoneNumber($row['location_phone']);
|
||||
if (empty($location_phone)) {
|
||||
$location_phone_display = "-";
|
||||
} else {
|
||||
$location_phone_display = $location_phone;
|
||||
}
|
||||
$location_hours = htmlentities($row['location_hours']);
|
||||
if (empty($location_hours)) {
|
||||
$location_hours_display = "-";
|
||||
} else {
|
||||
$location_hours_display = $location_hours;
|
||||
}
|
||||
$location_photo = htmlentities($row['location_photo']);
|
||||
$location_notes = htmlentities($row['location_notes']);
|
||||
$location_created_at = $row['location_created_at'];
|
||||
$location_contact_id = $row['location_contact_id'];
|
||||
if ($location_id == $primary_location) {
|
||||
$primary_location_display = "<p class='text-success'>Primary Location</p>";
|
||||
} else {
|
||||
$primary_location_display = "";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw fa-map-marker-alt text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>"><?php echo $location_name; ?></a>
|
||||
<?php echo $primary_location_display; ?>
|
||||
</th>
|
||||
<td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"><?php echo $location_address; ?><br><?php echo "$location_city $location_state $location_zip"; ?></a></td>
|
||||
<td><?php echo $location_phone_display; ?></td>
|
||||
<td><?php echo $location_hours_display; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>">Edit</a>
|
||||
<?php if ($session_user_role == 3 && $location_id !== $primary_location) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_location=<?php echo $location_id; ?>">Archive</a>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_location=<?php echo $location_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php require("client_location_edit_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
include("client_location_add_modal.php");
|
||||
include("client_location_import_modal.php");
|
||||
|
||||
?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
require_once("client_location_add_modal.php");
|
||||
require_once("client_location_import_modal.php");
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
}else{
|
||||
$sb = "login_name";
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "login_name";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
|
|
@ -13,7 +13,7 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM logins
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM logins
|
||||
WHERE login_client_id = $client_id
|
||||
AND (login_name LIKE '%$q%' OR login_uri LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
|
|
@ -23,154 +23,151 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-key"></i> Passwords</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addLoginModal"><i class="fas fa-fw fa-plus"></i> New Login</button>
|
||||
</div>
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-key"></i> Passwords</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addLoginModal"><i class="fas fa-fw fa-plus"></i> New Login</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Passwords">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_logins_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#importLoginModal"><i class="fa fa-fw fa-upload"></i> Import</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=login_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_username&o=<?php echo $disp; ?>">Username</a></th>
|
||||
<th>Password</th>
|
||||
<th>OTP</th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_uri&o=<?php echo $disp; ?>">URI</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$login_id = $row['login_id'];
|
||||
$login_name = htmlentities($row['login_name']);
|
||||
$login_uri = htmlentities($row['login_uri']);
|
||||
if (empty($login_uri)) {
|
||||
$login_uri_display = "-";
|
||||
}else{
|
||||
$login_uri_display = "$login_uri<button class='btn btn-sm clipboardjs' data-clipboard-text='$login_uri'><i class='far fa-copy text-secondary'></i></button><a href='https://$login_uri' target='_blank'><i class='fa fa-external-link-alt text-secondary'></i></a>";
|
||||
}
|
||||
$login_username = htmlentities(decryptLoginEntry($row['login_username']));
|
||||
if (empty($login_username)) {
|
||||
$login_username_display = "-";
|
||||
}else{
|
||||
$login_username_display = "$login_username<button class='btn btn-sm clipboardjs' data-clipboard-text='$login_username'><i class='far fa-copy text-secondary'></i></button>";
|
||||
}
|
||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
$login_otp_secret = htmlentities($row['login_otp_secret']);
|
||||
$login_id_with_secret = '"' . $row['login_id'] . '","' . $row['login_otp_secret'] . '"';
|
||||
if (empty($login_otp_secret)) {
|
||||
$otp_display = "-";
|
||||
}else{
|
||||
$otp_display = "<span onmouseenter='showOTP($login_id_with_secret)'><i class='far fa-clock'></i> <span id='otp_$login_id'><i>Hover..</i></span></span>";
|
||||
}
|
||||
$login_note = htmlentities($row['login_note']);
|
||||
$login_important = $row['login_important'];
|
||||
$login_contact_id = $row['login_contact_id'];
|
||||
$login_vendor_id = $row['login_vendor_id'];
|
||||
$login_asset_id = $row['login_asset_id'];
|
||||
$login_software_id = $row['login_software_id'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-fw fa-key text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">
|
||||
<?php echo $login_name; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $login_username_display; ?></td>
|
||||
<td>
|
||||
<a tabindex="0" href="#" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $login_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></a><button class="btn btn-sm clipboardjs" data-clipboard-text="<?php echo $login_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
</td>
|
||||
<td><?php echo $otp_display; ?></td>
|
||||
<td><?php echo $login_uri_display; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#shareModal" onclick="populateShareModal(<?php echo "$client_id, 'Login', $login_id"; ?>)">Share</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_login=<?php echo $login_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Passwords">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_logins_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#importLoginModal"><i class="fa fa-fw fa-upload"></i> Import</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
include("client_login_edit_modal.php");
|
||||
}
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=login_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_username&o=<?php echo $disp; ?>">Username</a></th>
|
||||
<th>Password</th>
|
||||
<th>OTP</th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_uri&o=<?php echo $disp; ?>">URI</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
?>
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$login_id = $row['login_id'];
|
||||
$login_name = htmlentities($row['login_name']);
|
||||
$login_uri = htmlentities($row['login_uri']);
|
||||
if (empty($login_uri)) {
|
||||
$login_uri_display = "-";
|
||||
} else {
|
||||
$login_uri_display = "$login_uri<button class='btn btn-sm clipboardjs' data-clipboard-text='$login_uri'><i class='far fa-copy text-secondary'></i></button><a href='https://$login_uri' target='_blank'><i class='fa fa-external-link-alt text-secondary'></i></a>";
|
||||
}
|
||||
$login_username = htmlentities(decryptLoginEntry($row['login_username']));
|
||||
if (empty($login_username)) {
|
||||
$login_username_display = "-";
|
||||
} else {
|
||||
$login_username_display = "$login_username<button class='btn btn-sm clipboardjs' data-clipboard-text='$login_username'><i class='far fa-copy text-secondary'></i></button>";
|
||||
}
|
||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
$login_otp_secret = htmlentities($row['login_otp_secret']);
|
||||
$login_id_with_secret = '"' . $row['login_id'] . '","' . $row['login_otp_secret'] . '"';
|
||||
if (empty($login_otp_secret)) {
|
||||
$otp_display = "-";
|
||||
} else {
|
||||
$otp_display = "<span onmouseenter='showOTP($login_id_with_secret)'><i class='far fa-clock'></i> <span id='otp_$login_id'><i>Hover..</i></span></span>";
|
||||
}
|
||||
$login_note = htmlentities($row['login_note']);
|
||||
$login_important = $row['login_important'];
|
||||
$login_contact_id = $row['login_contact_id'];
|
||||
$login_vendor_id = $row['login_vendor_id'];
|
||||
$login_asset_id = $row['login_asset_id'];
|
||||
$login_software_id = $row['login_software_id'];
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-fw fa-key text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">
|
||||
<?php echo $login_name; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $login_username_display; ?></td>
|
||||
<td>
|
||||
<a tabindex="0" href="#" data-toggle="popover" data-trigger="focus" data-placement="top" data-content="<?php echo $login_password; ?>"><i class="fas fa-2x fa-ellipsis-h text-secondary"></i><i class="fas fa-2x fa-ellipsis-h text-secondary"></i></a><button class="btn btn-sm clipboardjs" data-clipboard-text="<?php echo $login_password; ?>"><i class="far fa-copy text-secondary"></i></button>
|
||||
</td>
|
||||
<td><?php echo $otp_display; ?></td>
|
||||
<td><?php echo $login_uri_display; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#shareModal" onclick="populateShareModal(<?php echo "$client_id, 'Login', $login_id"; ?>)">Share</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_login=<?php echo $login_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
require("client_login_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function showOTP(id, secret) {
|
||||
//Send a GET request to ajax.php as ajax.php?get_totp_token=true&totp_secret=SECRET
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{get_totp_token: 'true', totp_secret: secret},
|
||||
function(data) {
|
||||
//If we get a response from post.php, parse it as JSON
|
||||
const token = JSON.parse(data);
|
||||
<script>
|
||||
function showOTP(id, secret) {
|
||||
//Send a GET request to ajax.php as ajax.php?get_totp_token=true&totp_secret=SECRET
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{get_totp_token: 'true', totp_secret: secret},
|
||||
function(data) {
|
||||
//If we get a response from post.php, parse it as JSON
|
||||
const token = JSON.parse(data);
|
||||
|
||||
document.getElementById("otp_" + id).innerText = token
|
||||
document.getElementById("otp_" + id).innerText = token
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function generatePassword() {
|
||||
document.getElementById("password").value = "<?php echo randomString(); ?>"
|
||||
}
|
||||
</script>
|
||||
function generatePassword() {
|
||||
document.getElementById("password").value = "<?php echo randomString(); ?>"
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_login_add_modal.php");
|
||||
include("share_modal.php");
|
||||
include("client_login_import_modal.php");
|
||||
|
||||
?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
require_once("client_login_add_modal.php");
|
||||
require_once("share_modal.php");
|
||||
require_once("client_login_import_modal.php");
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
173
client_logs.php
173
client_logs.php
|
|
@ -2,15 +2,15 @@
|
|||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "log_id";
|
||||
$sb = "log_id";
|
||||
}
|
||||
|
||||
// Reverse default sort
|
||||
if (!isset($_GET['o'])) {
|
||||
$o = "DESC";
|
||||
$disp = "ASC";
|
||||
$o = "DESC";
|
||||
$disp = "ASC";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
|
|
@ -30,88 +30,89 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-eye"></i> Audit Logs</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Logs">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive border">
|
||||
<table class="table table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_created_at&o=<?php echo $disp; ?>">Timestamp</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">User</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_action&o=<?php echo $disp; ?>">Action</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_description&o=<?php echo $disp; ?>">Description</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_ip&o=<?php echo $disp; ?>">IP Address</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_user_agent&o=<?php echo $disp; ?>">User Agent</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_entity_id&o=<?php echo $disp; ?>">Entity ID</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$log_id = $row['log_id'];
|
||||
$log_type = htmlentities($row['log_type']);
|
||||
$log_action = htmlentities($row['log_action']);
|
||||
$log_description = htmlentities($row['log_description']);
|
||||
$log_ip = htmlentities($row['log_ip']);
|
||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||
$log_user_os = getOS($log_user_agent);
|
||||
$log_user_browser = getWebBrowser($log_user_agent);
|
||||
$log_created_at = $row['log_created_at'];
|
||||
$user_id = $row['user_id'];
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
if (empty($user_name)) {
|
||||
$user_name_display = "-";
|
||||
} else {
|
||||
$user_name_display = $user_name;
|
||||
}
|
||||
$log_entity_id = $row['log_entity_id'];
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $log_created_at; ?></td>
|
||||
<td><?php echo $user_name_display; ?></td>
|
||||
<td><?php echo $log_type; ?></td>
|
||||
<td><?php echo $log_action; ?></td>
|
||||
<td><?php echo $log_description; ?></td>
|
||||
<td><?php echo $log_ip; ?></td>
|
||||
<td><?php echo "$log_user_os<br>$log_user_browser"; ?></td>
|
||||
<td><?php echo $log_entity_id; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-eye"></i> Audit Logs</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Logs">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive border">
|
||||
<table class="table table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_created_at&o=<?php echo $disp; ?>">Timestamp</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">User</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_action&o=<?php echo $disp; ?>">Action</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_description&o=<?php echo $disp; ?>">Description</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_ip&o=<?php echo $disp; ?>">IP Address</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_user_agent&o=<?php echo $disp; ?>">User Agent</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=log_entity_id&o=<?php echo $disp; ?>">Entity ID</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$log_id = $row['log_id'];
|
||||
$log_type = htmlentities($row['log_type']);
|
||||
$log_action = htmlentities($row['log_action']);
|
||||
$log_description = htmlentities($row['log_description']);
|
||||
$log_ip = htmlentities($row['log_ip']);
|
||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||
$log_user_os = getOS($log_user_agent);
|
||||
$log_user_browser = getWebBrowser($log_user_agent);
|
||||
$log_created_at = $row['log_created_at'];
|
||||
$user_id = $row['user_id'];
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
if (empty($user_name)) {
|
||||
$user_name_display = "-";
|
||||
} else {
|
||||
$user_name_display = $user_name;
|
||||
}
|
||||
$log_entity_id = $row['log_entity_id'];
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $log_created_at; ?></td>
|
||||
<td><?php echo $user_name_display; ?></td>
|
||||
<td><?php echo $log_type; ?></td>
|
||||
<td><?php echo $log_action; ?></td>
|
||||
<td><?php echo $log_description; ?></td>
|
||||
<td><?php echo $log_ip; ?></td>
|
||||
<td><?php echo "$log_user_os<br>$log_user_browser"; ?></td>
|
||||
<td><?php echo $log_entity_id; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once("footer.php"); ?>
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -2,188 +2,188 @@
|
|||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "network_name";
|
||||
$sb = "network_name";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM networks
|
||||
LEFT JOIN locations ON location_id = network_location_id
|
||||
WHERE network_client_id = $client_id
|
||||
AND (network_name LIKE '%$q%' OR network_vlan LIKE '%$q%' OR network LIKE '%$q%' OR network_gateway LIKE '%$q%' OR network_dhcp_range LIKE '%$q%' OR location_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM networks
|
||||
LEFT JOIN locations ON location_id = network_location_id
|
||||
WHERE network_client_id = $client_id
|
||||
AND (network_name LIKE '%$q%' OR network_vlan LIKE '%$q%' OR network LIKE '%$q%' OR network_gateway LIKE '%$q%' OR network_dhcp_range LIKE '%$q%' OR location_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-network-wired"></i> Networks</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addNetworkModal"><i class="fas fa-fw fa-plus"></i> New Network</button>
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-network-wired"></i> Networks</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addNetworkModal"><i class="fas fa-fw fa-plus"></i> New Network</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Networks">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_networks_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=network_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_vlan&o=<?php echo $disp; ?>">vLAN</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network&o=<?php echo $disp; ?>">Network</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_gateway&o=<?php echo $disp; ?>">Gateway</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_dhcp_range&o=<?php echo $disp; ?>">DHCP Range</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Location</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$network_id = $row['network_id'];
|
||||
$network_name = htmlentities($row['network_name']);
|
||||
$network_vlan = htmlentities($row['network_vlan']);
|
||||
if (empty($network_vlan)) {
|
||||
$network_vlan_display = "-";
|
||||
}else{
|
||||
$network_vlan_display = $network_vlan;
|
||||
}
|
||||
$network = htmlentities($row['network']);
|
||||
$network_gateway = htmlentities($row['network_gateway']);
|
||||
$network_dhcp_range = htmlentities($row['network_dhcp_range']);
|
||||
if (empty($network_dhcp_range)) {
|
||||
$network_dhcp_range_display = "-";
|
||||
}else{
|
||||
$network_dhcp_range_display = $network_dhcp_range;
|
||||
}
|
||||
$network_location_id = $row['network_location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
if (empty($location_name)) {
|
||||
$location_name_display = "-";
|
||||
} else {
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw fa-network-wired text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" onclick="populateNetworkEditModal(<?php echo $client_id, ",", $network_id ?>)" data-target="#editNetworkModal"><?php echo $network_name; ?></a></th>
|
||||
<td><?php echo $network_vlan_display; ?></td>
|
||||
<td><?php echo $network; ?></td>
|
||||
<td><?php echo $network_gateway; ?></td>
|
||||
<td><?php echo $network_dhcp_range_display; ?></td>
|
||||
<td><?php echo $location_name_display; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" onclick="populateNetworkEditModal(<?php echo $client_id, ",", $network_id ?>)" data-target="#editNetworkModal">Edit</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_network=<?php echo $network_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Networks">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_networks_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=network_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_vlan&o=<?php echo $disp; ?>">vLAN</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network&o=<?php echo $disp; ?>">Network</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_gateway&o=<?php echo $disp; ?>">Gateway</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_dhcp_range&o=<?php echo $disp; ?>">DHCP Range</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Location</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
?>
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$network_id = $row['network_id'];
|
||||
$network_name = htmlentities($row['network_name']);
|
||||
$network_vlan = htmlentities($row['network_vlan']);
|
||||
if (empty($network_vlan)) {
|
||||
$network_vlan_display = "-";
|
||||
} else {
|
||||
$network_vlan_display = $network_vlan;
|
||||
}
|
||||
$network = htmlentities($row['network']);
|
||||
$network_gateway = htmlentities($row['network_gateway']);
|
||||
$network_dhcp_range = htmlentities($row['network_dhcp_range']);
|
||||
if (empty($network_dhcp_range)) {
|
||||
$network_dhcp_range_display = "-";
|
||||
} else {
|
||||
$network_dhcp_range_display = $network_dhcp_range;
|
||||
}
|
||||
$network_location_id = $row['network_location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
if (empty($location_name)) {
|
||||
$location_name_display = "-";
|
||||
} else {
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw fa-network-wired text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" onclick="populateNetworkEditModal(<?php echo $client_id, ",", $network_id ?>)" data-target="#editNetworkModal"><?php echo $network_name; ?></a></th>
|
||||
<td><?php echo $network_vlan_display; ?></td>
|
||||
<td><?php echo $network; ?></td>
|
||||
<td><?php echo $network_gateway; ?></td>
|
||||
<td><?php echo $network_dhcp_range_display; ?></td>
|
||||
<td><?php echo $location_name_display; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" onclick="populateNetworkEditModal(<?php echo $client_id, ",", $network_id ?>)" data-target="#editNetworkModal">Edit</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_network=<?php echo $network_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_network_edit_modal.php");
|
||||
include("client_network_add_modal.php");
|
||||
require_once("client_network_edit_modal.php");
|
||||
require_once("client_network_add_modal.php");
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
function populateNetworkEditModal(client_id, network_id) {
|
||||
function populateNetworkEditModal(client_id, network_id) {
|
||||
|
||||
// Send a GET request to post.php as post.php?network_get_json_details=true&client_id=NUM&network_id=NUM
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{network_get_json_details: 'true', client_id: client_id, network_id: network_id},
|
||||
function(data) {
|
||||
// Send a GET request to post.php as post.php?network_get_json_details=true&client_id=NUM&network_id=NUM
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{network_get_json_details: 'true', client_id: client_id, network_id: network_id},
|
||||
function(data) {
|
||||
|
||||
// If we get a response from post.php, parse it as JSON
|
||||
const response = JSON.parse(data);
|
||||
// If we get a response from post.php, parse it as JSON
|
||||
const response = JSON.parse(data);
|
||||
|
||||
// Access the network (only one!) and locations (possibly multiple)
|
||||
const network = response.network[0];
|
||||
const locations = response.locations;
|
||||
// Access the network (only one!) and locations (possibly multiple)
|
||||
const network = response.network[0];
|
||||
const locations = response.locations;
|
||||
|
||||
// Populate the network modal fields
|
||||
document.getElementById("editNetworkHeader").innerText = network.network_name;
|
||||
document.getElementById("editNetworkId").value = network_id;
|
||||
document.getElementById("editNetworkName").value = network.network_name;
|
||||
document.getElementById("editNetworkVlan").value = network.network_vlan;
|
||||
document.getElementById("editNetworkCidr").value = network.network;
|
||||
document.getElementById("editNetworkGw").value = network.network_gateway;
|
||||
document.getElementById("editNetworkDhcp").value = network.network_dhcp_range;
|
||||
// Populate the network modal fields
|
||||
document.getElementById("editNetworkHeader").innerText = network.network_name;
|
||||
document.getElementById("editNetworkId").value = network_id;
|
||||
document.getElementById("editNetworkName").value = network.network_name;
|
||||
document.getElementById("editNetworkVlan").value = network.network_vlan;
|
||||
document.getElementById("editNetworkCidr").value = network.network;
|
||||
document.getElementById("editNetworkGw").value = network.network_gateway;
|
||||
document.getElementById("editNetworkDhcp").value = network.network_dhcp_range;
|
||||
|
||||
// Select the location dropdown
|
||||
var locationDropdown = document.getElementById("editNetworkLocation");
|
||||
// Select the location dropdown
|
||||
var locationDropdown = document.getElementById("editNetworkLocation");
|
||||
|
||||
// Clear location dropdown
|
||||
var i, L = locationDropdown.options.length -1;
|
||||
for(i = L; i >= 0; i--) {
|
||||
locationDropdown.remove(i);
|
||||
}
|
||||
locationDropdown[locationDropdown.length] = new Option('- Location -', '0');
|
||||
// Clear location dropdown
|
||||
var i, L = locationDropdown.options.length -1;
|
||||
for(i = L; i >= 0; i--) {
|
||||
locationDropdown.remove(i);
|
||||
}
|
||||
locationDropdown[locationDropdown.length] = new Option('- Location -', '0');
|
||||
|
||||
// Populate location dropdown
|
||||
locations.forEach(location => {
|
||||
if (parseInt(location.location_id) == parseInt(network.network_location_id)) {
|
||||
locationDropdown[locationDropdown.length] = new Option(location.location_name, location.location_id, true, true);
|
||||
}
|
||||
else{
|
||||
locationDropdown[locationDropdown.length] = new Option(location.location_name, location.location_id);
|
||||
}
|
||||
});
|
||||
// Populate location dropdown
|
||||
locations.forEach(location => {
|
||||
if (parseInt(location.location_id) == parseInt(network.network_location_id)) {
|
||||
locationDropdown[locationDropdown.length] = new Option(location.location_name, location.location_id, true, true);
|
||||
}
|
||||
else{
|
||||
locationDropdown[locationDropdown.length] = new Option(location.location_name, location.location_id);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<?php require_once("inc_all_client.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL AND contacts.company_id = $session_company_id ORDER BY contact_updated_at, contact_created_at DESC LIMIT 5");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,121 +1,120 @@
|
|||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "payment_date";
|
||||
$sb = "payment_date";
|
||||
}
|
||||
|
||||
// Reverse default sort
|
||||
if (!isset($_GET['o'])) {
|
||||
$o = "DESC";
|
||||
$disp = "ASC";
|
||||
$o = "DESC";
|
||||
$disp = "ASC";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM payments
|
||||
LEFT JOIN invoices ON payment_invoice_id = invoice_id
|
||||
LEFT JOIN accounts ON payment_account_id = account_id
|
||||
WHERE invoice_client_id = $client_id
|
||||
AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR account_name LIKE '%$q%' OR payment_method LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM payments
|
||||
LEFT JOIN invoices ON payment_invoice_id = invoice_id
|
||||
LEFT JOIN accounts ON payment_account_id = account_id
|
||||
WHERE invoice_client_id = $client_id
|
||||
AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR account_name LIKE '%$q%' OR payment_method LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-credit-card"></i> Payments</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Payments">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_payments_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=payment_date&o=<?php echo $disp; ?>">Payment Date</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_date&o=<?php echo $disp; ?>">Invoice Date</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_number&o=<?php echo $disp; ?>">Invoice</a></th>
|
||||
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_amount&o=<?php echo $disp; ?>">Invoice Amount</a></th>
|
||||
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_amount&o=<?php echo $disp; ?>">Payment Amount</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_method&o=<?php echo $disp; ?>">Method</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_reference&o=<?php echo $disp; ?>">Reference</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=account_name&o=<?php echo $disp; ?>">Account</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$invoice_id = $row['invoice_id'];
|
||||
$invoice_prefix = htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = htmlentities($row['invoice_number']);
|
||||
$invoice_status = htmlentities($row['invoice_status']);
|
||||
$invoice_amount = floatval($row['invoice_amount']);
|
||||
$invoice_currency_code = htmlentities($row['invoice_currency_code']);
|
||||
$invoice_date = $row['invoice_date'];
|
||||
$payment_date = $row['payment_date'];
|
||||
$payment_method = htmlentities($row['payment_method']);
|
||||
$payment_reference = htmlentities($row['payment_reference']);
|
||||
if (empty($payment_reference)) {
|
||||
$payment_reference_display = "-";
|
||||
}else{
|
||||
$payment_reference_display = $payment_reference;
|
||||
}
|
||||
$payment_amount = floatval($row['payment_amount']);
|
||||
$payment_currency_code = htmlentities($row['payment_currency_code']);
|
||||
$account_name = htmlentities($row['account_name']);
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $payment_date; ?></td>
|
||||
<td><?php echo $invoice_date; ?></td>
|
||||
<td><a href="invoice.php?invoice_id=<?php echo $invoice_id; ?>"><?php echo "$invoice_prefix$invoice_number"; ?></a></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code); ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $payment_amount, $payment_currency_code); ?></td>
|
||||
<td><?php echo $payment_method; ?></td>
|
||||
<td><?php echo $payment_reference_display; ?></td>
|
||||
<td><?php echo $account_name; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-credit-card"></i> Payments</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Payments">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_payments_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=payment_date&o=<?php echo $disp; ?>">Payment Date</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_date&o=<?php echo $disp; ?>">Invoice Date</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_number&o=<?php echo $disp; ?>">Invoice</a></th>
|
||||
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_amount&o=<?php echo $disp; ?>">Invoice Amount</a></th>
|
||||
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_amount&o=<?php echo $disp; ?>">Payment Amount</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_method&o=<?php echo $disp; ?>">Method</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_reference&o=<?php echo $disp; ?>">Reference</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=account_name&o=<?php echo $disp; ?>">Account</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$invoice_id = $row['invoice_id'];
|
||||
$invoice_prefix = htmlentities($row['invoice_prefix']);
|
||||
$invoice_number = htmlentities($row['invoice_number']);
|
||||
$invoice_status = htmlentities($row['invoice_status']);
|
||||
$invoice_amount = floatval($row['invoice_amount']);
|
||||
$invoice_currency_code = htmlentities($row['invoice_currency_code']);
|
||||
$invoice_date = $row['invoice_date'];
|
||||
$payment_date = $row['payment_date'];
|
||||
$payment_method = htmlentities($row['payment_method']);
|
||||
$payment_reference = htmlentities($row['payment_reference']);
|
||||
if (empty($payment_reference)) {
|
||||
$payment_reference_display = "-";
|
||||
} else {
|
||||
$payment_reference_display = $payment_reference;
|
||||
}
|
||||
$payment_amount = floatval($row['payment_amount']);
|
||||
$payment_currency_code = htmlentities($row['payment_currency_code']);
|
||||
$account_name = htmlentities($row['account_name']);
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $payment_date; ?></td>
|
||||
<td><?php echo $invoice_date; ?></td>
|
||||
<td><a href="invoice.php?invoice_id=<?php echo $invoice_id; ?>"><?php echo "$invoice_prefix$invoice_number"; ?></a></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code); ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $payment_amount, $payment_currency_code); ?></td>
|
||||
<td><?php echo $payment_method; ?></td>
|
||||
<td><?php echo $payment_reference_display; ?></td>
|
||||
<td><?php echo $account_name; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -17,11 +17,14 @@ if (!isset($_GET['o'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM quotes
|
||||
LEFT JOIN categories ON category_id = quote_category_id
|
||||
WHERE quote_client_id = $client_id
|
||||
AND (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM quotes
|
||||
LEFT JOIN categories ON category_id = quote_category_id
|
||||
WHERE quote_client_id = $client_id
|
||||
AND (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,141 +1,143 @@
|
|||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "recurring_id";
|
||||
$sb = "recurring_id";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM recurring
|
||||
LEFT JOIN categories ON recurring_category_id = category_id
|
||||
WHERE recurring_client_id = $client_id
|
||||
AND (CONCAT(recurring_prefix,recurring_number) LIKE '%$q%' OR recurring_frequency LIKE '%$q%' OR recurring_scope LIKE '%$q%' OR category_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM recurring
|
||||
LEFT JOIN categories ON recurring_category_id = category_id
|
||||
WHERE recurring_client_id = $client_id
|
||||
AND (CONCAT(recurring_prefix,recurring_number) LIKE '%$q%' OR recurring_frequency LIKE '%$q%' OR recurring_scope LIKE '%$q%' OR category_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-sync-alt"></i> Recurring Invoices</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addRecurringModal"><i class="fas fa-fw fa-plus"></i> New Recurring</button>
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-sync-alt"></i> Recurring Invoices</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addRecurringModal"><i class="fas fa-fw fa-plus"></i> New Recurring</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Recurring Invoices">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_recurring_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Recurring Invoices">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=recurring_number&o=<?php echo $disp; ?>">Number</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_scope&o=<?php echo $disp; ?>">Scope</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_frequency&o=<?php echo $disp; ?>">Frequency</a></th>
|
||||
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_amount&o=<?php echo $disp; ?>">Amount</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_last_sent&o=<?php echo $disp; ?>">Last Sent</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_next_date&o=<?php echo $disp; ?>">Next Date</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_recurring_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$recurring_id = $row['recurring_id'];
|
||||
$recurring_prefix = htmlentities($row['recurring_prefix']);
|
||||
$recurring_number = htmlentities($row['recurring_number']);
|
||||
$recurring_scope = htmlentities($row['recurring_scope']);
|
||||
$recurring_frequency = htmlentities($row['recurring_frequency']);
|
||||
$recurring_status = htmlentities($row['recurring_status']);
|
||||
$recurring_last_sent = $row['recurring_last_sent'];
|
||||
if ($recurring_last_sent == 0) {
|
||||
$recurring_last_sent = "-";
|
||||
}
|
||||
$recurring_next_date = $row['recurring_next_date'];
|
||||
$recurring_amount = floatval($row['recurring_amount']);
|
||||
$recurring_currency_code = htmlentities($row['recurring_currency_code']);
|
||||
$recurring_created_at = $row['recurring_created_at'];
|
||||
$category_id = $row['category_id'];
|
||||
$category_name = htmlentities($row['category_name']);
|
||||
if ($recurring_status == 1) {
|
||||
$status = "Active";
|
||||
$status_badge_color = "success";
|
||||
} else {
|
||||
$status = "Inactive";
|
||||
$status_badge_color = "secondary";
|
||||
}
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=recurring_number&o=<?php echo $disp; ?>">Number</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_scope&o=<?php echo $disp; ?>">Scope</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_frequency&o=<?php echo $disp; ?>">Frequency</a></th>
|
||||
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_amount&o=<?php echo $disp; ?>">Amount</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_last_sent&o=<?php echo $disp; ?>">Last Sent</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_next_date&o=<?php echo $disp; ?>">Next Date</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
?>
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$recurring_id = $row['recurring_id'];
|
||||
$recurring_prefix = htmlentities($row['recurring_prefix']);
|
||||
$recurring_number = htmlentities($row['recurring_number']);
|
||||
$recurring_scope = htmlentities($row['recurring_scope']);
|
||||
$recurring_frequency = htmlentities($row['recurring_frequency']);
|
||||
$recurring_status = htmlentities($row['recurring_status']);
|
||||
$recurring_last_sent = $row['recurring_last_sent'];
|
||||
if ($recurring_last_sent == 0) {
|
||||
$recurring_last_sent = "-";
|
||||
}
|
||||
$recurring_next_date = $row['recurring_next_date'];
|
||||
$recurring_amount = floatval($row['recurring_amount']);
|
||||
$recurring_currency_code = htmlentities($row['recurring_currency_code']);
|
||||
$recurring_created_at = $row['recurring_created_at'];
|
||||
$category_id = $row['category_id'];
|
||||
$category_name = htmlentities($row['category_name']);
|
||||
if ($recurring_status == 1) {
|
||||
$status = "Active";
|
||||
$status_badge_color = "success";
|
||||
}else{
|
||||
$status = "Inactive";
|
||||
$status_badge_color = "secondary";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><a href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>"><?php echo "$recurring_prefix$recurring_number"; ?></a></td>
|
||||
<td><?php echo $recurring_scope; ?></td>
|
||||
<td><?php echo ucwords($recurring_frequency); ?>ly</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $recurring_amount, $recurring_currency_code); ?></td>
|
||||
<td><?php echo $recurring_last_sent; ?></td>
|
||||
<td><?php echo $recurring_next_date; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td>
|
||||
<tr>
|
||||
<td><a href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>"><?php echo "$recurring_prefix$recurring_number"; ?></a></td>
|
||||
<td><?php echo $recurring_scope; ?></td>
|
||||
<td><?php echo ucwords($recurring_frequency); ?>ly</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $recurring_amount, $recurring_currency_code); ?></td>
|
||||
<td><?php echo $recurring_last_sent; ?></td>
|
||||
<td><?php echo $recurring_next_date; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td>
|
||||
<span class="p-2 badge badge-<?php echo $status_badge_color; ?>">
|
||||
<?php echo $status; ?>
|
||||
</span>
|
||||
</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">
|
||||
<a class="dropdown-item" href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_recurring=<?php echo $recurring_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</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">
|
||||
<a class="dropdown-item" href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_recurring=<?php echo $recurring_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("recurring_invoice_edit_modal.php");
|
||||
}
|
||||
<?php
|
||||
require("recurring_invoice_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("recurring_invoice_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("recurring_invoice_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -15,15 +15,14 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM scheduled_tickets
|
||||
LEFT JOIN clients on scheduled_ticket_client_id = client_id
|
||||
WHERE scheduled_ticket_client_id = $client_id
|
||||
AND scheduled_tickets.scheduled_ticket_subject LIKE '%$q%'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
LEFT JOIN clients on scheduled_ticket_client_id = client_id
|
||||
WHERE scheduled_ticket_client_id = $client_id
|
||||
AND scheduled_tickets.scheduled_ticket_subject LIKE '%$q%'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
||||
?>
|
||||
<script src="js/scheduled_tickets_edit_modal.js"></script>
|
||||
|
||||
|
|
@ -95,10 +94,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
data-target="#editScheduledTicketModal" onclick="populateScheduledTicketEditModal(<?php echo $client_id, ',', $scheduled_ticket_id ?>)">Edit</a>
|
||||
<?php
|
||||
if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_scheduled_ticket=<?php echo $scheduled_ticket_id; ?>">Delete</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_scheduled_ticket=<?php echo $scheduled_ticket_id; ?>">Delete</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
// Overview SQL query
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM services
|
||||
WHERE service_client_id = '$client_id'
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM services
|
||||
WHERE service_client_id = '$client_id'
|
||||
AND (service_name LIKE '%$q%' OR service_description LIKE '%$q%' OR service_category LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
|
@ -112,12 +112,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
// Associated Assets (and their logins/networks/locations)
|
||||
$sql_assets = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM service_assets
|
||||
LEFT JOIN assets ON service_assets.asset_id = assets.asset_id
|
||||
LEFT JOIN logins ON service_assets.asset_id = logins.login_asset_id
|
||||
LEFT JOIN networks ON assets.asset_network_id = networks.network_id
|
||||
LEFT JOIN locations ON assets.asset_location_id = locations.location_id
|
||||
WHERE service_id = '$service_id'"
|
||||
"SELECT * FROM service_assets
|
||||
LEFT JOIN assets ON service_assets.asset_id = assets.asset_id
|
||||
LEFT JOIN logins ON service_assets.asset_id = logins.login_asset_id
|
||||
LEFT JOIN networks ON assets.asset_network_id = networks.network_id
|
||||
LEFT JOIN locations ON assets.asset_location_id = locations.location_id
|
||||
WHERE service_id = '$service_id'"
|
||||
);
|
||||
|
||||
// Associated logins
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM shared_items
|
||||
WHERE item_client_id = $client_id
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM shared_items
|
||||
WHERE item_client_id = $client_id
|
||||
AND item_active = '1'
|
||||
AND item_views != item_view_limit
|
||||
AND item_expire_at > NOW()
|
||||
AND item_expire_at > NOW()
|
||||
AND (item_note LIKE '%$q%') ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
|
|
@ -33,100 +33,98 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-share"></i> Shared Items (Links)</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-share"></i> Shared Items (Links)</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Shared Items">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Shared Items">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th>Item Name</th>
|
||||
<th>Item Type</th>
|
||||
<th>Share Note</th>
|
||||
<th>Views</th>
|
||||
<th>Expires</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$item_id = $row['item_id'];
|
||||
$item_active = htmlentities($row['item_active']);
|
||||
$item_key = htmlentities($row['item_key']);
|
||||
$item_type = htmlentities($row['item_type']);
|
||||
$item_related_id = $row['item_related_id'];
|
||||
$item_note = htmlentities($row['item_note']);
|
||||
$item_views = htmlentities($row['item_views']);
|
||||
$item_view_limit = htmlentities($row['item_view_limit']);
|
||||
$item_created_at = $row['item_created_at'];
|
||||
$item_expire_at = $row['item_expire_at'];
|
||||
|
||||
if ($item_type == 'Login') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT login_name FROM logins WHERE login_id = '$item_related_id' AND login_client_id = '$client_id'");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$item_name = htmlentities($share_item['login_name']);
|
||||
} elseif ($item_type == 'Document') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT document_name FROM documents WHERE document_id = '$item_related_id' AND document_client_id = '$client_id'");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$item_name = htmlentities($share_item['document_name']);
|
||||
} elseif ($item_type == 'File') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT file_name FROM files WHERE file_id = '$item_related_id' AND file_client_id = '$client_id'");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$item_name = htmlentities($share_item['file_name']);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<td><?php echo $item_name; ?></td>
|
||||
<td><?php echo $item_type ?></td>
|
||||
<td><?php echo $item_note ?></td>
|
||||
<td><?php echo "$item_views / $item_view_limit" ?></td>
|
||||
<td><?php echo $item_expire_at ?></td>
|
||||
<td>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<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">
|
||||
<a class="dropdown-item text-danger" href="post.php?deactivate_shared_item=<?php echo $item_id; ?>">Deactivate</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<th>Item Name</th>
|
||||
<th>Item Type</th>
|
||||
<th>Share Note</th>
|
||||
<th>Views</th>
|
||||
<th>Expires</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$item_id = $row['item_id'];
|
||||
$item_active = htmlentities($row['item_active']);
|
||||
$item_key = htmlentities($row['item_key']);
|
||||
$item_type = htmlentities($row['item_type']);
|
||||
$item_related_id = $row['item_related_id'];
|
||||
$item_note = htmlentities($row['item_note']);
|
||||
$item_views = htmlentities($row['item_views']);
|
||||
$item_view_limit = htmlentities($row['item_view_limit']);
|
||||
$item_created_at = $row['item_created_at'];
|
||||
$item_expire_at = $row['item_expire_at'];
|
||||
|
||||
if ($item_type == 'Login') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT login_name FROM logins WHERE login_id = '$item_related_id' AND login_client_id = '$client_id'");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$item_name = htmlentities($share_item['login_name']);
|
||||
} elseif ($item_type == 'Document') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT document_name FROM documents WHERE document_id = '$item_related_id' AND document_client_id = '$client_id'");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$item_name = htmlentities($share_item['document_name']);
|
||||
} elseif ($item_type == 'File') {
|
||||
$share_item_sql = mysqli_query($mysqli, "SELECT file_name FROM files WHERE file_id = '$item_related_id' AND file_client_id = '$client_id'");
|
||||
$share_item = mysqli_fetch_array($share_item_sql);
|
||||
$item_name = htmlentities($share_item['file_name']);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $item_name; ?></td>
|
||||
<td><?php echo $item_type ?></td>
|
||||
<td><?php echo $item_note ?></td>
|
||||
<td><?php echo "$item_views / $item_view_limit" ?></td>
|
||||
<td><?php echo $item_expire_at ?></td>
|
||||
<td>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<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">
|
||||
<a class="dropdown-item text-danger" href="post.php?deactivate_shared_item=<?php echo $item_id; ?>">Deactivate</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -10,187 +10,189 @@ if (!empty($_GET['sb'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM software
|
||||
LEFT JOIN logins ON login_software_id = software_id
|
||||
WHERE software_client_id = $client_id
|
||||
AND software_template = 0
|
||||
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM software
|
||||
LEFT JOIN logins ON login_software_id = software_id
|
||||
WHERE software_client_id = $client_id
|
||||
AND software_template = 0
|
||||
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-cube"></i> Licenses</h3>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addSoftwareModal">
|
||||
<i class="fas fa-fw fa-plus"></i> New License
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#addSoftwareFromTemplateModal">From Template</a>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-cube"></i> Licenses</h3>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addSoftwareModal">
|
||||
<i class="fas fa-fw fa-plus"></i> New License
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#addSoftwareFromTemplateModal">From Template</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Licenses">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Licenses">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_software_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<a href="post.php?export_client_software_csv=<?php echo $client_id; ?>" class="btn btn-default"><i class="fa fa-fw fa-download"></i> Export</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=software_name&o=<?php echo $disp; ?>">Software</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_license_type&o=<?php echo $disp; ?>">License Type</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_seats&o=<?php echo $disp; ?>">Seats</a></th>
|
||||
<th></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$software_id = $row['software_id'];
|
||||
$software_name = htmlentities($row['software_name']);
|
||||
$software_version = htmlentities($row['software_version']);
|
||||
$software_type = htmlentities($row['software_type']);
|
||||
$software_license_type = htmlentities($row['software_license_type']);
|
||||
$software_key = htmlentities($row['software_key']);
|
||||
$software_seats = htmlentities($row['software_seats']);
|
||||
$software_purchase = $row['software_purchase'];
|
||||
$software_expire = $row['software_expire'];
|
||||
$software_notes = htmlentities($row['software_notes']);
|
||||
|
||||
// Get Login
|
||||
$login_id = $row['login_id'];
|
||||
$login_username = htmlentities(decryptLoginEntry($row['login_username']));
|
||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
|
||||
$seat_count = 0;
|
||||
|
||||
// Asset Licenses
|
||||
$asset_licenses_sql = mysqli_query($mysqli, "SELECT asset_id FROM software_assets WHERE software_id = $software_id");
|
||||
$asset_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($asset_licenses_sql)) {
|
||||
$asset_licenses_array[] = $row['asset_id'];
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
$asset_licenses = implode(',', $asset_licenses_array);
|
||||
|
||||
// Contact Licenses
|
||||
$contact_licenses_sql = mysqli_query($mysqli, "SELECT contact_id FROM software_contacts WHERE software_id = $software_id");
|
||||
$contact_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($contact_licenses_sql)) {
|
||||
$contact_licenses_array[] = $row['contact_id'];
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
$contact_licenses = implode(',', $contact_licenses_array);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editSoftwareModal<?php echo $software_id; ?>"><?php echo "$software_name<br><span class='text-secondary'>$software_version</span>"; ?></a></td>
|
||||
<td><?php echo $software_type; ?></td>
|
||||
<td><?php echo $software_license_type; ?></td>
|
||||
<td><?php echo "$seat_count / $software_seats"; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($login_id > 0) { ?>
|
||||
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key"></i></button>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_name&o=<?php echo $disp; ?>">Software</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_license_type&o=<?php echo $disp; ?>">License Type</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_seats&o=<?php echo $disp; ?>">Seats</a></th>
|
||||
<th></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key"></i> <?php echo $software_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<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-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" value="<?php echo $login_username; ?>" readonly>
|
||||
</div>
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$software_id = $row['software_id'];
|
||||
$software_name = htmlentities($row['software_name']);
|
||||
$software_version = htmlentities($row['software_version']);
|
||||
$software_type = htmlentities($row['software_type']);
|
||||
$software_license_type = htmlentities($row['software_license_type']);
|
||||
$software_key = htmlentities($row['software_key']);
|
||||
$software_seats = htmlentities($row['software_seats']);
|
||||
$software_purchase = $row['software_purchase'];
|
||||
$software_expire = $row['software_expire'];
|
||||
$software_notes = htmlentities($row['software_notes']);
|
||||
|
||||
// Get Login
|
||||
$login_id = $row['login_id'];
|
||||
$login_username = htmlentities(decryptLoginEntry($row['login_username']));
|
||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
|
||||
$seat_count = 0;
|
||||
|
||||
// Asset Licenses
|
||||
$asset_licenses_sql = mysqli_query($mysqli, "SELECT asset_id FROM software_assets WHERE software_id = $software_id");
|
||||
$asset_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($asset_licenses_sql)) {
|
||||
$asset_licenses_array[] = $row['asset_id'];
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
$asset_licenses = implode(',', $asset_licenses_array);
|
||||
|
||||
// Contact Licenses
|
||||
$contact_licenses_sql = mysqli_query($mysqli, "SELECT contact_id FROM software_contacts WHERE software_id = $software_id");
|
||||
$contact_licenses_array = array();
|
||||
while ($row = mysqli_fetch_array($contact_licenses_sql)) {
|
||||
$contact_licenses_array[] = $row['contact_id'];
|
||||
$seat_count = $seat_count + 1;
|
||||
}
|
||||
$contact_licenses = implode(',', $contact_licenses_array);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editSoftwareModal<?php echo $software_id; ?>"><?php echo "$software_name<br><span class='text-secondary'>$software_version</span>"; ?></a></td>
|
||||
<td><?php echo $software_type; ?></td>
|
||||
<td><?php echo $software_license_type; ?></td>
|
||||
<td><?php echo "$seat_count / $software_seats"; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($login_id > 0) { ?>
|
||||
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#viewPasswordModal<?php echo $login_id; ?>"><i class="fas fa-key"></i></button>
|
||||
|
||||
<div class="modal" id="viewPasswordModal<?php echo $login_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-key"></i> <?php echo $software_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
<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-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" value="<?php echo $login_username; ?>" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" value="<?php echo $login_password; ?>" readonly>
|
||||
</div>
|
||||
<input type="text" class="form-control" value="<?php echo $login_password; ?>" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</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="modal" data-target="#editSoftwareModal<?php echo $software_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_software=<?php echo $software_id; ?>">Archive and<br><small>Remove Licenses</small></a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
?>
|
||||
</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="modal" data-target="#editSoftwareModal<?php echo $software_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_software=<?php echo $software_id; ?>">Delete and<br><small>Remove Licenses</small></a>
|
||||
<?php } ?>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_software=<?php echo $software_id; ?>">Archive and<br><small>Remove Licenses</small></a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger text-bold" href="post.php?delete_software=<?php echo $software_id; ?>">Delete and<br><small>Remove Licenses</small></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
require("client_software_edit_modal.php");
|
||||
}
|
||||
require("client_software_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once("client_software_add_modal.php");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM tickets
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM tickets
|
||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||
LEFT JOIN assets ON ticket_asset_id = asset_id
|
||||
|
|
@ -104,8 +104,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
if (empty($ticket_updated_at)) {
|
||||
if ($ticket_status == "Closed") {
|
||||
$ticket_updated_at_display = "<p>Never</p>";
|
||||
}
|
||||
else{
|
||||
} else{
|
||||
$ticket_updated_at_display = "<p class='text-danger'>Never</p>";
|
||||
}
|
||||
} else {
|
||||
|
|
@ -117,7 +116,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$ticket_status_display = "<span class='p-2 badge badge-primary'>$ticket_status</span>";
|
||||
} elseif ($ticket_status == "Working") {
|
||||
$ticket_status_display = "<span class='p-2 badge badge-success'>$ticket_status</span>";
|
||||
} else{
|
||||
} else {
|
||||
$ticket_status_display = "<span class='p-2 badge badge-secondary'>$ticket_status</span>";
|
||||
}
|
||||
|
||||
|
|
@ -134,8 +133,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
if (empty($ticket_assigned_to)) {
|
||||
if ($ticket_status == "Closed") {
|
||||
$ticket_assigned_to_display = "<p>Not Assigned</p>";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$ticket_assigned_to_display = "<p class='text-danger'>Not Assigned</p>";
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -26,13 +26,15 @@ if (isset($_GET['dtf'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM trips
|
||||
LEFT JOIN users ON trip_user_id = user_id
|
||||
WHERE (trip_purpose LIKE '%$q%' OR trip_source LIKE '%$q%' OR trip_destination LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||
AND DATE(trip_date) BETWEEN '$dtf' AND '$dtt'
|
||||
AND company_id = $session_company_id
|
||||
AND trip_client_id = $client_id
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM trips
|
||||
LEFT JOIN users ON trip_user_id = user_id
|
||||
WHERE (trip_purpose LIKE '%$q%' OR trip_source LIKE '%$q%' OR trip_destination LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||
AND DATE(trip_date) BETWEEN '$dtf' AND '$dtt'
|
||||
AND company_id = $session_company_id
|
||||
AND trip_client_id = $client_id
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||
WHERE vendor_template = 1
|
||||
"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 $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
|
|
@ -33,137 +33,137 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2">
|
||||
<i class="fa fa-fw fa-building"></i> Vendor Templates
|
||||
</h3>
|
||||
<button type="button" class="btn btn-dark dropdown-toggle ml-1" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="client_vendors.php?client_id=<?php echo $client_id; ?>">Vendors</a>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2">
|
||||
<i class="fa fa-fw fa-building"></i> Vendor Templates
|
||||
</h3>
|
||||
<button type="button" class="btn btn-dark dropdown-toggle ml-1" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="client_vendors.php?client_id=<?php echo $client_id; ?>">Vendors</a>
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addVendorTemplateModal">
|
||||
<i class="fas fa-fw fa-plus"></i> New Template
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addVendorTemplateModal">
|
||||
<i class="fas fa-fw fa-plus"></i> New Template
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Vendors Templates">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group mb-3 mb-md-0">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Vendors Templates">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<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_sb; ?>&sb=vendor_name&o=<?php echo $disp; ?>">Vendor</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_description&o=<?php echo $disp; ?>">Description</a></th>
|
||||
<th>Contact</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = htmlentities($row['vendor_name']);
|
||||
$vendor_description = htmlentities($row['vendor_description']);
|
||||
if (empty($vendor_description)) {
|
||||
$vendor_description_display = "-";
|
||||
} else {
|
||||
$vendor_description_display = $vendor_description;
|
||||
}
|
||||
$vendor_account_number = htmlentities($row['vendor_account_number']);
|
||||
$vendor_contact_name = htmlentities($row['vendor_contact_name']);
|
||||
if (empty($vendor_contact_name)) {
|
||||
$vendor_contact_name_display = "-";
|
||||
} else {
|
||||
$vendor_contact_name_display = $vendor_contact_name;
|
||||
}
|
||||
$vendor_phone = formatPhoneNumber($row['vendor_phone']);
|
||||
$vendor_extension = htmlentities($row['vendor_extension']);
|
||||
$vendor_email = htmlentities($row['vendor_email']);
|
||||
$vendor_website = htmlentities($row['vendor_website']);
|
||||
$vendor_hours = htmlentities($row['vendor_hours']);
|
||||
$vendor_sla = htmlentities($row['vendor_sla']);
|
||||
$vendor_code = htmlentities($row['vendor_code']);
|
||||
$vendor_notes = htmlentities($row['vendor_notes']);
|
||||
$vendor_template = intval($row['vendor_template']);
|
||||
|
||||
?>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw fa-building text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorTemplateModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></a>
|
||||
<?php
|
||||
if (!empty($vendor_account_number)) { ?>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $vendor_account_number; ?></small>
|
||||
<?php } ?>
|
||||
</th>
|
||||
<td><?php echo $vendor_description_display; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if (!empty($vendor_contact_name)) { ?>
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_contact_name_display; ?>
|
||||
<br>
|
||||
<?php } else {
|
||||
echo $vendor_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; ?>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
if (!empty($vendor_email)) { ?>
|
||||
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
||||
<br>
|
||||
<?php } ?>
|
||||
</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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editVendorTemplateModal<?php echo $vendor_id; ?>">Edit</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_vendor=<?php echo $vendor_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_name&o=<?php echo $disp; ?>">Vendor</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_description&o=<?php echo $disp; ?>">Description</a></th>
|
||||
<th>Contact</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
require("vendor_template_edit_modal.php");
|
||||
}
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = htmlentities($row['vendor_name']);
|
||||
$vendor_description = htmlentities($row['vendor_description']);
|
||||
if (empty($vendor_description)) {
|
||||
$vendor_description_display = "-";
|
||||
} else {
|
||||
$vendor_description_display = $vendor_description;
|
||||
}
|
||||
$vendor_account_number = htmlentities($row['vendor_account_number']);
|
||||
$vendor_contact_name = htmlentities($row['vendor_contact_name']);
|
||||
if (empty($vendor_contact_name)) {
|
||||
$vendor_contact_name_display = "-";
|
||||
} else {
|
||||
$vendor_contact_name_display = $vendor_contact_name;
|
||||
}
|
||||
$vendor_phone = formatPhoneNumber($row['vendor_phone']);
|
||||
$vendor_extension = htmlentities($row['vendor_extension']);
|
||||
$vendor_email = htmlentities($row['vendor_email']);
|
||||
$vendor_website = htmlentities($row['vendor_website']);
|
||||
$vendor_hours = htmlentities($row['vendor_hours']);
|
||||
$vendor_sla = htmlentities($row['vendor_sla']);
|
||||
$vendor_code = htmlentities($row['vendor_code']);
|
||||
$vendor_notes = htmlentities($row['vendor_notes']);
|
||||
$vendor_template = intval($row['vendor_template']);
|
||||
|
||||
?>
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<i class="fa fa-fw fa-building text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorTemplateModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></a>
|
||||
<?php
|
||||
if (!empty($vendor_account_number)) { ?>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $vendor_account_number; ?></small>
|
||||
<?php } ?>
|
||||
</th>
|
||||
<td><?php echo $vendor_description_display; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if (!empty($vendor_contact_name)) { ?>
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_contact_name_display; ?>
|
||||
<br>
|
||||
<?php } else {
|
||||
echo $vendor_contact_name_display;
|
||||
}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
if (!empty($vendor_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_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; ?>
|
||||
<br>
|
||||
<?php } ?>
|
||||
</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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editVendorTemplateModal<?php echo $vendor_id; ?>">Edit</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_vendor=<?php echo $vendor_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
require("vendor_template_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once("vendor_template_add_modal.php");
|
||||
|
|
|
|||
|
|
@ -23,10 +23,12 @@ if (!empty($_GET['sb'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||
WHERE vendor_client_id = $client_id
|
||||
AND vendor_template = 0
|
||||
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 $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||
WHERE vendor_client_id = $client_id
|
||||
AND vendor_template = 0
|
||||
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 $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
|
|||
490
clients.php
490
clients.php
|
|
@ -89,270 +89,272 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['date_from'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sortby = http_build_query(array_merge($_GET, array('sortby' => $sortby, 'order' => $order)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM clients
|
||||
LEFT JOIN contacts ON clients.primary_contact = contacts.contact_id AND contact_archived_at IS NULL
|
||||
LEFT JOIN locations ON clients.primary_location = locations.location_id AND location_archived_at IS NULL
|
||||
WHERE (client_name LIKE '%$query%' OR client_type LIKE '%$query%' OR client_referral LIKE '%$query%' OR contact_email LIKE '%$query%' OR contact_name LIKE '%$query%' OR contact_phone LIKE '%$phone_query%'
|
||||
OR contact_mobile LIKE '%$phone_query%' OR location_address LIKE '%$query%' OR location_city LIKE '%$query%' OR location_state LIKE '%$query%' OR location_zip LIKE '%$query%')
|
||||
AND client_archived_at IS NULL
|
||||
AND DATE(client_created_at) BETWEEN '$date_from' AND '$date_to'
|
||||
AND clients.company_id = $session_company_id
|
||||
ORDER BY $sortby $order LIMIT $record_from, $record_to
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM clients
|
||||
LEFT JOIN contacts ON clients.primary_contact = contacts.contact_id AND contact_archived_at IS NULL
|
||||
LEFT JOIN locations ON clients.primary_location = locations.location_id AND location_archived_at IS NULL
|
||||
WHERE (client_name LIKE '%$query%' OR client_type LIKE '%$query%' OR client_referral LIKE '%$query%' OR contact_email LIKE '%$query%' OR contact_name LIKE '%$query%' OR contact_phone LIKE '%$phone_query%'
|
||||
OR contact_mobile LIKE '%$phone_query%' OR location_address LIKE '%$query%' OR location_city LIKE '%$query%' OR location_state LIKE '%$query%' OR location_zip LIKE '%$query%')
|
||||
AND client_archived_at IS NULL
|
||||
AND DATE(client_created_at) BETWEEN '$date_from' AND '$date_to'
|
||||
AND clients.company_id = $session_company_id
|
||||
ORDER BY $sortby $order LIMIT $record_from, $record_to
|
||||
");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-users"></i> Clients</h3>
|
||||
<div class="card-tools">
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-fw fa-plus"></i> New Client</button>
|
||||
<?php } ?>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-users"></i> Clients</h3>
|
||||
<div class="card-tools">
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addClientModal"><i class="fas fa-fw fa-plus"></i> New Client</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="query" value="<?php if (isset($query)) {echo strip_tags(htmlentities($query));} ?>" placeholder="Search Clients" 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>
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse mt-3 <?php if (!empty($_GET['date_from'])) { echo "show"; } ?>" id="advancedFilter">
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Canned Date</label>
|
||||
<select class="form-control select2" name="canned_date">
|
||||
<option <?php if ($_GET['canned_date'] == "custom") { echo "selected"; } ?> value="custom">Custom</option>
|
||||
<option <?php if ($_GET['canned_date'] == "today") { echo "selected"; } ?> value="today">Today</option>
|
||||
<option <?php if ($_GET['canned_date'] == "yesterday") { echo "selected"; } ?> value="yesterday">Yesterday</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thisweek") { echo "selected"; } ?> value="thisweek">This Week</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastweek") { echo "selected"; } ?> value="lastweek">Last Week</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thismonth") { echo "selected"; } ?> value="thismonth">This Month</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastmonth") { echo "selected"; } ?> value="lastmonth">Last Month</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thisyear") { echo "selected"; } ?> value="thisyear">This Year</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastyear") { echo "selected"; } ?> value="lastyear">Last Year</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date From</label>
|
||||
<input type="date" class="form-control" name="date_from" max="2999-12-31" value="<?php echo htmlentities($date_from); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date To</label>
|
||||
<input type="date" class="form-control" name="date_to" max="2999-12-31" value="<?php echo htmlentities($date_to); ?>">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="query" value="<?php if (isset($query)) {echo strip_tags(htmlentities($query));} ?>" placeholder="Search Clients" 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>
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover table-borderless">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sortby; ?>&sortby=client_name&order=<?php echo $order_display; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sortby; ?>&sortby=location_city&order=<?php echo $order_display; ?>">Primary Address </a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sortby; ?>&sortby=contact_name&order=<?php echo $order_display; ?>">Primary Contact</a></th>
|
||||
<?php if ($session_user_role == 3 || $session_user_role == 1 && $config_module_enable_accounting == 1) { ?> <th class="text-right">Billing</th> <?php } ?>
|
||||
<?php if ($session_user_role == 3) { ?> <th class="text-center">Action</th> <?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$client_id = $row['client_id'];
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_type = htmlentities($row['client_type']);
|
||||
$location_id = $row['location_id'];
|
||||
$location_country = htmlentities($row['location_country']);
|
||||
$location_address = htmlentities($row['location_address']);
|
||||
$location_city = htmlentities($row['location_city']);
|
||||
$location_state = htmlentities($row['location_state']);
|
||||
$location_zip = htmlentities($row['location_zip']);
|
||||
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";
|
||||
}
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
||||
$contact_extension = htmlentities($row['contact_extension']);
|
||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
$client_website = htmlentities($row['client_website']);
|
||||
$client_currency_code = htmlentities($row['client_currency_code']);
|
||||
$client_net_terms = htmlentities($row['client_net_terms']);
|
||||
$client_referral = htmlentities($row['client_referral']);
|
||||
$client_notes = htmlentities($row['client_notes']);
|
||||
$client_created_at = date('Y-m-d', strtotime($row['client_created_at']));
|
||||
$client_updated_at = $row['client_updated_at'];
|
||||
$client_archive_at = $row['client_archived_at'];
|
||||
|
||||
//Client Tags
|
||||
|
||||
$client_tag_name_display_array = array();
|
||||
$client_tag_id_array = array();
|
||||
$sql_client_tags = mysqli_query($mysqli, "SELECT * FROM client_tags LEFT JOIN tags ON client_tags.tag_id = tags.tag_id WHERE client_tags.client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql_client_tags)) {
|
||||
|
||||
$client_tag_id = $row['tag_id'];
|
||||
$client_tag_name = htmlentities($row['tag_name']);
|
||||
$client_tag_color = htmlentities($row['tag_color']);
|
||||
$client_tag_icon = htmlentities($row['tag_icon']);
|
||||
if (empty($client_tag_icon)) {
|
||||
$client_tag_icon = "tag";
|
||||
}
|
||||
|
||||
$client_tag_id_array[] = $client_tag_id;
|
||||
if (empty($client_tag_color)) {
|
||||
$client_tag_name_display_array[] = "<small class='text-secondary'>$client_tag_name</small> ";
|
||||
} else {
|
||||
$client_tag_name_display_array[] = "<span class='badge bg-$client_tag_color'><i class='fa fa-fw fa-$client_tag_icon'></i> $client_tag_name</span> ";
|
||||
}
|
||||
}
|
||||
$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' ");
|
||||
$row = mysqli_fetch_array($sql_invoice_amounts);
|
||||
|
||||
$invoice_amounts = $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 = $client_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
|
||||
$amount_paid = $row['amount_paid'];
|
||||
|
||||
$balance = $invoice_amounts - $amount_paid;
|
||||
//set Text color on balance
|
||||
if ($balance > 0) {
|
||||
$balance_text_color = "text-danger font-weight-bold";
|
||||
} else {
|
||||
$balance_text_color = "";
|
||||
}
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_monthly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'month' AND recurring_client_id = $client_id AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
|
||||
$recurring_monthly_total = $row['recurring_monthly_total'];
|
||||
|
||||
//Get Yearly Recurring Total
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_yearly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'year' AND recurring_client_id = $client_id AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
|
||||
$recurring_yearly_total = $row['recurring_yearly_total'] / 12;
|
||||
|
||||
$recurring_monthly = $recurring_monthly_total + $recurring_yearly_total;
|
||||
|
||||
?>
|
||||
<div class="collapse mt-3 <?php if (!empty($_GET['date_from'])) { echo "show"; } ?>" id="advancedFilter">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Canned Date</label>
|
||||
<select class="form-control select2" name="canned_date">
|
||||
<option <?php if ($_GET['canned_date'] == "custom") { echo "selected"; } ?> value="custom">Custom</option>
|
||||
<option <?php if ($_GET['canned_date'] == "today") { echo "selected"; } ?> value="today">Today</option>
|
||||
<option <?php if ($_GET['canned_date'] == "yesterday") { echo "selected"; } ?> value="yesterday">Yesterday</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thisweek") { echo "selected"; } ?> value="thisweek">This Week</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastweek") { echo "selected"; } ?> value="lastweek">Last Week</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thismonth") { echo "selected"; } ?> value="thismonth">This Month</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastmonth") { echo "selected"; } ?> value="lastmonth">Last Month</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thisyear") { echo "selected"; } ?> value="thisyear">This Year</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastyear") { echo "selected"; } ?> value="lastyear">Last Year</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date From</label>
|
||||
<input type="date" class="form-control" name="date_from" max="2999-12-31" value="<?php echo htmlentities($date_from); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date To</label>
|
||||
<input type="date" class="form-control" name="date_to" max="2999-12-31" value="<?php echo htmlentities($date_to); ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover table-borderless">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<td>
|
||||
<strong><a href="client_overview.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></strong>
|
||||
<?php
|
||||
if (!empty($client_type)) {
|
||||
?>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $client_type; ?></small>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (!empty($client_tags_display)) { ?>
|
||||
<br>
|
||||
<?php echo $client_tags_display; ?>
|
||||
<?php } ?>
|
||||
<br>
|
||||
<small class="text-secondary"><strong>Created:</strong> <?php echo $client_created_at; ?></small>
|
||||
</td>
|
||||
<td><?php echo $location_address_display; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if (empty($contact_name) && empty($contact_phone) && empty($contact_mobile) && empty($client_email)) {
|
||||
echo "-";
|
||||
}
|
||||
|
||||
if (!empty($contact_name)) { ?>
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><strong><?php echo $contact_name; ?></strong>
|
||||
<br>
|
||||
<?php } else {
|
||||
echo "-";
|
||||
}
|
||||
|
||||
if (!empty($contact_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $contact_phone; ?> <?php if (!empty($contact_extension)) { echo "x$contact_extension"; } ?>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
if (!empty($contact_mobile)) { ?>
|
||||
<i class="fa fa-fw fa-mobile-alt text-secondary mr-2"></i><?php echo $contact_mobile; ?>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
if (!empty($contact_email)) { ?>
|
||||
<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>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
<!-- Show Billing for Admin/Accountant roles only and if accounting module is enabled -->
|
||||
<?php if ($session_user_role == 3 || $session_user_role == 1 && $config_module_enable_accounting == 1) { ?>
|
||||
<td class="text-right">
|
||||
<span class="text-secondary">Balance</span> <span class="<?php echo $balance_text_color; ?>"><?php echo numfmt_format_currency($currency_format, $balance, $session_company_currency); ?></span>
|
||||
<br>
|
||||
<span class="text-secondary">Paid</span> <?php echo numfmt_format_currency($currency_format, $amount_paid, $session_company_currency); ?>
|
||||
<br>
|
||||
<span class="text-secondary">Monthly</span> <?php echo numfmt_format_currency($currency_format, $recurring_monthly, $session_company_currency); ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Show actions for Admin role only -->
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_client=<?php echo $client_id; ?>">Archive</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="#" data-toggle="modal" data-target="#deleteClientModal<?php echo $client_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sortby; ?>&sortby=client_name&order=<?php echo $order_display; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sortby; ?>&sortby=location_city&order=<?php echo $order_display; ?>">Primary Address </a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sortby; ?>&sortby=contact_name&order=<?php echo $order_display; ?>">Primary Contact</a></th>
|
||||
<?php if ($session_user_role == 3 || $session_user_role == 1 && $config_module_enable_accounting == 1) { ?> <th class="text-right">Billing</th> <?php } ?>
|
||||
<?php if ($session_user_role == 3) { ?> <th class="text-center">Action</th> <?php } ?>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
require("client_edit_modal.php");
|
||||
require("client_delete_modal.php");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$client_id = $row['client_id'];
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_type = htmlentities($row['client_type']);
|
||||
$location_id = $row['location_id'];
|
||||
$location_country = htmlentities($row['location_country']);
|
||||
$location_address = htmlentities($row['location_address']);
|
||||
$location_city = htmlentities($row['location_city']);
|
||||
$location_state = htmlentities($row['location_state']);
|
||||
$location_zip = htmlentities($row['location_zip']);
|
||||
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";
|
||||
}
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
||||
$contact_extension = htmlentities($row['contact_extension']);
|
||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
$client_website = htmlentities($row['client_website']);
|
||||
$client_currency_code = htmlentities($row['client_currency_code']);
|
||||
$client_net_terms = htmlentities($row['client_net_terms']);
|
||||
$client_referral = htmlentities($row['client_referral']);
|
||||
$client_notes = htmlentities($row['client_notes']);
|
||||
$client_created_at = date('Y-m-d', strtotime($row['client_created_at']));
|
||||
$client_updated_at = $row['client_updated_at'];
|
||||
$client_archive_at = $row['client_archived_at'];
|
||||
|
||||
} ?>
|
||||
//Client Tags
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
$client_tag_name_display_array = array();
|
||||
$client_tag_id_array = array();
|
||||
$sql_client_tags = mysqli_query($mysqli, "SELECT * FROM client_tags LEFT JOIN tags ON client_tags.tag_id = tags.tag_id WHERE client_tags.client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql_client_tags)) {
|
||||
|
||||
$client_tag_id = $row['tag_id'];
|
||||
$client_tag_name = htmlentities($row['tag_name']);
|
||||
$client_tag_color = htmlentities($row['tag_color']);
|
||||
$client_tag_icon = htmlentities($row['tag_icon']);
|
||||
if (empty($client_tag_icon)) {
|
||||
$client_tag_icon = "tag";
|
||||
}
|
||||
|
||||
$client_tag_id_array[] = $client_tag_id;
|
||||
if (empty($client_tag_color)) {
|
||||
$client_tag_name_display_array[] = "<small class='text-secondary'>$client_tag_name</small> ";
|
||||
} else {
|
||||
$client_tag_name_display_array[] = "<span class='badge bg-$client_tag_color'><i class='fa fa-fw fa-$client_tag_icon'></i> $client_tag_name</span> ";
|
||||
}
|
||||
}
|
||||
$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' ");
|
||||
$row = mysqli_fetch_array($sql_invoice_amounts);
|
||||
|
||||
$invoice_amounts = $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 = $client_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
|
||||
$amount_paid = $row['amount_paid'];
|
||||
|
||||
$balance = $invoice_amounts - $amount_paid;
|
||||
//set Text color on balance
|
||||
if ($balance > 0) {
|
||||
$balance_text_color = "text-danger font-weight-bold";
|
||||
} else {
|
||||
$balance_text_color = "";
|
||||
}
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_monthly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'month' AND recurring_client_id = $client_id AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
|
||||
$recurring_monthly_total = $row['recurring_monthly_total'];
|
||||
|
||||
//Get Yearly Recurring Total
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_yearly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'year' AND recurring_client_id = $client_id AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
|
||||
$recurring_yearly_total = $row['recurring_yearly_total'] / 12;
|
||||
|
||||
$recurring_monthly = $recurring_monthly_total + $recurring_yearly_total;
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><a href="client_overview.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></strong>
|
||||
<?php
|
||||
if (!empty($client_type)) {
|
||||
?>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $client_type; ?></small>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (!empty($client_tags_display)) { ?>
|
||||
<br>
|
||||
<?php echo $client_tags_display; ?>
|
||||
<?php } ?>
|
||||
<br>
|
||||
<small class="text-secondary"><strong>Created:</strong> <?php echo $client_created_at; ?></small>
|
||||
</td>
|
||||
<td><?php echo $location_address_display; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if (empty($contact_name) && empty($contact_phone) && empty($contact_mobile) && empty($client_email)) {
|
||||
echo "-";
|
||||
}
|
||||
|
||||
if (!empty($contact_name)) { ?>
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><strong><?php echo $contact_name; ?></strong>
|
||||
<br>
|
||||
<?php } else {
|
||||
echo "-";
|
||||
}
|
||||
|
||||
if (!empty($contact_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $contact_phone; ?> <?php if (!empty($contact_extension)) { echo "x$contact_extension"; } ?>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
if (!empty($contact_mobile)) { ?>
|
||||
<i class="fa fa-fw fa-mobile-alt text-secondary mr-2"></i><?php echo $contact_mobile; ?>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
if (!empty($contact_email)) { ?>
|
||||
<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>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
<!-- Show Billing for Admin/Accountant roles only and if accounting module is enabled -->
|
||||
<?php if ($session_user_role == 3 || $session_user_role == 1 && $config_module_enable_accounting == 1) { ?>
|
||||
<td class="text-right">
|
||||
<span class="text-secondary">Balance</span> <span class="<?php echo $balance_text_color; ?>"><?php echo numfmt_format_currency($currency_format, $balance, $session_company_currency); ?></span>
|
||||
<br>
|
||||
<span class="text-secondary">Paid</span> <?php echo numfmt_format_currency($currency_format, $amount_paid, $session_company_currency); ?>
|
||||
<br>
|
||||
<span class="text-secondary">Monthly</span> <?php echo numfmt_format_currency($currency_format, $recurring_monthly, $session_company_currency); ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Show actions for Admin role only -->
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_client=<?php echo $client_id; ?>">Archive</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="#" data-toggle="modal" data-target="#deleteClientModal<?php echo $client_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
require("client_edit_modal.php");
|
||||
require("client_delete_modal.php");
|
||||
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once("client_add_modal.php");
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@ if (!empty($_GET['sb'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM companies, settings
|
||||
WHERE companies.company_id = settings.company_id
|
||||
AND (company_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM companies, settings
|
||||
WHERE companies.company_id = settings.company_id
|
||||
AND (company_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
@ -73,7 +75,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$company_initials = htmlentities(initials($company_name));
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
|
|
@ -81,11 +82,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editCompanyModal<?php echo $company_id; ?>">
|
||||
<?php if (!empty($company_logo)) { ?>
|
||||
<img height="48" width="48" class="img-fluid rounded-circle" src="<?php echo "uploads/settings/$company_id/$company_logo"; ?>">
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
<span class="fa-stack fa-2x">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $company_initials; ?></span>
|
||||
</span>
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $company_initials; ?></span>
|
||||
</span>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
|||
55
cron.php
55
cron.php
|
|
@ -5,7 +5,7 @@ require_once("functions.php");
|
|||
|
||||
$sql_companies = mysqli_query($mysqli, "SELECT * FROM companies, settings WHERE companies.company_id = settings.company_id");
|
||||
|
||||
while($row = mysqli_fetch_array($sql_companies)){
|
||||
while ($row = mysqli_fetch_array($sql_companies)) {
|
||||
$company_id = $row['company_id'];
|
||||
$company_name = $row['company_name'];
|
||||
$company_phone = formatPhoneNumber($row['company_phone']);
|
||||
|
|
@ -127,7 +127,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
|
||||
$domainAlertArray = [1,7,14,30,90,120];
|
||||
|
||||
foreach($domainAlertArray as $day){
|
||||
foreach ($domainAlertArray as $day) {
|
||||
|
||||
//Get Domains Expiring
|
||||
$sql = mysqli_query(
|
||||
|
|
@ -138,7 +138,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
AND domains.company_id = $company_id"
|
||||
);
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$domain_id = $row['domain_id'];
|
||||
$domain_name = mysqli_real_escape_string($mysqli, $row['domain_name']);
|
||||
$domain_expire = $row['domain_expire'];
|
||||
|
|
@ -155,7 +155,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
|
||||
$certificateAlertArray = [1,7,14,30,90,120];
|
||||
|
||||
foreach($certificateAlertArray as $day){
|
||||
foreach ($certificateAlertArray as $day) {
|
||||
|
||||
//Get Certs Expiring
|
||||
$sql = mysqli_query(
|
||||
|
|
@ -166,7 +166,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
AND certificates.company_id = $company_id"
|
||||
);
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$certificate_id = $row['certificate_id'];
|
||||
$certificate_name = mysqli_real_escape_string($mysqli, $row['certificate_name']);
|
||||
$certificate_domain = $row['certificate_domain'];
|
||||
|
|
@ -184,18 +184,18 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
|
||||
$warranty_alert_array = [1,7,14,30,90,120];
|
||||
|
||||
foreach($warranty_alert_array as $day){
|
||||
foreach ($warranty_alert_array as $day) {
|
||||
|
||||
//Get Asset Warranty Expiring
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
"SELECT * FROM assets
|
||||
LEFT JOIN clients ON asset_client_id = client_id
|
||||
WHERE asset_warranty_expire = CURDATE() + INTERVAL $day DAY
|
||||
AND assets.company_id = $company_id"
|
||||
);
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = $row['asset_id'];
|
||||
$asset_name = mysqli_real_escape_string($mysqli, $row['asset_name']);
|
||||
$asset_warranty_expire = $row['asset_warranty_expire'];
|
||||
|
|
@ -217,8 +217,8 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
// Get scheduled tickets for today
|
||||
$sql_scheduled_tickets = mysqli_query($mysqli, "SELECT * FROM scheduled_tickets WHERE scheduled_ticket_next_run = '$today_text'");
|
||||
|
||||
if(mysqli_num_rows($sql_scheduled_tickets) > 0){
|
||||
while($row = mysqli_fetch_array($sql_scheduled_tickets)){
|
||||
if (mysqli_num_rows($sql_scheduled_tickets) > 0) {
|
||||
while ($row = mysqli_fetch_array($sql_scheduled_tickets)) {
|
||||
$schedule_id = $row['scheduled_ticket_id'];
|
||||
$subject = mysqli_real_escape_string($mysqli, $row['scheduled_ticket_subject']);
|
||||
$details = mysqli_real_escape_string($mysqli, $row['scheduled_ticket_details']);
|
||||
|
|
@ -246,11 +246,14 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
if (!empty($config_smtp_host) && $config_ticket_client_general_notifications == 1) {
|
||||
|
||||
// Get contact/ticket/company details
|
||||
$sql = mysqli_query($mysqli, "SELECT contact_name, contact_email, ticket_prefix, ticket_number, ticket_subject, company_phone FROM tickets
|
||||
LEFT JOIN clients ON ticket_client_id = client_id
|
||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||
LEFT JOIN companies ON tickets.company_id = companies.company_id
|
||||
WHERE ticket_id = $id AND tickets.company_id = $company_id");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT contact_name, contact_email, ticket_prefix, ticket_number, ticket_subject, company_phone FROM tickets
|
||||
LEFT JOIN clients ON ticket_client_id = client_id
|
||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||
LEFT JOIN companies ON tickets.company_id = companies.company_id
|
||||
WHERE ticket_id = $id AND tickets.company_id = $company_id"
|
||||
);
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$contact_name = $row['contact_name'];
|
||||
|
|
@ -261,7 +264,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
$company_phone = formatPhoneNumber($row['company_phone']);
|
||||
|
||||
// Verify contact email is valid
|
||||
if(filter_var($contact_email, FILTER_VALIDATE_EMAIL)){
|
||||
if (filter_var($contact_email, FILTER_VALIDATE_EMAIL)) {
|
||||
|
||||
$subject = "Ticket created - [$ticket_prefix$ticket_number] - $ticket_subject (scheduled)";
|
||||
$body = "<i style='color: #808080'>#--itflow--#</i><br><br>Hello, $contact_name<br><br>A ticket regarding \"$ticket_subject\" has been automatically created for you.<br><br>--------------------------------<br>$details--------------------------------<br><br>Ticket: $ticket_prefix$ticket_number<br>Subject: $ticket_subject<br>Status: Open<br>Portal: https://$config_base_url/portal/ticket.php?id=$id<br><br>~<br>$company_name<br>Support Department<br>$config_ticket_from_email<br>$company_phone";
|
||||
|
|
@ -289,24 +292,24 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
}
|
||||
|
||||
// Set the next run date
|
||||
if($frequency == "weekly"){
|
||||
if ($frequency == "weekly") {
|
||||
// Note: We seemingly have to initialize a new datetime for each loop to avoid stacking the dates
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('1 week'));
|
||||
}
|
||||
elseif($frequency == "monthly"){
|
||||
elseif ($frequency == "monthly") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('1 month'));
|
||||
}
|
||||
elseif($frequency == "quarterly"){
|
||||
elseif ($frequency == "quarterly") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('3 months'));
|
||||
}
|
||||
elseif($frequency == "biannually"){
|
||||
elseif ($frequency == "biannually") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('6 months'));
|
||||
}
|
||||
elseif($frequency == "annually"){
|
||||
elseif ($frequency == "annually") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('12 months'));
|
||||
}
|
||||
|
|
@ -323,7 +326,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
//$invoiceAlertArray = [$config_invoice_overdue_reminders];
|
||||
$invoiceAlertArray = [30,60,90,120,150,180,210,240,270,300,330,360,390,420,450,480,510,540,570,590,620];
|
||||
|
||||
foreach($invoiceAlertArray as $day){
|
||||
foreach ($invoiceAlertArray as $day) {
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
|
|
@ -338,7 +341,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
ORDER BY invoice_number DESC"
|
||||
);
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$invoice_id = $row['invoice_id'];
|
||||
$invoice_prefix = $row['invoice_prefix'];
|
||||
$invoice_number = $row['invoice_number'];
|
||||
|
|
@ -392,7 +395,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
//Loop through all recurring that match today's date and is active
|
||||
$sql_recurring = mysqli_query($mysqli, "SELECT * FROM recurring LEFT JOIN clients ON client_id = recurring_client_id WHERE recurring_next_date = CURDATE() AND recurring_status = 1 AND recurring.company_id = $company_id");
|
||||
|
||||
while($row = mysqli_fetch_array($sql_recurring)){
|
||||
while ($row = mysqli_fetch_array($sql_recurring)) {
|
||||
$recurring_id = $row['recurring_id'];
|
||||
$recurring_scope = $row['recurring_scope'];
|
||||
$recurring_frequency = $row['recurring_frequency'];
|
||||
|
|
@ -427,7 +430,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
//Copy Items from original recurring invoice to new invoice
|
||||
$sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_recurring_id = $recurring_id ORDER BY item_id ASC");
|
||||
|
||||
while($row = mysqli_fetch_array($sql_invoice_items)){
|
||||
while ($row = mysqli_fetch_array($sql_invoice_items)) {
|
||||
$item_id = $row['item_id'];
|
||||
$item_name = mysqli_real_escape_string($mysqli, $row['item_name']); //SQL Escape incase of ,
|
||||
$item_description = mysqli_real_escape_string($mysqli, $row['item_description']); //SQL Escape incase of ,
|
||||
|
|
@ -451,7 +454,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
|||
|
||||
mysqli_query($mysqli, "UPDATE recurring SET recurring_last_sent = CURDATE(), recurring_next_date = DATE_ADD(CURDATE(), INTERVAL 1 $recurring_frequency), recurring_updated_at = NOW() WHERE recurring_id = $recurring_id");
|
||||
|
||||
if($config_recurring_auto_send_invoice == 1){
|
||||
if ($config_recurring_auto_send_invoice == 1) {
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM invoices
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ TODO:
|
|||
- Support for authenticating with OAuth
|
||||
- Separate Mailbox Account for tickets 2022-12-14 - JQ
|
||||
|
||||
Relate PRs to https://github.com/itflow-org/itflow/issues/225 & https://forum.itflow.org/d/11-road-map & https://forum.itflow.org/d/31-tickets-from-email
|
||||
*/
|
||||
|
||||
// Get ITFlow config & helper functions
|
||||
|
|
@ -130,7 +129,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message)
|
|||
$message = "<i>Email from: $from_email at $date:-</i> <br><br>$message";
|
||||
|
||||
// Lookup the ticket ID
|
||||
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT ticket_id, ticket_subject, ticket_status, ticket_contact_id, ticket_client_id, tickets.company_id, contact_email
|
||||
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT ticket_id, ticket_subject, ticket_status, ticket_contact_id, ticket_client_id, tickets.company_id, contact_email
|
||||
FROM tickets
|
||||
LEFT JOIN contacts on tickets.ticket_contact_id = contacts.contact_id
|
||||
WHERE ticket_number = '$ticket_number' LIMIT 1"));
|
||||
|
|
@ -220,7 +219,7 @@ if ($emails) {
|
|||
rsort($emails);
|
||||
|
||||
// Loop through each email
|
||||
foreach($emails as $email) {
|
||||
foreach ($emails as $email) {
|
||||
|
||||
// Default false
|
||||
$email_processed = false;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php include("inc_all.php");
|
||||
<?php
|
||||
require_once("inc_all.php");
|
||||
|
||||
// Enforce accountant / admin role for the financial dashboard
|
||||
if ($_SESSION['user_role'] != 3 && $_SESSION['user_role'] != 1) {
|
||||
|
|
@ -12,8 +13,10 @@ if (isset($_GET['year'])) {
|
|||
}
|
||||
|
||||
//GET unique years from expenses, payments invoices and revenues
|
||||
$sql_years_select = mysqli_query($mysqli, "SELECT YEAR(expense_date) AS all_years FROM expenses WHERE company_id = $session_company_id
|
||||
UNION DISTINCT SELECT YEAR(payment_date) FROM payments WHERE company_id = $session_company_id
|
||||
$sql_years_select = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT YEAR(expense_date) AS all_years FROM expenses WHERE company_id = $session_company_id
|
||||
UNION DISTINCT SELECT YEAR(payment_date) FROM payments WHERE company_id = $session_company_id
|
||||
UNION DISTINCT SELECT YEAR(revenue_date) FROM revenues WHERE company_id = $session_company_id
|
||||
UNION DISTINCT SELECT YEAR(invoice_date) FROM invoices WHERE company_id = $session_company_id
|
||||
ORDER BY all_years DESC
|
||||
|
|
@ -60,8 +63,8 @@ $sql_accounts = mysqli_query($mysqli, "SELECT * FROM accounts WHERE company_id =
|
|||
|
||||
$sql_latest_invoice_payments = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM payments, invoices, clients
|
||||
WHERE payment_invoice_id = invoice_id
|
||||
"SELECT * FROM payments, invoices, clients
|
||||
WHERE payment_invoice_id = invoice_id
|
||||
AND invoice_client_id = client_id
|
||||
AND clients.company_id = $session_company_id
|
||||
ORDER BY payment_id DESC LIMIT 5"
|
||||
|
|
@ -69,8 +72,8 @@ $sql_latest_invoice_payments = mysqli_query(
|
|||
|
||||
$sql_latest_expenses = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM expenses, vendors, categories
|
||||
WHERE expense_vendor_id = vendor_id
|
||||
"SELECT * FROM expenses, vendors, categories
|
||||
WHERE expense_vendor_id = vendor_id
|
||||
AND expense_category_id = category_id
|
||||
AND expenses.company_id = $session_company_id
|
||||
ORDER BY expense_id DESC LIMIT 5"
|
||||
|
|
@ -461,7 +464,8 @@ $vendors_added = $row['vendors_added'];
|
|||
</div>
|
||||
</div> <!-- row -->
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php require_once("footer.php"); ?>
|
||||
|
||||
<script>
|
||||
// Set new default font family and font color to mimic Bootstrap's default styling
|
||||
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||
|
|
|
|||
22
expenses.php
22
expenses.php
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
require_once("inc_all.php");
|
||||
|
||||
//$o = "DESC";
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
|
|
@ -58,15 +56,17 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM expenses
|
||||
LEFT JOIN categories ON expense_category_id = category_id
|
||||
LEFT JOIN vendors ON expense_vendor_id = vendor_id
|
||||
LEFT JOIN accounts ON expense_account_id = account_id
|
||||
WHERE expenses.company_id = $session_company_id
|
||||
AND expense_vendor_id > 0
|
||||
AND DATE(expense_date) BETWEEN '$dtf' AND '$dtt'
|
||||
AND (vendor_name LIKE '%$q%' OR category_name LIKE '%$q%' OR account_name LIKE '%$q%' OR expense_description LIKE '%$q%' OR expense_amount LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM expenses
|
||||
LEFT JOIN categories ON expense_category_id = category_id
|
||||
LEFT JOIN vendors ON expense_vendor_id = vendor_id
|
||||
LEFT JOIN accounts ON expense_account_id = account_id
|
||||
WHERE expenses.company_id = $session_company_id
|
||||
AND expense_vendor_id > 0
|
||||
AND DATE(expense_date) BETWEEN '$dtf' AND '$dtt'
|
||||
AND (vendor_name LIKE '%$q%' OR category_name LIKE '%$q%' OR account_name LIKE '%$q%' OR expense_description LIKE '%$q%' OR expense_amount LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
|
|||
|
|
@ -5,33 +5,33 @@ if (!empty($_SESSION['alert_message'])) {
|
|||
if (!isset($_SESSION['alert_type'])) {
|
||||
$_SESSION['alert_type'] = "success";
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
toastr.options = {
|
||||
"closeButton": false,
|
||||
"debug": false,
|
||||
"newestOnTop": false,
|
||||
"progressBar": false,
|
||||
"positionClass": "toast-top-center",
|
||||
"preventDuplicates": false,
|
||||
"onclick": null,
|
||||
"showDuration": "300",
|
||||
"hideDuration": "1000",
|
||||
"timeOut": "5000",
|
||||
"extendedTimeOut": "1000",
|
||||
"showEasing": "swing",
|
||||
"hideEasing": "linear",
|
||||
"showMethod": "fadeIn",
|
||||
"hideMethod": "fadeOut"
|
||||
}
|
||||
toastr.options = {
|
||||
"closeButton": false,
|
||||
"debug": false,
|
||||
"newestOnTop": false,
|
||||
"progressBar": false,
|
||||
"positionClass": "toast-top-center",
|
||||
"preventDuplicates": false,
|
||||
"onclick": null,
|
||||
"showDuration": "300",
|
||||
"hideDuration": "1000",
|
||||
"timeOut": "5000",
|
||||
"extendedTimeOut": "1000",
|
||||
"showEasing": "swing",
|
||||
"hideEasing": "linear",
|
||||
"showMethod": "fadeIn",
|
||||
"hideMethod": "fadeOut"
|
||||
}
|
||||
|
||||
toastr["<?php echo $_SESSION['alert_type']; ?>"]("<?php echo $_SESSION['alert_message']; ?>")
|
||||
toastr["<?php echo $_SESSION['alert_type']; ?>"]("<?php echo $_SESSION['alert_message']; ?>")
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
unset($_SESSION['alert_type']);
|
||||
unset($_SESSION['alert_message']);
|
||||
|
|
@ -43,4 +43,4 @@ if (empty($_SESSION['records_per_page'])) {
|
|||
$_SESSION['records_per_page'] = 10;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -7,240 +7,243 @@ require_once("header.php");
|
|||
require_once("top_nav.php");
|
||||
|
||||
if (isset($_GET['client_id'])) {
|
||||
$client_id = intval($_GET['client_id']);
|
||||
$client_id = intval($_GET['client_id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "UPDATE clients SET client_accessed_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
|
||||
$sql = mysqli_query($mysqli, "UPDATE clients SET client_accessed_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM clients
|
||||
LEFT JOIN locations ON primary_location = location_id AND location_archived_at IS NULL
|
||||
LEFT JOIN contacts ON primary_contact = contact_id AND contact_archived_at IS NULL
|
||||
WHERE client_id = $client_id
|
||||
AND clients.company_id = $session_company_id");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM clients
|
||||
LEFT JOIN locations ON primary_location = location_id AND location_archived_at IS NULL
|
||||
LEFT JOIN contacts ON primary_contact = contact_id AND contact_archived_at IS NULL
|
||||
WHERE client_id = $client_id
|
||||
AND clients.company_id = $session_company_id"
|
||||
);
|
||||
|
||||
if (mysqli_num_rows($sql) == 0) {
|
||||
include("header.php");
|
||||
echo "<center><h1 class='text-secondary mt-5'>Nothing to see here</h1></center>";
|
||||
} else {
|
||||
if (mysqli_num_rows($sql) == 0) {
|
||||
require_once("header.php");
|
||||
echo "<center><h1 class='text-secondary mt-5'>Nothing to see here</h1></center>";
|
||||
} else {
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_type = htmlentities($row['client_type']);
|
||||
$client_website = htmlentities($row['client_website']);
|
||||
$client_referral = htmlentities($row['client_referral']);
|
||||
$client_currency_code = htmlentities($row['client_currency_code']);
|
||||
$client_net_terms = $row['client_net_terms'];
|
||||
if ($client_net_terms == 0) {
|
||||
$client_net_terms = $config_default_net_terms;
|
||||
}
|
||||
$client_notes = htmlentities($row['client_notes']);
|
||||
$client_created_at = $row['client_created_at'];
|
||||
$primary_contact = $row['primary_contact'];
|
||||
$primary_location = $row['primary_location'];
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
$contact_phone = $row['contact_phone'];
|
||||
$contact_extension = $row['contact_extension'];
|
||||
$contact_mobile = $row['contact_mobile'];
|
||||
$location_id = $row['location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
$location_address = htmlentities($row['location_address']);
|
||||
$location_city = htmlentities($row['location_city']);
|
||||
$location_state = htmlentities($row['location_state']);
|
||||
$location_zip = htmlentities($row['location_zip']);
|
||||
$location_country = htmlentities($row['location_country']);
|
||||
$location_phone = $row['location_phone'];
|
||||
|
||||
//Client Tags
|
||||
|
||||
$client_tag_name_display_array = array();
|
||||
$client_tag_id_array = array();
|
||||
$sql_client_tags = mysqli_query($mysqli, "SELECT * FROM client_tags LEFT JOIN tags ON client_tags.tag_id = tags.tag_id WHERE client_tags.client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql_client_tags)) {
|
||||
|
||||
$client_tag_id = $row['tag_id'];
|
||||
$client_tag_name = htmlentities($row['tag_name']);
|
||||
$client_tag_color = htmlentities($row['tag_color']);
|
||||
$client_tag_icon = htmlentities($row['tag_icon']);
|
||||
if (empty($client_tag_icon)) {
|
||||
$client_tag_icon = "tag";
|
||||
}
|
||||
|
||||
$client_tag_id_array[] = $client_tag_id;
|
||||
$client_tag_name_display_array[] = "$client_tag_name ";
|
||||
}
|
||||
$client_tags_display = "<i class='fa fa-fw fa-tag text-secondary ml-1 mr-2 mb-2'></i> " . 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'");
|
||||
$row = mysqli_fetch_array($sql_invoice_amounts);
|
||||
|
||||
$invoice_amounts = $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 = $client_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
|
||||
$amount_paid = $row['amount_paid'];
|
||||
|
||||
$balance = $invoice_amounts - $amount_paid;
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_monthly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'month' AND recurring_client_id = $client_id AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
|
||||
$recurring_monthly_total = $row['recurring_monthly_total'];
|
||||
|
||||
//Get Yearly Recurring Total
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_yearly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'year' AND recurring_client_id = $client_id AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
|
||||
$recurring_yearly_total = $row['recurring_yearly_total'] / 12;
|
||||
|
||||
$recurring_monthly = $recurring_monthly_total + $recurring_yearly_total;
|
||||
|
||||
//Badge Counts
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('contact_id') AS num FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id"));
|
||||
$num_contacts = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('location_id') AS num FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id"));
|
||||
$num_locations = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('asset_id') AS num FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||
$num_assets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_status != 'Closed' AND ticket_client_id = $client_id"));
|
||||
$num_active_tickets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_status = 'Closed' AND ticket_client_id = $client_id"));
|
||||
$num_closed_tickets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('service_id') AS num FROM services WHERE service_client_id = $client_id"));
|
||||
$num_services = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('vendor_id') AS num FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id AND vendor_template = 0"));
|
||||
$num_vendors = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('login_id') AS num FROM logins WHERE login_archived_at IS NULL AND login_client_id = $client_id"));
|
||||
$num_logins = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('network_id') AS num FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id"));
|
||||
$num_networks = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('domain_id') AS num FROM domains WHERE domain_archived_at IS NULL AND domain_client_id = $client_id"));
|
||||
$num_domains = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('certificate_id') AS num FROM certificates WHERE certificate_archived_at IS NULL AND certificate_client_id = $client_id"));
|
||||
$num_certificates = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('software_id') AS num FROM software WHERE software_archived_at IS NULL AND software_client_id = $client_id"));
|
||||
$num_software = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE (invoice_status = 'Sent' OR invoice_status = 'Viewed' OR invoice_status = 'Partial') AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_open = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Draft' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_draft = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Sent' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_sent = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Viewed' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_viewed = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Partial' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_partial = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Paid' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_paid = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('quote_id') AS num FROM quotes WHERE quote_archived_at IS NULL AND quote_client_id = $client_id"));
|
||||
$num_quotes = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('recurring_id') AS num FROM recurring WHERE recurring_archived_at IS NULL AND recurring_client_id = $client_id"));
|
||||
$num_recurring = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('payment_id') AS num FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_client_id = $client_id"));
|
||||
$num_payments = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('file_id') AS num FROM files WHERE file_archived_at IS NULL AND file_client_id = $client_id"));
|
||||
$num_files = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('document_id') AS num FROM documents WHERE document_archived_at IS NULL AND document_client_id = $client_id"));
|
||||
$num_documents = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('event_id') AS num FROM events WHERE event_client_id = $client_id"));
|
||||
$num_events = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('trip_id') AS num FROM trips WHERE trip_archived_at IS NULL AND trip_client_id = $client_id"));
|
||||
$num_trips = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('item_id') AS num FROM shared_items WHERE item_client_id = $client_id"));
|
||||
$num_shared_links = $row['num'];
|
||||
|
||||
// Expiring Items
|
||||
|
||||
// Count Domains Expiring within 30 Days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('domain_id') AS num FROM domains
|
||||
WHERE domain_client_id = $client_id
|
||||
AND domain_expire != '0000-00-00'
|
||||
AND domain_expire < CURRENT_DATE + INTERVAL 30 DAY
|
||||
AND domain_archived_at IS NULL
|
||||
AND company_id = $session_company_id"
|
||||
));
|
||||
$num_domains_expiring = $row['num'];
|
||||
|
||||
// Count Certificates Expiring within 30 Days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('certificate_id') AS num FROM certificates
|
||||
WHERE certificate_client_id = $client_id
|
||||
AND certificate_expire != '0000-00-00'
|
||||
AND certificate_expire < CURRENT_DATE + INTERVAL 30 DAY
|
||||
AND certificate_archived_at IS NULL
|
||||
AND company_id = $session_company_id"
|
||||
));
|
||||
$num_certs_expiring = $row['num'];
|
||||
|
||||
// Get Asset Warranties Expiring
|
||||
$sql_asset_warranties_expiring = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_warranty_expire != '0000-00-00'
|
||||
AND asset_archived_at IS NULL
|
||||
AND asset_warranty_expire < CURRENT_DATE + INTERVAL 90 DAY
|
||||
AND company_id = $session_company_id ORDER BY asset_warranty_expire DESC"
|
||||
);
|
||||
|
||||
// Get Assets Retiring
|
||||
$sql_asset_retire = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_install_date != '0000-00-00'
|
||||
AND asset_archived_at IS NULL
|
||||
AND asset_install_date + INTERVAL 7 YEAR < CURRENT_DATE + INTERVAL 90 DAY
|
||||
AND company_id = $session_company_id ORDER BY asset_install_date DESC"
|
||||
);
|
||||
|
||||
// Get Stale Tickets
|
||||
$sql_tickets_stale = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM tickets
|
||||
WHERE ticket_client_id = $client_id
|
||||
AND ticket_created_at < CURRENT_DATE - INTERVAL 14 DAY
|
||||
AND ticket_status != 'Closed'
|
||||
AND company_id = $session_company_id ORDER BY ticket_created_at DESC"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_type = htmlentities($row['client_type']);
|
||||
$client_website = htmlentities($row['client_website']);
|
||||
$client_referral = htmlentities($row['client_referral']);
|
||||
$client_currency_code = htmlentities($row['client_currency_code']);
|
||||
$client_net_terms = $row['client_net_terms'];
|
||||
if ($client_net_terms == 0) {
|
||||
$client_net_terms = $config_default_net_terms;
|
||||
}
|
||||
$client_notes = htmlentities($row['client_notes']);
|
||||
$client_created_at = $row['client_created_at'];
|
||||
$primary_contact = $row['primary_contact'];
|
||||
$primary_location = $row['primary_location'];
|
||||
$contact_id = $row['contact_id'];
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
$contact_phone = $row['contact_phone'];
|
||||
$contact_extension = $row['contact_extension'];
|
||||
$contact_mobile = $row['contact_mobile'];
|
||||
$location_id = $row['location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
$location_address = htmlentities($row['location_address']);
|
||||
$location_city = htmlentities($row['location_city']);
|
||||
$location_state = htmlentities($row['location_state']);
|
||||
$location_zip = htmlentities($row['location_zip']);
|
||||
$location_country = htmlentities($row['location_country']);
|
||||
$location_phone = $row['location_phone'];
|
||||
|
||||
//Client Tags
|
||||
|
||||
$client_tag_name_display_array = array();
|
||||
$client_tag_id_array = array();
|
||||
$sql_client_tags = mysqli_query($mysqli, "SELECT * FROM client_tags LEFT JOIN tags ON client_tags.tag_id = tags.tag_id WHERE client_tags.client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql_client_tags)) {
|
||||
|
||||
$client_tag_id = $row['tag_id'];
|
||||
$client_tag_name = htmlentities($row['tag_name']);
|
||||
$client_tag_color = htmlentities($row['tag_color']);
|
||||
$client_tag_icon = htmlentities($row['tag_icon']);
|
||||
if (empty($client_tag_icon)) {
|
||||
$client_tag_icon = "tag";
|
||||
}
|
||||
|
||||
$client_tag_id_array[] = $client_tag_id;
|
||||
$client_tag_name_display_array[] = "$client_tag_name ";
|
||||
}
|
||||
$client_tags_display = "<i class='fa fa-fw fa-tag text-secondary ml-1 mr-2 mb-2'></i> " . 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'");
|
||||
$row = mysqli_fetch_array($sql_invoice_amounts);
|
||||
|
||||
$invoice_amounts = $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 = $client_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
|
||||
$amount_paid = $row['amount_paid'];
|
||||
|
||||
$balance = $invoice_amounts - $amount_paid;
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_monthly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'month' AND recurring_client_id = $client_id AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
|
||||
$recurring_monthly_total = $row['recurring_monthly_total'];
|
||||
|
||||
//Get Yearly Recurring Total
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_yearly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'year' AND recurring_client_id = $client_id AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
|
||||
$recurring_yearly_total = $row['recurring_yearly_total'] / 12;
|
||||
|
||||
$recurring_monthly = $recurring_monthly_total + $recurring_yearly_total;
|
||||
|
||||
//Badge Counts
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('contact_id') AS num FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id"));
|
||||
$num_contacts = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('location_id') AS num FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id"));
|
||||
$num_locations = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('asset_id') AS num FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id"));
|
||||
$num_assets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_status != 'Closed' AND ticket_client_id = $client_id"));
|
||||
$num_active_tickets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_status = 'Closed' AND ticket_client_id = $client_id"));
|
||||
$num_closed_tickets = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('service_id') AS num FROM services WHERE service_client_id = $client_id"));
|
||||
$num_services = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('vendor_id') AS num FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id AND vendor_template = 0"));
|
||||
$num_vendors = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('login_id') AS num FROM logins WHERE login_archived_at IS NULL AND login_client_id = $client_id"));
|
||||
$num_logins = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('network_id') AS num FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id"));
|
||||
$num_networks = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('domain_id') AS num FROM domains WHERE domain_archived_at IS NULL AND domain_client_id = $client_id"));
|
||||
$num_domains = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('certificate_id') AS num FROM certificates WHERE certificate_archived_at IS NULL AND certificate_client_id = $client_id"));
|
||||
$num_certificates = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('software_id') AS num FROM software WHERE software_archived_at IS NULL AND software_client_id = $client_id"));
|
||||
$num_software = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE (invoice_status = 'Sent' OR invoice_status = 'Viewed' OR invoice_status = 'Partial') AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_open = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Draft' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_draft = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Sent' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_sent = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Viewed' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_viewed = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Partial' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_partial = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Paid' AND invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices_paid = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_archived_at IS NULL AND invoice_client_id = $client_id"));
|
||||
$num_invoices = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('quote_id') AS num FROM quotes WHERE quote_archived_at IS NULL AND quote_client_id = $client_id"));
|
||||
$num_quotes = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('recurring_id') AS num FROM recurring WHERE recurring_archived_at IS NULL AND recurring_client_id = $client_id"));
|
||||
$num_recurring = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('payment_id') AS num FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_client_id = $client_id"));
|
||||
$num_payments = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('file_id') AS num FROM files WHERE file_archived_at IS NULL AND file_client_id = $client_id"));
|
||||
$num_files = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('document_id') AS num FROM documents WHERE document_archived_at IS NULL AND document_client_id = $client_id"));
|
||||
$num_documents = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('event_id') AS num FROM events WHERE event_client_id = $client_id"));
|
||||
$num_events = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('trip_id') AS num FROM trips WHERE trip_archived_at IS NULL AND trip_client_id = $client_id"));
|
||||
$num_trips = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('item_id') AS num FROM shared_items WHERE item_client_id = $client_id"));
|
||||
$num_shared_links = $row['num'];
|
||||
|
||||
// Expiring Items
|
||||
|
||||
// Count Domains Expiring within 30 Days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('domain_id') AS num FROM domains
|
||||
WHERE domain_client_id = $client_id
|
||||
AND domain_expire != '0000-00-00'
|
||||
AND domain_expire < CURRENT_DATE + INTERVAL 30 DAY
|
||||
AND domain_archived_at IS NULL
|
||||
AND company_id = $session_company_id"
|
||||
));
|
||||
$num_domains_expiring = $row['num'];
|
||||
|
||||
// Count Certificates Expiring within 30 Days
|
||||
$row = mysqli_fetch_assoc(mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT COUNT('certificate_id') AS num FROM certificates
|
||||
WHERE certificate_client_id = $client_id
|
||||
AND certificate_expire != '0000-00-00'
|
||||
AND certificate_expire < CURRENT_DATE + INTERVAL 30 DAY
|
||||
AND certificate_archived_at IS NULL
|
||||
AND company_id = $session_company_id"
|
||||
));
|
||||
$num_certs_expiring = $row['num'];
|
||||
|
||||
// Get Asset Warranties Expiring
|
||||
$sql_asset_warranties_expiring = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_warranty_expire != '0000-00-00'
|
||||
AND asset_archived_at IS NULL
|
||||
AND asset_warranty_expire < CURRENT_DATE + INTERVAL 90 DAY
|
||||
AND company_id = $session_company_id ORDER BY asset_warranty_expire DESC"
|
||||
);
|
||||
|
||||
// Get Assets Retiring
|
||||
$sql_asset_retire = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM assets
|
||||
WHERE asset_client_id = $client_id
|
||||
AND asset_install_date != '0000-00-00'
|
||||
AND asset_archived_at IS NULL
|
||||
AND asset_install_date + INTERVAL 7 YEAR < CURRENT_DATE + INTERVAL 90 DAY
|
||||
AND company_id = $session_company_id ORDER BY asset_install_date DESC"
|
||||
);
|
||||
|
||||
// Get Stale Tickets
|
||||
$sql_tickets_stale = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM tickets
|
||||
WHERE ticket_client_id = $client_id
|
||||
AND ticket_created_at < CURRENT_DATE - INTERVAL 14 DAY
|
||||
AND ticket_status != 'Closed'
|
||||
AND company_id = $session_company_id ORDER BY ticket_created_at DESC"
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
require_once("client_side_nav.php");
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
|
||||
include("config.php");
|
||||
include_once("functions.php");
|
||||
include("check_login.php");
|
||||
include("header.php");
|
||||
include("top_nav.php");
|
||||
include("reports_side_nav.php");
|
||||
include("inc_wrapper.php");
|
||||
include("inc_alert_feedback.php");
|
||||
require_once("config.php");
|
||||
require_once("functions.php");
|
||||
require_once("check_login.php");
|
||||
require_once("header.php");
|
||||
require_once("top_nav.php");
|
||||
require_once("reports_side_nav.php");
|
||||
require_once("inc_wrapper.php");
|
||||
require_once("inc_alert_feedback.php");
|
||||
|
||||
// Set variable default values
|
||||
$largest_income_month = 0;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
|
||||
include("config.php");
|
||||
include_once("functions.php");
|
||||
include("check_login.php");
|
||||
require_once("config.php");
|
||||
require_once("functions.php");
|
||||
require_once("check_login.php");
|
||||
|
||||
validateAdminRole();
|
||||
|
||||
include("header.php");
|
||||
include("top_nav.php");
|
||||
include("settings_side_nav.php");
|
||||
include("inc_wrapper.php");
|
||||
include("inc_alert_feedback.php");
|
||||
include("pagination_head.php");
|
||||
require_once("header.php");
|
||||
require_once("top_nav.php");
|
||||
require_once("settings_side_nav.php");
|
||||
require_once("inc_wrapper.php");
|
||||
require_once("inc_alert_feedback.php");
|
||||
require_once("pagination_head.php");
|
||||
|
||||
|
|
|
|||
|
|
@ -7,123 +7,107 @@ $location_phone = formatPhoneNumber($location_phone);
|
|||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<h4 class="text-secondary"><strong><?php echo $client_name; ?></strong></h4>
|
||||
<?php if (!empty($location_address)) { ?>
|
||||
<a href="//maps.<?php echo $session_map_source; ?>.com/?q=<?php echo "$location_address $location_zip"; ?>" target="_blank">
|
||||
<div><i class="fa fa-fw fa-map-marker-alt text-secondary ml-1 mr-1"></i> <?php echo $location_address; ?></div>
|
||||
<div class="ml-4 mb-2"><?php echo "$location_city $location_state $location_zip"; ?></div>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (!empty($location_phone)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-phone text-secondary ml-1 mr-2 mb-2"></i> <a href="tel:<?php echo $location_phone?>"><?php echo $location_phone; ?></a>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($client_website)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-globe text-secondary ml-1 mr-2 mb-2"></i> <a target="_blank" href="//<?php echo $client_website; ?>"><?php echo $client_website; ?></a>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($client_tag_name_display_array)) {
|
||||
?>
|
||||
<?php echo $client_tags_display; ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md border-left">
|
||||
<h4 class="text-secondary">Primary Contact</h4>
|
||||
<?php
|
||||
if (!empty($contact_name)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-user text-secondary ml-1 mr-2 mb-2"></i> <?php echo $contact_name; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($contact_email)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-envelope text-secondary ml-1 mr-2 mb-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>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($contact_phone)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-phone text-secondary ml-1 mr-2 mb-2"></i> <a href="tel:<?php echo $contact_phone; ?>"><?php echo $contact_phone; ?> </a>
|
||||
<?php
|
||||
if (!empty($contact_extension)) {
|
||||
?>
|
||||
x<?php echo $contact_extension; ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($contact_mobile)) {
|
||||
?>
|
||||
<i class="fa fa-fw fa-mobile-alt text-secondary ml-1 mr-2 mb-2"></i> <a href="tel:<?php echo $contact_mobile; ?>"> <?php echo $contact_mobile; ?> </a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php if ($session_user_role == 1 || $session_user_role == 3 && $config_module_enable_accounting == 1) { ?>
|
||||
<div class="col-md border-left">
|
||||
<h4 class="text-secondary">Billing</h4>
|
||||
<h6 class="ml-1 text-secondary">Paid <div class="text-dark float-right"> <?php echo numfmt_format_currency($currency_format, $amount_paid, $client_currency_code); ?></div></h6>
|
||||
<h6 class="ml-1 text-secondary">Balance <div class="<?php if ($balance > 0) { echo "text-danger"; }else{ echo "text-dark"; } ?> float-right"> <?php echo numfmt_format_currency($currency_format, $balance, $client_currency_code); ?></div></h6>
|
||||
<h6 class="ml-1 text-secondary">Monthly Recurring <div class="text-dark float-right"> <?php echo numfmt_format_currency($currency_format, $recurring_monthly, $client_currency_code); ?></div></h6>
|
||||
<h6 class="ml-1 text-secondary">Net Terms <div class="text-dark float-right"><?php echo $client_net_terms; ?> <small class="text-secondary">Days</small></div></h6>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if ($config_module_enable_ticketing == 1) { ?>
|
||||
<div class="col-md border-left">
|
||||
<h4 class="text-secondary">Support</h4>
|
||||
<h6 class="ml-1 text-secondary">Open Tickets <div class="text-dark float-right"><?php echo $num_active_tickets; ?></div></h6>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-1 border-left">
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-dark btn-sm float-right" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="post.php?export_client_pdf=<?php echo $client_id; ?>" target="_blank">Export Data PDF<br><small class="text-secondary">(without passwords)</small></a>
|
||||
<a class="dropdown-item" href="post.php?export_client_pdf=<?php echo $client_id; ?>&passwords" target="_blank">Export Data PDF<br><small class="text-secondary">(with passwords)</small></a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">Edit Client</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_client=<?php echo $client_id; ?>">Archive Client</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="#" data-toggle="modal" data-target="#deleteClientModal<?php echo $client_id; ?>">Delete Client</a>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<h4 class="text-secondary"><strong><?php echo $client_name; ?></strong></h4>
|
||||
<?php if (!empty($location_address)) { ?>
|
||||
<a href="//maps.<?php echo $session_map_source; ?>.com/?q=<?php echo "$location_address $location_zip"; ?>" target="_blank">
|
||||
<div><i class="fa fa-fw fa-map-marker-alt text-secondary ml-1 mr-1"></i> <?php echo $location_address; ?></div>
|
||||
<div class="ml-4 mb-2"><?php echo "$location_city $location_state $location_zip"; ?></div>
|
||||
</a>
|
||||
<?php }
|
||||
|
||||
if (!empty($location_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary ml-1 mr-2 mb-2"></i> <a href="tel:<?php echo $location_phone?>"><?php echo $location_phone; ?></a>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
if (!empty($client_website)) { ?>
|
||||
<i class="fa fa-fw fa-globe text-secondary ml-1 mr-2 mb-2"></i> <a target="_blank" href="//<?php echo $client_website; ?>"><?php echo $client_website; ?></a>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
if (!empty($client_tag_name_display_array)) {
|
||||
echo $client_tags_display;
|
||||
} ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="col-md border-left">
|
||||
<h4 class="text-secondary">Primary Contact</h4>
|
||||
<?php
|
||||
|
||||
if (!empty($contact_name)) { ?>
|
||||
<i class="fa fa-fw fa-user text-secondary ml-1 mr-2 mb-2"></i> <?php echo $contact_name; ?>
|
||||
<br>
|
||||
<?php }
|
||||
|
||||
|
||||
if (!empty($contact_email)) { ?>
|
||||
<i class="fa fa-fw fa-envelope text-secondary ml-1 mr-2 mb-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>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
if (!empty($contact_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary ml-1 mr-2 mb-2"></i> <a href="tel:<?php echo $contact_phone; ?>"><?php echo $contact_phone; ?> </a>
|
||||
|
||||
<?php
|
||||
if (!empty($contact_extension)) {
|
||||
echo "x $contact_extension";
|
||||
}
|
||||
echo "<br>";
|
||||
}
|
||||
|
||||
if (!empty($contact_mobile)) { ?>
|
||||
<i class="fa fa-fw fa-mobile-alt text-secondary ml-1 mr-2 mb-2"></i> <a href="tel:<?php echo $contact_mobile; ?>"> <?php echo $contact_mobile; ?> </a>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<?php if ($session_user_role == 1 || $session_user_role == 3 && $config_module_enable_accounting == 1) { ?>
|
||||
<div class="col-md border-left">
|
||||
<h4 class="text-secondary">Billing</h4>
|
||||
<h6 class="ml-1 text-secondary">Paid <div class="text-dark float-right"> <?php echo numfmt_format_currency($currency_format, $amount_paid, $client_currency_code); ?></div></h6>
|
||||
<h6 class="ml-1 text-secondary">Balance <div class="<?php if ($balance > 0) { echo "text-danger"; }else{ echo "text-dark"; } ?> float-right"> <?php echo numfmt_format_currency($currency_format, $balance, $client_currency_code); ?></div></h6>
|
||||
<h6 class="ml-1 text-secondary">Monthly Recurring <div class="text-dark float-right"> <?php echo numfmt_format_currency($currency_format, $recurring_monthly, $client_currency_code); ?></div></h6>
|
||||
<h6 class="ml-1 text-secondary">Net Terms <div class="text-dark float-right"><?php echo $client_net_terms; ?> <small class="text-secondary">Days</small></div></h6>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($config_module_enable_ticketing == 1) { ?>
|
||||
<div class="col-md border-left">
|
||||
<h4 class="text-secondary">Support</h4>
|
||||
<h6 class="ml-1 text-secondary">Open Tickets <div class="text-dark float-right"><?php echo $num_active_tickets; ?></div></h6>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="col-md-1 border-left">
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-dark btn-sm float-right" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="post.php?export_client_pdf=<?php echo $client_id; ?>" target="_blank">Export Data PDF<br><small class="text-secondary">(without passwords)</small></a>
|
||||
<a class="dropdown-item" href="post.php?export_client_pdf=<?php echo $client_id; ?>&passwords" target="_blank">Export Data PDF<br><small class="text-secondary">(with passwords)</small></a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">Edit Client</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_client=<?php echo $client_id; ?>">Archive Client</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="#" data-toggle="modal" data-target="#deleteClientModal<?php echo $client_id; ?>">Delete Client</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_edit_modal.php");
|
||||
include("client_delete_modal.php");
|
||||
include("category_quick_add_modal.php");
|
||||
require_once("client_edit_modal.php");
|
||||
require_once("client_delete_modal.php");
|
||||
require_once("category_quick_add_modal.php");
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -119,14 +119,17 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM invoices
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM invoices
|
||||
LEFT JOIN clients ON invoice_client_id = client_id
|
||||
LEFT JOIN categories ON invoice_category_id = category_id
|
||||
WHERE invoices.company_id = $session_company_id
|
||||
AND (invoice_status LIKE '$status_query')
|
||||
AND DATE(invoice_date) BETWEEN '$dtf' AND '$dtt'
|
||||
AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR invoice_scope LIKE '%$q%' OR client_name LIKE '%$q%' OR invoice_status LIKE '%$q%' OR invoice_amount LIKE '%$q%' OR category_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR invoice_scope LIKE '%$q%' OR client_name LIKE '%$q%' OR invoice_status LIKE '%$q%' OR invoice_amount LIKE '%$q%' OR category_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ if (isset($_POST['login'])) {
|
|||
<p class="login-box-msg"><?php if (isset($response)) { echo $response; } ?></p>
|
||||
<form method="post">
|
||||
<div class="input-group mb-3" <?php if (isset($token_field)) { echo "hidden"; } ?>>
|
||||
<input type="text" class="form-control" placeholder="Agent Email" name="email" value="<?php if(isset($token_field)){ echo $email; }?>" required <?php if(!isset($token_field)){ echo "autofocus"; } ?> >
|
||||
<input type="text" class="form-control" placeholder="Agent Email" name="email" value="<?php if (isset($token_field)) { echo $email; }?>" required <?php if (!isset($token_field)) { echo "autofocus"; } ?> >
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
|
|
@ -264,7 +264,7 @@ if (isset($_POST['login'])) {
|
|||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-3" <?php if (isset($token_field)) { echo "hidden"; } ?>>
|
||||
<input type="password" class="form-control" placeholder="Agent Password" name="password" value="<?php if(isset($token_field)){ echo $password; } ?>" required>
|
||||
<input type="password" class="form-control" placeholder="Agent Password" name="password" value="<?php if (isset($token_field)) { echo $password; } ?>" required>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
|
|
|
|||
2
logs.php
2
logs.php
|
|
@ -176,7 +176,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<td><?php echo $log_description; ?></td>
|
||||
<td><?php echo $log_ip; ?></td>
|
||||
<td><?php echo "$log_user_os<br>$log_user_browser"; ?></td>
|
||||
<td><?php echo $log_entity_id; ?></td>
|
||||
<td><?php echo $log_entity_id; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -27,16 +27,18 @@ if (!empty($_GET['dtf'])) {
|
|||
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM notifications
|
||||
LEFT JOIN users ON notification_dismissed_by = user_id
|
||||
LEFT JOIN clients ON notification_client_id = client_id
|
||||
WHERE (notification_type LIKE '%$q%' OR notification LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt'
|
||||
AND (notification_user_id = $session_user_id OR notification_user_id = 0)
|
||||
AND notifications.company_id = $session_company_id
|
||||
AND notification_dismissed_at IS NOT NULL
|
||||
ORDER BY $sb $o
|
||||
LIMIT $record_from, $record_to
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM notifications
|
||||
LEFT JOIN users ON notification_dismissed_by = user_id
|
||||
LEFT JOIN clients ON notification_client_id = client_id
|
||||
WHERE (notification_type LIKE '%$q%' OR notification LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt'
|
||||
AND (notification_user_id = $session_user_id OR notification_user_id = 0)
|
||||
AND notifications.company_id = $session_company_id
|
||||
AND notification_dismissed_at IS NOT NULL
|
||||
ORDER BY $sb $o
|
||||
LIMIT $record_from, $record_to
|
||||
");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
|
@ -83,12 +85,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<table class="table table-hover">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_timestamp&o=<?php echo $disp; ?>">Timestamp <i class="fa fa-sort-numeric<?php if ($disp=='ASC') { echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_type&o=<?php echo $disp; ?>">Type <i class="fa fa-sort-alpha<?php if ($disp=='ASC') { echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification&o=<?php echo $disp; ?>">Notification <i class="fa fa-sort-alpha<?php if ($disp=='ASC') { echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client <i class="fa fa-sort-numeric<?php if ($disp=='ASC') { echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_dismissed_at&o=<?php echo $disp; ?>">Dismissed At <i class="fa fa-sort-numeric<?php if ($disp=='ASC') { echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">Dismissed By <i class="fa fa-sort-numeric<?php if ($disp=='ASC') { echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_timestamp&o=<?php echo $disp; ?>">Timestamp <i class="fa fa-sort-numeric<?php if ($disp=='ASC') { echo "-up"; } else { echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_type&o=<?php echo $disp; ?>">Type <i class="fa fa-sort-alpha<?php if ($disp=='ASC') { echo "-up"; } else { echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification&o=<?php echo $disp; ?>">Notification <i class="fa fa-sort-alpha<?php if ($disp=='ASC') { echo "-up"; } else { echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client <i class="fa fa-sort-numeric<?php if ($disp=='ASC') { echo "-up"; } else { echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_dismissed_at&o=<?php echo $disp; ?>">Dismissed At <i class="fa fa-sort-numeric<?php if ($disp=='ASC') { echo "-up"; } else { echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">Dismissed By <i class="fa fa-sort-numeric<?php if ($disp=='ASC') { echo "-up"; } else { echo "-down"; }?>"></i></a></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -96,30 +98,30 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$notification_id = $row['notification_id'];
|
||||
$notification_timestamp = $row['notification_timestamp'];
|
||||
$notification_type = htmlentities($row['notification_type']);
|
||||
$notification = htmlentities($row['notification']);
|
||||
$notification_dismissed_at = $row['notification_dismissed_at'];
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_id = $row['client_id'];
|
||||
if (empty($client_name)) {
|
||||
$client_name_display = "-";
|
||||
} else {
|
||||
$client_name_display = "<a href='client_overview.php?client_id=$client_id'>$client_name</a>";
|
||||
}
|
||||
$notification_id = $row['notification_id'];
|
||||
$notification_timestamp = $row['notification_timestamp'];
|
||||
$notification_type = htmlentities($row['notification_type']);
|
||||
$notification = htmlentities($row['notification']);
|
||||
$notification_dismissed_at = $row['notification_dismissed_at'];
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_id = $row['client_id'];
|
||||
if (empty($client_name)) {
|
||||
$client_name_display = "-";
|
||||
} else {
|
||||
$client_name_display = "<a href='client_overview.php?client_id=$client_id'>$client_name</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $notification_timestamp; ?></td>
|
||||
<td><?php echo $notification_type; ?></td>
|
||||
<td><?php echo $notification; ?></td>
|
||||
<td><?php echo $client_name_display; ?></td>
|
||||
<td><?php echo $notification_dismissed_at; ?></td>
|
||||
<td><?php echo $user_name; ?></td>
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $notification_timestamp; ?></td>
|
||||
<td><?php echo $notification_type; ?></td>
|
||||
<td><?php echo $notification; ?></td>
|
||||
<td><?php echo $client_name_display; ?></td>
|
||||
<td><?php echo $notification_dismissed_at; ?></td>
|
||||
<td><?php echo $user_name; ?></td>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM products LEFT JOIN categories ON product_category_id = category_id
|
||||
WHERE products.company_id = $session_company_id
|
||||
AND (product_name LIKE '%$q%' OR product_description LIKE '%$q%' OR category_name LIKE '%$q%' OR product_price LIKE '%$q%')
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM products LEFT JOIN categories ON product_category_id = category_id
|
||||
WHERE products.company_id = $session_company_id
|
||||
AND (product_name LIKE '%$q%' OR product_description LIKE '%$q%' OR category_name LIKE '%$q%' OR product_price LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ require_once("footer.php");
|
|||
?>
|
||||
|
||||
<!-- JSON Autocomplete / type ahead -->
|
||||
<!-- //TODO: Not sure quite how to make this more modular to include elsewhere, I'll leave that design decision down to you.. -->
|
||||
<!-- //TODO: Move to js/ -->
|
||||
<link rel="stylesheet" href="plugins/jquery-ui/jquery-ui.min.css">
|
||||
<script src="plugins/jquery-ui/jquery-ui.min.js"></script>
|
||||
<script>
|
||||
|
|
|
|||
16
quotes.php
16
quotes.php
|
|
@ -55,13 +55,15 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM quotes
|
||||
LEFT JOIN clients ON quote_client_id = client_id
|
||||
LEFT JOIN categories ON quote_category_id = category_id
|
||||
WHERE quotes.company_id = $session_company_id
|
||||
AND (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%' OR quote_amount LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
AND DATE(quote_date) BETWEEN '$dtf' AND '$dtt'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM quotes
|
||||
LEFT JOIN clients ON quote_client_id = client_id
|
||||
LEFT JOIN categories ON quote_category_id = category_id
|
||||
WHERE quotes.company_id = $session_company_id
|
||||
AND (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%' OR quote_amount LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
AND DATE(quote_date) BETWEEN '$dtf' AND '$dtt'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ if (isset($_GET['recurring_id'])) {
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM recurring
|
||||
"SELECT * FROM recurring
|
||||
LEFT JOIN clients ON recurring_client_id = client_id
|
||||
LEFT JOIN locations ON primary_location = location_id
|
||||
LEFT JOIN contacts ON primary_contact = contact_id
|
||||
|
|
@ -219,7 +219,7 @@ if (isset($_GET['recurring_id'])) {
|
|||
|
||||
<?php
|
||||
|
||||
include("item_edit_modal.php");
|
||||
require("item_edit_modal.php");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,28 +17,28 @@ if (empty($_GET['canned_date'])) {
|
|||
if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
||||
$dtf = strip_tags(mysqli_real_escape_string($mysqli, $_GET['dtf']));
|
||||
$dtt = strip_tags(mysqli_real_escape_string($mysqli, $_GET['dtt']));
|
||||
}elseif ($_GET['canned_date'] == "today") {
|
||||
} elseif ($_GET['canned_date'] == "today") {
|
||||
$dtf = date('Y-m-d');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "yesterday") {
|
||||
} elseif ($_GET['canned_date'] == "yesterday") {
|
||||
$dtf = date('Y-m-d', strtotime("yesterday"));
|
||||
$dtt = date('Y-m-d', strtotime("yesterday"));
|
||||
}elseif ($_GET['canned_date'] == "thisweek") {
|
||||
} elseif ($_GET['canned_date'] == "thisweek") {
|
||||
$dtf = date('Y-m-d', strtotime("monday this week"));
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastweek") {
|
||||
} elseif ($_GET['canned_date'] == "lastweek") {
|
||||
$dtf = date('Y-m-d', strtotime("monday last week"));
|
||||
$dtt = date('Y-m-d', strtotime("sunday last week"));
|
||||
}elseif ($_GET['canned_date'] == "thismonth") {
|
||||
} elseif ($_GET['canned_date'] == "thismonth") {
|
||||
$dtf = date('Y-m-01');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
} elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
$dtf = date('Y-m-d', strtotime("first day of last month"));
|
||||
$dtt = date('Y-m-d', strtotime("last day of last month"));
|
||||
}elseif ($_GET['canned_date'] == "thisyear") {
|
||||
} elseif ($_GET['canned_date'] == "thisyear") {
|
||||
$dtf = date('Y-01-01');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastyear") {
|
||||
} elseif ($_GET['canned_date'] == "lastyear") {
|
||||
$dtf = date('Y-m-d', strtotime("first day of january last year"));
|
||||
$dtt = date('Y-m-d', strtotime("last day of december last year"));
|
||||
} else {
|
||||
|
|
@ -55,164 +55,166 @@ if (empty($_GET['canned_date'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM recurring
|
||||
LEFT JOIN clients ON recurring_client_id = client_id
|
||||
LEFT JOIN categories ON recurring_category_id = category_id
|
||||
WHERE recurring.company_id = $session_company_id
|
||||
AND (CONCAT(recurring_prefix,recurring_number) LIKE '%$q%' OR recurring_frequency LIKE '%$q%' OR recurring_scope LIKE '%$q%' OR client_name LIKE '%$q%' OR category_name LIKE '%$q%')
|
||||
AND DATE(recurring_next_date) BETWEEN '$dtf' AND '$dtt'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM recurring
|
||||
LEFT JOIN clients ON recurring_client_id = client_id
|
||||
LEFT JOIN categories ON recurring_category_id = category_id
|
||||
WHERE recurring.company_id = $session_company_id
|
||||
AND (CONCAT(recurring_prefix,recurring_number) LIKE '%$q%' OR recurring_frequency LIKE '%$q%' OR recurring_scope LIKE '%$q%' OR client_name LIKE '%$q%' OR category_name LIKE '%$q%')
|
||||
AND DATE(recurring_next_date) BETWEEN '$dtf' AND '$dtt'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-sync-alt"></i> Recurring Invoices</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addRecurringModal"><i class="fas fa-fw fa-plus"></i> New Recurring</button>
|
||||
</div>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-sync-alt"></i> Recurring Invoices</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addRecurringModal"><i class="fas fa-fw fa-plus"></i> New Recurring</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<div class="card-body">
|
||||
<form class="mb-4" 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 strip_tags(htmlentities($q));} ?>" placeholder="Search Recurring Invoices">
|
||||
<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>
|
||||
<div class="collapse mt-3 <?php if (!empty($_GET['dtf'])) { echo "show"; } ?>" id="advancedFilter">
|
||||
<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 strip_tags(htmlentities($q));} ?>" placeholder="Search Recurring Invoices">
|
||||
<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 class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Canned Date</label>
|
||||
<select class="form-control select2" name="canned_date">
|
||||
<option <?php if ($_GET['canned_date'] == "custom") { echo "selected"; } ?> value="custom">Custom</option>
|
||||
<option <?php if ($_GET['canned_date'] == "today") { echo "selected"; } ?> value="today">Today</option>
|
||||
<option <?php if ($_GET['canned_date'] == "yesterday") { echo "selected"; } ?> value="yesterday">Yesterday</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thisweek") { echo "selected"; } ?> value="thisweek">This Week</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastweek") { echo "selected"; } ?> value="lastweek">Last Week</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thismonth") { echo "selected"; } ?> value="thismonth">This Month</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastmonth") { echo "selected"; } ?> value="lastmonth">Last Month</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thisyear") { echo "selected"; } ?> value="thisyear">This Year</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastyear") { echo "selected"; } ?> value="lastyear">Last Year</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date From</label>
|
||||
<input type="date" class="form-control" name="dtf" max="2999-12-31" value="<?php echo htmlentities($dtf); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date To</label>
|
||||
<input type="date" class="form-control" name="dtt" max="2999-12-31" value="<?php echo htmlentities($dtt); ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse mt-3 <?php if (!empty($_GET['dtf'])) { echo "show"; } ?>" id="advancedFilter">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Canned Date</label>
|
||||
<select class="form-control select2" name="canned_date">
|
||||
<option <?php if ($_GET['canned_date'] == "custom") { echo "selected"; } ?> value="custom">Custom</option>
|
||||
<option <?php if ($_GET['canned_date'] == "today") { echo "selected"; } ?> value="today">Today</option>
|
||||
<option <?php if ($_GET['canned_date'] == "yesterday") { echo "selected"; } ?> value="yesterday">Yesterday</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thisweek") { echo "selected"; } ?> value="thisweek">This Week</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastweek") { echo "selected"; } ?> value="lastweek">Last Week</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thismonth") { echo "selected"; } ?> value="thismonth">This Month</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastmonth") { echo "selected"; } ?> value="lastmonth">Last Month</option>
|
||||
<option <?php if ($_GET['canned_date'] == "thisyear") { echo "selected"; } ?> value="thisyear">This Year</option>
|
||||
<option <?php if ($_GET['canned_date'] == "lastyear") { echo "selected"; } ?> value="lastyear">Last Year</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date From</label>
|
||||
<input type="date" class="form-control" name="dtf" max="2999-12-31" value="<?php echo htmlentities($dtf); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date To</label>
|
||||
<input type="date" class="form-control" name="dtt" max="2999-12-31" value="<?php echo htmlentities($dtt); ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_number&o=<?php echo $disp; ?>">Number</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_next_date&o=<?php echo $disp; ?>">Next Date</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_scope&o=<?php echo $disp; ?>">Scope</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_frequency&o=<?php echo $disp; ?>">Frequency</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
|
||||
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_amount&o=<?php echo $disp; ?>">Amount</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_last_sent&o=<?php echo $disp; ?>">Last Sent</a></th>
|
||||
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$recurring_id = $row['recurring_id'];
|
||||
$recurring_prefix = htmlentities($row['recurring_prefix']);
|
||||
$recurring_number = htmlentities($row['recurring_number']);
|
||||
$recurring_scope = htmlentities($row['recurring_scope']);
|
||||
$recurring_frequency = htmlentities($row['recurring_frequency']);
|
||||
$recurring_status = htmlentities($row['recurring_status']);
|
||||
$recurring_last_sent = $row['recurring_last_sent'];
|
||||
if ($recurring_last_sent == 0) {
|
||||
$recurring_last_sent = "-";
|
||||
}
|
||||
$recurring_next_date = $row['recurring_next_date'];
|
||||
$recurring_amount = floatval($row['recurring_amount']);
|
||||
$recurring_currency_code = htmlentities($row['recurring_currency_code']);
|
||||
$recurring_created_at = $row['recurring_created_at'];
|
||||
$client_id = $row['client_id'];
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_currency_code = htmlentities($row['client_currency_code']);
|
||||
$category_id = $row['category_id'];
|
||||
$category_name = htmlentities($row['category_name']);
|
||||
if ($recurring_status == 1) {
|
||||
$status = "Active";
|
||||
$status_badge_color = "success";
|
||||
} else {
|
||||
$status = "Inactive";
|
||||
$status_badge_color = "secondary";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_number&o=<?php echo $disp; ?>">Number</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_next_date&o=<?php echo $disp; ?>">Next Date</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_scope&o=<?php echo $disp; ?>">Scope</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_frequency&o=<?php echo $disp; ?>">Frequency</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
|
||||
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_amount&o=<?php echo $disp; ?>">Amount</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_last_sent&o=<?php echo $disp; ?>">Last Sent</a></th>
|
||||
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$recurring_id = $row['recurring_id'];
|
||||
$recurring_prefix = htmlentities($row['recurring_prefix']);
|
||||
$recurring_number = htmlentities($row['recurring_number']);
|
||||
$recurring_scope = htmlentities($row['recurring_scope']);
|
||||
$recurring_frequency = htmlentities($row['recurring_frequency']);
|
||||
$recurring_status = htmlentities($row['recurring_status']);
|
||||
$recurring_last_sent = $row['recurring_last_sent'];
|
||||
if ($recurring_last_sent == 0) {
|
||||
$recurring_last_sent = "-";
|
||||
}
|
||||
$recurring_next_date = $row['recurring_next_date'];
|
||||
$recurring_amount = floatval($row['recurring_amount']);
|
||||
$recurring_currency_code = htmlentities($row['recurring_currency_code']);
|
||||
$recurring_created_at = $row['recurring_created_at'];
|
||||
$client_id = $row['client_id'];
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_currency_code = htmlentities($row['client_currency_code']);
|
||||
$category_id = $row['category_id'];
|
||||
$category_name = htmlentities($row['category_name']);
|
||||
if ($recurring_status == 1) {
|
||||
$status = "Active";
|
||||
$status_badge_color = "success";
|
||||
} else {
|
||||
$status = "Inactive";
|
||||
$status_badge_color = "secondary";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><a href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>"><?php echo "$recurring_prefix$recurring_number"; ?></a></td>
|
||||
<td><?php echo $recurring_next_date; ?></td>
|
||||
<td><?php echo $recurring_scope; ?></td>
|
||||
<td><?php echo ucwords($recurring_frequency); ?>ly</td>
|
||||
<td><a href="client_recurring_invoices.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $recurring_amount, $recurring_currency_code); ?></td>
|
||||
<td><?php echo $recurring_last_sent; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td>
|
||||
<td><a href="recurring_invoice.php?recurring_id=<?php echo $recurring_id; ?>"><?php echo "$recurring_prefix$recurring_number"; ?></a></td>
|
||||
<td><?php echo $recurring_next_date; ?></td>
|
||||
<td><?php echo $recurring_scope; ?></td>
|
||||
<td><?php echo ucwords($recurring_frequency); ?>ly</td>
|
||||
<td><a href="client_recurring_invoices.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $recurring_amount, $recurring_currency_code); ?></td>
|
||||
<td><?php echo $recurring_last_sent; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td>
|
||||
<span class="p-2 badge badge-<?php echo $status_badge_color; ?>">
|
||||
<?php echo $status; ?>
|
||||
</span>
|
||||
|
||||
</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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editRecurringModal<?php echo $recurring_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_recurring=<?php echo $recurring_id; ?>">Delete</a>
|
||||
</div>
|
||||
</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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editRecurringModal<?php echo $recurring_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_recurring=<?php echo $recurring_id; ?>">Delete</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
require("recurring_invoice_edit_modal.php");
|
||||
<?php
|
||||
require("recurring_invoice_edit_modal.php");
|
||||
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -15,63 +15,63 @@ $sql_vendors = mysqli_query($mysqli, "SELECT * FROM vendors WHERE company_id = $
|
|||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-building"></i> Expense By Vendor</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary d-print-none" onclick="window.print();"><i class="fas fa-fw fa-print"></i> Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="mb-3">
|
||||
<select onchange="this.form.submit()" class="form-control" name="year">
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_payment_years)) {
|
||||
$payment_year = $row['payment_year'];
|
||||
?>
|
||||
<option <?php if ($year == $payment_year) { ?> selected <?php } ?> > <?php echo $payment_year; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Vendor</th>
|
||||
<th class="text-right">Paid</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = htmlentities($row['vendor_name']);
|
||||
|
||||
$sql_amount_paid = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS amount_paid FROM expenses WHERE YEAR(expense_date) = $year AND expense_vendor_id = $vendor_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
|
||||
$amount_paid = floatval($row['amount_paid']);
|
||||
|
||||
if ($amount_paid > 599) { ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $vendor_name; ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $amount_paid, $session_company_currency); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-building"></i> Expense By Vendor</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary d-print-none" onclick="window.print();"><i class="fas fa-fw fa-print"></i> Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="mb-3">
|
||||
<select onchange="this.form.submit()" class="form-control" name="year">
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_payment_years)) {
|
||||
$payment_year = $row['payment_year'];
|
||||
?>
|
||||
<option <?php if ($year == $payment_year) { ?> selected <?php } ?> > <?php echo $payment_year; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Vendor</th>
|
||||
<th class="text-right">Paid</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($sql_vendors)) {
|
||||
$vendor_id = $row['vendor_id'];
|
||||
$vendor_name = htmlentities($row['vendor_name']);
|
||||
|
||||
$sql_amount_paid = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS amount_paid FROM expenses WHERE YEAR(expense_date) = $year AND expense_vendor_id = $vendor_id");
|
||||
$row = mysqli_fetch_array($sql_amount_paid);
|
||||
|
||||
$amount_paid = floatval($row['amount_paid']);
|
||||
|
||||
if ($amount_paid > 599) { ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $vendor_name; ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $amount_paid, $session_company_currency); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once("footer.php"); ?>
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ $sql_categories = mysqli_query($mysqli, "SELECT * FROM categories WHERE category
|
|||
?>
|
||||
<option <?php if ($year == $expense_year) { ?> selected <?php } ?> > <?php echo $expense_year; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</form>
|
||||
|
|
@ -74,7 +72,7 @@ $sql_categories = mysqli_query($mysqli, "SELECT * FROM categories WHERE category
|
|||
<?php
|
||||
|
||||
$total_expense_for_all_months = 0;
|
||||
for($month = 1; $month<=12; $month++) {
|
||||
for ($month = 1; $month<=12; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE expense_category_id = $category_id AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$expense_amount_for_month = $row['expense_amount_for_month'];
|
||||
|
|
@ -84,26 +82,18 @@ $sql_categories = mysqli_query($mysqli, "SELECT * FROM categories WHERE category
|
|||
?>
|
||||
<td class="text-right"><a class="text-dark" href="expenses.php?q=<?php echo $category_name; ?>&dtf=<?php echo "$year-$month"; ?>-01&dtt=<?php echo "$year-$month"; ?>-31"><?php echo numfmt_format_currency($currency_format, $expense_amount_for_month, $session_company_currency); ?></a></td>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
<th class="text-right"><a class="text-dark" href="expenses.php?q=<?php echo $category_name; ?>&dtf=<?php echo $year; ?>-01-01&dtt=<?php echo $year; ?>-12-31"><?php echo numfmt_format_currency($currency_format, $total_expense_for_all_months, $session_company_currency); ?></a></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<th>Total</th>
|
||||
<?php
|
||||
|
||||
for($month = 1; $month<=12; $month++) {
|
||||
for ($month = 1; $month<=12; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND expense_vendor_id > 0 AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$expense_total_amount_for_month = $row['expense_total_amount_for_month'];
|
||||
|
|
@ -113,11 +103,8 @@ $sql_categories = mysqli_query($mysqli, "SELECT * FROM categories WHERE category
|
|||
?>
|
||||
|
||||
<th class="text-right"><a class="text-dark" href="expenses.php?dtf=<?php echo "$year-$month"; ?>-01&dtt=<?php echo "$year-$month"; ?>-31"><?php echo numfmt_format_currency($currency_format, $expense_total_amount_for_month, $session_company_currency); ?></a></th>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
<th class="text-right"><a class="text-dark" href="expenses.php?dtf=<?php echo $year; ?>-01-01&dtt=<?php echo $year; ?>-12-31"><?php echo numfmt_format_currency($currency_format, $total_expense_for_all_months, $session_company_currency); ?></th>
|
||||
</tr>
|
||||
|
|
@ -155,7 +142,7 @@ $sql_categories = mysqli_query($mysqli, "SELECT * FROM categories WHERE category
|
|||
|
||||
$largest_expense_month = 0;
|
||||
|
||||
for($month = 1; $month<=12; $month++) {
|
||||
for ($month = 1; $month<=12; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli, "SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND expense_vendor_id > 0 AND expenses.company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$expenses_for_month = $row['expense_amount_for_month'];
|
||||
|
|
@ -164,15 +151,9 @@ $sql_categories = mysqli_query($mysqli, "SELECT * FROM categories WHERE category
|
|||
$largest_expense_month = $expenses_for_month;
|
||||
}
|
||||
|
||||
echo "$expenses_for_month,";
|
||||
|
||||
?>
|
||||
<?php echo "$expenses_for_month,"; ?>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
} ?>
|
||||
|
||||
],
|
||||
}],
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ $sql_clients = mysqli_query($mysqli, "SELECT * FROM clients WHERE company_id = $
|
|||
?>
|
||||
<option <?php if ($year == $payment_year) { ?> selected <?php } ?> > <?php echo $payment_year; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</form>
|
||||
|
|
@ -76,4 +74,5 @@ $sql_clients = mysqli_query($mysqli, "SELECT * FROM clients WHERE company_id = $
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once("footer.php"); ?>
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
16
revenues.php
16
revenues.php
|
|
@ -56,13 +56,15 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM revenues
|
||||
JOIN categories ON revenue_category_id = category_id
|
||||
LEFT JOIN accounts ON revenue_account_id = account_id
|
||||
WHERE revenues.company_id = $session_company_id
|
||||
AND (account_name LIKE '%$q%' OR revenue_payment_method LIKE '%$q%' OR category_name LIKE '%$q%' OR revenue_reference LIKE '%$q%' OR revenue_amount LIKE '%$q%')
|
||||
AND DATE(revenue_date) BETWEEN '$dtf' AND '$dtt'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM revenues
|
||||
JOIN categories ON revenue_category_id = category_id
|
||||
LEFT JOIN accounts ON revenue_account_id = account_id
|
||||
WHERE revenues.company_id = $session_company_id
|
||||
AND (account_name LIKE '%$q%' OR revenue_payment_method LIKE '%$q%' OR category_name LIKE '%$q%' OR revenue_reference LIKE '%$q%' OR revenue_amount LIKE '%$q%')
|
||||
AND DATE(revenue_date) BETWEEN '$dtf' AND '$dtt'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM scheduled_tickets
|
||||
LEFT JOIN clients on scheduled_ticket_client_id = client_id
|
||||
WHERE scheduled_tickets.scheduled_ticket_subject LIKE '%$q%'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
LEFT JOIN clients on scheduled_ticket_client_id = client_id
|
||||
WHERE scheduled_tickets.scheduled_ticket_subject LIKE '%$q%'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
|
@ -66,43 +66,42 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$scheduled_ticket_id = $row['scheduled_ticket_id'];
|
||||
$scheduled_ticket_client_id = $row['client_id'];
|
||||
$scheduled_ticket_subject = htmlentities($row['scheduled_ticket_subject']);
|
||||
$scheduled_ticket_priority = htmlentities($row['scheduled_ticket_priority']);
|
||||
$scheduled_ticket_frequency = htmlentities($row['scheduled_ticket_frequency']);
|
||||
$scheduled_ticket_next_run = $row['scheduled_ticket_next_run'];
|
||||
$scheduled_ticket_client_name = htmlentities($row['client_name']);
|
||||
?>
|
||||
$scheduled_ticket_id = $row['scheduled_ticket_id'];
|
||||
$scheduled_ticket_client_id = $row['client_id'];
|
||||
$scheduled_ticket_subject = htmlentities($row['scheduled_ticket_subject']);
|
||||
$scheduled_ticket_priority = htmlentities($row['scheduled_ticket_priority']);
|
||||
$scheduled_ticket_frequency = htmlentities($row['scheduled_ticket_frequency']);
|
||||
$scheduled_ticket_next_run = $row['scheduled_ticket_next_run'];
|
||||
$scheduled_ticket_client_name = htmlentities($row['client_name']);
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><a> <?php echo $scheduled_ticket_client_name ?></a></td>
|
||||
<td><a href="#" data-toggle="modal" data-target="#editScheduledTicketModal"
|
||||
onclick="populateScheduledTicketEditModal(<?php echo $scheduled_ticket_client_id, ",", $scheduled_ticket_id ?>)"> <?php echo $scheduled_ticket_subject ?> </a></td> <td><a> <?php echo $scheduled_ticket_priority ?></a></td>
|
||||
<td><a> <?php echo $scheduled_ticket_frequency ?></a></td>
|
||||
<td><a> <?php echo $scheduled_ticket_next_run ?></a></td>
|
||||
<tr>
|
||||
<td><a> <?php echo $scheduled_ticket_client_name ?></a></td>
|
||||
<td><a href="#" data-toggle="modal" data-target="#editScheduledTicketModal"
|
||||
onclick="populateScheduledTicketEditModal(<?php echo $scheduled_ticket_client_id, ",", $scheduled_ticket_id ?>)"> <?php echo $scheduled_ticket_subject ?> </a></td> <td><a> <?php echo $scheduled_ticket_priority ?></a></td>
|
||||
<td><a> <?php echo $scheduled_ticket_frequency ?></a></td>
|
||||
<td><a> <?php echo $scheduled_ticket_next_run ?></a></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal"
|
||||
data-target="#editScheduledTicketModal" onclick="populateScheduledTicketEditModal(<?php echo $scheduled_ticket_client_id, ",", $scheduled_ticket_id ?>)">Edit</a>
|
||||
<?php
|
||||
if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_scheduled_ticket=<?php echo $scheduled_ticket_id; ?>">Delete</a>
|
||||
<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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal"
|
||||
data-target="#editScheduledTicketModal" onclick="populateScheduledTicketEditModal(<?php echo $scheduled_ticket_client_id, ",", $scheduled_ticket_id ?>)">Edit</a>
|
||||
<?php
|
||||
if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_scheduled_ticket=<?php echo $scheduled_ticket_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,53 +1,55 @@
|
|||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-bell"></i> Alerts</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_enable_cron" <?php if ($config_enable_cron == 1) { echo "checked"; } ?> value="1" id="enableCronSwitch">
|
||||
<label class="custom-control-label" for="enableCronSwitch">Enable Cron <small>(cron.php must also be added to cron and run daily at 1:00AM for alerts to work)</small></label>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-bell"></i> Alerts</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_enable_alert_domain_expire" <?php if ($config_enable_alert_domain_expire == 1) { echo "checked"; } ?> value="1" id="alertDomainExpireSwitch">
|
||||
<label class="custom-control-label" for="alertDomainExpireSwitch">Enable Domain Expiration Alerts</label>
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_enable_cron" <?php if ($config_enable_cron == 1) { echo "checked"; } ?> value="1" id="enableCronSwitch">
|
||||
<label class="custom-control-label" for="enableCronSwitch">Enable Cron <small>(cron.php must also be added to cron and run daily at 1:00AM for alerts to work)</small></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" name="config_enable_alert_domain_expire" <?php if ($config_enable_alert_domain_expire == 1) { echo "checked"; } ?> value="1" id="alertDomainExpireSwitch">
|
||||
<label class="custom-control-label" for="alertDomainExpireSwitch">Enable Domain Expiration Alerts</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<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">Send Invoice Reminders</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($config_send_invoice_reminders == 1) { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Overdue Reminders</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-bell"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_invoice_overdue_reminders" placeholder="Send After Due Days" value="<?php echo htmlentities($config_invoice_overdue_reminders); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_alert_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch">
|
||||
<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">Send Invoice Reminders</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($config_send_invoice_reminders == 1) { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Overdue Reminders</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-bell"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_invoice_overdue_reminders" placeholder="Send After Due Days" value="<?php echo htmlentities($config_invoice_overdue_reminders); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_alert_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -1,39 +1,40 @@
|
|||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-puzzle-piece"></i> Integration Settings</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<h4>Client Portal SSO via Microsoft Azure AD</h4>
|
||||
<div class="form-group">
|
||||
<label>MS Azure OAuth App (Client) ID</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="azure_client_id" placeholder="e721e3b6-01d6-50e8-7f22-c84d951a52e7" value="<?php echo htmlentities($config_azure_client_id); ?>">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-puzzle-piece"></i> Integration Settings</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<label>MS Azure OAuth Secret</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="azure_client_secret" placeholder="Auto-generated from App Registration" value="<?php echo htmlentities($config_azure_client_secret); ?>" autocomplete="new-password">
|
||||
<h4>Client Portal SSO via Microsoft Azure AD</h4>
|
||||
<div class="form-group">
|
||||
<label>MS Azure OAuth App (Client) ID</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="azure_client_id" placeholder="e721e3b6-01d6-50e8-7f22-c84d951a52e7" value="<?php echo htmlentities($config_azure_client_id); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>MS Azure OAuth Secret</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="azure_client_secret" placeholder="Auto-generated from App Registration" value="<?php echo htmlentities($config_azure_client_secret); ?>" autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_integrations_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_integrations_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -1,91 +1,93 @@
|
|||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-file"></i> Invoice Settings</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<legend>Invoice</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Invoice Prefix</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_invoice_prefix" placeholder="Invoice Prefix" value="<?php echo htmlentities($config_invoice_prefix); ?>" required>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-file"></i> Invoice Settings</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Next Number</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="number" min="0" class="form-control" name="config_invoice_next_number" placeholder="Next Invoice Number" value="<?php echo htmlentities($config_invoice_next_number); ?>" required>
|
||||
<legend>Invoice</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Invoice Prefix</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_invoice_prefix" placeholder="Invoice Prefix" value="<?php echo htmlentities($config_invoice_prefix); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Next Number</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="number" min="0" class="form-control" name="config_invoice_next_number" placeholder="Next Invoice Number" value="<?php echo htmlentities($config_invoice_next_number); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Invoice Footer</label>
|
||||
<textarea class="form-control" rows="4" name="config_invoice_footer"><?php echo htmlentities($config_invoice_footer); ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>From Email</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="config_invoice_from_email" placeholder="From Email" value="<?php echo htmlentities($config_invoice_from_email); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>From Name</label>
|
||||
<div class="input-group">
|
||||
<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="config_invoice_from_name" placeholder="From Name" value="<?php echo htmlentities($config_invoice_from_name); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<legend>Recurring Invoice</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Recurring Prefix</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_recurring_prefix" placeholder="Recurring Prefix" value="<?php echo htmlentities($config_recurring_prefix); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Next Number</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="number" min="0" class="form-control" name="config_recurring_next_number" placeholder="Next Recurring Number" value="<?php echo htmlentities($config_recurring_next_number); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_invoice_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Invoice Footer</label>
|
||||
<textarea class="form-control" rows="4" name="config_invoice_footer"><?php echo htmlentities($config_invoice_footer); ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>From Email</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="config_invoice_from_email" placeholder="From Email" value="<?php echo htmlentities($config_invoice_from_email); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>From Name</label>
|
||||
<div class="input-group">
|
||||
<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="config_invoice_from_name" placeholder="From Name" value="<?php echo htmlentities($config_invoice_from_name); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<legend>Recurring Invoice</legend>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Recurring Prefix</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_recurring_prefix" placeholder="Recurring Prefix" value="<?php echo htmlentities($config_recurring_prefix); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Next Number</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||
</div>
|
||||
<input type="number" min="0" class="form-control" name="config_recurring_next_number" placeholder="Next Recurring Number" value="<?php echo htmlentities($config_recurring_next_number); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_invoice_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -1,168 +1,169 @@
|
|||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-envelope"></i> Mail Settings</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Host</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_smtp_host" placeholder="Mail Server Address" value="<?php echo htmlentities($config_smtp_host); ?>" required>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-envelope"></i> Mail Settings</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Port</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-plug"></i></span>
|
||||
</div>
|
||||
<input type="number" min="0" class="form-control" name="config_smtp_port" placeholder="Mail Server Port Number" value="<?php echo htmlentities($config_smtp_port); ?>" required>
|
||||
<div class="form-group">
|
||||
<label>SMTP Host</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_smtp_host" placeholder="Mail Server Address" value="<?php echo htmlentities($config_smtp_host); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Port</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-plug"></i></span>
|
||||
</div>
|
||||
<input type="number" min="0" class="form-control" name="config_smtp_port" placeholder="Mail Server Port Number" value="<?php echo htmlentities($config_smtp_port); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Encryption</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_smtp_encryption">
|
||||
<option value=''>None</option>
|
||||
<option <?php if ($config_smtp_encryption == 'tls') { echo "selected"; } ?> value="tls">TLS</option>
|
||||
<option <?php if ($config_smtp_encryption == 'ssl') { echo "selected"; } ?> value="ssl">SSL</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Username</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_smtp_username" placeholder="Username" value="<?php echo htmlentities($config_smtp_username); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Password</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" data-toggle="password" name="config_smtp_password" placeholder="Password" value="<?php echo htmlentities($config_smtp_password); ?>" autocomplete="new-password" required>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Email Address</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="config_mail_from_email" placeholder="Email Address" value="<?php echo htmlentities($config_mail_from_email); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name</label>
|
||||
<div class="input-group">
|
||||
<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="config_mail_from_name" placeholder="Name" value="<?php echo htmlentities($config_mail_from_name); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<label>IMAP Host</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_imap_host" placeholder="Incoming Mail Server Address (for email to ticket parsing)" value="<?php echo htmlentities($config_imap_host); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>IMAP Port</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-plug"></i></span>
|
||||
</div>
|
||||
<input type="number" min="0" class="form-control" name="config_imap_port" placeholder="Incoming Mail Server Port Number (993)" value="<?php echo htmlentities($config_imap_port); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>IMAP Encryption</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_imap_encryption">
|
||||
<option value=''>None</option>
|
||||
<option <?php if ($config_imap_encryption == 'tls') { echo "selected"; } ?> value="tls">TLS</option>
|
||||
<option <?php if ($config_imap_encryption == 'ssl') { echo "selected"; } ?> value="ssl">SSL</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_mail_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Encryption</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_smtp_encryption">
|
||||
<option value=''>None</option>
|
||||
<option <?php if ($config_smtp_encryption == 'tls') { echo "selected"; } ?> value="tls">TLS</option>
|
||||
<option <?php if ($config_smtp_encryption == 'ssl') { echo "selected"; } ?> value="ssl">SSL</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Username</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_smtp_username" placeholder="Username" value="<?php echo htmlentities($config_smtp_username); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Password</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" data-toggle="password" name="config_smtp_password" placeholder="Password" value="<?php echo htmlentities($config_smtp_password); ?>" autocomplete="new-password" required>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Email Address</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="config_mail_from_email" placeholder="Email Address" value="<?php echo htmlentities($config_mail_from_email); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Name</label>
|
||||
<div class="input-group">
|
||||
<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="config_mail_from_name" placeholder="Name" value="<?php echo htmlentities($config_mail_from_name); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<label>IMAP Host</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_imap_host" placeholder="Incoming Mail Server Address (for email to ticket parsing)" value="<?php echo htmlentities($config_imap_host); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>IMAP Port</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-plug"></i></span>
|
||||
</div>
|
||||
<input type="number" min="0" class="form-control" name="config_imap_port" placeholder="Incoming Mail Server Port Number (993)" value="<?php echo htmlentities($config_imap_port); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>IMAP Encryption</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_imap_encryption">
|
||||
<option value=''>None</option>
|
||||
<option <?php if ($config_imap_encryption == 'tls') { echo "selected"; } ?> value="tls">TLS</option>
|
||||
<option <?php if ($config_imap_encryption == 'ssl') { echo "selected"; } ?> value="ssl">SSL</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_mail_settings" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($config_smtp_host) && !empty($config_smtp_port) && !empty($config_smtp_username) && !empty($config_smtp_password) && !empty($config_mail_from_email) && !empty($config_mail_from_name)) { ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-paper-plane"></i> Test Email Sending</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="email" class="form-control " name="email" placeholder="Email address to test">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="test_email_smtp" class="btn btn-success"><i class="fa fa-fw fa-paper-plane"></i> Send</button>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-paper-plane"></i> Test Email Sending</h3>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="email" class="form-control " name="email" placeholder="Email address to test">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="test_email_smtp" class="btn btn-success"><i class="fa fa-fw fa-paper-plane"></i> Send</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if (!empty($config_smtp_username) && !empty($config_smtp_password) && !empty($config_imap_host) && !empty($config_imap_port)) { ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-paper-plane"></i> Test Email Receiving</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="test_email_imap" class="btn btn-success"><i class="fa fa-fw fa-inbox"></i> Test</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-paper-plane"></i> Test Email Receiving</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="test_email_imap" class="btn btn-success"><i class="fa fa-fw fa-inbox"></i> Test</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ $sql_accounts = mysqli_query($mysqli, "SELECT * FROM accounts WHERE company_id =
|
|||
<select class="form-control" name="config_stripe_account">
|
||||
<option value="">- Account -</option>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($sql_accounts)) { ?>
|
||||
<option value="<?php echo $row['account_id'] ?>" <?php if ($row['account_id'] == $config_stripe_account) { echo "selected"; } ?>><?php echo $row['account_name'] ?></option>
|
||||
<?php }
|
||||
while ($row = mysqli_fetch_array($sql_accounts)) { ?>
|
||||
<option value="<?php echo $row['account_id'] ?>" <?php if ($row['account_id'] == $config_stripe_account) { echo "selected"; } ?>><?php echo $row['account_name'] ?></option>
|
||||
<?php }
|
||||
?>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
|
|
@ -60,4 +61,5 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM tags
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM tags
|
||||
WHERE tag_name LIKE '%$q%'
|
||||
AND company_id = $session_company_id
|
||||
AND company_id = $session_company_id
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ if ($num_rows > 0) {
|
|||
//Colors Used
|
||||
$sql_colors_used = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT tag_color FROM tags
|
||||
"SELECT tag_color FROM tags
|
||||
WHERE tag_archived_at IS NULL
|
||||
AND company_id = $session_company_id"
|
||||
);
|
||||
|
|
@ -41,84 +41,84 @@ if ($num_rows > 0) {
|
|||
?>
|
||||
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-tags"></i> Tags</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addTagModal"><i class="fas fa-fw fa-plus"></i> New</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 mb-2">
|
||||
<form autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Tags">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-tags"></i> Tags</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addTagModal"><i class="fas fa-fw fa-plus"></i> New</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=tag_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=tag_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<th>Color</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$tag_id = $row['tag_id'];
|
||||
$tag_name = htmlentities($row['tag_name']);
|
||||
$tag_type = htmlentities($row['tag_type']);
|
||||
$tag_color = htmlentities($row['tag_color']);
|
||||
$tag_icon = htmlentities($row['tag_icon']);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo "<i class='fa fa-fw fa-$tag_icon'></i>"; ?> <a class="text-dark" href="#" data-toggle="modal" data-target="#editTagModal<?php echo $tag_id; ?>"><?php echo "$tag_name"; ?></a></td>
|
||||
<td><?php echo $tag_type; ?></td>
|
||||
<td><i class="fa fa-3x fa-circle" style="color:<?php echo $tag_color; ?>;"></i></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTagModal<?php echo $tag_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_tag=<?php echo $tag_id; ?>">Delete</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 mb-2">
|
||||
<form autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Tags">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=tag_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=tag_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<th>Color</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
require("settings_tag_edit_modal.php");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$tag_id = $row['tag_id'];
|
||||
$tag_name = htmlentities($row['tag_name']);
|
||||
$tag_type = htmlentities($row['tag_type']);
|
||||
$tag_color = htmlentities($row['tag_color']);
|
||||
$tag_icon = htmlentities($row['tag_icon']);
|
||||
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo "<i class='fa fa-fw fa-$tag_icon'></i>"; ?> <a class="text-dark" href="#" data-toggle="modal" data-target="#editTagModal<?php echo $tag_id; ?>"><?php echo "$tag_name"; ?></a></td>
|
||||
<td><?php echo $tag_type; ?></td>
|
||||
<td><i class="fa fa-3x fa-circle" style="color:<?php echo $tag_color; ?>;"></i></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTagModal<?php echo $tag_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_tag=<?php echo $tag_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
require("settings_tag_edit_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once("settings_tag_add_modal.php");
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM taxes
|
||||
WHERE tax_archived_at IS NULL
|
||||
AND company_id = $session_company_id
|
||||
"SELECT * FROM taxes
|
||||
WHERE tax_archived_at IS NULL
|
||||
AND company_id = $session_company_id
|
||||
ORDER BY $sb $o"
|
||||
);
|
||||
|
||||
|
|
@ -22,66 +22,66 @@ $num_rows = mysqli_num_rows($sql);
|
|||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-balance-scale"></i> Taxes</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addTaxModal"><i class="fas fa-fw fa-plus"></i> New Tax</button>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-balance-scale"></i> Taxes</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addTaxModal"><i class="fas fa-fw fa-plus"></i> New Tax</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=tax_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=tax_percent&o=<?php echo $disp; ?>">Percent</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$tax_id = $row['tax_id'];
|
||||
$tax_name = htmlentities($row['tax_name']);
|
||||
$tax_percent = $row['tax_percent'];
|
||||
|
||||
?>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editTaxModal<?php echo $tax_id; ?>"><?php echo "$tax_name"; ?></a></td>
|
||||
<td><?php echo "$tax_percent%"; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTaxModal<?php echo $tax_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_tax=<?php echo $tax_id; ?>">Archive</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=tax_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=tax_percent&o=<?php echo $disp; ?>">Percent</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
require("settings_tax_edit_modal.php");
|
||||
}
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$tax_id = $row['tax_id'];
|
||||
$tax_name = htmlentities($row['tax_name']);
|
||||
$tax_percent = $row['tax_percent'];
|
||||
|
||||
if ($num_rows == 0) {
|
||||
echo "<h3 class='text-secondary mt-3' style='text-align: center'>No Records Here</h3>";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editTaxModal<?php echo $tax_id; ?>"><?php echo "$tax_name"; ?></a></td>
|
||||
<td><?php echo "$tax_percent%"; ?></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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTaxModal<?php echo $tax_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="post.php?archive_tax=<?php echo $tax_id; ?>">Archive</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
require("settings_tax_edit_modal.php");
|
||||
}
|
||||
|
||||
if ($num_rows == 0) {
|
||||
echo "<h3 class='text-secondary mt-3' style='text-align: center'>No Records Here</h3>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once("settings_tax_add_modal.php");
|
||||
|
|
|
|||
|
|
@ -1,43 +1,45 @@
|
|||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-broadcast-tower"></i> Telemetry</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<p class="text-center">Installation ID: <strong><?php echo $installation_id; ?></strong></p>
|
||||
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Telemery</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-broadcast-tower"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_telemetry">
|
||||
<option <?php if ($config_telemetry == "0") { echo "selected"; } ?> value = "0">Disabled</option>
|
||||
<option <?php if ($config_telemetry == "1") { echo "selected"; } ?> value = "1">Basic</option>
|
||||
<option <?php if ($config_telemetry == "2") { echo "selected"; } ?> value = "2">Detailed</option>
|
||||
</select>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-broadcast-tower"></i> Telemetry</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Comments</label>
|
||||
<textarea class="form-control" rows="4" name="comments" placeholder="Any Comments to send before hitting Send Telemetry Data?"></textarea>
|
||||
</div>
|
||||
<p class="text-center">Installation ID: <strong><?php echo $installation_id; ?></strong></p>
|
||||
|
||||
<hr>
|
||||
|
||||
<?php if ($config_telemetry > 0) { ?>
|
||||
<button type="submit" name="send_telemetry_data" class="btn btn-success"><i class="fa fa-fw fa-paper-plane"></i> Send Telemetry Data</button>
|
||||
<?php } ?>
|
||||
<button type="submit" name="edit_telemetry_settings" class="btn btn-primary text-bold float-right"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<?php include("footer.php");
|
||||
<div class="form-group">
|
||||
<label>Telemery</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-broadcast-tower"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_telemetry">
|
||||
<option <?php if ($config_telemetry == "0") { echo "selected"; } ?> value = "0">Disabled</option>
|
||||
<option <?php if ($config_telemetry == "1") { echo "selected"; } ?> value = "1">Basic</option>
|
||||
<option <?php if ($config_telemetry == "2") { echo "selected"; } ?> value = "2">Detailed</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Comments</label>
|
||||
<textarea class="form-control" rows="4" name="comments" placeholder="Any Comments to send before hitting Send Telemetry Data?"></textarea>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<?php if ($config_telemetry > 0) { ?>
|
||||
<button type="submit" name="send_telemetry_data" class="btn btn-success"><i class="fa fa-fw fa-paper-plane"></i> Send Telemetry Data</button>
|
||||
<?php } ?>
|
||||
<button type="submit" name="edit_telemetry_settings" class="btn btn-primary text-bold float-right"><i class="fa fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
|
|
@ -41,4 +42,5 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||
WHERE vendor_template = 1
|
||||
"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 $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
|
|
|
|||
28
setup.php
28
setup.php
|
|
@ -825,7 +825,7 @@ if (isset($_POST['add_database'])) {
|
|||
// If it has a semicolon at the end, it's the end of the query
|
||||
if (substr(trim($line), -1, 1) == ';') {
|
||||
// Perform the query
|
||||
mysqli_query($mysqli,$templine);
|
||||
mysqli_query($mysqli, $templine);
|
||||
// Reset temp variable to empty
|
||||
$templine = '';
|
||||
}
|
||||
|
|
@ -846,8 +846,8 @@ if (isset($_POST['add_user'])) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['name'])));
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['email'])));
|
||||
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
|
||||
|
||||
//Generate master encryption key
|
||||
|
|
@ -921,17 +921,17 @@ if (isset($_POST['add_company_settings'])) {
|
|||
$row = mysqli_fetch_array($sql);
|
||||
$user_id = $row['user_id'];
|
||||
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||
$country = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['country'])));
|
||||
$address = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['address'])));
|
||||
$city = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['city'])));
|
||||
$state = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['state'])));
|
||||
$zip = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip'])));
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['name'])));
|
||||
$country = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['country'])));
|
||||
$address = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['address'])));
|
||||
$city = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['city'])));
|
||||
$state = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['state'])));
|
||||
$zip = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['zip'])));
|
||||
$phone = preg_replace("/[^0-9]/", '',$_POST['phone']);
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||
$website = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['website'])));
|
||||
$locale = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['locale'])));
|
||||
$currency_code = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['currency_code'])));
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['email'])));
|
||||
$website = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['website'])));
|
||||
$locale = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['locale'])));
|
||||
$currency_code = trim(strip_tags(mysqli_real_escape_string($mysqli, $_POST['currency_code'])));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO companies SET company_name = '$name', company_address = '$address', company_city = '$city', company_state = '$state', company_zip = '$zip', company_country = '$country', company_phone = '$phone', company_email = '$email', company_website = '$website', company_locale = '$locale', company_currency = '$currency_code', company_created_at = NOW()");
|
||||
|
||||
|
|
@ -1021,7 +1021,7 @@ if (isset($_POST['add_company_settings'])) {
|
|||
|
||||
if (isset($_POST['add_telemetry'])) {
|
||||
|
||||
if ($_POST['share_data'] == 1) {
|
||||
if (isset($_POST['share_data']) && $_POST['share_data'] == 1) {
|
||||
|
||||
$comments = trim(strip_tags($_POST['comments']));
|
||||
|
||||
|
|
|
|||
160
share_modal.php
160
share_modal.php
|
|
@ -1,96 +1,96 @@
|
|||
<script>
|
||||
|
||||
function populateShareModal(client_id, item_type, item_ref_id) {
|
||||
document.getElementById("share_client_id").value = client_id;
|
||||
document.getElementById("share_item_type").value = item_type;
|
||||
document.getElementById("share_item_ref_id").value = item_ref_id;
|
||||
}
|
||||
function populateShareModal(client_id, item_type, item_ref_id) {
|
||||
document.getElementById("share_client_id").value = client_id;
|
||||
document.getElementById("share_item_type").value = item_type;
|
||||
document.getElementById("share_item_ref_id").value = item_ref_id;
|
||||
}
|
||||
|
||||
function generateShareLink() {
|
||||
let client_id = document.getElementById("share_client_id").value;
|
||||
let item_type = document.getElementById("share_item_type").value;
|
||||
let item_ref_id = document.getElementById("share_item_ref_id").value;
|
||||
let item_note = document.getElementById("share_note").value;
|
||||
let item_views = document.getElementById("share_views").value;
|
||||
let item_expires = document.getElementById("share_expires").value;
|
||||
function generateShareLink() {
|
||||
let client_id = document.getElementById("share_client_id").value;
|
||||
let item_type = document.getElementById("share_item_type").value;
|
||||
let item_ref_id = document.getElementById("share_item_ref_id").value;
|
||||
let item_note = document.getElementById("share_note").value;
|
||||
let item_views = document.getElementById("share_views").value;
|
||||
let item_expires = document.getElementById("share_expires").value;
|
||||
|
||||
// Check values are provided
|
||||
if (item_views && item_expires && item_note) {
|
||||
// Send a GET request to ajax.php as ajax.php?share_generate_link=true....
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{share_generate_link: 'true', client_id: client_id, type: item_type, id: item_ref_id, note: item_note ,views: item_views, expires: item_expires},
|
||||
function(data) {
|
||||
// Check values are provided
|
||||
if (item_views && item_expires && item_note) {
|
||||
// Send a GET request to ajax.php as ajax.php?share_generate_link=true....
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{share_generate_link: 'true', client_id: client_id, type: item_type, id: item_ref_id, note: item_note ,views: item_views, expires: item_expires},
|
||||
function(data) {
|
||||
|
||||
// If we get a response from ajax.php, parse it as JSON
|
||||
const response = JSON.parse(data);
|
||||
// If we get a response from ajax.php, parse it as JSON
|
||||
const response = JSON.parse(data);
|
||||
|
||||
document.getElementById("share_link_header").hidden = false;
|
||||
document.getElementById("share_link").hidden = false;
|
||||
document.getElementById("share_link").value = response;
|
||||
document.getElementById("share_link_header").hidden = false;
|
||||
document.getElementById("share_link").hidden = false;
|
||||
document.getElementById("share_link").value = response;
|
||||
|
||||
// Copy link to clipboard
|
||||
navigator.clipboard.writeText(response);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
// Copy link to clipboard
|
||||
navigator.clipboard.writeText(response);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal" id="shareModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-share"></i> Generate Share Link</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="ajax.php" method="GET" id="newShareLink">
|
||||
<input type="hidden" name="client_id" id="share_client_id" value="">
|
||||
<input type="hidden" name="item_type" id="share_item_type" value="">
|
||||
<input type="hidden" name="item_ref_id" id="share_item_ref_id" value="">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<label>Views / Expire <strong class="text-danger">*</strong></label>
|
||||
<div class="form-row">
|
||||
<div class="col-4">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
|
||||
</div>
|
||||
<input type="number" class="form-control" name="views" id="share_views" placeholder="Views before link expires" value="1" required>
|
||||
</div>
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-share"></i> Generate Share Link</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
<form action="ajax.php" method="GET" id="newShareLink">
|
||||
<input type="hidden" name="client_id" id="share_client_id" value="">
|
||||
<input type="hidden" name="item_type" id="share_item_type" value="">
|
||||
<input type="hidden" name="item_ref_id" id="share_item_ref_id" value="">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<label>Views / Expire <strong class="text-danger">*</strong></label>
|
||||
<div class="form-row">
|
||||
<div class="col-4">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
|
||||
</div>
|
||||
<input type="number" class="form-control" name="views" id="share_views" placeholder="Views before link expires" value="1" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="datetime-local" class="form-control" name="expires" id="share_expires" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="4" name="note" id="share_note" placeholder="Client visible note (required)" required></textarea>
|
||||
</div>
|
||||
|
||||
<p><i>Note: Logins are shared "as is" and will not update</i></p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3 id="share_link_header" hidden>Share URL:</h3>
|
||||
<input type="text" class="form-control" disabled id="share_link" hidden value="">
|
||||
|
||||
</div>
|
||||
<input type="datetime-local" class="form-control" name="expires" id="share_expires" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="4" name="note" id="share_note" placeholder="Client visible note (required)" required></textarea>
|
||||
</div>
|
||||
|
||||
<p><i>Note: Logins are shared "as is" and will not update</i></p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3 id="share_link_header" hidden>Share URL:</h3>
|
||||
<input type="text" class="form-control" disabled id="share_link" hidden value="">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-primary" onclick="event.preventDefault(); generateShareLink()"><strong><i class="fa fa-fw fa-check"></i> Generate</strong></button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-primary" onclick="event.preventDefault(); generateShareLink()"><strong><i class="fa fa-fw fa-check"></i> Generate</strong></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
14
side_nav.php
14
side_nav.php
|
|
@ -40,7 +40,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
|
||||
<h5 class="brand-text text-light my-3"><?php echo htmlentities($session_company_name); ?></h5>
|
||||
|
||||
|
|
@ -93,9 +93,9 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
<?php }
|
||||
|
||||
<?php if ($config_module_enable_accounting == 1) { ?>
|
||||
if ($config_module_enable_accounting == 1) { ?>
|
||||
|
||||
<li class="nav-header mt-3">SALES</li>
|
||||
<li class="nav-item">
|
||||
|
|
@ -129,9 +129,9 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
<?php }
|
||||
|
||||
<?php if ($session_user_role == 1 || $session_user_role == 3 && $config_module_enable_accounting == 1) { ?>
|
||||
if ($session_user_role == 1 || $session_user_role == 3 && $config_module_enable_accounting == 1) { ?>
|
||||
|
||||
<li class="nav-header mt-3">ACCOUNTING</li>
|
||||
<li class="nav-item">
|
||||
|
|
@ -173,9 +173,9 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
<?php }
|
||||
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
if ($session_user_role == 3) { ?>
|
||||
|
||||
<li class="nav-item mt-3">
|
||||
<a href="users.php" class="nav-link">
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ if (isset($_GET['ticket_id'])) {
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM tickets
|
||||
LEFT JOIN clients ON ticket_client_id = client_id
|
||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||
"SELECT * FROM tickets
|
||||
LEFT JOIN clients ON ticket_client_id = client_id
|
||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||
LEFT JOIN locations ON ticket_location_id = location_id
|
||||
LEFT JOIN assets ON ticket_asset_id = asset_id
|
||||
LEFT JOIN vendors ON ticket_vendor_id = vendor_id
|
||||
|
|
@ -637,3 +637,4 @@ if ($ticket_status !== "Closed") { ?>
|
|||
<!-- Ticket collision detect JS (jQuery is called in footer, so collision detection script MUST be below it) -->
|
||||
<script src="js/ticket_collision_detection.js"></script>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
|||
101
tickets.php
101
tickets.php
|
|
@ -109,18 +109,21 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
|||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o, 'status' => $status, 'assigned' => $ticket_assigned_filter)));
|
||||
|
||||
// Main ticket query:
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM tickets
|
||||
LEFT JOIN clients ON ticket_client_id = client_id
|
||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||
LEFT JOIN assets ON ticket_asset_id = asset_id
|
||||
LEFT JOIN locations ON ticket_location_id = location_id
|
||||
WHERE tickets.company_id = $session_company_id
|
||||
AND ticket_assigned_to LIKE '%$ticket_assigned_filter%'
|
||||
AND $ticket_status_snippet
|
||||
AND DATE(ticket_created_at) BETWEEN '$dtf' AND '$dtt'
|
||||
AND (CONCAT(ticket_prefix,ticket_number) LIKE '%$q%' OR client_name LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM tickets
|
||||
LEFT JOIN clients ON ticket_client_id = client_id
|
||||
LEFT JOIN contacts ON ticket_contact_id = contact_id
|
||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||
LEFT JOIN assets ON ticket_asset_id = asset_id
|
||||
LEFT JOIN locations ON ticket_location_id = location_id
|
||||
WHERE tickets.company_id = $session_company_id
|
||||
AND ticket_assigned_to LIKE '%$ticket_assigned_filter%'
|
||||
AND $ticket_status_snippet
|
||||
AND DATE(ticket_created_at) BETWEEN '$dtf' AND '$dtt'
|
||||
AND (CONCAT(ticket_prefix,ticket_number) LIKE '%$q%' OR client_name LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
|
@ -147,11 +150,11 @@ $row = mysqli_fetch_array($sql_total_tickets_assigned);
|
|||
$user_active_assigned_tickets = $row['total_tickets_assigned'];
|
||||
|
||||
?>
|
||||
<style>
|
||||
.popover {
|
||||
max-width: 600px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.popover {
|
||||
max-width: 600px;
|
||||
}
|
||||
</style>
|
||||
<div class="card card-dark elevation-3">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-life-ring"></i> Tickets
|
||||
|
|
@ -200,7 +203,7 @@ $user_active_assigned_tickets = $row['total_tickets_assigned'];
|
|||
</div>
|
||||
<a href="?assigned=unassigned" class="btn btn-outline-danger"><i class="fa fa-fw fa-exclamation-triangle"></i>
|
||||
Unassigned Tickets | <strong> <?php echo $total_tickets_unassigned; ?></strong></a>
|
||||
<!-- <a href="#" class="btn btn-outline-info"><i class="fa fa-fw fa-cogs"></i> Tasks</a>-->
|
||||
<!-- <a href="#" class="btn btn-outline-info"><i class="fa fa-fw fa-cogs"></i> Tasks</a>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -306,27 +309,27 @@ $user_active_assigned_tickets = $row['total_tickets_assigned'];
|
|||
} ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark"
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_number&o=<?php echo $disp; ?>">Number</a>
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_number&o=<?php echo $disp; ?>">Number</a>
|
||||
</th>
|
||||
<th><a class="text-dark"
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_subject&o=<?php echo $disp; ?>">Subject</a>
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_subject&o=<?php echo $disp; ?>">Subject</a>
|
||||
</th>
|
||||
<th><a class="text-dark"
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client / Contact</a>
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client / Contact</a>
|
||||
</th>
|
||||
<th><a class="text-dark"
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_priority&o=<?php echo $disp; ?>">Priority</a>
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_priority&o=<?php echo $disp; ?>">Priority</a>
|
||||
</th>
|
||||
<th><a class="text-dark"
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_status&o=<?php echo $disp; ?>">Status</a>
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_status&o=<?php echo $disp; ?>">Status</a>
|
||||
<th><a class="text-dark"
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">Assigned</a>
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">Assigned</a>
|
||||
</th>
|
||||
<th><a class="text-dark"
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_updated_at&o=<?php echo $disp; ?>">Last Response</a>
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_updated_at&o=<?php echo $disp; ?>">Last Response</a>
|
||||
</th>
|
||||
<th><a class="text-dark"
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_created_at&o=<?php echo $disp; ?>">Created</a>
|
||||
href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_created_at&o=<?php echo $disp; ?>">Created</a>
|
||||
</th>
|
||||
|
||||
<th class="text-center">Action</th>
|
||||
|
|
@ -384,8 +387,7 @@ $user_active_assigned_tickets = $row['total_tickets_assigned'];
|
|||
if (empty($ticket_assigned_to)) {
|
||||
if ($ticket_status == "Closed") {
|
||||
$ticket_assigned_to_display = "<p>Not Assigned</p>";
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$ticket_assigned_to_display = "<p class='text-danger'>Not Assigned</p>";
|
||||
}
|
||||
} else {
|
||||
|
|
@ -407,7 +409,7 @@ $user_active_assigned_tickets = $row['total_tickets_assigned'];
|
|||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<strong><a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>"><?php echo $ticket_subject; ?></a></strong>
|
||||
<strong><a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>"><?php echo $ticket_subject; ?></a></strong>
|
||||
</td>
|
||||
<td>
|
||||
<strong><a href="client_tickets.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></strong>
|
||||
|
|
@ -421,24 +423,23 @@ $user_active_assigned_tickets = $row['total_tickets_assigned'];
|
|||
<td><?php echo $ticket_created_at; ?></td>
|
||||
<td>
|
||||
<?php if ($ticket_status !== "Closed") { ?>
|
||||
<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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal"
|
||||
data-target="#editTicketModal<?php echo $ticket_id; ?>">Edit</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger"
|
||||
href="post.php?delete_ticket=<?php echo $ticket_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
<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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal"
|
||||
data-target="#editTicketModal<?php echo $ticket_id; ?>">Edit</a>
|
||||
<?php if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger"
|
||||
href="post.php?delete_ticket=<?php echo $ticket_id; ?>">Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
include("ticket_edit_modal.php");
|
||||
require("ticket_edit_modal.php");
|
||||
|
||||
?>
|
||||
</td>
|
||||
|
|
@ -453,10 +454,10 @@ $user_active_assigned_tickets = $row['total_tickets_assigned'];
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("ticket_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("ticket_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS transfer_created_at, expense_date AS transfer_date, expense_amount AS transfer_amount, expense_account_id AS transfer_account_from, revenue_account_id AS transfer_account_to, transfer_expense_id, transfer_revenue_id , transfer_id, transfer_notes FROM transfers, expenses, revenues
|
||||
WHERE transfer_expense_id = expense_id
|
||||
AND transfer_revenue_id = revenue_id
|
||||
AND transfers.company_id = $session_company_id
|
||||
AND DATE(expense_date) BETWEEN '$dtf' AND '$dtt'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
"SELECT SQL_CALC_FOUND_ROWS transfer_created_at, expense_date AS transfer_date, expense_amount AS transfer_amount, expense_account_id AS transfer_account_from, revenue_account_id AS transfer_account_to, transfer_expense_id, transfer_revenue_id , transfer_id, transfer_notes FROM transfers, expenses, revenues
|
||||
WHERE transfer_expense_id = expense_id
|
||||
AND transfer_revenue_id = revenue_id
|
||||
AND transfers.company_id = $session_company_id
|
||||
AND DATE(expense_date) BETWEEN '$dtf' AND '$dtt'
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM trips
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM trips
|
||||
LEFT JOIN clients ON trip_client_id = client_id
|
||||
LEFT JOIN users ON trip_user_id = user_id
|
||||
WHERE (trip_purpose LIKE '%$q%' OR trip_source LIKE '%$q%' OR trip_destination LIKE '%$q%' OR trip_miles LIKE '%$q%' OR client_name LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||
|
|
|
|||
285
users.php
285
users.php
|
|
@ -1,4 +1,5 @@
|
|||
<?php require_once("inc_all_settings.php");
|
||||
<?php
|
||||
require_once("inc_all_settings.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
|
|
@ -19,162 +20,162 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-users"></i> Users</h3>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addUserModal">
|
||||
<i class="fas fa-fw fa-plus"></i> New User
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<!--<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#userInviteModal"><i class="fas fa-paper-plane mr-2"></i>Invite User</a>-->
|
||||
</div>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-users"></i> Users</h3>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addUserModal">
|
||||
<i class="fas fa-fw fa-plus"></i> New User
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<!--<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#userInviteModal"><i class="fas fa-paper-plane mr-2"></i>Invite User</a>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control col-md-4" name="q" value="<?php if (isset($q)) {echo strip_tags(htmlentities($q));} ?>" placeholder="Search Users">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control col-md-4" name="q" value="<?php if (isset($q)) {echo strip_tags(htmlentities($q));} ?>" placeholder="Search Users">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="text-center"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_email&o=<?php echo $disp; ?>">Email</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_role&o=<?php echo $disp; ?>">Role</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th>Last Login</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th class="text-center"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_email&o=<?php echo $disp; ?>">Email</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_role&o=<?php echo $disp; ?>">Role</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th>Last Login</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$user_id = $row['user_id'];
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
$user_email = htmlentities($row['user_email']);
|
||||
$user_status = intval($row['user_status']);
|
||||
if ($user_status == 2) {
|
||||
$user_status_display = "<span class='text-info'>Invited</span>";
|
||||
}elseif ($user_status == 1) {
|
||||
$user_status_display = "<span class='text-success'>Active</span>";
|
||||
}else{
|
||||
$user_status_display = "<span class='text-danger'>Disabled</span>";
|
||||
}
|
||||
$user_avatar = htmlentities($row['user_avatar']);
|
||||
$user_token = htmlentities($row['user_token']);
|
||||
$user_default_company = $row['user_default_company'];
|
||||
$user_role = $row['user_role'];
|
||||
if ($user_role == 3) {
|
||||
$user_role_display = "Administrator";
|
||||
}elseif ($user_role == 2) {
|
||||
$user_role_display = "Technician";
|
||||
}else{
|
||||
$user_role_display = "Accountant";
|
||||
}
|
||||
$user_company_access_sql = mysqli_query($mysqli, "SELECT company_id FROM user_companies WHERE user_id = $user_id");
|
||||
$user_company_access_array = array();
|
||||
while ($row = mysqli_fetch_array($user_company_access_sql)) {
|
||||
$user_company_access_array[] = $row['company_id'];
|
||||
}
|
||||
$user_company_access = implode(',', $user_company_access_array);
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$user_id = $row['user_id'];
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
$user_email = htmlentities($row['user_email']);
|
||||
$user_status = intval($row['user_status']);
|
||||
if ($user_status == 2) {
|
||||
$user_status_display = "<span class='text-info'>Invited</span>";
|
||||
}elseif ($user_status == 1) {
|
||||
$user_status_display = "<span class='text-success'>Active</span>";
|
||||
}else{
|
||||
$user_status_display = "<span class='text-danger'>Disabled</span>";
|
||||
}
|
||||
$user_avatar = htmlentities($row['user_avatar']);
|
||||
$user_token = htmlentities($row['user_token']);
|
||||
$user_default_company = $row['user_default_company'];
|
||||
$user_role = $row['user_role'];
|
||||
if ($user_role == 3) {
|
||||
$user_role_display = "Administrator";
|
||||
}elseif ($user_role == 2) {
|
||||
$user_role_display = "Technician";
|
||||
}else{
|
||||
$user_role_display = "Accountant";
|
||||
}
|
||||
$user_company_access_sql = mysqli_query($mysqli, "SELECT company_id FROM user_companies WHERE user_id = $user_id");
|
||||
$user_company_access_array = array();
|
||||
while ($row = mysqli_fetch_array($user_company_access_sql)) {
|
||||
$user_company_access_array[] = $row['company_id'];
|
||||
}
|
||||
$user_company_access = implode(',', $user_company_access_array);
|
||||
|
||||
$user_initials = htmlentities(initials($user_name));
|
||||
$user_initials = htmlentities(initials($user_name));
|
||||
|
||||
$sql_last_login = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM logs
|
||||
$sql_last_login = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT * FROM logs
|
||||
WHERE log_user_id = $user_id AND log_type = 'Login'
|
||||
ORDER BY log_id DESC LIMIT 1"
|
||||
);
|
||||
$row = mysqli_fetch_array($sql_last_login);
|
||||
$log_created_at = $row['log_created_at'];
|
||||
$log_ip = htmlentities($row['log_ip']);
|
||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||
$log_user_os = getOS($log_user_agent);
|
||||
$log_user_browser = getWebBrowser($log_user_agent);
|
||||
$last_login = "$log_user_os<br>$log_user_browser<br><i class='fa fa-fw fa-globe'></i> $log_ip";
|
||||
if (empty($last_login)) {
|
||||
$last_login = "Never logged in";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editUserModal<?php echo $user_id; ?>">
|
||||
<?php if (!empty($user_avatar)) { ?>
|
||||
<img class="img-size-50 img-circle" src="<?php echo "uploads/users/$user_id/$user_avatar"; ?>">
|
||||
<?php }else{ ?>
|
||||
<span class="fa-stack fa-2x">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $user_initials; ?></span>
|
||||
</span>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
||||
<div class="text-secondary"><?php echo $user_name; ?></div>
|
||||
</a>
|
||||
</td>
|
||||
<td><a href="mailto:<?php echo $user_email; ?>"><?php echo $user_email; ?></a></td>
|
||||
<td><?php echo $user_role_display; ?></td>
|
||||
<td><?php echo $user_status_display; ?></td>
|
||||
<td>
|
||||
<?php echo $log_created_at; ?>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $last_login; ?></small>
|
||||
</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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editUserModal<?php echo $user_id; ?>">Edit</a>
|
||||
<?php if ($user_status == 0) { ?>
|
||||
<a class="dropdown-item text-success" href="post.php?activate_user=<?php echo $user_id; ?>">Activate</a>
|
||||
<?php }elseif ($user_status == 1) { ?>
|
||||
<a class="dropdown-item text-danger" href="post.php?disable_user=<?php echo $user_id; ?>">Disable</a>
|
||||
<?php } ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editUserCompaniesModal<?php echo $user_id; ?>">Company Access</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="#" data-toggle="modal" data-target="#archiveUserModal<?php echo $user_id; ?>">Archive</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("user_edit_modal.php");
|
||||
include("user_companies_modal.php");
|
||||
include("user_archive_modal.php");
|
||||
|
||||
);
|
||||
$row = mysqli_fetch_array($sql_last_login);
|
||||
$log_created_at = $row['log_created_at'];
|
||||
$log_ip = htmlentities($row['log_ip']);
|
||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||
$log_user_os = getOS($log_user_agent);
|
||||
$log_user_browser = getWebBrowser($log_user_agent);
|
||||
$last_login = "$log_user_os<br>$log_user_browser<br><i class='fa fa-fw fa-globe'></i> $log_ip";
|
||||
if (empty($last_login)) {
|
||||
$last_login = "Never logged in";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editUserModal<?php echo $user_id; ?>">
|
||||
<?php if (!empty($user_avatar)) { ?>
|
||||
<img class="img-size-50 img-circle" src="<?php echo "uploads/users/$user_id/$user_avatar"; ?>">
|
||||
<?php }else{ ?>
|
||||
<span class="fa-stack fa-2x">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $user_initials; ?></span>
|
||||
</span>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<div class="text-secondary"><?php echo $user_name; ?></div>
|
||||
</a>
|
||||
</td>
|
||||
<td><a href="mailto:<?php echo $user_email; ?>"><?php echo $user_email; ?></a></td>
|
||||
<td><?php echo $user_role_display; ?></td>
|
||||
<td><?php echo $user_status_display; ?></td>
|
||||
<td>
|
||||
<?php echo $log_created_at; ?>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $last_login; ?></small>
|
||||
</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">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editUserModal<?php echo $user_id; ?>">Edit</a>
|
||||
<?php if ($user_status == 0) { ?>
|
||||
<a class="dropdown-item text-success" href="post.php?activate_user=<?php echo $user_id; ?>">Activate</a>
|
||||
<?php }elseif ($user_status == 1) { ?>
|
||||
<a class="dropdown-item text-danger" href="post.php?disable_user=<?php echo $user_id; ?>">Disable</a>
|
||||
<?php } ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editUserCompaniesModal<?php echo $user_id; ?>">Company Access</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="#" data-toggle="modal" data-target="#archiveUserModal<?php echo $user_id; ?>">Archive</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("user_edit_modal.php");
|
||||
include("user_companies_modal.php");
|
||||
include("user_archive_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
</div>
|
||||
<script>
|
||||
function generatePassword() {
|
||||
document.getElementById("password").value = "<?php echo randomString() ?>"
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<script>
|
||||
function generatePassword() {
|
||||
document.getElementById("password").value = "<?php echo randomString() ?>"
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ $url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, '
|
|||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||
"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
|
||||
WHERE vendor_client_id = 0
|
||||
AND vendor_template = 0
|
||||
AND vendor_template = 0
|
||||
AND DATE(vendor_created_at) BETWEEN '$dtf' AND '$dtt'
|
||||
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%')
|
||||
AND vendor_archived_at IS NULL
|
||||
|
|
|
|||
Loading…
Reference in New Issue