mirror of https://github.com/itflow-org/itflow
Tidying
This commit is contained in:
parent
6975d6ef44
commit
c65db3431d
|
|
@ -181,3 +181,4 @@ require_once "footer.php";
|
|||
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
<div class="form-group">
|
||||
<label>Account Type</label>
|
||||
<select class="form-control select2" name="type" required>
|
||||
<option value="" <?php if ($account_type == NULL) echo "selected"; ?>>- Select -</option>
|
||||
<option value="1" <?php if ($account_type == 'Assets') echo "selected"; ?>>Assets</option>
|
||||
<option value="2" <?php if ($account_type == 'Liabilities') echo "selected"; ?>>Liabilities</option>
|
||||
<option value="3" <?php if ($account_type == 'Equity') echo "selected"; ?>>Equity</option>
|
||||
<option value="" <?php if ($account_type == NULL) { echo "selected"; } ?>>- Select -</option>
|
||||
<option value="1" <?php if ($account_type == 'Assets') { echo "selected"; } ?>>Assets</option>
|
||||
<option value="2" <?php if ($account_type == 'Liabilities') { echo "selected"; } ?>>Liabilities</option>
|
||||
<option value="3" <?php if ($account_type == 'Equity') { echo "selected"; } ?>>Equity</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
<div class="form-group">
|
||||
<label>Account Type</label>
|
||||
<select class="form-control select2" name="type" required>
|
||||
<option value="1" <?php if ($account_parent == 1) echo 'selected'; ?>>Assets</option>
|
||||
<option value="2" <?php if ($account_parent == 2) echo 'selected'; ?>>Liabilities</option>
|
||||
<option value="3" <?php if ($account_parent == 3) echo 'selected'; ?>>Equity</option>
|
||||
<option value="1" <?php if ($account_parent == 1) { echo 'selected'; } ?>>Assets</option>
|
||||
<option value="2" <?php if ($account_parent == 2) { echo 'selected'; } ?>>Liabilities</option>
|
||||
<option value="3" <?php if ($account_parent == 3) { echo 'selected'; } ?>>Equity</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -113,8 +113,6 @@ function fetchDatabaseStructureFromServer() {
|
|||
}
|
||||
}
|
||||
|
||||
//$mysqli->close();
|
||||
|
||||
return $tables;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ $purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'htt
|
|||
$purifier = new HTMLPurifier($purifier_config);
|
||||
|
||||
if (isset($_GET['document_id'])) {
|
||||
$document_id = intval($_GET['document_id']);
|
||||
$document_id = intval($_GET['document_id']);
|
||||
}
|
||||
|
||||
$sql_document = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_template = 1 AND document_id = $document_id");
|
||||
|
|
@ -26,36 +26,36 @@ $document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
|||
|
||||
?>
|
||||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_users.php">Admin</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_document_templates.php">Document Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-file mr-2"></i><?php echo $document_name; ?></li>
|
||||
</ol>
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_users.php">Admin</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_document_templates.php">Document Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-file mr-2"></i><?php echo $document_name; ?></li>
|
||||
</ol>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-file mr-2"></i><?php echo $document_name; ?></h3>
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-file mr-2"></i><?php echo $document_name; ?></h3>
|
||||
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editDocumentTemplateModal<?php echo $document_id; ?>">
|
||||
<i class="fas fa-edit mr-2"></i>Edit
|
||||
</button>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editDocumentTemplateModal<?php echo $document_id; ?>">
|
||||
<i class="fas fa-edit mr-2"></i>Edit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body prettyContent">
|
||||
<?php echo $document_content; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body prettyContent">
|
||||
<?php echo $document_content; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/pretty_content.js"></script>
|
||||
<script src="js/pretty_content.js"></script>
|
||||
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ $purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'htt
|
|||
$purifier = new HTMLPurifier($purifier_config);
|
||||
|
||||
if (isset($_GET['ticket_template_id'])) {
|
||||
$ticket_template_id = intval($_GET['ticket_template_id']);
|
||||
$ticket_template_id = intval($_GET['ticket_template_id']);
|
||||
}
|
||||
|
||||
$sql_ticket_templates = mysqli_query($mysqli, "SELECT * FROM ticket_templates WHERE ticket_template_id = $ticket_template_id");
|
||||
|
|
@ -30,101 +30,101 @@ $sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE
|
|||
|
||||
?>
|
||||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_users.php">Admin</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_ticket_templates.php">Ticket Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-life-ring mr-2"></i><?php echo $ticket_template_name; ?></li>
|
||||
</ol>
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_users.php">Admin</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="admin_ticket_templates.php">Ticket Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-life-ring mr-2"></i><?php echo $ticket_template_name; ?></li>
|
||||
</ol>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title mt-2">
|
||||
<div class="media">
|
||||
<i class="fa fa-fw fa-2x fa-life-ring mr-3"></i>
|
||||
<div class="media-body">
|
||||
<h3 class="mb-0"><?php echo $ticket_template_name; ?></h3>
|
||||
<div><small class="text-secondary"><?php echo $ticket_template_description; ?></small></div>
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title mt-2">
|
||||
<div class="media">
|
||||
<i class="fa fa-fw fa-2x fa-life-ring mr-3"></i>
|
||||
<div class="media-body">
|
||||
<h3 class="mb-0"><?php echo $ticket_template_name; ?></h3>
|
||||
<div><small class="text-secondary"><?php echo $ticket_template_description; ?></small></div>
|
||||
</div>
|
||||
</div>
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#editTicketTemplateModal<?php echo $template_id; ?>">
|
||||
<i class="fas fa-edit"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<h5><?php echo $ticket_subject; ?></h5>
|
||||
<div class="card-body prettyContent">
|
||||
<?php echo $ticket_template_details; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#editTicketTemplateModal<?php echo $template_id; ?>">
|
||||
<i class="fas fa-edit"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h5><?php echo $ticket_subject; ?></h5>
|
||||
<div class="card-body prettyContent">
|
||||
<?php echo $ticket_template_details; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="fa fa-fw fa-tasks mr-2"></i>Tasks</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="ticket_template_id" value="<?php echo $ticket_template_id; ?>">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tasks"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="task_name" placeholder="Task name">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="add_ticket_template_task" class="btn btn-primary"><i class="fas fa-fw fa-check mr-2"></i>Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table class="table table-striped table-sm">
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_task_templates)){
|
||||
$task_id = intval($row['task_template_id']);
|
||||
$task_name = nullable_htmlentities($row['task_template_name']);
|
||||
$task_order = intval($row['task_template_order']);
|
||||
$task_description = nullable_htmlentities($row['task_template_description']);
|
||||
?>
|
||||
<tr>
|
||||
<td><i class="far fa-fw fa-square text-secondary"></i></td>
|
||||
<td><?php echo $task_name; ?></td>
|
||||
<td class="text-right">
|
||||
<button type="button" class="btn btn-link btn-sm text-secondary" data-toggle="modal" data-target="#editTaskModal<?php echo $task_id; ?>">
|
||||
<i class="fa fa-fw fa-pencil-alt"></i>
|
||||
</button>
|
||||
<a href="post.php?delete_task_template=<?php echo $task_id; ?>" class="btn btn-link btn-sm text-danger">
|
||||
<i class="fa fa-fw fa-trash-alt"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
require "task_edit_modal.php";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="fa fa-fw fa-tasks mr-2"></i>Tasks</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="ticket_template_id" value="<?php echo $ticket_template_id; ?>">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tasks"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="task_name" placeholder="Task name">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" name="add_ticket_template_task" class="btn btn-primary"><i class="fas fa-fw fa-check mr-2"></i>Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table class="table table-striped table-sm">
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_task_templates)){
|
||||
$task_id = intval($row['task_template_id']);
|
||||
$task_name = nullable_htmlentities($row['task_template_name']);
|
||||
$task_order = intval($row['task_template_order']);
|
||||
$task_description = nullable_htmlentities($row['task_template_description']);
|
||||
?>
|
||||
<tr>
|
||||
<td><i class="far fa-fw fa-square text-secondary"></i></td>
|
||||
<td><?php echo $task_name; ?></td>
|
||||
<td class="text-right">
|
||||
<button type="button" class="btn btn-link btn-sm text-secondary" data-toggle="modal" data-target="#editTaskModal<?php echo $task_id; ?>">
|
||||
<i class="fa fa-fw fa-pencil-alt"></i>
|
||||
</button>
|
||||
<a href="post.php?delete_task_template=<?php echo $task_id; ?>" class="btn btn-link btn-sm text-danger">
|
||||
<i class="fa fa-fw fa-trash-alt"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
require "task_edit_modal.php";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="js/pretty_content.js"></script>
|
||||
<script src="js/pretty_content.js"></script>
|
||||
|
||||
<?php
|
||||
|
||||
|
|
|
|||
11
ajax.php
11
ajax.php
|
|
@ -458,17 +458,6 @@ if (isset($_GET['get_client_contacts'])) {
|
|||
echo json_encode($response);
|
||||
}
|
||||
|
||||
/*
|
||||
* Dynamic TOTP "resolver"
|
||||
* When provided with a TOTP secret, returns a 6-digit code
|
||||
* // TODO: Check if this can now be removed
|
||||
*/
|
||||
if (isset($_GET['get_totp_token'])) {
|
||||
$otp = TokenAuth6238::getTokenCode(strtoupper($_GET['totp_secret']));
|
||||
|
||||
echo json_encode($otp);
|
||||
}
|
||||
|
||||
/*
|
||||
* NEW TOTP getter for client login/passwords page
|
||||
* When provided with a login ID, checks permissions and returns the 6-digit code
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
// Includes
|
||||
require_once(__DIR__ . '../../../functions.php');
|
||||
require_once(__DIR__ . "../../../config.php");
|
||||
require_once __DIR__ . '../../../functions.php';
|
||||
require_once __DIR__ . "../../../config.php";
|
||||
|
||||
// JSON header
|
||||
header('Content-Type: application/json');
|
||||
|
|
|
|||
44
blank.php
44
blank.php
|
|
@ -1,17 +1,17 @@
|
|||
<?php require_once "inc_all.php"; ?>
|
||||
|
||||
<!-- Breadcrumbs-->
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="index.html">Dashboard</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Blank Page</li>
|
||||
</ol>
|
||||
<!-- Breadcrumbs-->
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="index.html">Dashboard</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Blank Page</li>
|
||||
</ol>
|
||||
|
||||
<!-- Page Content -->
|
||||
<h1>Blank Page</h1>
|
||||
<hr>
|
||||
<p>This is a great starting point for new custom pages.</p>
|
||||
<!-- Page Content -->
|
||||
<h1>Blank Page</h1>
|
||||
<hr>
|
||||
<p>This is a great starting point for new custom pages.</p>
|
||||
|
||||
<?php
|
||||
|
||||
|
|
@ -24,21 +24,21 @@ echo getUserAgent();
|
|||
|
||||
|
||||
?>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<dl>
|
||||
<dt>Requester</dt>
|
||||
<dd>Sam Adams</dd>
|
||||
<dl>
|
||||
<dt>Requester</dt>
|
||||
<dd>Sam Adams</dd>
|
||||
|
||||
<dt>Created</dt>
|
||||
<dd><time datetime="2024-04-11T17:52:30+00:00" title="2024-04-11 13:52" data-datetime="calendar">Today at 13:52</time></dd>
|
||||
<dt>Created</dt>
|
||||
<dd><time datetime="2024-04-11T17:52:30+00:00" title="2024-04-11 13:52" data-datetime="calendar">Today at 13:52</time></dd>
|
||||
|
||||
<dt>Last activity</dt>
|
||||
<dd><time datetime="2024-04-11T18:08:55+00:00" title="2024-04-11 14:08" data-datetime="calendar">Today at 14:08</time></dd>
|
||||
</dl>
|
||||
<dt>Last activity</dt>
|
||||
<dd><time datetime="2024-04-11T18:08:55+00:00" title="2024-04-11 14:08" data-datetime="calendar">Today at 14:08</time></dd>
|
||||
</dl>
|
||||
|
||||
<?php echo randomString(100); ?>
|
||||
<br>
|
||||
<?php echo randomString(100); ?>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
// show the current Date and Time
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ $grandTotal = 0;
|
|||
<div class="form-group">
|
||||
<select class="form-control" name="year" id="yearSelect" onchange="submit();">
|
||||
<?php foreach ($years as $year): ?>
|
||||
<option value="<?php echo $year; ?>" <?php if ($year == $currentYear) echo 'selected'; ?>><?php echo $year; ?></option>
|
||||
<option value="<?php echo $year; ?>" <?php if ($year == $currentYear) { echo 'selected'; } ?>><?php echo $year; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
2
cron.php
2
cron.php
|
|
@ -696,7 +696,7 @@ while ($row = mysqli_fetch_array($sql_recurring_expenses)) {
|
|||
|
||||
// TELEMETRY
|
||||
|
||||
if ($config_telemetry > 0 OR $config_telemetry == 2) {
|
||||
if ($config_telemetry > 0 || $config_telemetry == 2) {
|
||||
|
||||
$current_version = exec("git rev-parse HEAD");
|
||||
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ function createMailboxFolder($client, $folderName) {
|
|||
}
|
||||
|
||||
// Function to subscribe to a folder in the mailbox
|
||||
function subscribeMailboxFolder($client, $folder) {
|
||||
function subscribeMailboxFolder($folder) {
|
||||
if ($folder) {
|
||||
try {
|
||||
// Subscribe to the folder
|
||||
|
|
@ -378,7 +378,7 @@ $client->connect();
|
|||
$folder = createMailboxFolder($client, 'ITFlow');
|
||||
|
||||
// Subscribe to the "ITFlow" mailbox folder
|
||||
subscribeMailboxFolder($client, $folder);
|
||||
subscribeMailboxFolder($folder);
|
||||
|
||||
// Possible names for the inbox folder
|
||||
$inboxNames = ['Inbox', 'INBOX', 'inbox'];
|
||||
|
|
|
|||
|
|
@ -867,23 +867,6 @@ function roundToNearest15($time)
|
|||
return number_format($decimalHours, 2);
|
||||
}
|
||||
|
||||
// Get the value of a setting from the database
|
||||
function getSettingValue($mysqli, $setting_name)
|
||||
{
|
||||
//if starts with config_ then get from config table
|
||||
if (substr($setting_name, 0, 7) == "config_") {
|
||||
$sql = mysqli_query($mysqli, "SELECT $setting_name FROM settings");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
return $row[$setting_name];
|
||||
} elseif (substr($setting_name, 0, 7) == "company") {
|
||||
$sql = mysqli_query($mysqli, "SELECT $setting_name FROM companies");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
return $row[$setting_name];
|
||||
} else {
|
||||
return "Cannot Find Setting Name";
|
||||
}
|
||||
}
|
||||
|
||||
function getMonthlyTax($tax_name, $month, $year, $mysqli)
|
||||
{
|
||||
// SQL to calculate monthly tax
|
||||
|
|
@ -932,8 +915,7 @@ function getAccountCurrencyCode($mysqli, $account_id)
|
|||
{
|
||||
$sql = mysqli_query($mysqli, "SELECT account_currency_code FROM accounts WHERE account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$account_currency_code = nullable_htmlentities($row['account_currency_code']);
|
||||
return $account_currency_code;
|
||||
return nullable_htmlentities($row['account_currency_code']);
|
||||
}
|
||||
|
||||
function calculateAccountBalance($mysqli, $account_id)
|
||||
|
|
@ -1059,32 +1041,6 @@ function addToMailQueue($mysqli, $data) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function calculateInvoiceBalance($mysqli, $invoice_id)
|
||||
{
|
||||
$invoice_id_int = intval($invoice_id);
|
||||
$sql_invoice = mysqli_query($mysqli, "SELECT * FROM invoices WHERE invoice_id = $invoice_id_int");
|
||||
$row = mysqli_fetch_array($sql_invoice);
|
||||
$invoice_amount = floatval($row['invoice_amount']);
|
||||
|
||||
$sql_payments = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT SUM(payment_amount) AS total_payments FROM payments
|
||||
WHERE payment_invoice_id = $invoice_id
|
||||
"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$total_payments = floatval($row['total_payments']);
|
||||
|
||||
$balance = $invoice_amount - $total_payments;
|
||||
|
||||
if ($balance == '') {
|
||||
$balance = '0.00';
|
||||
}
|
||||
|
||||
return $balance;
|
||||
}
|
||||
|
||||
function createiCalStr($datetime, $title, $description, $location)
|
||||
{
|
||||
require_once "plugins/zapcal/zapcallib.php";
|
||||
|
|
@ -1148,21 +1104,6 @@ function createiCalStrCancel($originaliCalStr) {
|
|||
return $cal_event->export();
|
||||
}
|
||||
|
||||
function getTicketStatusColor($ticket_status) {
|
||||
|
||||
global $mysqli;
|
||||
|
||||
$status_id = intval($ticket_status);
|
||||
$row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT ticket_status_color FROM ticket_statuses WHERE ticket_status_id = $status_id LIMIT 1"));
|
||||
|
||||
if ($row) {
|
||||
return nullable_htmlentities($row['ticket_status_color']);
|
||||
}
|
||||
|
||||
// Default return
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
function getTicketStatusName($ticket_status) {
|
||||
|
||||
global $mysqli;
|
||||
|
|
@ -1196,7 +1137,6 @@ function fetchUpdates() {
|
|||
}
|
||||
|
||||
|
||||
|
||||
$updates = new stdClass();
|
||||
$updates->output = $output;
|
||||
$updates->result = $result;
|
||||
|
|
@ -1205,7 +1145,6 @@ function fetchUpdates() {
|
|||
$updates->update_message = $update_message;
|
||||
|
||||
|
||||
|
||||
return $updates;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,6 @@
|
|||
|
||||
require_once 'guest_header.php';
|
||||
|
||||
function log_to_console($message) {
|
||||
$message = date("H:i:s") . " - $message - ".PHP_EOL;
|
||||
print($message);
|
||||
flush();
|
||||
ob_flush();
|
||||
}
|
||||
|
||||
// Define wording
|
||||
DEFINE("WORDING_PAYMENT_FAILED", "<br><h2>There was an error verifying your payment. Please contact us for more information before attempting payment again.</h2>");
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ if ($total_found_rows > 5) {
|
|||
$next_class = "disabled";
|
||||
}
|
||||
$get_copy = $_GET; // create a copy of the $_GET array
|
||||
//unset($get_copy['page']);
|
||||
// Unset Array Var to prevent Duplicate Get VARs
|
||||
unset($get_copy['page']);
|
||||
$url_query_strings_page = http_build_query($get_copy);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ if (isset($_GET['archived'])) {
|
|||
$archived = intval($_GET['archived']);
|
||||
}
|
||||
|
||||
if($archived == 1){
|
||||
if ($archived == 1){
|
||||
$archive_query = "archived_at IS NOT NULL";
|
||||
} else {
|
||||
$archive_query = "archived_at IS NULL";
|
||||
|
|
|
|||
|
|
@ -18,11 +18,8 @@ header("X-Frame-Options: DENY"); // Legacy
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex">
|
||||
|
||||
<!--
|
||||
Favicon
|
||||
If Fav Icon exists else use the default one
|
||||
-->
|
||||
<?php if(file_exists('../uploads/favicon.ico')) { ?>
|
||||
<!-- Favicon: If Fav Icon exists, else use the default one -->
|
||||
<?php if (file_exists('../uploads/favicon.ico')) { ?>
|
||||
<link rel="icon" type="image/x-icon" href="../uploads/favicon.ico">
|
||||
<?php } ?>
|
||||
|
||||
|
|
@ -50,9 +47,9 @@ header("X-Frame-Options: DENY"); // Legacy
|
|||
<li class="nav-item <?php if (basename($_SERVER['PHP_SELF']) == "index.php") {echo "active";} ?>">
|
||||
<a class="nav-link" href="index.php">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?php if (basename($_SERVER['PHP_SELF']) == "tickets.php" || basename($_SERVER['PHP_SELF']) == "ticket_add.php" || basename($_SERVER['PHP_SELF']) == "ticket.php") {echo "active";} ?>" href="tickets.php">Tickets</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?php if (basename($_SERVER['PHP_SELF']) == "tickets.php" || basename($_SERVER['PHP_SELF']) == "ticket_add.php" || basename($_SERVER['PHP_SELF']) == "ticket.php") {echo "active";} ?>" href="tickets.php">Tickets</a>
|
||||
</li>
|
||||
|
||||
<?php if (($session_contact_primary == 1 || $session_contact_is_billing_contact) && $config_module_enable_accounting == 1) { ?>
|
||||
<li class="nav-item">
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ if (isset($_GET['id']) && intval($_GET['id'])) {
|
|||
|
||||
<script src="../js/pretty_content.js"></script>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
} else {
|
||||
echo "Ticket ID not found!";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ if (isset($_GET['delete_custom_link'])) {
|
|||
mysqli_query($mysqli,"DELETE FROM custom_links WHERE custom_link_id = $custom_link_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Tag', log_action = '$session_name Deleted custom link', log_description = '$tag_id', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Custom Link', log_action = 'Delete', log_description = '$session_name deleted a custom link', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Cusatom Link deleted!";
|
||||
$_SESSION['alert_type'] = "error";
|
||||
|
|
|
|||
|
|
@ -55,11 +55,13 @@
|
|||
HAVING
|
||||
balance > 0 AND months_behind >= 2
|
||||
ORDER BY
|
||||
months_behind DESC;";
|
||||
months_behind DESC";
|
||||
|
||||
$result_client_balance_report = mysqli_query($mysqli, $sql_client_balance_report);
|
||||
|
||||
//get currency format from settings
|
||||
$config_currency_code = getSettingValue($mysqli, "company_currency");
|
||||
$currency_row = mysqli_fetch_array(mysqli_query($mysqli,"SELECT company_currency FROM companies WHERE company_id = 1"));
|
||||
$company_currency = nullable_htmlentities($currency_row['company_currency']);
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
|
|
@ -102,9 +104,9 @@
|
|||
$behind_amount = floatval($row['behind_amount']);
|
||||
$months_behind = number_format($row['months_behind']);
|
||||
|
||||
$formatted_balance = numfmt_format_currency($currency_format, $balance, $config_currency_code);
|
||||
$formatted_recurring_monthly_total = numfmt_format_currency($currency_format, $recurring_monthly_total, $config_currency_code);
|
||||
$formatted_behind_amount = numfmt_format_currency($currency_format, $behind_amount, $config_currency_code);
|
||||
$formatted_balance = numfmt_format_currency($currency_format, $balance, $company_currency);
|
||||
$formatted_recurring_monthly_total = numfmt_format_currency($currency_format, $recurring_monthly_total, $company_currency);
|
||||
$formatted_behind_amount = numfmt_format_currency($currency_format, $behind_amount, $company_currency);
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td><a href='client_statement.php?client_id=$client_id'>$client_name</a></td>";
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS domains.*,
|
|||
LEFT JOIN vendors AS webhost ON domains.domain_webhost = webhost.vendor_id
|
||||
WHERE domain_archived_at IS NULL
|
||||
AND (domain_name LIKE '%$q%' OR domain_description LIKE '%$q%' OR registrar.vendor_name LIKE '%$q%' OR dnshost.vendor_name LIKE '%$q%' OR mailhost.vendor_name LIKE '%$q%' OR webhost.vendor_name LIKE '%$q%' OR client_name LIKE '%$q%')
|
||||
ORDER BY $sort $order LIMIT $record_from, $record_to");
|
||||
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
@ -122,7 +123,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
}
|
||||
|
||||
$domain_registrar_name = nullable_htmlentities($row['registrar_name']);
|
||||
if($domain_registrar_name) {
|
||||
if ($domain_registrar_name) {
|
||||
$domain_registrar_name_display = $domain_registrar_name;
|
||||
} else {
|
||||
$domain_registrar_name_display = "-";
|
||||
|
|
@ -148,7 +149,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a class="text-dark" href="#" data-toggle="modal" onclick="populateDomainEditModal(<?php echo $client_id, ",", $domain_id ?>)" data-target="#editDomainModal">
|
||||
<a class="text-dark">
|
||||
<div class="media">
|
||||
<i class="fa fa-fw fa-2x fa-globe mr-3"></i>
|
||||
<div class="media-body">
|
||||
|
|
@ -203,7 +204,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/domain_edit_modal.js"></script>
|
||||
<script src="js/bulk_actions.js"></script>
|
||||
|
||||
<?php require_once "footer.php";
|
||||
|
|
@ -7,15 +7,14 @@ validateAccountantRole();
|
|||
$year = isset($_GET['year']) ? intval($_GET['year']) : date('Y');
|
||||
|
||||
$view = isset($_GET['view']) ? $_GET['view'] : 'quarterly';
|
||||
$company_currency = getSettingValue($mysqli, 'company_currency');
|
||||
|
||||
$currency_row = mysqli_fetch_array(mysqli_query($mysqli,"SELECT company_currency FROM companies WHERE company_id = 1"));
|
||||
$company_currency = nullable_htmlentities($currency_row['company_currency']);
|
||||
|
||||
//GET unique years from expenses, payments and revenues
|
||||
// GET unique years from expenses, payments and revenues
|
||||
$sql_all_years = mysqli_query($mysqli, "SELECT DISTINCT(YEAR(item_created_at)) AS all_years FROM invoice_items ORDER BY all_years DESC");
|
||||
|
||||
$sql_tax = mysqli_query($mysqli,
|
||||
"SELECT `tax_name`
|
||||
FROM `taxes`");
|
||||
$sql_tax = mysqli_query($mysqli, "SELECT `tax_name` FROM `taxes`");
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -42,7 +41,7 @@ $sql_tax = mysqli_query($mysqli,
|
|||
|
||||
</select>
|
||||
|
||||
<!-- View Selection Dropdown -->
|
||||
<!-- View Selection Dropdown -->
|
||||
<select onchange="this.form.submit()" class="form-control" name="view">
|
||||
<option value="monthly" <?php if ($view == 'monthly') echo "selected"; ?>>Monthly</option>
|
||||
<option value="quarterly" <?php if ($view == 'quarterly') echo "selected"; ?>>Quarterly</option>
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="domains.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "domains.php") { echo "active"; } ?>">
|
||||
<a href="report_domains.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_domains.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-globe"></i>
|
||||
<p>All Domains</p>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ if (isset($_GET['status']) && is_array($_GET['status']) && !empty($_GET['status'
|
|||
$sanitizedStatusesString = implode(",", $sanitizedStatuses);
|
||||
$ticket_status_snippet = "ticket_status IN ($sanitizedStatusesString)";
|
||||
|
||||
var_dump($status);
|
||||
|
||||
} else {
|
||||
|
||||
if (isset($_GET['status']) && ($_GET['status']) == 'Closed') {
|
||||
|
|
@ -27,7 +29,7 @@ if (isset($_GET['status']) && is_array($_GET['status']) && !empty($_GET['status'
|
|||
$ticket_status_snippet = "ticket_resolved_at IS NOT NULL";
|
||||
} else {
|
||||
// Default - Show open tickets
|
||||
$status = 'Open';
|
||||
$status = 2;
|
||||
$ticket_status_snippet = "ticket_resolved_at IS NULL";
|
||||
}
|
||||
}
|
||||
|
|
@ -125,7 +127,6 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
|||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="status" value="<?php echo $status; ?>">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
|
|
|
|||
Loading…
Reference in New Issue