Merge pull request #599 from wrongecho/misc-tidy

Misc tidy
This commit is contained in:
Johnny 2023-02-02 16:02:43 -05:00 committed by GitHub
commit 11155f64b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 1193 additions and 1214 deletions

View File

@ -1,36 +1,36 @@
<?php
if (!isset($_SESSION)) {
// HTTP Only cookies
ini_set("session.cookie_httponly", True);
if ($config_https_only) {
// Tell client to only send cookie(s) over HTTPS
ini_set("session.cookie_secure", True);
}
session_start();
// HTTP Only cookies
ini_set("session.cookie_httponly", true);
if ($config_https_only) {
// Tell client to only send cookie(s) over HTTPS
ini_set("session.cookie_secure", true);
}
session_start();
}
//Check to see if setup is enabled
if (!isset($config_enable_setup) || $config_enable_setup == 1) {
header("Location: setup.php");
exit;
header("Location: setup.php");
exit;
}
// Check user is logged in with a valid session
if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
header("Location: login.php");
exit;
header("Location: login.php");
exit;
}
// SESSION FINGERPRINT
$session_ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
$session_ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
// User agent
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
$session_user_id = $_SESSION['user_id'];
$sql = mysqli_query($mysqli,"SELECT * FROM users, user_settings WHERE users.user_id = user_settings.user_id AND users.user_id = $session_user_id");
$sql = mysqli_query($mysqli, "SELECT * FROM users, user_settings WHERE users.user_id = user_settings.user_id AND users.user_id = $session_user_id");
$row = mysqli_fetch_array($sql);
$session_name = mysqli_real_escape_string($mysqli, $row['user_name']);
$session_email = $row['user_email'];
@ -39,29 +39,29 @@ $session_token = $row['user_token'];
$session_company_id = $row['user_default_company'];
$session_user_role = $row['user_role'];
if ($session_user_role == 3) {
$session_user_role_display = "Administrator";
}elseif ($session_user_role == 2) {
$session_user_role_display = "Technician";
}else{
$session_user_role_display = "Accountant";
$session_user_role_display = "Administrator";
} elseif ($session_user_role == 2) {
$session_user_role_display = "Technician";
} else {
$session_user_role_display = "Accountant";
}
//LOAD USER COMPANY ACCESS PERMISSIONS
$session_user_company_access_sql = mysqli_query($mysqli,"SELECT company_id FROM user_companies WHERE user_id = $session_user_id");
$session_user_company_access_sql = mysqli_query($mysqli, "SELECT company_id FROM user_companies WHERE user_id = $session_user_id");
$session_user_company_access_array = array();
while ($row = mysqli_fetch_array($session_user_company_access_sql)) {
$session_user_company_access_array[] = $row['company_id'];
$session_user_company_access_array[] = $row['company_id'];
}
$session_user_company_access = implode(',',$session_user_company_access_array);
$session_user_company_access = implode(',', $session_user_company_access_array);
//Check to see if user has rights to company Prevents User from access a company he is not allowed to have access to.
if (!in_array($session_company_id,$session_user_company_access_array)) {
session_start();
session_destroy();
header('Location: login.php');
if (!in_array($session_company_id, $session_user_company_access_array)) {
session_start();
session_destroy();
header('Location: login.php');
}
$sql = mysqli_query($mysqli,"SELECT * FROM companies WHERE company_id = $session_company_id");
$sql = mysqli_query($mysqli, "SELECT * FROM companies WHERE company_id = $session_company_id");
$row = mysqli_fetch_array($sql);
$session_company_name = $row['company_name'];
@ -69,21 +69,21 @@ $session_company_country = $row['company_country'];
$session_company_locale = $row['company_locale'];
$session_company_currency = $row['company_currency'];
include("get_settings.php");
require_once("get_settings.php");
//Detects if using an Apple device and uses Apple Maps instead of google
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$iPod = stripos($_SERVER['HTTP_USER_AGENT'], "iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'], "iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'], "iPad");
if ($iPod || $iPhone || $iPad) {
$session_map_source = "apple";
}else{
$session_map_source = "google";
$session_map_source = "apple";
} else {
$session_map_source = "google";
}
//Get Notification Count for the badge on the top nav
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('notification_id') AS num FROM notifications WHERE (notification_user_id = $session_user_id OR notification_user_id = 0) AND notification_dismissed_at IS NULL AND company_id = $session_company_id"));
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('notification_id') AS num FROM notifications WHERE (notification_user_id = $session_user_id OR notification_user_id = 0) AND notification_dismissed_at IS NULL AND company_id = $session_company_id"));
$num_notifications = $row['num'];
//Set Currency Format

View File

@ -1,4 +1,4 @@
<?php include("inc_all_client.php");
<?php require_once("inc_all_client.php");
//Get Asset Counts
//All Asset Count
@ -73,7 +73,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-desktop"></i> Assets</h3>
<div class="card-tools">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addAssetModal"><i class="fas fa-fw fa-plus"></i> New <?php if (!empty($_GET['type'])) { echo ucwords(strip_tags(htmlentities($_GET['type']))); }else{ echo "Asset"; } ?></button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addAssetModal"><i class="fas fa-fw fa-plus"></i> New <?php if (!empty($_GET['type'])) { echo ucwords(strip_tags(htmlentities($_GET['type']))); } else { echo "Asset"; } ?></button>
</div>
</div>
<div class="card-body">
@ -84,7 +84,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<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 <?php if (!empty($_GET['type'])) { echo ucwords(strip_tags(htmlentities($_GET['type']))); }else{ echo "Asset"; } ?>s">
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search <?php if (!empty($_GET['type'])) { echo ucwords(strip_tags(htmlentities($_GET['type']))); } else { echo "Asset"; } ?>s">
<div class="input-group-append">
<button class="btn btn-dark"><i class="fa fa-search"></i></button>
</div>
@ -92,30 +92,30 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
</div>
<div class="col-sm-6">
<div class="btn-group btn-group-lg">
<a href="?<?php echo $url_query_strings_sb; ?>&type=" class="btn <?php if ($_GET['type'] == 'all' || empty($_GET['type'])) { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">All Assets <span class="right badge badge-light"><?php echo $all_count; ?></span></a>
<a href="?<?php echo $url_query_strings_sb; ?>&type=" class="btn <?php if ($_GET['type'] == 'all' || empty($_GET['type'])) { echo 'btn-primary'; } else { echo 'btn-default'; } ?>">All Assets <span class="right badge badge-light"><?php echo $all_count; ?></span></a>
<?php
if ($workstation_count > 0) { ?>
<a href="?<?php echo $url_query_strings_sb; ?>&type=workstation" class="btn <?php if ($_GET['type'] == 'workstation') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-desktop"></i> Workstations <span class="right badge badge-light"><?php echo $workstation_count; ?></span></a>
<a href="?<?php echo $url_query_strings_sb; ?>&type=workstation" class="btn <?php if ($_GET['type'] == 'workstation') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-desktop"></i> Workstations <span class="right badge badge-light"><?php echo $workstation_count; ?></span></a>
<?php
} ?>
<?php
if ($server_count > 0) { ?>
<a href="?<?php echo $url_query_strings_sb; ?>&type=server" class="btn <?php if ($_GET['type'] == 'server') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-server"></i> Servers <span class="right badge badge-light"><?php echo $server_count; ?></span></a>
<a href="?<?php echo $url_query_strings_sb; ?>&type=server" class="btn <?php if ($_GET['type'] == 'server') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-server"></i> Servers <span class="right badge badge-light"><?php echo $server_count; ?></span></a>
<?php
} ?>
<?php
if ($virtual_count > 0) { ?>
<a href="?<?php echo $url_query_strings_sb; ?>&type=virtual" class="btn <?php if ($_GET['type'] == 'virtual') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-cloud"></i> Virtual <span class="right badge badge-light"><?php echo $virtual_count; ?></span></a>
<a href="?<?php echo $url_query_strings_sb; ?>&type=virtual" class="btn <?php if ($_GET['type'] == 'virtual') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-cloud"></i> Virtual <span class="right badge badge-light"><?php echo $virtual_count; ?></span></a>
<?php
} ?>
<?php
if ($network_count > 0) { ?>
<a href="?<?php echo $url_query_strings_sb; ?>&type=network" class="btn <?php if ($_GET['type'] == 'network') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-network-wired"></i> Network <span class="right badge badge-light"><?php echo $network_count; ?></span></a>
<a href="?<?php echo $url_query_strings_sb; ?>&type=network" class="btn <?php if ($_GET['type'] == 'network') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-network-wired"></i> Network <span class="right badge badge-light"><?php echo $network_count; ?></span></a>
<?php
} ?>
<?php
if ($network_count > 0) { ?>
<a href="?<?php echo $url_query_strings_sb; ?>&type=other" class="btn <?php if ($_GET['type'] == 'other') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>"><i class="fa fa-fw fa-tag"></i> Other <span class="right badge badge-light"><?php echo $other_count; ?></span></a>
<a href="?<?php echo $url_query_strings_sb; ?>&type=other" class="btn <?php if ($_GET['type'] == 'other') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-tag"></i> Other <span class="right badge badge-light"><?php echo $other_count; ?></span></a>
<?php
} ?>
</div>
@ -169,19 +169,19 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
$asset_serial = htmlentities($row['asset_serial']);
if (empty($asset_serial)) {
$asset_serial_display = "-";
}else{
} else {
$asset_serial_display = $asset_serial;
}
$asset_os = htmlentities($row['asset_os']);
if (empty($asset_os)) {
$asset_os_display = "-";
}else{
} else {
$asset_os_display = $asset_os;
}
$asset_ip = htmlentities($row['asset_ip']);
if (empty($asset_ip)) {
$asset_ip_display = "-";
}else{
} else {
$asset_ip_display = "$asset_ip<button class='btn btn-sm' data-clipboard-text='$asset_ip'><i class='far fa-copy text-secondary'></i></button>";
}
$asset_mac = htmlentities($row['asset_mac']);
@ -191,7 +191,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
$asset_install_date = $row['asset_install_date'];
if (empty($asset_install_date)) {
$asset_install_date_display = "-";
}else{
} else {
$asset_install_date_display = $asset_install_date;
}
$asset_notes = htmlentities($row['asset_notes']);
@ -203,29 +203,29 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
if ($asset_type == 'Laptop') {
$device_icon = "laptop";
}elseif ($asset_type == 'Desktop') {
} elseif ($asset_type == 'Desktop') {
$device_icon = "desktop";
}elseif ($asset_type == 'Server') {
} elseif ($asset_type == 'Server') {
$device_icon = "server";
}elseif ($asset_type == 'Printer') {
} elseif ($asset_type == 'Printer') {
$device_icon = "print";
}elseif ($asset_type == 'Camera') {
} elseif ($asset_type == 'Camera') {
$device_icon = "video";
}elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
} elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
$device_icon = "network-wired";
}elseif ($asset_type == 'Access Point') {
} elseif ($asset_type == 'Access Point') {
$device_icon = "wifi";
}elseif ($asset_type == 'Phone') {
} elseif ($asset_type == 'Phone') {
$device_icon = "phone";
}elseif ($asset_type == 'Mobile Phone') {
} elseif ($asset_type == 'Mobile Phone') {
$device_icon = "mobile-alt";
}elseif ($asset_type == 'Tablet') {
} elseif ($asset_type == 'Tablet') {
$device_icon = "tablet-alt";
}elseif ($asset_type == 'TV') {
} elseif ($asset_type == 'TV') {
$device_icon = "tv";
}elseif ($asset_type == 'Virtual Machine') {
} elseif ($asset_type == 'Virtual Machine') {
$device_icon = "cloud";
}else{
} else {
$device_icon = "tag";
}
@ -345,10 +345,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<?php
include("client_asset_edit_modal.php");
include("client_asset_copy_modal.php");
include("client_asset_tickets_modal.php");
include("client_asset_interface_add_modal.php");
require("client_asset_edit_modal.php");
require("client_asset_copy_modal.php");
require("client_asset_tickets_modal.php");
require("client_asset_interface_add_modal.php");
}
?>
@ -356,13 +356,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
</tbody>
</table>
</div>
<?php include("pagination.php"); ?>
<?php require_once("pagination.php"); ?>
</div>
</div>
<?php
include("client_asset_add_modal.php");
include("client_asset_import_modal.php");
?>
<?php include("footer.php"); ?>
require_once("client_asset_add_modal.php");
require_once("client_asset_import_modal.php");
require_once include("footer.php");

View File

@ -1,4 +1,4 @@
<?php include("inc_all_client.php");
<?php require_once("inc_all_client.php");
$sql_files_images = mysqli_query($mysqli, "SELECT * FROM files WHERE file_client_id = $client_id AND (file_ext LIKE 'JPG' OR file_ext LIKE 'jpg' OR file_ext LIKE 'JPEG' OR file_ext LIKE 'jpeg' OR file_ext LIKE 'png' OR file_ext LIKE 'PNG') ORDER BY file_name ASC");
@ -8,105 +8,101 @@ $num_of_files = mysqli_num_rows($sql_files_images) + mysqli_num_rows($sql_files_
?>
<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-paperclip"></i> Files</h3>
<div class="card-tools">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addFileModal"><i class="fas fa-fw fa-cloud-upload-alt"></i> Upload File</button>
</div>
</div>
<div class="card-body">
<?php
if ($num_of_files == 0) {
echo "<div style='text-align: center;'><h3 class='text-secondary'>No Records Here</h3></div>";
}
?>
<div class="row">
<?php
while ($row = mysqli_fetch_array($sql_files_images)) {
$file_id = $row['file_id'];
$file_name = htmlentities($row['file_name']);
$file_reference_name = htmlentities($row['file_reference_name']);
$file_ext = htmlentities($row['file_ext']);
?>
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 mb-3">
<div class="card">
<a href="#" data-toggle="modal" data-target="#viewFileModal<?php echo $file_id; ?>">
<img class="img-fluid" src="<?php echo "uploads/clients/$session_company_id/$client_id/$file_reference_name"; ?>">
</a>
<div class="card-footer bg-dark text-white p-1">
<center>
<a href="<?php echo "uploads/clients/$session_company_id/$client_id/$file_reference_name"; ?>" download="<?php echo $file_name; ?>" class="text-white float-left ml-1"><i class="fa fa-cloud-download-alt"></i></a>
<a href="#" data-toggle="modal" data-target="#shareModal" onclick="populateShareModal(<?php echo "$client_id, 'File', $file_id"; ?>)" class="text-white float-left ml-1"><i class="fa fa-share"></i></a>
<small><?php echo $file_name; ?></small>
<a href="post.php?delete_file=<?php echo $file_id; ?>" class="text-white float-right mr-1"><i class="fa fa-times"></i></a>
</center>
</div>
<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-paperclip"></i> Files</h3>
<div class="card-tools">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addFileModal"><i class="fas fa-fw fa-cloud-upload-alt"></i> Upload File</button>
</div>
</div>
</div>
<div class="card-body">
<?php
include("client_file_view_modal.php");
}
?>
</div>
<?php
if ($num_of_files == 0) {
<div class="row">
echo "<div style='text-align: center;'><h3 class='text-secondary'>No Records Here</h3></div>";
}
<table class="table">
?>
<?php
while ($row = mysqli_fetch_array($sql_files_other)) {
$file_id = $row['file_id'];
$file_name = htmlentities($row['file_name']);
$file_reference_name = htmlentities($row['file_reference_name']);
$file_ext = htmlentities($row['file_ext']);
if ($file_ext == 'pdf') {
$file_icon = "file-pdf";
}elseif ($file_ext == 'gz' || $file_ext == 'tar' || $file_ext == 'zip' || $file_ext == '7z' || $file_ext == 'rar') {
$file_icon = "file-archive";
}elseif ($file_ext == 'txt') {
$file_icon = "file-alt";
}elseif ($file_ext == 'doc' || $file_ext == 'docx') {
$file_icon = "file-word";
}elseif ($file_ext == 'xls' || $file_ext == 'xlsx' || $file_ext == 'ods') {
$file_icon = "file-excel";
}elseif ($file_ext == 'mp3' || $file_ext == 'wav' || $file_ext == 'ogg') {
$file_icon = "file-audio";
}else{
$file_icon = "file";
}
?>
<div class="row">
<tr>
<td><a href="<?php echo "uploads/clients/$session_company_id/$client_id/$file_reference_name"; ?>" target="_blank" class="text-secondary"><i class="fa fa-fw fa-2x fa-<?php echo $file_icon; ?> mr-3"></i> <?php echo basename($file_name); ?></a></td>
<td>
<a href="<?php echo "uploads/clients/$session_company_id/$client_id/$file_reference_name"; ?>" download="<?php echo $file_name; ?>" class="text-secondary float-left ml-1"><i class="fa fa-cloud-download-alt"></i></a>
<a href="#" data-toggle="modal" data-target="#shareModal" onclick="populateShareModal(<?php echo "$client_id, 'File', $file_id"; ?>)" class="text-secondary float-left ml-1"><i class="fa fa-share"></i></a>
<a href="post.php?delete_file=<?php echo $file_id; ?>" class="text-secondary float-right mr-1"><i class="fa fa-times"></i></a>
</td>
</tr>
<?php
}
?>
<?php
while ($row = mysqli_fetch_array($sql_files_images)) {
$file_id = $row['file_id'];
$file_name = htmlentities($row['file_name']);
$file_reference_name = htmlentities($row['file_reference_name']);
$file_ext = htmlentities($row['file_ext']);
?>
<div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 mb-3">
<div class="card">
<a href="#" data-toggle="modal" data-target="#viewFileModal<?php echo $file_id; ?>">
<img class="img-fluid" src="<?php echo "uploads/clients/$session_company_id/$client_id/$file_reference_name"; ?>" alt="<?php echo $file_reference_name ?>">
</a>
<div class="card-footer bg-dark text-white p-1" style="text-align: center;">
<a href="<?php echo "uploads/clients/$session_company_id/$client_id/$file_reference_name"; ?>" download="<?php echo $file_name; ?>" class="text-white float-left ml-1"><i class="fa fa-cloud-download-alt"></i></a>
<a href="#" data-toggle="modal" data-target="#shareModal" onclick="populateShareModal(<?php echo "$client_id, 'File', $file_id"; ?>)" class="text-white float-left ml-1"><i class="fa fa-share"></i></a>
<small><?php echo $file_name; ?></small>
<a href="post.php?delete_file=<?php echo $file_id; ?>" class="text-white float-right mr-1"><i class="fa fa-times"></i></a>
</div>
</div>
</div>
<?php
include("client_file_view_modal.php");
}
?>
</div>
<div class="row">
<table class="table">
<?php
while ($row = mysqli_fetch_array($sql_files_other)) {
$file_id = $row['file_id'];
$file_name = htmlentities($row['file_name']);
$file_reference_name = htmlentities($row['file_reference_name']);
$file_ext = htmlentities($row['file_ext']);
if ($file_ext == 'pdf') {
$file_icon = "file-pdf";
} elseif ($file_ext == 'gz' || $file_ext == 'tar' || $file_ext == 'zip' || $file_ext == '7z' || $file_ext == 'rar') {
$file_icon = "file-archive";
} elseif ($file_ext == 'txt') {
$file_icon = "file-alt";
} elseif ($file_ext == 'doc' || $file_ext == 'docx') {
$file_icon = "file-word";
} elseif ($file_ext == 'xls' || $file_ext == 'xlsx' || $file_ext == 'ods') {
$file_icon = "file-excel";
} elseif ($file_ext == 'mp3' || $file_ext == 'wav' || $file_ext == 'ogg') {
$file_icon = "file-audio";
} else {
$file_icon = "file";
}
?>
<tr>
<td><a href="<?php echo "uploads/clients/$session_company_id/$client_id/$file_reference_name"; ?>" target="_blank" class="text-secondary"><i class="fa fa-fw fa-2x fa-<?php echo $file_icon; ?> mr-3"></i> <?php echo basename($file_name); ?></a></td>
<td>
<a href="<?php echo "uploads/clients/$session_company_id/$client_id/$file_reference_name"; ?>" download="<?php echo $file_name; ?>" class="text-secondary float-left ml-1"><i class="fa fa-cloud-download-alt"></i></a>
<a href="#" data-toggle="modal" data-target="#shareModal" onclick="populateShareModal(<?php echo "$client_id, 'File', $file_id"; ?>)" class="text-secondary float-left ml-1"><i class="fa fa-share"></i></a>
<a href="post.php?delete_file=<?php echo $file_id; ?>" class="text-secondary float-right mr-1"><i class="fa fa-times"></i></a>
</td>
</tr>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
<?php
include("client_file_add_modal.php");
include("share_modal.php");
?>
<?php include("footer.php"); ?>
require_once("client_file_add_modal.php");
require_once("share_modal.php");
require_once("footer.php");

View File

@ -1,4 +1,4 @@
<?php include("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");
@ -44,213 +44,213 @@ $sql_domains_expiring = mysqli_query($mysqli, "SELECT * FROM domains
<?php if (mysqli_num_rows($sql_important_contacts) > 0) { ?>
<div class="col-md-4">
<div class="col-md-4">
<div class="card card-dark mb-3">
<div class="card-header">
<h5 class="card-title"><i class="fa fa-fw fa-users mr-2"></i>Important Contacts</h5>
</div>
<div class="card-body p-1">
<table class="table table-borderless table-sm">
<?php
while ($row = mysqli_fetch_array($sql_important_contacts)) {
$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 = formatPhoneNumber($row['contact_phone']);
$contact_extension = htmlentities($row['contact_extension']);
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
?>
<tr>
<td>
<a href="client_contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>" class="text-bold"><?php echo $contact_name; ?></a>
<br>
<small class="text-secondary"><?php echo $contact_title; ?></small>
</td>
<td>
<?php if (!empty($contact_phone)) { ?>
<?php echo "<i class='fa fa-fw fa-phone text-secondary'></i> $contact_phone $contact_extension"; ?>
<?php } ?>
<?php if (!empty($contact_mobile)) { ?>
<br>
<div class="text-secondary"><i class='fa fa-fw fa-mobile-alt text-secondary'></i> <?php echo "$contact_mobile"; ?></div>
<?php } ?>
</td>
</tr>
<div class="card card-dark mb-3">
<div class="card-header">
<h5 class="card-title"><i class="fa fa-fw fa-users mr-2"></i>Important Contacts</h5>
</div>
<div class="card-body p-1">
<table class="table table-borderless table-sm">
<?php
}
?>
</table>
while ($row = mysqli_fetch_array($sql_important_contacts)) {
$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 = formatPhoneNumber($row['contact_phone']);
$contact_extension = htmlentities($row['contact_extension']);
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
?>
<tr>
<td>
<a href="client_contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>" class="text-bold"><?php echo $contact_name; ?></a>
<br>
<small class="text-secondary"><?php echo $contact_title; ?></small>
</td>
<td>
<?php if (!empty($contact_phone)) { ?>
<?php echo "<i class='fa fa-fw fa-phone text-secondary'></i> $contact_phone $contact_extension"; ?>
<?php } ?>
<?php if (!empty($contact_mobile)) { ?>
<br>
<div class="text-secondary"><i class='fa fa-fw fa-mobile-alt text-secondary'></i> <?php echo "$contact_mobile"; ?></div>
<?php } ?>
</td>
</tr>
<?php
}
?>
</table>
</div>
</div>
</div>
</div>
<?php } ?>
<?php if (mysqli_num_rows($sql_contacts) > 0 || mysqli_num_rows($sql_vendors) > 0) { ?>
<div class="col-md-3">
<div class="col-md-3">
<div class="card card-dark mb-3">
<div class="card-header">
<h5 class="card-title"><i class="fa fa-history mr-2"></i>Recently Updated</h5>
</div>
<div class="card-body">
<div class="card card-dark mb-3">
<div class="card-header">
<h5 class="card-title"><i class="fa fa-history mr-2"></i>Recently Updated</h5>
</div>
<div class="card-body">
<?php
while ($row = mysqli_fetch_array($sql_contacts)) {
$contact_id = $row['contact_id'];
$contact_name = htmlentities($row['contact_name']);
$contact_updated_at = $row['contact_updated_at'];
?>
<p class="mb-1">
<i class="fa fa-fw fa-user text-secondary mr-1"></i>
<a href="client_contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>"><?php echo $contact_name; ?></a>
</p>
<?php
}
?>
<?php
while ($row = mysqli_fetch_array($sql_vendors)) {
$vendor_id = $row['vendor_id'];
$vendor_name = htmlentities($row['vendor_name']);
$vendor_updated_at = $row['vendor_updated_at'];
while ($row = mysqli_fetch_array($sql_contacts)) {
$contact_id = $row['contact_id'];
$contact_name = htmlentities($row['contact_name']);
$contact_updated_at = $row['contact_updated_at'];
?>
<p class="mb-1">
<i class="fa fa-fw fa-user text-secondary mr-1"></i>
<a href="client_contact_details.php?client_id=<?php echo $client_id; ?>&contact_id=<?php echo $contact_id; ?>"><?php echo $contact_name; ?></a>
</p>
<?php
}
?>
<p class="mb-1">
<i class="fas fa-fw fa-building text-secondary mr-1"></i>
<a href="client_vendors.php?client_id=<?php echo $client_id; ?>&q=<?php echo $vendor_name; ?>"><?php echo $vendor_name; ?></a></td>
</p>
<?php
}
?>
<?php
while ($row = mysqli_fetch_array($sql_vendors)) {
$vendor_id = $row['vendor_id'];
$vendor_name = htmlentities($row['vendor_name']);
$vendor_updated_at = $row['vendor_updated_at'];
?>
<p class="mb-1">
<i class="fas fa-fw fa-building text-secondary mr-1"></i>
<a href="client_vendors.php?client_id=<?php echo $client_id; ?>&q=<?php echo $vendor_name; ?>"><?php echo $vendor_name; ?></a></td>
</p>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php } ?>
<?php
if (mysqli_num_rows($sql_domains_expiring) > 0
|| mysqli_num_rows($sql_asset_warranties_expiring) > 0
|| mysqli_num_rows($sql_asset_retire) > 0
<?php
if (mysqli_num_rows($sql_domains_expiring) > 0
|| mysqli_num_rows($sql_asset_warranties_expiring) > 0
|| mysqli_num_rows($sql_asset_retire) > 0
) { ?>
<div class="col-md-4">
<div class="card card-dark mb-3">
<div class="card-header">
<h5 class="card-title"><i class="fa fa-fw fa-exclamation-triangle text-warning mr-2"></i>Upcoming Expirations</h5>
</div>
<div class="card-body">
<?php
while ($row = mysqli_fetch_array($sql_domains_expiring)) {
$domain_id = $row['domain_id'];
$domain_name = htmlentities($row['domain_name']);
$domain_expire = $row['domain_expire'];
?>
<p class="mb-1">
<i class="fa fa-fw fa-globe text-secondary mr-1"></i>
<a href="client_domains.php?client_id=<?php echo $client_id; ?>&q=<?php echo $domain_name; ?>"><?php echo $domain_name; ?></a>
<span class="text-warning">-- <?php echo $domain_expire; ?></span>
</p>
<?php
}
?>
<?php
while ($row = mysqli_fetch_array($sql_asset_warranties_expiring)) {
$asset_id = $row['asset_id'];
$asset_name = htmlentities($row['asset_name']);
$asset_warranty_expire = $row['asset_warranty_expire'];
?>
<p class="mb-1">
<i class="fa fa-fw fa-laptop text-secondary mr-1"></i>
<a href="client_assets.php?client_id=<?php echo $client_id; ?>&q=<?php echo $asset_name; ?>"><?php echo $asset_name; ?></a>
<span class="text-warning">-- <?php echo $asset_warranty_expire; ?></span>
</p>
<div class="col-md-4">
<div class="card card-dark mb-3">
<div class="card-header">
<h5 class="card-title"><i class="fa fa-fw fa-exclamation-triangle text-warning mr-2"></i>Upcoming Expirations</h5>
</div>
<div class="card-body">
<?php
}
?>
<?php
while ($row = mysqli_fetch_array($sql_asset_retire)) {
$asset_id = $row['asset_id'];
$asset_name = htmlentities($row['asset_name']);
$asset_install_date = $row['asset_install_date'];
while ($row = mysqli_fetch_array($sql_domains_expiring)) {
$domain_id = $row['domain_id'];
$domain_name = htmlentities($row['domain_name']);
$domain_expire = $row['domain_expire'];
?>
<p class="mb-1">
<i class="fa fa-fw fa-globe text-secondary mr-1"></i>
<a href="client_domains.php?client_id=<?php echo $client_id; ?>&q=<?php echo $domain_name; ?>"><?php echo $domain_name; ?></a>
<span class="text-warning">-- <?php echo $domain_expire; ?></span>
</p>
<?php
}
?>
<p class="mb-1">
<i class="fa fa-fw fa-laptop text-secondary mr-1"></i>
<a href="client_assets.php?client_id=<?php echo $client_id; ?>&q=<?php echo $asset_name; ?>"><?php echo $asset_name; ?></a>
<span class="text-warning">-- <?php echo $asset_install_date; ?></span>
</p>
<?php
}
?>
while ($row = mysqli_fetch_array($sql_asset_warranties_expiring)) {
$asset_id = $row['asset_id'];
$asset_name = htmlentities($row['asset_name']);
$asset_warranty_expire = $row['asset_warranty_expire'];
?>
<p class="mb-1">
<i class="fa fa-fw fa-laptop text-secondary mr-1"></i>
<a href="client_assets.php?client_id=<?php echo $client_id; ?>&q=<?php echo $asset_name; ?>"><?php echo $asset_name; ?></a>
<span class="text-warning">-- <?php echo $asset_warranty_expire; ?></span>
</p>
<?php
}
?>
<?php
while ($row = mysqli_fetch_array($sql_asset_retire)) {
$asset_id = $row['asset_id'];
$asset_name = htmlentities($row['asset_name']);
$asset_install_date = $row['asset_install_date'];
?>
<p class="mb-1">
<i class="fa fa-fw fa-laptop text-secondary mr-1"></i>
<a href="client_assets.php?client_id=<?php echo $client_id; ?>&q=<?php echo $asset_name; ?>"><?php echo $asset_name; ?></a>
<span class="text-warning">-- <?php echo $asset_install_date; ?></span>
</p>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php } ?>
<?php if (mysqli_num_rows($sql_tickets_stale) > 0) { ?>
<!-- Stale Tickets -->
<!-- Stale Tickets -->
<div class="col-md-5">
<div class="col-md-5">
<div class="card card-dark mb-3">
<div class="card-header">
<h5 class="card-title"><i class="fa fa-life-ring"></i> Stale Tickets <small>(14d)</small></h5>
</div>
<div class="card-body">
<table class="table table-borderless table-sm">
<tbody>
<?php
while ($row = mysqli_fetch_array($sql_tickets_stale)) {
$ticket_id = $row['ticket_id'];
$ticket_prefix = htmlentities($row['ticket_prefix']);
$ticket_number = $row['ticket_number'];
$ticket_subject = htmlentities($row['ticket_subject']);
$ticket_created_at = $row['ticket_created_at'];
?>
<tr>
<td><a href="ticket.php?ticket_id=<?php echo $ticket_id?>"><?php echo "$ticket_prefix$ticket_number"; ?></a></td>
<td><?php echo $ticket_subject; ?></td>
<td class="text-danger"><?php echo $ticket_created_at; ?></td>
</tr>
<div class="card card-dark mb-3">
<div class="card-header">
<h5 class="card-title"><i class="fa fa-life-ring"></i> Stale Tickets <small>(14d)</small></h5>
</div>
<div class="card-body">
<table class="table table-borderless table-sm">
<tbody>
<?php
}
?>
</tbody>
</table>
while ($row = mysqli_fetch_array($sql_tickets_stale)) {
$ticket_id = $row['ticket_id'];
$ticket_prefix = htmlentities($row['ticket_prefix']);
$ticket_number = $row['ticket_number'];
$ticket_subject = htmlentities($row['ticket_subject']);
$ticket_created_at = $row['ticket_created_at'];
?>
<tr>
<td><a href="ticket.php?ticket_id=<?php echo $ticket_id?>"><?php echo "$ticket_prefix$ticket_number"; ?></a></td>
<td><?php echo $ticket_subject; ?></td>
<td class="text-danger"><?php echo $ticket_created_at; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php } ?>
@ -276,6 +276,4 @@ $sql_domains_expiring = mysqli_query($mysqli, "SELECT * FROM domains
<?php
include("footer.php");
?>
require_once("footer.php");

View File

@ -1,6 +1,6 @@
<?php
include("inc_all.php");
require_once("inc_all.php");
if (isset($_GET['invoice_id'])) {
@ -180,7 +180,7 @@ if (isset($_GET['invoice_id'])) {
<div class="row mb-4">
<div class="col-sm-2">
<img class="img-fluid" src="<?php echo "uploads/settings/$company_id/$company_logo"; ?>">
<img class="img-fluid" src="<?php echo "uploads/settings/$company_id/$company_logo"; ?>" alt="Company logo">
</div>
<div class="col-sm-10">
<div class="ribbon-wrapper">
@ -483,12 +483,12 @@ if (isset($_GET['invoice_id'])) {
</div>
<?php
include("invoice_payment_add_modal.php");
include("invoice_copy_modal.php");
include("invoice_recurring_add_modal.php");
include("invoice_edit_modal.php");
include("invoice_note_modal.php");
include("category_quick_add_modal.php");
include_once("invoice_payment_add_modal.php");
include_once("invoice_copy_modal.php");
include_once("invoice_recurring_add_modal.php");
include_once("invoice_edit_modal.php");
include_once("invoice_note_modal.php");
include_once("category_quick_add_modal.php");
}
}

View File

@ -1,78 +1,72 @@
<?php include("inc_all.php"); ?>
<?php require_once("inc_all.php");
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM notifications LEFT JOIN clients ON notification_client_id = client_id WHERE notification_dismissed_at IS NULL AND (notification_user_id = $session_user_id OR notification_user_id = 0) AND notifications.company_id = $session_company_id ORDER BY notification_id DESC");
$sql = mysqli_query($mysqli, "SELECT * FROM notifications LEFT JOIN clients ON notification_client_id = client_id WHERE notification_dismissed_at IS NULL AND (notification_user_id = $session_user_id OR notification_user_id = 0) AND notifications.company_id = $session_company_id ORDER BY notification_id DESC");
?>
<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-bell"></i> Notifications</h3>
<div class="card-tools">
<?php if (mysqli_num_rows($sql) > 0) { ?><a href="post.php?dismiss_all_notifications" class="btn btn-primary"><i class="fa fa-check"></i> Dismiss All</a><?php } ?>
<a href="notifications_dismissed.php" class="btn btn-secondary"><i class="fa fa-history"></i> Dismissed</a>
<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-bell"></i> Notifications</h3>
<div class="card-tools">
<?php if (mysqli_num_rows($sql) > 0) { ?><a href="post.php?dismiss_all_notifications" class="btn btn-primary"><i class="fa fa-check"></i> Dismiss All</a><?php } ?>
<a href="notifications_dismissed.php" class="btn btn-secondary"><i class="fa fa-history"></i> Dismissed</a>
</div>
</div>
<div class="card-body">
<?php if (mysqli_num_rows($sql) > 0) { ?>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover">
<thead>
<tr>
<th>Timestamp</th>
<th>Type</th>
<th>Notification</th>
<th>Client</th>
<th class="text-center">Dismiss</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($sql)) {
$notification_id = $row['notification_id'];
$notification_type = htmlentities($row['notification_type']);
$notification = htmlentities($row['notification']);
$notification_timestamp = $row['notification_timestamp'];
$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 class="row-danger">
<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 class="text-center"><a class="btn btn-info btn-sm" href="post.php?dismiss_notification=<?php echo $notification_id; ?>"><i class="fa fa-check"></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php } else { ?>
<div class="my-5" style="text-align: center">
<i class='far fa-fw fa-6x fa-bell-slash text-secondary'></i><h3 class='text-secondary mt-3'>No Notifications</h3>
</div>
<?php } ?>
</div>
</div>
<div class="card-body">
<?php if (mysqli_num_rows($sql) > 0) { ?>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover">
<thead>
<tr>
<th>Timestamp</th>
<th>Type</th>
<th>Notification</th>
<th>Client</th>
<th class="text-center">Dismiss</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($sql)) {
$notification_id = $row['notification_id'];
$notification_type = htmlentities($row['notification_type']);
$notification = htmlentities($row['notification']);
$notification_timestamp = $row['notification_timestamp'];
$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 class="row-danger">
<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 class="text-center"><a class="btn btn-info btn-sm" href="post.php?dismiss_notification=<?php echo $notification_id; ?>"><i class="fa fa-check"></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php
}else{
?>
<center class="my-5">
<i class='far fa-fw fa-6x fa-bell-slash text-secondary'></i><h3 class='text-secondary mt-3'>No Notifications</h3>
</center>
<?php
}
?>
</div>
<?php include("footer.php");
<?php require_once("footer.php");

1503
quote.php

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
<?php include("inc_all.php");
<?php require_once("inc_all.php");
if (isset($_GET['recurring_id'])) {
@ -19,7 +19,7 @@ if (isset($_GET['recurring_id'])) {
$recurring_scope = htmlentities($row['recurring_scope']);
$recurring_frequency = htmlentities($row['recurring_frequency']);
$recurring_status = htmlentities($row['recurring_status']);
$recurring_created_at = date('Y-m-d',strtotime($row['recurring_created_at']));
$recurring_created_at = date('Y-m-d', strtotime($row['recurring_created_at']));
$recurring_last_sent = $row['recurring_last_sent'];
if ($recurring_last_sent == 0) {
$recurring_last_sent = '-';
@ -350,13 +350,13 @@ if (isset($_GET['recurring_id'])) {
<?php
include("recurring_invoice_edit_modal.php");
include("recurring_invoice_note_modal.php");
include("category_quick_add_modal.php");
require_once("recurring_invoice_edit_modal.php");
require_once("recurring_invoice_note_modal.php");
require_once("category_quick_add_modal.php");
}
include("footer.php");
require_once("footer.php");
?>

View File

@ -4,10 +4,8 @@
<div class="card-header py-3">
<h3 class="card-title"><i class="fa fa-fw fa-database"></i> Download Database</h3>
</div>
<div class="card-body">
<center>
<a class="btn btn-primary btn-lg p-3" href="post.php?download_database"><i class="fa fa-fw fa-4x fa-download"></i><br><br>Download</a>
</center>
<div class="card-body" style="text-align: center;">
<a class="btn btn-primary btn-lg p-3" href="post.php?download_database"><i class="fa fa-fw fa-4x fa-download"></i><br><br>Download</a>
</div>
</div>
@ -16,18 +14,20 @@
<h3 class="card-title"><i class="fa fa-fw fa-key"></i> Backup Master Encryption Key</h3>
</div>
<div class="card-body">
<center>
<div class="card-body">
<form action="post.php" method="POST">
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
<div class="input-group col-4">
<div class="input-group-prepend">
<input type="password" class="form-control" placeholder="Enter your account password" name="password" autocomplete="new-password" required>
<div class="row d-flex justify-content-center">
<div class="input-group col-4">
<div class="input-group-prepend">
<input type="password" class="form-control" placeholder="Enter your account password" name="password" autocomplete="new-password" required>
</div>
<button class="btn btn-primary" type="submit" name="backup_master_key"><i class="fa fa-fw fa-key"></i> Get Master Key</button>
</div>
<button class="btn btn-primary" type="submit" name="backup_master_key"><i class="fa fa-fw fa-key"></i> Get Master Key</button>
</div>
</form>
</center>
</div>
</div>
</div>
<?php include("footer.php");
<?php require_once("footer.php");

View File

@ -1,7 +1,7 @@
<?php
require_once("inc_all_settings.php");
include("database_version.php");
include("config.php");
require_once("database_version.php");
require_once("config.php");
// Fetch the latest code changes but don't apply them
exec("git fetch", $output, $result);
@ -22,43 +22,37 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format
<div class="card-header py-3">
<h3 class="card-title"><i class="fas fa-fw fa-arrow-alt-circle-up"></i> Update</h3>
</div>
<div class="card-body">
<center>
<div class="card-body" style="text-align: center;">
<!-- Check if git fetch result is zero (success) -->
<?php if ($result !== 0) { ?>
<div class="alert alert-danger" role="alert">
<strong>Warning: Could not find execute 'git fetch'. Do you have git installed?</strong>
<!-- Check if git fetch result is zero (success) -->
<?php if ($result !== 0) { ?>
<div class="alert alert-danger" role="alert">
<strong>Warning: Could not find execute 'git fetch'. Do you have git installed?</strong>
</div>
<?php } ?>
<?php if (!empty($git_log)) { ?>
<a class="btn btn-primary btn-lg my-4" href="post.php?update"><i class="fas fa-fw fa-4x fa-arrow-alt-circle-up mb-1"></i><h5>Update App</h5></a>
<hr>
<?php } else {
if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { ?>
<div class="alert alert-warning" role="alert">
<strong>Ensure you have a current app & database backup before updating!</strong>
</div>
<?php } ?>
<br>
<a class="btn btn-dark btn-lg my-4" href="post.php?update_db"><i class="fas fa-fw fa-4x fa-arrow-alt-circle-up mb-1"></i><h5>Update Database</h5></a>
<br>
<small class="text-secondary">Current DB Version: <?php echo CURRENT_DATABASE_VERSION; ?></small>
<br>
<small class="text-secondary">Latest DB Version: <?php echo LATEST_DATABASE_VERSION; ?></small>
<?php } else { ?>
<h3 class="text-success"><i class="fas fa-check-square"></i> Latest version!</h3>
<small class="text-secondary">Current DB Version: <?php echo CURRENT_DATABASE_VERSION; ?></small>
<?php }
}
<?php if (!empty($git_log)) { ?>
<a class="btn btn-primary btn-lg my-4" href="post.php?update"><i class="fas fa-fw fa-4x fa-arrow-alt-circle-up mb-1"></i><h5>Update App</h5></a>
<?php
} else {
if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { ?>
<div class="alert alert-warning" role="alert">
<strong>Ensure you have a current app & database backup before updating!</strong>
</div>
<br>
<a class="btn btn-dark btn-lg my-4" href="post.php?update_db"><i class="fas fa-fw fa-4x fa-arrow-alt-circle-up mb-1"></i><h5>Update Database</h5></a>
<br>
<small class="text-secondary">Current DB Version: <?php echo CURRENT_DATABASE_VERSION; ?></small>
<br>
<small class="text-secondary">Latest DB Version: <?php echo LATEST_DATABASE_VERSION; ?></small>
<?php }
else { ?>
<h3 class="text-success"><i class="fas fa-check-square"></i> Latest version!</h3>
<small class="text-secondary">Current DB Version: <?php echo CURRENT_DATABASE_VERSION; ?></small>
<?php } ?>
<?php
}
?>
</center>
<?php
if (!empty($git_log)) {
?>
if (!empty($git_log)) { ?>
<table class="table ">
<thead>
<tr>
@ -83,4 +77,4 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format
<?php
include("footer.php");
require_once("footer.php");