mirror of https://github.com/itflow-org/itflow
Merge branch 'master' into See-All-Timers
This commit is contained in:
commit
5657c153be
12
ajax.php
12
ajax.php
|
|
@ -181,6 +181,18 @@ if (isset($_POST['contact_set_notes'])) {
|
|||
|
||||
}
|
||||
|
||||
if (isset($_POST['asset_set_notes'])) {
|
||||
$asset_id = intval($_POST['asset_id']);
|
||||
$notes = sanitizeInput($_POST['notes']);
|
||||
|
||||
// Update notes
|
||||
mysqli_query($mysqli, "UPDATE assets SET asset_notes = '$notes' WHERE asset_id = $asset_id");
|
||||
|
||||
// Logging
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Assets', log_action = 'Modify', log_description = '$session_name modified asset notes', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Collision Detection/Avoidance
|
||||
* Called upon loading a ticket, and every 2 mins thereafter
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
require_once '../validate_api_key.php';
|
||||
|
||||
require_once '../require_post_method.php';
|
||||
|
||||
// Parse info
|
||||
require_once 'document_model.php';
|
||||
|
||||
// Default
|
||||
$insert_id = false;
|
||||
|
||||
if (!empty($name) && !(empty($content))) {
|
||||
|
||||
// Create document
|
||||
$insert_sql = mysqli_query($mysqli,"INSERT INTO documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_template = 0, document_folder_id = $folder, document_created_by = 0, document_client_id = $client_id");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($insert_sql) {
|
||||
$insert_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Update field document_parent to be the same id as document ID as this is the only version of the document.
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_parent = $insert_id WHERE document_id = $insert_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Document', log_action = 'Create', log_description = '$name via API ($api_key_name)', log_ip = '$ip', log_user_agent = '$user_agent', log_client_id = $client_id");
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'API', log_action = 'Success', log_description = 'Created document $name via API ($api_key_name)', log_ip = '$ip', log_user_agent = '$user_agent', log_client_id = $client_id");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Output
|
||||
require_once '../create_output.php';
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
// Variable assignment from POST (or: blank/from DB is updating)
|
||||
|
||||
if (isset($_POST['document_name'])) {
|
||||
$name = sanitizeInput($_POST['document_name']);
|
||||
} elseif (isset($document_row) && isset($document_row['document_name'])) {
|
||||
$name = $document_row['document_name'];
|
||||
} else {
|
||||
$name = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['document_description'])) {
|
||||
$description = sanitizeInput($_POST['document_description']);
|
||||
} elseif (isset($document_row) && isset($document_row['document_description'])) {
|
||||
$description = $document_row['document_description'];
|
||||
} else {
|
||||
$description = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['document_content'])) {
|
||||
$content = mysqli_real_escape_string($mysqli, $_POST['document_content']);
|
||||
} elseif (isset($document_row) && isset($document_row['document_content'])) {
|
||||
$content = $document_row['document_content'];
|
||||
} else {
|
||||
$content = '';
|
||||
}
|
||||
|
||||
// Raw content (used for FULL INDEX searching)
|
||||
if (isset($_POST['document_content'])) {
|
||||
$content_raw = sanitizeInput($_POST['document_name'] . $_POST['document_description'] . " " . str_replace("<", " <", $_POST['document_content']));
|
||||
} elseif (isset($document_row) && isset($document_row['document_content_raw'])) {
|
||||
$content_raw = $document_row['document_content_raw'];
|
||||
} else {
|
||||
$content_raw = '';
|
||||
}
|
||||
|
||||
if (isset($_POST['document_folder_id'])) {
|
||||
$folder = intval($_POST['document_content']);
|
||||
} elseif (isset($document_row) && isset($document_row['document_folder_id'])) {
|
||||
$folder = intval($document_row['document_folder_id']);
|
||||
} else {
|
||||
$folder = 0;
|
||||
}
|
||||
|
|
@ -7,13 +7,15 @@ require_once '../require_get_method.php';
|
|||
|
||||
if (isset($_GET['document_id'])) {
|
||||
// Document via ID (single)
|
||||
|
||||
$id = intval($_GET['document_id']);
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = '$id' AND document_client_id LIKE '$client_id'");
|
||||
|
||||
} elseif (isset($_GET['client_id'])) {
|
||||
// Documents via client ID (multiple)
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_client_id LIKE '$client_id' AND document_archived_at IS NULL");
|
||||
|
||||
} else {
|
||||
// All documents
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_client_id LIKE '$client_id' ORDER BY document_id LIMIT $limit OFFSET $offset");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
require_once '../validate_api_key.php';
|
||||
|
||||
require_once '../require_post_method.php';
|
||||
|
||||
// Parse ID
|
||||
$document_id = intval($_POST['document_id']);
|
||||
|
||||
// Default
|
||||
$update_count = false;
|
||||
|
||||
if (!empty($document_id)) {
|
||||
|
||||
$document_row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT * FROM documents WHERE document_id = '$document_id' AND document_client_id = $client_id LIMIT 1"));
|
||||
|
||||
// Variable assignment from POST - assigning the current database value if a value is not provided
|
||||
require_once 'document_model.php';
|
||||
|
||||
// Documents are a little weird as we update them by *inserting* a new document row
|
||||
$update_insert_sql = mysqli_query($mysqli,"INSERT INTO documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_template = 0, document_folder_id = $folder, document_created_by = 0, document_client_id = $client_id");
|
||||
|
||||
// Check insert & get insert ID
|
||||
if ($update_insert_sql) {
|
||||
$insert_id = $new_document_id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Update the parent ID of the new document to match its new document ID
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_parent = $new_document_id WHERE document_id = $new_document_id");
|
||||
|
||||
// Link all existing links with old document with new document
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_parent = $new_document_id, document_archived_at = NOW() WHERE document_parent = $document_id");
|
||||
|
||||
// Update Links to the new parent document:-
|
||||
// Document files
|
||||
mysqli_query($mysqli,"UPDATE document_files SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Contact documents
|
||||
mysqli_query($mysqli,"UPDATE contact_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Asset documents
|
||||
mysqli_query($mysqli,"UPDATE asset_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Software documents
|
||||
mysqli_query($mysqli,"UPDATE software_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Vendor documents
|
||||
mysqli_query($mysqli,"UPDATE vendor_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Document', log_action = 'Modify', log_description = '$name via API ($api_key_name) previous version was kept', log_ip = '$ip', log_user_agent = '$user_agent', log_client_id = $client_id");
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'API', log_action = 'Success', log_description = 'Edited document $name via API ($api_key_name)', log_ip = '$ip', log_user_agent = '$user_agent', log_client_id = $client_id");
|
||||
|
||||
// Override update count to 1 for API to report a success (as we inserted a document, not "updated" an existing row)
|
||||
$update_count = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Output
|
||||
require_once '../update_output.php';
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($budget_amount,2); ?>" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($budget_amount, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -58,9 +58,6 @@
|
|||
<?php } ?>
|
||||
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-dark" data-toggle="modal" data-target="#addQuickCalendarModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@
|
|||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<a class="btn text-danger mr-auto" href="post.php?delete_event=<?php echo $event_id; ?>"><i class="fa fa-calendar-times mr-2"></i>Delete</a>
|
||||
<a class="btn btn-default text-danger mr-auto" href="post.php?delete_event=<?php echo $event_id; ?>"><i class="fa fa-calendar-times mr-2"></i>Delete</a>
|
||||
<button type="submit" name="edit_event" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -25,9 +25,6 @@ require_once "calendar_event_add_modal.php";
|
|||
|
||||
require_once "calendar_add_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
|
||||
//loop through IDs and create a modal for each
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM events LEFT JOIN calendars ON event_calendar_id = calendar_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
|
|
@ -44,7 +41,6 @@ while ($row = mysqli_fetch_array($sql)) {
|
|||
|
||||
require "calendar_event_edit_modal.php";
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,96 +0,0 @@
|
|||
<div class="modal" id="addQuickCategoryExpenseModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="type" value="Expense">
|
||||
<input type="hidden" name="color" value="#000000">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Category name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_category" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="addQuickCategoryIncomeModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="type" value="Income">
|
||||
<input type="hidden" name="color" value="#000000">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Category name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_category" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="addQuickVendorModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Vendor name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_vendor" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="addQuickReferralModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="type" value="Referral">
|
||||
<input type="hidden" name="color" value="#000000">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Referral name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_category" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="addQuickCalendarModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="color" value="#000000">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Calendar name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_calendar" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -9,6 +9,8 @@
|
|||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="lead" value="0">
|
||||
<input type="hidden" name="net_terms" value="0">
|
||||
<input type="hidden" name="currency_code" value="<?php echo $session_company_currency; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
|
|
@ -21,11 +23,13 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-contact" id="contactNavPill">Contact</a>
|
||||
</li>
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-additional">Additional</a>
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-billing">Billing</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-tag">Tag</a>
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-more">More</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -61,7 +65,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-smile-wink"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="referral">
|
||||
<select class="form-control select2" data-tags="true" name="referral">
|
||||
<option value="">N/A</option>
|
||||
<?php
|
||||
|
||||
|
|
@ -72,9 +76,6 @@
|
|||
<?php } ?>
|
||||
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickReferralModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -231,115 +232,90 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-additional">
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
<div class="tab-pane fade" id="pills-billing">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Hourly Rate</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="rate" placeholder="0.00">
|
||||
<div class="form-group">
|
||||
<label>Hourly Rate</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="rate" placeholder="0.00" value="<?php echo "$config_default_hourly_rate"; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Currency <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-money-bill"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="currency_code" required>
|
||||
<option value="">- Currency -</option>
|
||||
<?php foreach($currencies_array as $currency_code => $currency_name) { ?>
|
||||
<option <?php if ($session_company_currency == $currency_code) { echo "selected"; } ?> value="<?php echo $currency_code; ?>"><?php echo "$currency_code - $currency_name"; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<div class="form-group">
|
||||
<label>Currency <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-money-bill"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="currency_code" required>
|
||||
<option value="">- Currency -</option>
|
||||
<?php foreach($currencies_array as $currency_code => $currency_name) { ?>
|
||||
<option <?php if ($session_company_currency == $currency_code) { echo "selected"; } ?> value="<?php echo $currency_code; ?>"><?php echo "$currency_code - $currency_name"; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Payment Terms</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="net_terms">
|
||||
<?php foreach($net_terms_array as $net_term_value => $net_term_name) { ?>
|
||||
<option <?php if ($config_default_net_terms == $net_term_value) { echo "selected"; } ?> value="<?php echo $net_term_value; ?>"><?php echo $net_term_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<div class="form-group">
|
||||
<label>Payment Terms</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="net_terms">
|
||||
<?php foreach($net_terms_array as $net_term_value => $net_term_name) { ?>
|
||||
<option <?php if ($config_default_net_terms == $net_term_value) { echo "selected"; } ?> value="<?php echo $net_term_value; ?>"><?php echo $net_term_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Tax ID</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-balance-scale"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="tax_id_number" placeholder="Tax ID Number">
|
||||
<div class="form-group">
|
||||
<label>Tax ID</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-balance-scale"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="tax_id_number" placeholder="Tax ID Number">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="currency_code" value="<?php echo $session_company_currency; ?>">
|
||||
<input type="hidden" name="net_terms" value="0">
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="tab-pane fade" id="pills-more">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Notes</label>
|
||||
<textarea class="form-control" rows="6" name="notes" placeholder="Enter some notes"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Tags</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tags"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="tags[]" data-placeholder="Add some tags" multiple>
|
||||
<?php
|
||||
|
||||
<div class="tab-pane fade" id="pills-tag">
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 1 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
<option value="<?php echo $tag_id_select; ?>"><?php echo $tag_name_select; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<ul class="list-group">
|
||||
|
||||
<?php
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 1 ORDER BY tag_name ASC");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
$tag_color_select = nullable_htmlentities($row['tag_color']);
|
||||
if (empty($tag_color_select)) {
|
||||
$tag_color_select = "dark";
|
||||
}
|
||||
$tag_icon_select = nullable_htmlentities($row['tag_icon']);
|
||||
if (empty($tag_icon_select)) {
|
||||
$tag_icon_select = "tag";
|
||||
}
|
||||
|
||||
?>
|
||||
<li class="list-group-item">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" id="tagCheckbox<?php echo $tag_id_select; ?>" name="tags[]" value="<?php echo $tag_id_select; ?>">
|
||||
<label for="tagCheckbox<?php echo $tag_id_select; ?>" class="custom-control-label">
|
||||
<span class="badge bg-<?php echo $tag_color_select; ?>">
|
||||
<?php echo "<i class='fa fw fa-$tag_icon_select mr-2'></i>"; ?><?php echo $tag_name_select; ?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php if (mysqli_num_rows($sql_tags_select) == 0){ ?>
|
||||
|
||||
<div class='my-3 text-center'>
|
||||
<i class='fa fa-fw fa-6x fa-tags text-secondary'></i>
|
||||
<h3 class='text-secondary mt-3'>No Tags Found!</h3>
|
||||
<a href="settings_tags.php">Try adding a few <b>Settings > Tags</b></a>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ if (isset($_GET['asset_id'])) {
|
|||
<h5 class="card-title"><i class="fa fa-fw fa-edit mr-2"></i>Notes</h5>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
<textarea class="form-control" rows=6 id="contactNotes" placeholder="Enter quick notes here" onblur="updateAssetNotes(<?php echo $asset_id ?>)"><?php echo $asset_notes ?></textarea>
|
||||
<textarea class="form-control" rows=6 id="assetNotes" placeholder="Enter quick notes here" onblur="updateAssetNotes(<?php echo $asset_id ?>)"><?php echo $asset_notes ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -495,8 +495,8 @@ if (isset($_GET['asset_id'])) {
|
|||
jQuery.post(
|
||||
"ajax.php",
|
||||
{
|
||||
contact_set_notes: 'TRUE',
|
||||
contact_id: contact_id,
|
||||
asset_set_notes: 'TRUE',
|
||||
asset_id: asset_id,
|
||||
notes: notes
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -109,43 +109,41 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="btn-group btn-group-lg">
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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_sort; ?>&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>
|
||||
<div class="col-sm-8">
|
||||
<div class="btn-toolbar float-right">
|
||||
<div class="btn-group mr-5">
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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 ($server_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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
|
||||
}
|
||||
if ($virtual_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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
|
||||
}
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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
|
||||
}
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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
|
||||
} ?>
|
||||
if ($workstation_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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
|
||||
}
|
||||
if ($server_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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
|
||||
}
|
||||
if ($virtual_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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
|
||||
}
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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
|
||||
}
|
||||
if ($other_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&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>
|
||||
<div class="btn-group mr-2">
|
||||
<?php if($archived == 1){ ?>
|
||||
<a href="?client_id=<?php echo $client_id; ?>&archived=0" class="btn btn-primary"><i class="fa fa-fw fa-archive mr-2"></i>Archived</a>
|
||||
<?php } else { ?>
|
||||
<a href="?client_id=<?php echo $client_id; ?>&archived=1" class="btn btn-default"><i class="fa fa-fw fa-archive mr-2"></i>Archived</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="float-right">
|
||||
<?php if($archived == 1){ ?>
|
||||
<a href="?client_id=<?php echo $client_id; ?>&archived=0" class="btn btn-primary"><i class="fa fa-fw fa-archive mr-2"></i>Archived</a>
|
||||
<?php } else { ?>
|
||||
<a href="?client_id=<?php echo $client_id; ?>&archived=1" class="btn btn-default"><i class="fa fa-fw fa-archive mr-2"></i>Archived</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,15 @@ $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="fas fa-fw fa-lock mr-2"></i>Certificates</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addCertificateModal"><i class="fas fa-plus mr-2"></i>New Certificate</button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addCertificateModal"><i class="fas fa-plus mr-2"></i>New Certificate</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="#exportCertificateModal">
|
||||
<i class="fa fa-fw fa-download mr-2"></i>Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
|
@ -43,22 +51,18 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportCertificateModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="dropdown float-right" id="multiActionButton" hidden>
|
||||
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-list mr-2"></i>Selected (<span id="selectedCount">0</span>)
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<button class="dropdown-item text-danger text-bold"
|
||||
type="submit" form="multi_actions" name="bulk_delete_certificates">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
<div class="dropdown" id="multiActionButton" hidden>
|
||||
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-fw fa-list mr-2"></i>Selected (<span id="selectedCount">0</span>)
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<button class="dropdown-item text-danger text-bold"
|
||||
type="submit" form="multi_actions" name="bulk_delete_certificates">
|
||||
<i class="fas fa-fw fa-trash mr-2"></i>Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -155,10 +155,19 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<input type="hidden" name="folder_id" value="<?php echo $get_folder_id; ?>">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control " name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search Documents">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
|
||||
<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 stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search Documents">
|
||||
<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">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,15 @@ $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-globe mr-2"></i>Domains</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addDomainModal"><i class="fas fa-plus mr-2"></i>New Domain</button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addDomainModal"><i class="fas fa-plus mr-2"></i>New Domain</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="#exportDomainModal">
|
||||
<i class="fa fa-fw fa-download mr-2"></i>Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -33,7 +41,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<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 stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search Domains">
|
||||
|
|
@ -45,10 +52,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportDomainModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
|
|
|
|||
|
|
@ -12,24 +12,25 @@
|
|||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<input type="hidden" name="lead" value="0">
|
||||
<input type="hidden" name="currency_code" value="<?php if (empty($currency_code)) {
|
||||
echo $session_company_currency;
|
||||
} else {
|
||||
echo $currency_code;
|
||||
} ?>">
|
||||
<input type="hidden" name="net_terms" value="<?php echo $client_net_terms; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<ul class="nav nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="pill"
|
||||
href="#pills-client-details<?php echo $client_id; ?>">Details</a>
|
||||
<a class="nav-link active" data-toggle="pill" href="#pills-client-details<?php echo $client_id; ?>">Details</a>
|
||||
</li>
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill"
|
||||
href="#pills-client-billing<?php echo $client_id; ?>">Billing</a>
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-client-billing<?php echo $client_id; ?>">Billing</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill"
|
||||
href="#pills-client-notes<?php echo $client_id; ?>">Notes</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill"
|
||||
href="#pills-client-tag<?php echo $client_id; ?>">Tag</a>
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-client-more<?php echo $client_id; ?>">More</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -67,7 +68,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-smile-wink"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="referral">
|
||||
<select class="form-control select2" data-tags="true" name="referral">
|
||||
<option value="">N/A</option>
|
||||
<?php
|
||||
|
||||
|
|
@ -85,11 +86,6 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal"
|
||||
data-target="#addQuickReferralModal"><i
|
||||
class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -117,152 +113,110 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-client-billing<?php echo $client_id; ?>">
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
|
||||
<?php if ($config_module_enable_accounting) { ?>
|
||||
<div class="tab-pane fade" id="pills-client-billing<?php echo $client_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Hourly Rate</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric"
|
||||
pattern="[0-9]*\.?[0-9]{0,2}" name="rate" placeholder="0.00"
|
||||
value="<?php echo $client_rate; ?>">
|
||||
<div class="form-group">
|
||||
<label>Hourly Rate</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric"
|
||||
pattern="[0-9]*\.?[0-9]{0,2}" name="rate" placeholder="0.00"
|
||||
value="<?php echo number_format($client_rate, 2, '.', ''); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Currency <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-money-bill"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="currency_code" required>
|
||||
<option value="">- Currency -</option>
|
||||
<?php foreach ($currencies_array as $currency_code => $currency_name) { ?>
|
||||
<option <?php if ($client_currency_code == $currency_code) {
|
||||
echo "selected";
|
||||
} ?> value="<?php echo $currency_code; ?>">
|
||||
<?php echo "$currency_code - $currency_name"; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<div class="form-group">
|
||||
<label>Currency <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-money-bill"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="currency_code" required>
|
||||
<option value="">- Currency -</option>
|
||||
<?php foreach ($currencies_array as $currency_code => $currency_name) { ?>
|
||||
<option <?php if ($client_currency_code == $currency_code) {
|
||||
echo "selected";
|
||||
} ?> value="<?php echo $currency_code; ?>">
|
||||
<?php echo "$currency_code - $currency_name"; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Invoice Net Terms</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="net_terms">
|
||||
<option value="">- Net Terms -</option>
|
||||
<?php foreach ($net_terms_array as $net_term_value => $net_term_name) { ?>
|
||||
<option <?php if ($net_term_value == $client_net_terms) {
|
||||
echo "selected";
|
||||
} ?> value="<?php echo $net_term_value; ?>">
|
||||
<?php echo $net_term_name; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<div class="form-group">
|
||||
<label>Invoice Net Terms</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="net_terms">
|
||||
<option value="">- Net Terms -</option>
|
||||
<?php foreach ($net_terms_array as $net_term_value => $net_term_name) { ?>
|
||||
<option <?php if ($net_term_value == $client_net_terms) {
|
||||
echo "selected";
|
||||
} ?> value="<?php echo $net_term_value; ?>">
|
||||
<?php echo $net_term_name; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Tax ID</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-balance-scale"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="tax_id_number"
|
||||
placeholder="Tax ID Number" value="<?php echo $client_tax_id_number; ?>">
|
||||
<div class="form-group">
|
||||
<label>Tax ID</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-balance-scale"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="tax_id_number"
|
||||
placeholder="Tax ID Number" value="<?php echo $client_tax_id_number; ?>">
|
||||
</div>
|
||||
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="currency_code" value="<?php if (empty($currency_code)) {
|
||||
echo $session_company_currency;
|
||||
} else {
|
||||
echo $currency_code;
|
||||
} ?>">
|
||||
<input type="hidden" name="net_terms" value="<?php echo $net_term_value; ?>">
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-client-notes<?php echo $client_id; ?>">
|
||||
<?php } ?>
|
||||
|
||||
<div class="tab-pane fade" id="pills-client-more<?php echo $client_id; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="8" placeholder="Enter some notes"
|
||||
name="notes"><?php echo $client_notes; ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Tags</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tags"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="tags[]" data-placeholder="Add some tags" multiple>
|
||||
<?php
|
||||
|
||||
<div class="tab-pane fade" id="pills-client-tag<?php echo $client_id; ?>">
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 1 ORDER BY tag_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
?>
|
||||
<option value="<?php echo $tag_id_select; ?>" <?php if (in_array($tag_id_select, $client_tag_id_array)) { echo "selected"; } ?>><?php echo $tag_name_select; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<ul class="list-group">
|
||||
|
||||
<?php
|
||||
|
||||
$sql_tags_select = mysqli_query($mysqli, "SELECT * FROM tags WHERE tag_type = 1 ORDER BY tag_name ASC");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_tags_select)) {
|
||||
$tag_id_select = intval($row['tag_id']);
|
||||
$tag_name_select = nullable_htmlentities($row['tag_name']);
|
||||
$tag_color_select = nullable_htmlentities($row['tag_color']);
|
||||
if (empty($tag_color_select)) {
|
||||
$tag_color_select = "dark";
|
||||
}
|
||||
$tag_icon_select = nullable_htmlentities($row['tag_icon']);
|
||||
if (empty($tag_icon_select)) {
|
||||
$tag_icon_select = "tag";
|
||||
}
|
||||
|
||||
?>
|
||||
<li class="list-group-item">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox"
|
||||
id="tagCheckbox<?php echo "$tag_id_select$client_id"; ?>" name="tags[]"
|
||||
value="<?php echo $tag_id_select; ?>" <?php if (in_array($tag_id_select, $client_tag_id_array)) {
|
||||
echo "checked";
|
||||
} ?>>
|
||||
<label for="tagCheckbox<?php echo "$tag_id_select$client_id"; ?>"
|
||||
class="custom-control-label">
|
||||
<span class="badge bg-<?php echo $tag_color_select; ?>">
|
||||
<?php echo "<i class='fa fw fa-$tag_icon_select mr-2'></i>"; ?>
|
||||
<?php echo $tag_name_select; ?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php if (mysqli_num_rows($sql_tags_select) == 0) { ?>
|
||||
|
||||
<div class='my-3 text-center'>
|
||||
<i class='fa fa-fw fa-6x fa-tags text-secondary'></i>
|
||||
<h3 class='text-secondary mt-3'>No Tags Found!</h3>
|
||||
<a href="settings_tags.php">Try adding a few <b>Settings > Tags</b></a>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="edit_client" class="btn btn-primary text-bold"><i
|
||||
class="fa fa-check mr-2"></i>Save</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i
|
||||
class="fa fa-times mr-2"></i>Cancel</button>
|
||||
<button type="submit" name="edit_client" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fa fa-times mr-2"></i>Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -26,8 +26,16 @@ $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-file-invoice mr-2"></i>Invoices</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addInvoiceModal"><i class="fas fa-plus mr-2"></i>New Invoice</button>
|
||||
<div class="card-tools">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addInvoiceModal"><i class="fas fa-plus mr-2"></i>New Invoice</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="#exportInvoiceModal">
|
||||
<i class="fa fa-fw fa-download mr-2"></i>Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
|
@ -46,7 +54,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportInvoiceModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,16 @@ $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="fas fa-fw fa-network-wired mr-2"></i>Networks</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addNetworkModal"><i class="fas fa-plus mr-2"></i>New Network</button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addNetworkModal"><i class="fas fa-plus mr-2"></i>New Network</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="#exportNetworkModal">
|
||||
<i class="fa fa-fw fa-download mr-2"></i>Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
|
@ -47,7 +56,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportNetworkModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,11 @@ $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 mr-2"></i>Payments</h3>
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-credit-card mr-2"></i>Payments</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportPaymentModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form autocomplete="off">
|
||||
|
|
@ -44,7 +47,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportPaymentModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,15 @@ $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-comment-dollar mr-2"></i>Quotes</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addQuoteModal"><i class="fas fa-plus mr-2"></i>New Quote</button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addQuoteModal"><i class="fas fa-plus mr-2"></i>New Quote</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="#exportQuoteModal">
|
||||
<i class="fa fa-fw fa-download mr-2"></i>Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
|
@ -46,7 +54,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportQuoteModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -163,7 +170,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<?php
|
||||
//require_once "quote_add_modal.php";
|
||||
require_once "quote_add_modal.php";
|
||||
|
||||
require_once "quote_edit_modal.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,15 @@ $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="fas fa-fw fa-redo-alt mr-2"></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-plus mr-2"></i>New Recurring</button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addRecurringModal"><i class="fas fa-plus mr-2"></i>New Recurring</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="#exportRecurringModal">
|
||||
<i class="fa fa-fw fa-download mr-2"></i>Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
|
@ -45,7 +53,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportRecurringModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -97,9 +97,9 @@
|
|||
<div class="tab-pane fade" id="pills-general">
|
||||
<div class="form-group">
|
||||
<label for="contacts">Select related Contacts</label>
|
||||
<select multiple class="form-control" id="contacts" name="contacts[]">
|
||||
<select class="form-control select2" id="contacts" name="contacts[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = '$client_id'");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
|
|
@ -111,9 +111,9 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label for="vendors">Select related vendors</label>
|
||||
<select multiple class="form-control" id="vendors" name="vendors[]">
|
||||
<select class="form-control select2" id="vendors" name="vendors[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_template = 0 AND vendor_client_id = '$client_id'");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_template = 0 AND vendor_archived_at IS NULL AND vendor_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$vendor_id = intval($row['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row['vendor_name']);
|
||||
|
|
@ -125,9 +125,9 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label for="documents">Select related documents</label>
|
||||
<select multiple class="form-control" id="documents" name="documents[]">
|
||||
<select class="form-control select2" id="documents" name="documents[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_client_id = '$client_id'");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_archived_at IS NULL AND document_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
|
|
@ -144,78 +144,62 @@
|
|||
|
||||
<div class="tab-pane fade" id="pills-assets">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="assets">Select related assets</label>
|
||||
<select multiple class="form-control" id="assets" name="assets[]">
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_client_id = '$client_id'");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
echo "<option value=\"$asset_id\">$asset_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="logins">Select related logins</label>
|
||||
<select multiple class="form-control" id="logins" name="logins[]">
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_client_id = '$client_id'");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$login_id = intval($row['login_id']);
|
||||
$login_name = nullable_htmlentities($row['login_name']);
|
||||
echo "<option value=\"$login_id\">$login_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="assets">Select related assets</label>
|
||||
<select class="form-control select2" id="assets" name="assets[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
echo "<option value=\"$asset_id\">$asset_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="logins">Select related logins</label>
|
||||
<select class="form-control select2" id="logins" name="logins[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_archived_at IS NULL AND login_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$login_id = intval($row['login_id']);
|
||||
$login_name = nullable_htmlentities($row['login_name']);
|
||||
echo "<option value=\"$login_id\">$login_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="domains">Select related domains</label>
|
||||
<select class="form-control select2" id="domains" name="domains[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_archived_at IS NULL AND domain_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
echo "<option value=\"$domain_id\">$domain_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="domains">Select related domains</label>
|
||||
<select multiple class="form-control" id="domains" name="domains[]">
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_client_id = '$client_id'");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
echo "<option value=\"$domain_id\">$domain_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="certificates">Select related certificates</label>
|
||||
<select multiple class="form-control" id="certificates" name="certificates[]">
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM certificates WHERE certificate_client_id = '$client_id'");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$cert_id = intval($row['certificate_id']);
|
||||
$cert_name = nullable_htmlentities($row['certificate_name']);
|
||||
$cert_domain = nullable_htmlentities($row['certificate_domain']);
|
||||
echo "<option value=\"$cert_id\">$cert_name ($cert_domain)</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="certificates">Select related certificates</label>
|
||||
<select class="form-control select2" id="certificates" name="certificates[]" multiple>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM certificates WHERE certificate_archived_at IS NULL AND certificate_client_id = $client_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$cert_id = intval($row['certificate_id']);
|
||||
$cert_name = nullable_htmlentities($row['certificate_name']);
|
||||
$cert_domain = nullable_htmlentities($row['certificate_domain']);
|
||||
echo "<option value=\"$cert_id\">$cert_name ($cert_domain)</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -96,16 +96,18 @@
|
|||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-general<?php echo $service_id ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="contacts">Contacts</label>
|
||||
<select multiple class="form-control" id="contacts" name="contacts[]">
|
||||
<select multiple class="form-control select2" name="contacts[]">
|
||||
<?php
|
||||
// Get just the currently selected contact IDs
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_contacts, MYSQLI_ASSOC), "contact_id");
|
||||
|
||||
// Get all contacts
|
||||
// NOTE: These are called $sql_all and $row_all for a reason - anything overwriting $sql or $row will break the current while loop we are in from client_services.php
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = $client_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM contacts WHERE (contact_archived_at > '$service_created_at' OR contact_archived_at IS NULL) AND contact_client_id = $client_id");
|
||||
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$contact_id = intval($row_all['contact_id']);
|
||||
|
|
@ -124,11 +126,11 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label for="vendors">Vendors</label>
|
||||
<select multiple class="form-control" id="vendors" name="vendors[]">
|
||||
<select multiple class="form-control select2" name="vendors[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_vendors, MYSQLI_ASSOC), "vendor_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_template = 0 AND vendor_client_id = '$client_id'");
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM vendors WHERE (vendor_archived_at > '$service_created_at' OR vendor_archived_at IS NULL) AND vendor_template = 0 AND vendor_client_id = $client_id");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$vendor_id = intval($row_all['vendor_id']);
|
||||
$vendor_name = nullable_htmlentities($row_all['vendor_name']);
|
||||
|
|
@ -146,11 +148,11 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label for="documents">Documents</label>
|
||||
<select multiple class="form-control" id="documents" name="documents[]">
|
||||
<select multiple class="form-control select2" name="documents[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_docs, MYSQLI_ASSOC), "document_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_client_id = '$client_id'");
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_archived_at IS NULL AND document_client_id = $client_id");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$document_id = intval($row_all['document_id']);
|
||||
$document_name = nullable_htmlentities($row_all['document_name']);
|
||||
|
|
@ -174,113 +176,95 @@
|
|||
|
||||
<div class="tab-pane fade" id="pills-assets<?php echo $service_id ?>">
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<label for="assets">Assets</label>
|
||||
<select multiple class="form-control select2" name="assets[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_assets, MYSQLI_ASSOC), "asset_id");
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="assets">Assets</label>
|
||||
<select multiple class="form-control" id="assets" name="assets[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_assets, MYSQLI_ASSOC), "asset_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_client_id = '$client_id'");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$asset_id = intval($row_all['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row_all['asset_name']);
|
||||
|
||||
if (in_array($asset_id, $selected_ids)) {
|
||||
echo "<option value=\"$asset_id\" selected>$asset_name</option>";
|
||||
}
|
||||
else{
|
||||
echo "<option value=\"$asset_id\">$asset_name</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="logins">Logins</label>
|
||||
<select multiple class="form-control" id="logins" name="logins[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_logins, MYSQLI_ASSOC), "login_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_client_id = '$client_id'");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$login_id = intval($row_all['login_id']);
|
||||
$login_name = nullable_htmlentities($row_all['login_name']);
|
||||
|
||||
if (in_array($login_id, $selected_ids)) {
|
||||
echo "<option value=\"$login_id\" selected>$login_name</option>";
|
||||
}
|
||||
else{
|
||||
echo "<option value=\"$login_id\">$login_name</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM assets WHERE (asset_archived_at > '$service_created_at' OR asset_archived_at IS NULL) AND asset_client_id = $client_id");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$asset_id = intval($row_all['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row_all['asset_name']);
|
||||
|
||||
if (in_array($asset_id, $selected_ids)) {
|
||||
echo "<option value=\"$asset_id\" selected>$asset_name</option>";
|
||||
}
|
||||
else{
|
||||
echo "<option value=\"$asset_id\">$asset_name</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="logins">Logins</label>
|
||||
<select multiple class="form-control select2" name="logins[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_logins, MYSQLI_ASSOC), "login_id");
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="domains">Domains</label>
|
||||
<select multiple class="form-control" id="domains" name="domains[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_domains, MYSQLI_ASSOC), "domain_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_client_id = '$client_id'");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$domain_id = intval($row_all['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row_all['domain_name']);
|
||||
|
||||
if (in_array($domain_id, $selected_ids)) {
|
||||
echo "<option value=\"$domain_id\" selected>$domain_name</option>";
|
||||
}
|
||||
else{
|
||||
echo "<option value=\"$domain_id\">$domain_name</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="certificates">Certificates</label>
|
||||
<select multiple class="form-control" id="certificates" name="certificates[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_certificates, MYSQLI_ASSOC), "certificate_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM certificates WHERE certificate_client_id = '$client_id'");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$cert_id = intval($row_all['certificate_id']);
|
||||
$cert_name = nullable_htmlentities($row_all['certificate_name']);
|
||||
|
||||
if (in_array($cert_id, $selected_ids)) {
|
||||
echo "<option value=\"$cert_id\" selected>$cert_name</option>";
|
||||
}
|
||||
else{
|
||||
echo "<option value=\"$cert_id\">$cert_name</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM logins WHERE (login_archived_at > '$service_created_at' OR login_archived_at IS NULL) AND login_client_id = $client_id");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$login_id = intval($row_all['login_id']);
|
||||
$login_name = nullable_htmlentities($row_all['login_name']);
|
||||
|
||||
if (in_array($login_id, $selected_ids)) {
|
||||
echo "<option value=\"$login_id\" selected>$login_name</option>";
|
||||
}
|
||||
else{
|
||||
echo "<option value=\"$login_id\">$login_name</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="domains">Domains</label>
|
||||
<select multiple class="form-control select2" name="domains[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_domains, MYSQLI_ASSOC), "domain_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM domains WHERE (domain_archived_at > '$service_created_at' OR domain_archived_at IS NULL) AND domain_client_id = $client_id");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$domain_id = intval($row_all['domain_id']);
|
||||
$domain_name = nullable_htmlentities($row_all['domain_name']);
|
||||
|
||||
if (in_array($domain_id, $selected_ids)) {
|
||||
echo "<option value=\"$domain_id\" selected>$domain_name</option>";
|
||||
}
|
||||
else{
|
||||
echo "<option value=\"$domain_id\">$domain_name</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="certificates">Certificates</label>
|
||||
<select multiple class="form-control select2" name="certificates[]">
|
||||
<?php
|
||||
$selected_ids = array_column(mysqli_fetch_all($sql_certificates, MYSQLI_ASSOC), "certificate_id");
|
||||
|
||||
$sql_all = mysqli_query($mysqli, "SELECT * FROM certificates WHERE (certificate_archived_at > '$service_created_at' OR certificate_archived_at IS NULL) AND certificate_client_id = $client_id");
|
||||
while ($row_all = mysqli_fetch_array($sql_all)) {
|
||||
$cert_id = intval($row_all['certificate_id']);
|
||||
$cert_name = nullable_htmlentities($row_all['certificate_name']);
|
||||
|
||||
if (in_array($cert_id, $selected_ids)) {
|
||||
echo "<option value=\"$cert_id\" selected>$cert_name</option>";
|
||||
}
|
||||
else{
|
||||
echo "<option value=\"$cert_id\">$cert_name</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
|
|
|
|||
|
|
@ -34,10 +34,19 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control " name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search Services">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
|
||||
<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 stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search Services">
|
||||
<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">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -119,7 +128,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
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"
|
||||
AND service_id = $service_id"
|
||||
);
|
||||
|
||||
// Associated logins
|
||||
|
|
|
|||
|
|
@ -47,40 +47,39 @@
|
|||
</li>
|
||||
|
||||
|
||||
<?php if ($config_module_enable_ticketing == 1) { ?>
|
||||
<li class="nav-header mt-3">SUPPORT</li>
|
||||
|
||||
<?php if ($config_module_enable_ticketing == 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="client_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_tickets.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>
|
||||
Tickets
|
||||
<?php
|
||||
if ($num_active_tickets > 0) { ?>
|
||||
<span class="right badge <?php if ($num_active_tickets > 0) { ?> badge-danger <?php } ?> text-light"><?php echo $num_active_tickets; ?></span>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a href="client_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_tickets.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-life-ring"></i>
|
||||
<p>
|
||||
Tickets
|
||||
<?php
|
||||
if ($num_active_tickets > 0) { ?>
|
||||
<span class="right badge <?php if ($num_active_tickets > 0) { ?> badge-danger <?php } ?> text-light"><?php echo $num_active_tickets; ?></span>
|
||||
<?php } ?>
|
||||
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="client_scheduled_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_scheduled_tickets.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-calendar-check"></i>
|
||||
<p>
|
||||
Schedule Ticket
|
||||
<?php
|
||||
if ($num_scheduled_tickets > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_scheduled_tickets; ?></span>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a href="client_scheduled_tickets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_scheduled_tickets.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-calendar-check"></i>
|
||||
<p>
|
||||
Schedule Ticket
|
||||
<?php
|
||||
if ($num_scheduled_tickets > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_scheduled_tickets; ?></span>
|
||||
<?php } ?>
|
||||
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="client_vendors.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_vendors.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-building"></i>
|
||||
|
|
@ -98,7 +97,7 @@
|
|||
<a href="client_events.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_events.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-calendar-alt"></i>
|
||||
<p>
|
||||
Events
|
||||
Calendar
|
||||
<?php
|
||||
if ($num_events > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_events; ?></span>
|
||||
|
|
@ -107,10 +106,12 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<?php if ($config_module_enable_itdoc == 1) { ?>
|
||||
|
||||
<li class="nav-header mt-3">DOCUMENTATION</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="client_assets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_assets.php") { echo "active"; } ?>">
|
||||
<a href="client_assets.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "client_assets.php" || basename($_SERVER["PHP_SELF"]) == "client_asset_details.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-desktop"></i>
|
||||
<p>
|
||||
Assets
|
||||
|
|
@ -229,6 +230,7 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($session_user_role == 1 || $session_user_role > 2 && $config_module_enable_accounting == 1) { ?>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,7 @@
|
|||
<a class="nav-link active" data-toggle="pill" href="#pills-details">Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-device-licenses">Device Licenses</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-user-licenses">User Licenses</a>
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-licensing">Licensing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-notes">Notes</a>
|
||||
|
|
@ -70,6 +67,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-licensing">
|
||||
|
||||
<div class="form-group">
|
||||
<label>License Type</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -125,67 +126,54 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Devices</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-desktop"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="assets[]" data-placeholder="Select licensed Assets" multiple>
|
||||
<?php
|
||||
|
||||
<div class="tab-pane fade" id="pills-device-licenses">
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id WHERE asset_archived_at IS NULL AND asset_client_id = $client_id ORDER BY asset_name ASC");
|
||||
|
||||
<div class="alert alert-info">
|
||||
Select Assets that are licensed for this software
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$asset_type = nullable_htmlentities($row['asset_type']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
?>
|
||||
<option value="<?php echo $asset_id; ?>"><?php echo "$asset_name - $contact_name"; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="list-group">
|
||||
<div class="form-group">
|
||||
<label>Users</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-users"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="contacts[]" data-placeholder="Select licensed Users" multiple>
|
||||
<?php
|
||||
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id WHERE asset_archived_at IS NULL AND asset_client_id = $client_id ORDER BY asset_name ASC");
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$asset_id = intval($row['asset_id']);
|
||||
$asset_name = nullable_htmlentities($row['asset_name']);
|
||||
$asset_type = nullable_htmlentities($row['asset_type']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
|
||||
?>
|
||||
<option value="<?php echo $contact_id; ?>"><?php echo "$contact_name - $contact_email"; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
?>
|
||||
<li class="list-group-item">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" name="assets[]" value="<?php echo $asset_id; ?>">
|
||||
<label class="form-check-label ml-2"><?php echo "$asset_name - $contact_name"; ?></label>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-user-licenses">
|
||||
|
||||
<div class="alert alert-info">
|
||||
Select Users that are licensed for this software
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="list-group">
|
||||
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$contact_id = intval($row['contact_id']);
|
||||
$contact_name = nullable_htmlentities($row['contact_name']);
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
|
||||
?>
|
||||
<li class="list-group-item">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" name="contacts[]" value="<?php echo $contact_id; ?>">
|
||||
<label class="form-check-label ml-2"><?php echo "$contact_name - $contact_email"; ?></label>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pills-notes">
|
||||
|
|
|
|||
|
|
@ -232,5 +232,3 @@ require_once "client_ticket_export_modal.php";
|
|||
require_once "footer.php";
|
||||
|
||||
?>
|
||||
|
||||
<script src="js/ticket_add_remove_watchers.js"></script>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,16 @@ $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="fas fa-route mr-2"></i>Trips</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addTripModal"><i class="fas fa-plus mr-2"></i>New Trip</button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addTripModal"><i class="fas fa-plus mr-2"></i>New Trip</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="#exportTripModal">
|
||||
<i class="fa fa-fw fa-download mr-2"></i>Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
|
@ -46,7 +55,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<div class="col-md-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#exportTripModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search <?php if($leads == 0){ echo "clients"; } else { echo "leads"; } ?>" autofocus>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -88,9 +89,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<a href="?leads=0" class="btn btn-<?php if($leads == 0){ echo "primary"; } else { echo "default"; } ?>"><i class="fa fa-fw fa-user-friends mr-2"></i>Clients</a>
|
||||
<a href="?leads=1" class="btn btn-<?php if($leads == 1){ echo "primary"; } else { echo "default"; } ?>"><i class="fa fa-fw fa-bullhorn mr-2"></i>Leads</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-default" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -263,7 +262,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
}
|
||||
|
||||
if (!empty($contact_name)) { ?>
|
||||
<div>
|
||||
<div class="text-bold">
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $contact_name; ?>
|
||||
</div>
|
||||
<?php } else {
|
||||
|
|
@ -348,7 +347,5 @@ require_once "client_add_modal.php";
|
|||
|
||||
require_once "client_export_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
require_once "footer.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ $lock_file_path = "{$temp_dir}/itflow_email_parser_{$installation_id}.lock";
|
|||
// Check for lock file to prevent concurrent script runs
|
||||
if (file_exists($lock_file_path)) {
|
||||
$file_age = time() - filemtime($lock_file_path);
|
||||
|
||||
|
||||
// If file is older than 10 minutes (600 seconds), delete and continue
|
||||
if ($file_age > 600) {
|
||||
unlink($lock_file_path);
|
||||
|
|
@ -371,7 +371,13 @@ if ($emails) {
|
|||
|
||||
$from_array = $parser->getAddresses('from')[0];
|
||||
$from_name = trim(mysqli_real_escape_string($mysqli, nullable_htmlentities(strip_tags($from_array['display']))));
|
||||
$from_email = trim(mysqli_real_escape_string($mysqli, nullable_htmlentities(strip_tags($from_array['address']))));
|
||||
|
||||
// Handle blank 'From' emails
|
||||
$from_email = "itflow-guest@example.com";
|
||||
if (filter_var($from_array['address'], FILTER_VALIDATE_EMAIL)) {
|
||||
$from_email = trim(mysqli_real_escape_string($mysqli, nullable_htmlentities(strip_tags($from_array['address']))));
|
||||
}
|
||||
|
||||
$from_domain = explode("@", $from_array['address']);
|
||||
$from_domain = trim(mysqli_real_escape_string($mysqli, nullable_htmlentities(strip_tags(end($from_domain))))); // Use the final element in the array (as technically legal to have multiple @'s)
|
||||
|
||||
|
|
|
|||
|
|
@ -1491,11 +1491,18 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
|||
|
||||
}
|
||||
|
||||
//if (CURRENT_DATABASE_VERSION == '0.9.1') {
|
||||
// Insert queries here required to update to DB version 0.9.0
|
||||
if (CURRENT_DATABASE_VERSION == '0.9.3') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_default_hourly_rate` DECIMAL(15,2) NOT NULL DEFAULT 0.00 AFTER `config_default_net_terms`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.4'");
|
||||
|
||||
}
|
||||
|
||||
//if (CURRENT_DATABASE_VERSION == '0.9.4') {
|
||||
// Insert queries here required to update to DB version 0.9.5
|
||||
|
||||
// Then, update the database to the next sequential version
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.2'");
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.5'");
|
||||
//}
|
||||
} else {
|
||||
// Up-to-date
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@
|
|||
* It is used in conjunction with database_updates.php
|
||||
*/
|
||||
|
||||
DEFINE("LATEST_DATABASE_VERSION", "0.9.3");
|
||||
DEFINE("LATEST_DATABASE_VERSION", "0.9.4");
|
||||
|
||||
|
|
|
|||
3
db.sql
3
db.sql
|
|
@ -1233,6 +1233,7 @@ CREATE TABLE `settings` (
|
|||
`config_default_expense_payment_method` varchar(200) DEFAULT NULL,
|
||||
`config_default_calendar` int(11) DEFAULT NULL,
|
||||
`config_default_net_terms` int(11) DEFAULT NULL,
|
||||
`config_default_hourly_rate` decimal(15,2) NOT NULL DEFAULT 0.00,
|
||||
`config_invoice_prefix` varchar(200) DEFAULT NULL,
|
||||
`config_invoice_next_number` int(11) DEFAULT NULL,
|
||||
`config_invoice_footer` text DEFAULT NULL,
|
||||
|
|
@ -1744,4 +1745,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2023-10-20 14:53:11
|
||||
-- Dump completed on 2023-11-06 14:51:28
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickVendorModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="vendors.php" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryExpenseModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Expense" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($expense_amount,2); ?>" placeholder="0.00" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($expense_amount, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($expense_amount,2); ?>" placeholder="0.00" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($expense_amount, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickVendorModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="vendors.php" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryExpenseModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Expense" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="amount" value="-<?php echo number_format($expense_amount,2); ?>" placeholder="-0.00" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="amount" value="-<?php echo number_format($expense_amount, 2, '.', ''); ?>" placeholder="-0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
10
expenses.php
10
expenses.php
|
|
@ -49,7 +49,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default btn-lg" data-toggle="modal" data-target="#exportExpensesModal"><i class="fas fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -83,6 +82,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<input type="date" class="form-control" name="dtt" max="2999-12-31" value="<?php echo nullable_htmlentities($dtt); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="float-right">
|
||||
<br>
|
||||
<button type="button" class="btn btn-default mt-2" data-toggle="modal" data-target="#exportExpensesModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -201,7 +206,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php
|
||||
require_once "expense_add_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
require_once "footer.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ $config_default_payment_method = $row['config_default_payment_method'];
|
|||
$config_default_expense_payment_method = $row['config_default_expense_payment_method'];
|
||||
$config_default_calendar = intval($row['config_default_calendar']);
|
||||
$config_default_net_terms = intval($row['config_default_net_terms']);
|
||||
$config_default_hourly_rate = floatval($row['config_default_hourly_rate']);
|
||||
|
||||
// Invoice
|
||||
$config_invoice_prefix = $row['config_invoice_prefix'];
|
||||
|
|
@ -106,7 +107,10 @@ $config_theme_mode = "dark_mode";
|
|||
// Telemetry
|
||||
$config_telemetry = intval($row['config_telemetry']);
|
||||
|
||||
$colors_array = array(
|
||||
|
||||
// Select Arrays
|
||||
|
||||
$colors_array = array (
|
||||
'blue',
|
||||
'green',
|
||||
'cyan',
|
||||
|
|
@ -128,7 +132,7 @@ $colors_array = array(
|
|||
'olive'
|
||||
);
|
||||
|
||||
$net_terms_array = array(
|
||||
$net_terms_array = array (
|
||||
'0'=>'On Receipt',
|
||||
'7'=>'7 Days',
|
||||
'10'=>'10 Days',
|
||||
|
|
@ -139,19 +143,19 @@ $net_terms_array = array(
|
|||
'90'=>'90 Days'
|
||||
);
|
||||
|
||||
$records_per_page_array = array('5','10','15','20','30','50','100');
|
||||
$records_per_page_array = array ('5','10','15','20','30','50','100');
|
||||
|
||||
include_once "settings_localization_array.php";
|
||||
|
||||
|
||||
$category_types_array = array(
|
||||
$category_types_array = array (
|
||||
'Expense',
|
||||
'Income',
|
||||
'Payment Method',
|
||||
'Referral'
|
||||
);
|
||||
|
||||
$asset_types_array = array(
|
||||
$asset_types_array = array (
|
||||
'Laptop'=>'fa-laptop',
|
||||
'Desktop'=>'fa-desktop',
|
||||
'Server'=>'fa-server',
|
||||
|
|
@ -168,7 +172,7 @@ $asset_types_array = array(
|
|||
'Other'=>'fa-tag'
|
||||
);
|
||||
|
||||
$software_types_array = array(
|
||||
$software_types_array = array (
|
||||
'SaaS',
|
||||
'Application',
|
||||
'Mobile',
|
||||
|
|
@ -177,18 +181,18 @@ $software_types_array = array(
|
|||
'Misc'
|
||||
);
|
||||
|
||||
$license_types_array = array(
|
||||
$license_types_array = array (
|
||||
'Device',
|
||||
'User'
|
||||
);
|
||||
|
||||
$document_types_array = array(
|
||||
$document_types_array = array (
|
||||
'0'=>'Document',
|
||||
'1'=>'Template',
|
||||
'2'=>'Global Template'
|
||||
);
|
||||
|
||||
$asset_status_array = array(
|
||||
$asset_status_array = array (
|
||||
'Ready to Deploy',
|
||||
'Deployed',
|
||||
'Out for Repair',
|
||||
|
|
@ -197,7 +201,7 @@ $asset_status_array = array(
|
|||
'Retired'
|
||||
);
|
||||
|
||||
$ticket_status_array = array(
|
||||
$ticket_status_array = array (
|
||||
'Pending-Assignment',
|
||||
'Assigned',
|
||||
'In-Progress',
|
||||
|
|
@ -207,3 +211,39 @@ $ticket_status_array = array(
|
|||
'Scheduled',
|
||||
'Closed'
|
||||
);
|
||||
|
||||
$industry_select_array = array(
|
||||
"Accounting",
|
||||
"Agriculture",
|
||||
"Automotive",
|
||||
"Construction",
|
||||
"Education",
|
||||
"Entertainent",
|
||||
"Finance",
|
||||
"Government",
|
||||
"Healthcare",
|
||||
"Hospititality",
|
||||
"Information Technology",
|
||||
"Insurance",
|
||||
"Pharmacy",
|
||||
"Law",
|
||||
"Manufacturing",
|
||||
"Marketing & Advertising",
|
||||
"Military",
|
||||
"Non-Profit",
|
||||
"Real Estate",
|
||||
"Retail",
|
||||
"Services",
|
||||
"Transportation",
|
||||
"Other" // An 'Other' option for industries not listed
|
||||
);
|
||||
|
||||
$start_page_select_array = array (
|
||||
'dashboard.php'=>'Personal Dashboard',
|
||||
'dashboard_financial.php'=>'Administrative Dashboard',
|
||||
'dashboard_technical.php' => 'Technical Dashboard',
|
||||
'clients.php'=> 'Client Management',
|
||||
'tickets.php'=> 'Support Tickets',
|
||||
'invoices.php' => 'Invoices'
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,13 @@ if (isset($_GET['query'])) {
|
|||
AND (vendor_name LIKE '%$query%' OR vendor_phone LIKE '%$phone_query%')
|
||||
ORDER BY vendor_id DESC LIMIT 5"
|
||||
);
|
||||
|
||||
$sql_domains = mysqli_query($mysqli, "SELECT * FROM domains
|
||||
LEFT JOIN clients ON domain_client_id = client_id
|
||||
WHERE domain_archived_at IS NULL
|
||||
AND domain_name LIKE '%$query%'
|
||||
ORDER BY domain_id DESC LIMIT 5"
|
||||
);
|
||||
|
||||
$sql_products = mysqli_query($mysqli, "SELECT * FROM products
|
||||
WHERE product_archived_at IS NULL
|
||||
|
|
@ -240,6 +247,50 @@ if (isset($_GET['query'])) {
|
|||
|
||||
<?php } ?>
|
||||
|
||||
<?php if (mysqli_num_rows($sql_domains) > 0) { ?>
|
||||
|
||||
<!-- Domains -->
|
||||
<div class="col-sm-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fas fa-fw fa-globe mr-2"></i>Domains</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Expiry</th>
|
||||
<th>Client</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_domains)) {
|
||||
$domain_name = nullable_htmlentities($row['domain_name']);
|
||||
$domain_expiry = nullable_htmlentities($row['domain_expire']);
|
||||
$domain_id = intval($row['domain_id']);
|
||||
$client_id = intval($row['client_id']);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="client_domains.php?client_id=<?php echo $client_id; ?>&domain_id=<?php echo $domain_id; ?>"><?php echo $domain_name; ?></a>
|
||||
<td><?php echo $domain_expiry; ?></td>
|
||||
<td><a href="client_overview.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if (mysqli_num_rows($sql_products) > 0) { ?>
|
||||
|
||||
<!-- Products -->
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
<td>Date</td>
|
||||
<td class="text-right"><?php echo $invoice_date; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="text-bold">
|
||||
<td>Due</td>
|
||||
<td class="text-right"><div class="<?php echo $invoice_color; ?>"><?php echo $invoice_due; ?></div></td>
|
||||
</tr>
|
||||
|
|
@ -212,7 +212,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
<?php
|
||||
|
||||
$total_tax = 0.00;
|
||||
$sub_total = 0.00;
|
||||
$sub_total = 0.00 - $invoice_discount;
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_invoice_items)) {
|
||||
$item_id = intval($row['item_id']);
|
||||
|
|
@ -258,28 +258,30 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
<div class="col-sm-3 offset-sm-2">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr class="border-bottom">
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $sub_total, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($invoice_discount > 0) {
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $invoice_discount, $invoice_currency_code); ?></td>
|
||||
<td class="text-right">-<?php echo numfmt_format_currency($currency_format, $invoice_discount, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$sub_total = $sub_total - $invoice_discount;
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $sub_total, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Tax</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $total_tax, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Total</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php if ($amount_paid > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td><div class="text-success">Paid</div></td>
|
||||
|
|
@ -397,11 +399,11 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
{},
|
||||
{
|
||||
text: 'Due',
|
||||
style: 'invoiceDateTitle'
|
||||
style: 'invoiceDueDateTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode($invoice_due)) ?>,
|
||||
style: 'invoiceDateValue'
|
||||
style: 'invoiceDueDateValue'
|
||||
},
|
||||
],
|
||||
]
|
||||
|
|
@ -520,7 +522,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
],
|
||||
[
|
||||
{
|
||||
rowSpan: 5,
|
||||
rowSpan: '*',
|
||||
text: <?php echo json_encode(html_entity_decode($invoice_note)) ?>,
|
||||
style: 'notesText'
|
||||
},
|
||||
|
|
@ -533,6 +535,20 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php if ($invoice_discount > 0) { ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
text: 'Discount',
|
||||
style: 'itemsFooterSubTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, -$invoice_discount, $invoice_currency_code)) ?>,
|
||||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php } ?>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -544,6 +560,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php } ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -555,6 +572,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php if ($amount_paid > 0) { ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -566,6 +584,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php } ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -631,7 +650,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
alignment: 'right',
|
||||
margin: [0,0,0,30]
|
||||
},
|
||||
// Invoice Dates
|
||||
// Invoice Date
|
||||
invoiceDateTitle: {
|
||||
fontSize: 10,
|
||||
alignment: 'left',
|
||||
|
|
@ -642,6 +661,19 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
|
|||
alignment: 'right',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
// Invoice Due Date
|
||||
invoiceDueDateTitle: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
alignment: 'left',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
invoiceDueDateValue: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
alignment: 'right',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
// Items Header
|
||||
itemsHeader: {
|
||||
fontSize: 10,
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
<td>Date</td>
|
||||
<td class="text-right"><?php echo $quote_date; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="text-bold">
|
||||
<td>Expire</td>
|
||||
<td class="text-right"><?php echo $quote_expire; ?></td>
|
||||
</tr>
|
||||
|
|
@ -233,21 +233,16 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
<div class="col-sm-3 offset-sm-2">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<?php
|
||||
if ($quote_discount > 0) {
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $quote_discount, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$sub_total = $sub_total - $quote_discount;
|
||||
}
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $sub_total, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php if ($quote_discount > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, -$quote_discount, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Tax</td>
|
||||
|
|
@ -378,11 +373,11 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
{},
|
||||
{
|
||||
text: 'Expire',
|
||||
style: 'invoiceDateTitle'
|
||||
style: 'invoiceDueDateTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode($quote_expire)) ?>,
|
||||
style: 'invoiceDateValue'
|
||||
style: 'invoiceDueDateValue'
|
||||
},
|
||||
],
|
||||
]
|
||||
|
|
@ -501,7 +496,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
],
|
||||
[
|
||||
{
|
||||
rowSpan: 3,
|
||||
rowSpan: '*',
|
||||
text: <?php echo json_encode(html_entity_decode($quote_note)) ?>,
|
||||
style: 'notesText'
|
||||
},
|
||||
|
|
@ -514,6 +509,20 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php if ($quote_discount > 0) { ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
text: 'Discount',
|
||||
style: 'itemsFooterSubTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, -$quote_discount, $quote_currency_code)) ?>,
|
||||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php } ?>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -525,15 +534,16 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php } ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
text: 'Total',
|
||||
style: 'itemsFooterSubTitle'
|
||||
style: 'itemsFooterTotalTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $quote_amount, $quote_currency_code)) ?>,
|
||||
style: 'itemsFooterSubValue'
|
||||
style: 'itemsFooterTotalValue'
|
||||
}
|
||||
],
|
||||
]
|
||||
|
|
@ -600,6 +610,19 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
|
|||
alignment: 'right',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
// Invoice Due Dates
|
||||
invoiceDueDateTitle: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
alignment: 'left',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
invoiceDueDateValue: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
alignment: 'right',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
// Items Header
|
||||
itemsHeader: {
|
||||
fontSize: 10,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ if (isset($_GET['client_id'])) {
|
|||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$client_name = nullable_htmlentities($row['client_name']);
|
||||
$client_is_lead = intval($row['client_lead']);
|
||||
$client_type = nullable_htmlentities($row['client_type']);
|
||||
$client_website = nullable_htmlentities($row['client_website']);
|
||||
$client_referral = nullable_htmlentities($row['client_referral']);
|
||||
|
|
|
|||
|
|
@ -159,7 +159,3 @@ require_once "client_edit_modal.php";
|
|||
require_once "client_delete_modal.php";
|
||||
|
||||
require_once "client_download_pdf_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
|
||||
|
|
|
|||
63
invoice.php
63
invoice.php
|
|
@ -242,7 +242,7 @@ if (isset($_GET['invoice_id'])) {
|
|||
<td>Date</td>
|
||||
<td class="text-right"><?php echo $invoice_date; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="text-bold">
|
||||
<td>Due</td>
|
||||
<td class="text-right"><?php echo $invoice_due; ?></td>
|
||||
</tr>
|
||||
|
|
@ -403,28 +403,31 @@ if (isset($_GET['invoice_id'])) {
|
|||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
|
||||
<tr class="border-bottom">
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $sub_total, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($invoice_discount > 0) {
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $invoice_discount, $invoice_currency_code); ?></td>
|
||||
<td class="text-right">-<?php echo numfmt_format_currency($currency_format, $invoice_discount, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$sub_total = $sub_total - $invoice_discount;
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $sub_total, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Tax</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $total_tax, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php }
|
||||
<?php } ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Total</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($amount_paid > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td><div class="text-success">Paid</div></td>
|
||||
|
|
@ -680,11 +683,11 @@ require_once "footer.php";
|
|||
{},
|
||||
{
|
||||
text: 'Due',
|
||||
style: 'invoiceDateTitle'
|
||||
style: 'invoiceDueDateTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode($invoice_due) ?>,
|
||||
style: 'invoiceDateValue'
|
||||
style: 'invoiceDueDateValue'
|
||||
},
|
||||
],
|
||||
]
|
||||
|
|
@ -803,7 +806,7 @@ require_once "footer.php";
|
|||
],
|
||||
[
|
||||
{
|
||||
rowSpan: 5,
|
||||
rowSpan: '*',
|
||||
text: <?php echo json_encode(html_entity_decode($invoice_note)) ?>,
|
||||
style: 'notesText'
|
||||
},
|
||||
|
|
@ -816,6 +819,20 @@ require_once "footer.php";
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php if ($invoice_discount > 0) { ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
text: 'Discount',
|
||||
style: 'itemsFooterSubTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, -$invoice_discount, $invoice_currency_code)) ?>,
|
||||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php } ?>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -827,6 +844,7 @@ require_once "footer.php";
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php } ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -838,6 +856,7 @@ require_once "footer.php";
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php if ($amount_paid > 0) { ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -849,6 +868,7 @@ require_once "footer.php";
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
<?php } ?>
|
||||
[
|
||||
{},
|
||||
{
|
||||
|
|
@ -858,7 +878,7 @@ require_once "footer.php";
|
|||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $balance, $invoice_currency_code)) ?>,
|
||||
|
||||
style: 'itemsFooterTotalTitle'
|
||||
style: 'itemsFooterTotalValue'
|
||||
}
|
||||
],
|
||||
]
|
||||
|
|
@ -914,7 +934,7 @@ require_once "footer.php";
|
|||
alignment: 'right',
|
||||
margin: [0,0,0,30]
|
||||
},
|
||||
// Invoice Dates
|
||||
// Invoice Date
|
||||
invoiceDateTitle: {
|
||||
fontSize: 10,
|
||||
alignment: 'left',
|
||||
|
|
@ -925,6 +945,19 @@ require_once "footer.php";
|
|||
alignment: 'right',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
// Invoice Due Date
|
||||
invoiceDueDateTitle: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
alignment: 'left',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
invoiceDueDateValue: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
alignment: 'right',
|
||||
margin: [0,5,0,5]
|
||||
},
|
||||
// Items Header
|
||||
itemsHeader: {
|
||||
fontSize: 10,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
<div class='input-group-prepend'>
|
||||
<span class='input-group-text'><i class='fa fa-fw fa-dollar-sign'></i></span>
|
||||
</div>
|
||||
<input type='number' class='form-control' step="0.01" name='invoice_discount' placeholder='Discount Amount' value='<?php echo $invoice_discount; ?>'>
|
||||
<input type='text' class='form-control' inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name='invoice_discount' placeholder='0.00' value="<?php echo number_format($invoice_discount, 2, '.', ''); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($balance, 2); ?>" placeholder="0.00" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($balance, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -162,13 +162,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) {echo stripslashes(nullable_htmlentities($q));} ?>" placeholder="Search 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 class="col-sm-8">
|
||||
<div class="float-right">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
<div class="float-right">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -326,7 +326,5 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<?php
|
||||
require_once "invoice_add_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
require_once "footer.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="price" value="<?php echo number_format($item_price,2); ?>" placeholder="0.00" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="price" value="<?php echo number_format($item_price, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
function addWatcher(button) {
|
||||
var container = button.previousElementSibling;
|
||||
var textFieldWrapper = document.createElement("div");
|
||||
textFieldWrapper.className = "input-group mb-3";
|
||||
|
||||
var prependWrapper = document.createElement("div");
|
||||
prependWrapper.className = "input-group-prepend";
|
||||
var iconSpan = document.createElement("span");
|
||||
iconSpan.className = "input-group-text";
|
||||
iconSpan.innerHTML = "<i class='fas fa-fw fa-envelope'></i>";
|
||||
prependWrapper.appendChild(iconSpan);
|
||||
|
||||
var textField = document.createElement("input");
|
||||
textField.type = "email";
|
||||
textField.className = "form-control";
|
||||
textField.name = "watchers[]";
|
||||
textField.placeholder = "Enter an email";
|
||||
|
||||
var removeButtonWrapper = document.createElement("div");
|
||||
removeButtonWrapper.className = "input-group-append";
|
||||
|
||||
var removeButton = document.createElement("button");
|
||||
removeButton.className = "btn btn-danger";
|
||||
removeButton.type = "button";
|
||||
removeButton.innerHTML = "<i class='fas fa-fw fa-minus'></i>";
|
||||
removeButton.onclick = function() {
|
||||
removeWatcher(this);
|
||||
};
|
||||
|
||||
removeButtonWrapper.appendChild(removeButton);
|
||||
textFieldWrapper.appendChild(prependWrapper);
|
||||
textFieldWrapper.appendChild(textField);
|
||||
textFieldWrapper.appendChild(removeButtonWrapper);
|
||||
container.appendChild(textFieldWrapper);
|
||||
}
|
||||
|
||||
function removeWatcher(button) {
|
||||
var container = button.parentNode.parentNode.parentNode; // Navigate to the container
|
||||
var textFieldWrapper = button.parentNode.parentNode;
|
||||
container.removeChild(textFieldWrapper);
|
||||
}
|
||||
|
|
@ -125,6 +125,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function updateRunningTicketsCount() {
|
||||
var runningTickets = parseInt(document.getElementById('runningTicketsCount').innerText, 10);
|
||||
|
||||
|
|
@ -136,6 +137,16 @@
|
|||
|
||||
document.getElementById('runningTicketsCount').innerText = runningTickets.toString();
|
||||
}
|
||||
|
||||
// Function to check status and pause timer
|
||||
function checkStatusAndPauseTimer() {
|
||||
var status = document.querySelector('select[name="status"]').value;
|
||||
if (status.includes("Pending")) {
|
||||
pauseTimer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
document.getElementById("hours").addEventListener('change', updateTimeFromInput);
|
||||
document.getElementById("minutes").addEventListener('change', updateTimeFromInput);
|
||||
|
|
@ -146,6 +157,9 @@
|
|||
document.getElementById("minutes").addEventListener('focus', handleInputFocus);
|
||||
document.getElementById("seconds").addEventListener('focus', handleInputFocus);
|
||||
|
||||
document.querySelector('select[name="status"]').addEventListener('change', checkStatusAndPauseTimer);
|
||||
|
||||
|
||||
document.getElementById("startStopTimer").addEventListener('click', function() {
|
||||
if (timerInterval === null) {
|
||||
startTimer();
|
||||
|
|
@ -162,16 +176,17 @@
|
|||
// Wait for other synchronous actions (if any) to complete before resetting the timer.
|
||||
setTimeout(forceResetTimer, 100); // 100ms delay should suffice, but you can adjust as needed.
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
displayTime();
|
||||
if (!localStorage.getItem(getLocalStorageKey("startTime")) && !localStorage.getItem(getLocalStorageKey("pausedTime"))) {
|
||||
// If first time, start the timer automatically
|
||||
startTimer();
|
||||
} else if (localStorage.getItem(getLocalStorageKey("startTime"))) {
|
||||
// Continue timer if it was running before
|
||||
startTimer();
|
||||
}
|
||||
|
||||
// Check and pause timer if status is pending
|
||||
checkStatusAndPauseTimer();
|
||||
} catch (error) {
|
||||
console.error("There was an issue initializing the timer:", error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,6 +310,12 @@ if (isset($_POST['login'])) {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mb-3">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="remember_me">
|
||||
<label class="custom-control-label" for="remember_me">Remember Me</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($token_field)) { echo $token_field; } ?>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-block mb-3" name="login">Sign In</button>
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ if (isset($_POST['code']) && $_POST['state'] == session_id()) {
|
|||
header("Location: index.php");
|
||||
|
||||
} else {
|
||||
$_SESSION['login_message'] = 'Something went wrong with login. Ensure you are setup for SSO.';
|
||||
$_SESSION['login_message'] = 'Something went wrong with logging you in: Your account is not configured for Azure SSO. Please ensure you are setup in ITFlow as a contact and have Azure SSO configured.';
|
||||
header("Location: index.php");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ if (isset($_POST['add_client'])) {
|
|||
|
||||
$extended_log_description = '';
|
||||
|
||||
// Create client
|
||||
mysqli_query($mysqli, "INSERT INTO clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_lead = $lead, client_notes = '$notes', client_accessed_at = NOW()");
|
||||
|
||||
$client_id = mysqli_insert_id($mysqli);
|
||||
|
|
@ -35,7 +36,15 @@ if (isset($_POST['add_client'])) {
|
|||
file_put_contents("uploads/clients/$client_id/index.php", "");
|
||||
}
|
||||
|
||||
//Add Location
|
||||
// Create Referral if it doesn't exist
|
||||
$sql = mysqli_query($mysqli, "SELECT category_name FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND category_name = '$referral'");
|
||||
if(mysqli_num_rows($sql) == 0) {
|
||||
mysqli_query($mysqli, "INSERT INTO categories SET category_name = '$referral', category_type = 'Referral'");
|
||||
// Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Category', log_action = 'Create', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||
}
|
||||
|
||||
// Create Location
|
||||
if (!empty($location_phone) || !empty($address) || !empty($city) || !empty($state) || !empty($zip)) {
|
||||
mysqli_query($mysqli, "INSERT INTO locations SET location_name = 'Primary', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$location_phone', location_country = '$country', location_primary = 1, location_client_id = $client_id");
|
||||
|
||||
|
|
@ -44,7 +53,7 @@ if (isset($_POST['add_client'])) {
|
|||
}
|
||||
|
||||
|
||||
//Add Contact
|
||||
// Create Contact
|
||||
if (!empty($contact) || !empty($title) || !empty($contact_phone) || !empty($contact_mobile) || !empty($contact_email)) {
|
||||
mysqli_query($mysqli, "INSERT INTO contacts SET contact_name = '$contact', contact_title = '$title', contact_phone = '$contact_phone', contact_extension = '$contact_extension', contact_mobile = '$contact_mobile', contact_email = '$contact_email', contact_primary = 1, contact_important = 1, contact_client_id = $client_id");
|
||||
|
||||
|
|
@ -52,7 +61,7 @@ if (isset($_POST['add_client'])) {
|
|||
$extended_log_description .= ", primary contact $contact added";
|
||||
}
|
||||
|
||||
//Add Tags
|
||||
// Add Tags
|
||||
if (isset($_POST['tags'])) {
|
||||
foreach($_POST['tags'] as $tag) {
|
||||
$tag = intval($tag);
|
||||
|
|
@ -60,7 +69,7 @@ if (isset($_POST['add_client'])) {
|
|||
}
|
||||
}
|
||||
|
||||
//Add domain to domains/certificates
|
||||
// Create domain in domains/certificates
|
||||
if (!empty($website) && filter_var($website, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
|
||||
// Get domain expiry date
|
||||
$expire = getDomainExpirationDate($website);
|
||||
|
|
@ -96,7 +105,7 @@ if (isset($_POST['add_client'])) {
|
|||
|
||||
}
|
||||
|
||||
//Logging
|
||||
// Logging
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Client', log_action = 'Create', log_description = '$session_name created client $name$extended_log_description', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Client <strong>$name</strong> created";
|
||||
|
|
@ -110,24 +119,31 @@ if (isset($_POST['edit_client'])) {
|
|||
|
||||
require_once 'post/client_model.php';
|
||||
|
||||
|
||||
validateAdminRole();
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
||||
mysqli_query($mysqli, "UPDATE clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_lead = $lead, client_notes = '$notes' WHERE client_id = $client_id");
|
||||
|
||||
//Tags
|
||||
//Delete existing tags
|
||||
// Create Referral if it doesn't exist
|
||||
$sql = mysqli_query($mysqli, "SELECT category_name FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND category_name = '$referral'");
|
||||
if(mysqli_num_rows($sql) == 0) {
|
||||
mysqli_query($mysqli, "INSERT INTO categories SET category_name = '$referral', category_type = 'Referral'");
|
||||
// Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Category', log_action = 'Create', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||
}
|
||||
|
||||
// Tags
|
||||
// Delete existing tags
|
||||
mysqli_query($mysqli, "DELETE FROM client_tags WHERE client_tag_client_id = $client_id");
|
||||
|
||||
//Add new tags
|
||||
// Add new tags
|
||||
foreach($_POST['tags'] as $tag) {
|
||||
$tag = intval($tag);
|
||||
mysqli_query($mysqli, "INSERT INTO client_tags SET client_tag_client_id = $client_id, client_tag_tag_id = $tag");
|
||||
}
|
||||
|
||||
//Logging
|
||||
// Logging
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Client', log_action = 'Modify', log_description = '$session_name modified client $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Client <strong>$client_name</strong> updated";
|
||||
|
|
|
|||
|
|
@ -134,6 +134,9 @@ if (isset($_POST['edit_document'])) {
|
|||
// vendor documents
|
||||
mysqli_query($mysqli,"UPDATE vendor_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
// Service document
|
||||
mysqli_query($mysqli,"UPDATE service_documents SET document_id = $new_document_id WHERE document_id = $document_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Edit', log_description = '$session_name Edited document $name previous version was kept', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $new_document_id");
|
||||
|
||||
|
|
@ -424,6 +427,9 @@ if (isset($_GET['archive_document'])) {
|
|||
// Vendor Associations
|
||||
mysqli_query($mysqli,"DELETE FROM vendor_documents WHERE document_id = $document_id");
|
||||
|
||||
// Service Associations
|
||||
mysqli_query($mysqli,"DELETE FROM service_documents WHERE document_id = $document_id");
|
||||
|
||||
//logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Archive', log_description = '$session_name archived document $document_name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $document_id");
|
||||
|
||||
|
|
@ -458,6 +464,9 @@ if (isset($_GET['delete_document'])) {
|
|||
// Vendor Associations
|
||||
mysqli_query($mysqli,"DELETE FROM vendor_documents WHERE document_id = $document_id");
|
||||
|
||||
// Service Associations
|
||||
mysqli_query($mysqli,"DELETE FROM service_documents WHERE document_id = $document_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Delete', log_description = '$document_id', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||
|
||||
|
|
|
|||
|
|
@ -265,8 +265,9 @@ if (isset($_POST['edit_default_settings'])) {
|
|||
$transfer_to_account = intval($_POST['transfer_to_account']);
|
||||
$calendar = intval($_POST['calendar']);
|
||||
$net_terms = intval($_POST['net_terms']);
|
||||
$hourly_rate = floatval($_POST['hourly_rate']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$start_page', config_default_expense_account = $expense_account, config_default_payment_account = $payment_account, config_default_payment_method = '$payment_method', config_default_expense_payment_method = '$expense_payment_method', config_default_transfer_from_account = $transfer_from_account, config_default_transfer_to_account = $transfer_to_account, config_default_calendar = $calendar, config_default_net_terms = $net_terms WHERE company_id = 1");
|
||||
mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$start_page', config_default_expense_account = $expense_account, config_default_payment_account = $payment_account, config_default_payment_method = '$payment_method', config_default_expense_payment_method = '$expense_payment_method', config_default_transfer_from_account = $transfer_from_account, config_default_transfer_to_account = $transfer_to_account, config_default_calendar = $calendar, config_default_net_terms = $net_terms, config_default_hourly_rate = $hourly_rate WHERE company_id = 1");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified default settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||
|
|
|
|||
|
|
@ -59,11 +59,11 @@ if (isset($_GET['delete_trip'])) {
|
|||
if (isset($_POST['export_trips_csv'])) {
|
||||
$date_from = sanitizeInput($_POST['date_from']);
|
||||
$date_to = sanitizeInput($_POST['date_to']);
|
||||
if(!empty($date_from) && !empty($date_to)){
|
||||
$date_query = "AND DATE(trip_date) BETWEEN '$date_from' AND '$date_to'";
|
||||
if (!empty($date_from) && !empty($date_to)){
|
||||
$date_query = "DATE(trip_date) BETWEEN '$date_from' AND '$date_to'";
|
||||
$file_name_date = "$date_from-to-$date_to";
|
||||
}else{
|
||||
$date_query = "";
|
||||
} else {
|
||||
$date_query = "trip_date IS NOT NULL";
|
||||
$file_name_date = date('Y-m-d');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" class="form-control" name="price" value="<?php echo $product_price; ?>" placeholder="0.00" required>
|
||||
<input type="text" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" class="form-control" name="price" value="<?php echo number_format($product_price, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -123,7 +123,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
require_once "product_add_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
require_once "footer.php";
|
||||
|
||||
|
|
|
|||
590
quote.php
590
quote.php
|
|
@ -99,7 +99,7 @@ if (isset($_GET['quote_id'])) {
|
|||
$json_products = json_encode($products);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
|
|
@ -135,10 +135,10 @@ if (isset($_GET['quote_id'])) {
|
|||
<?php } ?>
|
||||
|
||||
<?php if ($quote_status == 'Sent' || $quote_status == 'Viewed') { ?>
|
||||
<a class="btn btn-success" href="post.php?accept_quote=<?php echo $quote_id; ?>">
|
||||
<a class="btn btn-primary" href="post.php?accept_quote=<?php echo $quote_id; ?>">
|
||||
<i class="fas fa-thumbs-up mr-2"></i>Accept
|
||||
</a>
|
||||
<a class="btn btn-outline-danger" href="post.php?decline_quote=<?php echo $quote_id; ?>">
|
||||
<a class="btn btn-default" href="post.php?decline_quote=<?php echo $quote_id; ?>">
|
||||
<i class="fas fa-thumbs-down mr-2"></i>Decline
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
|
@ -167,8 +167,7 @@ if (isset($_GET['quote_id'])) {
|
|||
<a class="dropdown-item" href="#" onclick="window.print();">
|
||||
<i class="fa fa-fw fa-print text-secondary mr-2"></i>Print
|
||||
</a>
|
||||
<a class="dropdown-item" href="#"
|
||||
onclick="pdfMake.createPdf(docDefinition).download('<?php echo strtoAZaz09(html_entity_decode("$quote_date-$company_name-$client_name-Quote-$quote_prefix$quote_number")); ?>');">
|
||||
<a class="dropdown-item" href="#" onclick="pdfMake.createPdf(docDefinition).download('<?php echo strtoAZaz09(html_entity_decode("$quote_date-$company_name-$client_name-Quote-$quote_prefix$quote_number")); ?>');">
|
||||
<i class="fa fa-fw fa-download text-secondary mr-2"></i>Download PDF
|
||||
</a>
|
||||
<?php if (!empty($config_smtp_host) && !empty($contact_email)) { ?>
|
||||
|
|
@ -207,7 +206,9 @@ if (isset($_GET['quote_id'])) {
|
|||
<div class="row mb-4">
|
||||
<div class="col">
|
||||
<ul class="list-unstyled">
|
||||
<li><h4><strong><?php echo $company_name; ?></strong></h4></li>
|
||||
<li>
|
||||
<h4><strong><?php echo $company_name; ?></strong></h4>
|
||||
</li>
|
||||
<li><?php echo $company_address; ?></li>
|
||||
<li><?php echo "$company_city $company_state $company_zip"; ?></li>
|
||||
<li><?php echo $company_phone; ?></li>
|
||||
|
|
@ -216,7 +217,9 @@ if (isset($_GET['quote_id'])) {
|
|||
</div>
|
||||
<div class="col">
|
||||
<ul class="list-unstyled text-right">
|
||||
<li><h4><strong><?php echo $client_name; ?></strong></h4></li>
|
||||
<li>
|
||||
<h4><strong><?php echo $client_name; ?></strong></h4>
|
||||
</li>
|
||||
<li><?php echo $location_address; ?></li>
|
||||
<li><?php echo "$location_city $location_state $location_zip"; ?></li>
|
||||
<li><?php echo "$contact_phone $contact_extension"; ?></li>
|
||||
|
|
@ -234,7 +237,7 @@ if (isset($_GET['quote_id'])) {
|
|||
<td>Date</td>
|
||||
<td class="text-right"><?php echo $quote_date; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="text-bold">
|
||||
<td>Expire</td>
|
||||
<td class="text-right"><?php echo $quote_expire; ?></td>
|
||||
</tr>
|
||||
|
|
@ -250,151 +253,154 @@ if (isset($_GET['quote_id'])) {
|
|||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="d-print-none"></th>
|
||||
<th>Item</th>
|
||||
<th>Description</th>
|
||||
<th class="text-center">Quantity</th>
|
||||
<th class="text-right">Price</th>
|
||||
<th class="text-right">Tax</th>
|
||||
<th class="text-right">Total</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="d-print-none"></th>
|
||||
<th>Item</th>
|
||||
<th>Description</th>
|
||||
<th class="text-center">Quantity</th>
|
||||
<th class="text-right">Price</th>
|
||||
<th class="text-right">Tax</th>
|
||||
<th class="text-right">Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$total_tax = 0.00;
|
||||
$sub_total = 0.00;
|
||||
$total_tax = 0.00;
|
||||
$sub_total = 0.00;
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_items)) {
|
||||
$item_id = intval($row['item_id']);
|
||||
$item_name = nullable_htmlentities($row['item_name']);
|
||||
$item_description = nullable_htmlentities($row['item_description']);
|
||||
$item_order = intval($row['item_order']);
|
||||
$item_quantity = number_format(floatval($row['item_quantity']),2);
|
||||
$item_price = floatval($row['item_price']);
|
||||
$item_tax = floatval($row['item_tax']);
|
||||
$item_total = floatval($row['item_total']);
|
||||
$item_created_at = nullable_htmlentities($row['item_created_at']);
|
||||
$tax_id = intval($row['item_tax_id']);
|
||||
$total_tax = $item_tax + $total_tax;
|
||||
$sub_total = $item_price * $item_quantity + $sub_total;
|
||||
while ($row = mysqli_fetch_array($sql_items)) {
|
||||
$item_id = intval($row['item_id']);
|
||||
$item_name = nullable_htmlentities($row['item_name']);
|
||||
$item_description = nullable_htmlentities($row['item_description']);
|
||||
$item_order = intval($row['item_order']);
|
||||
$item_quantity = number_format(floatval($row['item_quantity']), 2);
|
||||
$item_price = floatval($row['item_price']);
|
||||
$item_tax = floatval($row['item_tax']);
|
||||
$item_total = floatval($row['item_total']);
|
||||
$item_created_at = nullable_htmlentities($row['item_created_at']);
|
||||
$tax_id = intval($row['item_tax_id']);
|
||||
$total_tax = $item_tax + $total_tax;
|
||||
$sub_total = $item_price * $item_quantity + $sub_total;
|
||||
|
||||
// Logic to check if top or bottom arrow should be hidden by looking at max and min of item_order
|
||||
$sql = mysqli_query($mysqli, "SELECT MAX(item_order) AS item_order FROM invoice_items WHERE item_quote_id = $quote_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$max_item_order = intval($row['item_order']);
|
||||
// Logic to check if top or bottom arrow should be hidden by looking at max and min of item_order
|
||||
$sql = mysqli_query($mysqli, "SELECT MAX(item_order) AS item_order FROM invoice_items WHERE item_quote_id = $quote_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$max_item_order = intval($row['item_order']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT MIN(item_order) AS item_order FROM invoice_items WHERE item_quote_id = $quote_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$min_item_order = intval($row['item_order']);
|
||||
$sql = mysqli_query($mysqli, "SELECT MIN(item_order) AS item_order FROM invoice_items WHERE item_quote_id = $quote_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$min_item_order = intval($row['item_order']);
|
||||
|
||||
if ($item_order == $max_item_order) {
|
||||
$down_hidden = "hidden";
|
||||
} else {
|
||||
$down_hidden = "";
|
||||
}
|
||||
if ($item_order == $max_item_order) {
|
||||
$down_hidden = "hidden";
|
||||
} else {
|
||||
$down_hidden = "";
|
||||
}
|
||||
|
||||
if ($item_order == $min_item_order) {
|
||||
$up_hidden = "hidden";
|
||||
} else {
|
||||
$up_hidden = "";
|
||||
}?>
|
||||
|
||||
<tr>
|
||||
<td class="d-print-none">
|
||||
<?php if ($quote_status !== "Invoiced" && $quote_status !== "Accepted" && $quote_status !== "Declined") { ?>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-sm btn-light" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<form action="post.php" method="post">
|
||||
<input type="hidden" name="item_quote_id" value="<?php echo $quote_id; ?>">
|
||||
<input type="hidden" name="item_id" value="<?php echo $item_id; ?>">
|
||||
<input type="hidden" name="item_order" value="<?php echo $item_order; ?>">
|
||||
<button class="dropdown-item" type="submit" name="update_quote_item_order" value="up" <?php echo $up_hidden; ?>><i class="fa fa-fw fa-arrow-up mr-2"></i>Move Up</button>
|
||||
<?php if ($up_hidden == "" && $down_hidden == "") { echo '<div class="dropdown-divider"></div>'; }?>
|
||||
<button class="dropdown-item" type="submit" name="update_quote_item_order" value="down" <?php echo $down_hidden; ?>><i class="fa fa-fw fa-arrow-down mr-2"></i>Move Down</button>
|
||||
</form>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>">
|
||||
<i class="fa fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_quote_item=<?php echo $item_id; ?>">
|
||||
<i class="fa fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
if ($item_order == $min_item_order) {
|
||||
$up_hidden = "hidden";
|
||||
} else {
|
||||
$up_hidden = "";
|
||||
} ?>
|
||||
|
||||
<tr>
|
||||
<td class="d-print-none">
|
||||
<?php if ($quote_status !== "Invoiced" && $quote_status !== "Accepted" && $quote_status !== "Declined") { ?>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-sm btn-light" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<form action="post.php" method="post">
|
||||
<input type="hidden" name="item_quote_id" value="<?php echo $quote_id; ?>">
|
||||
<input type="hidden" name="item_id" value="<?php echo $item_id; ?>">
|
||||
<input type="hidden" name="item_order" value="<?php echo $item_order; ?>">
|
||||
<button class="dropdown-item" type="submit" name="update_quote_item_order" value="up" <?php echo $up_hidden; ?>><i class="fa fa-fw fa-arrow-up mr-2"></i>Move Up</button>
|
||||
<?php if ($up_hidden == "" && $down_hidden == "") {
|
||||
echo '<div class="dropdown-divider"></div>';
|
||||
} ?>
|
||||
<button class="dropdown-item" type="submit" name="update_quote_item_order" value="down" <?php echo $down_hidden; ?>><i class="fa fa-fw fa-arrow-down mr-2"></i>Move Down</button>
|
||||
</form>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>">
|
||||
<i class="fa fa-fw fa-edit mr-2"></i>Edit
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_quote_item=<?php echo $item_id; ?>">
|
||||
<i class="fa fa-fw fa-trash mr-2"></i>Delete
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php echo $item_name; ?></td>
|
||||
<td><?php echo nl2br($item_description); ?></td>
|
||||
<td class="text-center"><?php echo $item_quantity; ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $item_price, $quote_currency_code); ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $item_tax, $quote_currency_code); ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $item_total, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?php echo $item_name; ?></td>
|
||||
<td><?php echo nl2br($item_description); ?></td>
|
||||
<td class="text-center"><?php echo $item_quantity; ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $item_price, $quote_currency_code); ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $item_tax, $quote_currency_code); ?></td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $item_total, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
if ($quote_status !== "Invoiced" && $quote_status !== "Accepted" && $quote_status !== "Declined") {
|
||||
require "item_edit_modal.php";
|
||||
|
||||
if ($quote_status !== "Invoiced" && $quote_status !== "Accepted" && $quote_status !== "Declined") {
|
||||
require "item_edit_modal.php";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
||||
<tr class="d-print-none" <?php if ($quote_status == "Invoiced" || $quote_status == "Accepted" || $quote_status == "Declined") {
|
||||
echo "hidden";
|
||||
} ?>>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="quote_id" value="<?php echo $quote_id; ?>">
|
||||
<input type="hidden" name="item_order" value="<?php
|
||||
//find largest order number and add 1
|
||||
$sql = mysqli_query($mysqli, "SELECT MAX(item_order) AS item_order FROM invoice_items WHERE item_quote_id = $quote_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$item_order = intval($row['item_order']) + 1;
|
||||
echo $item_order;
|
||||
?>">
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="text" class="form-control" name="name" id="name" placeholder="Item" required>
|
||||
</td>
|
||||
<td>
|
||||
<textarea class="form-control" rows="2" name="description" id="desc" placeholder="Enter a Description"></textarea>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" id="qty" style="text-align: center;" name="qty" placeholder="Quantity">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" id="price" style="text-align: right;" name="price" placeholder="Price (<?php echo $quote_currency_code; ?>)">
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control select2" id="tax" name="tax_id" required>
|
||||
<option value="0">No Tax</option>
|
||||
<?php
|
||||
|
||||
<tr class="d-print-none" <?php if ($quote_status == "Invoiced" || $quote_status == "Accepted" || $quote_status == "Declined") { echo "hidden"; } ?>>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="quote_id" value="<?php echo $quote_id; ?>">
|
||||
<input type="hidden" name="item_order" value="<?php
|
||||
//find largest order number and add 1
|
||||
$sql = mysqli_query($mysqli, "SELECT MAX(item_order) AS item_order FROM invoice_items WHERE item_quote_id = $quote_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$item_order = intval($row['item_order']) + 1;
|
||||
echo $item_order;
|
||||
?>">
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="text" class="form-control" name="name" id="name" placeholder="Item" required>
|
||||
</td>
|
||||
<td>
|
||||
<textarea class="form-control" rows="2" name="description" id="desc" placeholder="Enter a Description"></textarea>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" id="qty" style="text-align: center;" name="qty" placeholder="Quantity">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" id="price" style="text-align: right;" name="price" placeholder="Price (<?php echo $quote_currency_code; ?>)"></td>
|
||||
<td>
|
||||
<select class="form-control select2" id="tax" name="tax_id" required>
|
||||
<option value="0">No Tax</option>
|
||||
<?php
|
||||
|
||||
$taxes_sql = mysqli_query($mysqli, "SELECT tax_id, tax_name, tax_percent FROM taxes WHERE tax_archived_at IS NULL ORDER BY tax_name ASC");
|
||||
while ($row = mysqli_fetch_array($taxes_sql)) {
|
||||
$tax_id = intval($row['tax_id']);
|
||||
$tax_name = nullable_htmlentities($row['tax_name']);
|
||||
$tax_percent = floatval($row['tax_percent']);
|
||||
$taxes_sql = mysqli_query($mysqli, "SELECT tax_id, tax_name, tax_percent FROM taxes WHERE tax_archived_at IS NULL ORDER BY tax_name ASC");
|
||||
while ($row = mysqli_fetch_array($taxes_sql)) {
|
||||
$tax_id = intval($row['tax_id']);
|
||||
$tax_name = nullable_htmlentities($row['tax_name']);
|
||||
$tax_percent = floatval($row['tax_percent']);
|
||||
?>
|
||||
<option value="<?php echo $tax_id; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
|
||||
<option value="<?php echo $tax_id; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button class="btn btn-light text-success" type="submit" name="add_quote_item">
|
||||
<i class="fa fa-check"></i>
|
||||
</button>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button class="btn btn-light text-success" type="submit" name="add_quote_item">
|
||||
<i class="fa fa-check"></i>
|
||||
</button>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -422,31 +428,26 @@ if (isset($_GET['quote_id'])) {
|
|||
<div class="col-sm-3 offset-sm-2">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<?php
|
||||
if ($quote_discount > 0) {
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $quote_discount, $quote_currency_code); ?></td>
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $sub_total, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$sub_total = $sub_total - $quote_discount;
|
||||
}
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $sub_total, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
<?php if ($quote_discount > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right">-<?php echo numfmt_format_currency($currency_format, $quote_discount, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Tax</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $total_tax, $quote_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Tax</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $total_tax, $quote_currency_code); ?></td>
|
||||
<td><strong>Total</strong></td>
|
||||
<td class="text-right"><strong><?php echo numfmt_format_currency($currency_format, $quote_amount, $quote_currency_code); ?></strong></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr class="border-bottom">
|
||||
<td><strong>Total</strong></td>
|
||||
<td class="text-right"><strong><?php echo numfmt_format_currency($currency_format, $quote_amount, $quote_currency_code); ?></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -475,29 +476,29 @@ if (isset($_GET['quote_id'])) {
|
|||
<div class="card-body">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Status</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Status</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_history)) {
|
||||
$history_created_at = nullable_htmlentities($row['history_created_at']);
|
||||
$history_status = nullable_htmlentities($row['history_status']);
|
||||
$history_description = nullable_htmlentities($row['history_description']);
|
||||
while ($row = mysqli_fetch_array($sql_history)) {
|
||||
$history_created_at = nullable_htmlentities($row['history_created_at']);
|
||||
$history_status = nullable_htmlentities($row['history_status']);
|
||||
$history_description = nullable_htmlentities($row['history_description']);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $history_created_at; ?></td>
|
||||
<td><?php echo $history_status; ?></td>
|
||||
<td><?php echo $history_description; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $history_created_at; ?></td>
|
||||
<td><?php echo $history_status; ?></td>
|
||||
<td><?php echo $history_description; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -506,7 +507,7 @@ if (isset($_GET['quote_id'])) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
require_once "quote_edit_modal.php";
|
||||
|
||||
require_once "quote_to_invoice_modal.php";
|
||||
|
|
@ -514,10 +515,6 @@ if (isset($_GET['quote_id'])) {
|
|||
require_once "quote_copy_modal.php";
|
||||
|
||||
require_once "quote_note_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
|
||||
}
|
||||
|
||||
require_once "footer.php";
|
||||
|
|
@ -531,11 +528,11 @@ require_once "footer.php";
|
|||
<script src="plugins/jquery-ui/jquery-ui.min.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
var availableProducts = <?php echo $json_products?>;
|
||||
var availableProducts = <?php echo $json_products ?>;
|
||||
|
||||
$("#name").autocomplete({
|
||||
source: availableProducts,
|
||||
select: function (event, ui) {
|
||||
select: function(event, ui) {
|
||||
$("#name").val(ui.item.label); // Product name field - this seemingly has to referenced as label
|
||||
$("#desc").val(ui.item.description); // Product description field
|
||||
$("#qty").val(1); // Product quantity field automatically make it a 1
|
||||
|
|
@ -549,7 +546,6 @@ require_once "footer.php";
|
|||
<script src='plugins/pdfmake/pdfmake.min.js'></script>
|
||||
<script src='plugins/pdfmake/vfs_fonts.js'></script>
|
||||
<script>
|
||||
|
||||
var docDefinition = {
|
||||
info: {
|
||||
title: <?php echo json_encode(html_entity_decode($company_name) . "- Quote") ?>,
|
||||
|
|
@ -562,31 +558,26 @@ require_once "footer.php";
|
|||
// Header
|
||||
{
|
||||
columns: [
|
||||
<?php if (!empty($company_logo_base64)) { ?>
|
||||
{
|
||||
image: <?php echo json_encode("data:image;base64,$company_logo_base64") ?>,
|
||||
width: 120
|
||||
},
|
||||
<?php if (!empty($company_logo_base64)) { ?> {
|
||||
image: <?php echo json_encode("data:image;base64,$company_logo_base64") ?>,
|
||||
width: 120
|
||||
},
|
||||
<?php } ?>
|
||||
|
||||
[
|
||||
{
|
||||
text: 'Quote',
|
||||
style: 'invoiceTitle',
|
||||
width: '*'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode("$quote_prefix$quote_number") ?>,
|
||||
style: 'invoiceNumber',
|
||||
width: '*'
|
||||
},
|
||||
],
|
||||
[{
|
||||
text: 'Quote',
|
||||
style: 'invoiceTitle',
|
||||
width: '*'
|
||||
}, {
|
||||
text: <?php echo json_encode("$quote_prefix$quote_number") ?>,
|
||||
style: 'invoiceNumber',
|
||||
width: '*'
|
||||
}, ],
|
||||
],
|
||||
},
|
||||
// Billing Headers
|
||||
{
|
||||
columns: [
|
||||
{
|
||||
columns: [{
|
||||
text: <?php echo json_encode(html_entity_decode($company_name)) ?>,
|
||||
style: 'invoiceBillingTitle'
|
||||
},
|
||||
|
|
@ -598,8 +589,7 @@ require_once "footer.php";
|
|||
},
|
||||
// Billing Address
|
||||
{
|
||||
columns: [
|
||||
{
|
||||
columns: [{
|
||||
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website")) ?>,
|
||||
style: 'invoiceBillingAddress'
|
||||
},
|
||||
|
|
@ -615,20 +605,18 @@ require_once "footer.php";
|
|||
// headers are automatically repeated if the table spans over multiple pages
|
||||
// you can declare how many rows should be treated as headers
|
||||
headerRows: 0,
|
||||
widths: [ '*',80, 80 ],
|
||||
widths: ['*', 80, 80],
|
||||
|
||||
body: [
|
||||
// Total
|
||||
[
|
||||
{
|
||||
[{
|
||||
text: '',
|
||||
rowSpan: 3
|
||||
},
|
||||
{},
|
||||
{},
|
||||
],
|
||||
[
|
||||
{},
|
||||
[{},
|
||||
{
|
||||
text: 'Date',
|
||||
style: 'invoiceDateTitle'
|
||||
|
|
@ -638,15 +626,14 @@ require_once "footer.php";
|
|||
style: 'invoiceDateValue'
|
||||
},
|
||||
],
|
||||
[
|
||||
{},
|
||||
[{},
|
||||
{
|
||||
text: 'Expire',
|
||||
style: 'invoiceDateTitle'
|
||||
style: 'invoiceDueDateTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(html_entity_decode($quote_expire)) ?>,
|
||||
style: 'invoiceDateValue'
|
||||
style: 'invoiceDueDateValue'
|
||||
},
|
||||
],
|
||||
]
|
||||
|
|
@ -661,30 +648,29 @@ require_once "footer.php";
|
|||
// headers are automatically repeated if the table spans over multiple pages
|
||||
// you can declare how many rows should be treated as headers
|
||||
headerRows: 1,
|
||||
widths: [ '*', 40, 'auto', 'auto', 80 ],
|
||||
widths: ['*', 40, 'auto', 'auto', 80],
|
||||
|
||||
body: [
|
||||
// Table Header
|
||||
[
|
||||
{
|
||||
[{
|
||||
text: 'Product',
|
||||
style: [ 'itemsHeader', 'left']
|
||||
style: ['itemsHeader', 'left']
|
||||
},
|
||||
{
|
||||
text: 'Qty',
|
||||
style: [ 'itemsHeader', 'center']
|
||||
style: ['itemsHeader', 'center']
|
||||
},
|
||||
{
|
||||
text: 'Price',
|
||||
style: [ 'itemsHeader', 'right']
|
||||
style: ['itemsHeader', 'right']
|
||||
},
|
||||
{
|
||||
text: 'Tax',
|
||||
style: [ 'itemsHeader', 'right']
|
||||
style: ['itemsHeader', 'right']
|
||||
},
|
||||
{
|
||||
text: 'Total',
|
||||
style: [ 'itemsHeader', 'right']
|
||||
style: ['itemsHeader', 'right']
|
||||
}
|
||||
],
|
||||
// Items
|
||||
|
|
@ -695,47 +681,42 @@ require_once "footer.php";
|
|||
$sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_quote_id = $quote_id ORDER BY item_order ASC");
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_invoice_items)) {
|
||||
$item_name = $row['item_name'];
|
||||
$item_description = $row['item_description'];
|
||||
$item_quantity = $row['item_quantity'];
|
||||
$item_price = $row['item_price'];
|
||||
$item_subtotal = $row['item_price'];
|
||||
$item_tax = $row['item_tax'];
|
||||
$item_total = $row['item_total'];
|
||||
$tax_id = $row['item_tax_id'];
|
||||
$total_tax = $item_tax + $total_tax;
|
||||
$sub_total = $item_price * $item_quantity + $sub_total;
|
||||
$item_name = $row['item_name'];
|
||||
$item_description = $row['item_description'];
|
||||
$item_quantity = $row['item_quantity'];
|
||||
$item_price = $row['item_price'];
|
||||
$item_subtotal = $row['item_price'];
|
||||
$item_tax = $row['item_tax'];
|
||||
$item_total = $row['item_total'];
|
||||
$tax_id = $row['item_tax_id'];
|
||||
$total_tax = $item_tax + $total_tax;
|
||||
$sub_total = $item_price * $item_quantity + $sub_total;
|
||||
?>
|
||||
|
||||
// Item
|
||||
[
|
||||
// Item
|
||||
[
|
||||
{
|
||||
text: <?php echo json_encode($item_name) ?>,
|
||||
style: 'itemTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode($item_description) ?>,
|
||||
style: 'itemDescription'
|
||||
[{
|
||||
text: <?php echo json_encode($item_name) ?>,
|
||||
style: 'itemTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode($item_description) ?>,
|
||||
style: 'itemDescription'
|
||||
}
|
||||
], {
|
||||
text: <?php echo json_encode($item_quantity) ?>,
|
||||
style: 'itemQty'
|
||||
}, {
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $item_price, $quote_currency_code)) ?>,
|
||||
style: 'itemNumber'
|
||||
}, {
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $item_tax, $quote_currency_code)) ?>,
|
||||
style: 'itemNumber'
|
||||
}, {
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $item_total, $quote_currency_code)) ?>,
|
||||
style: 'itemNumber'
|
||||
}
|
||||
],
|
||||
{
|
||||
text: <?php echo json_encode($item_quantity) ?>,
|
||||
style: 'itemQty'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $item_price, $quote_currency_code)) ?>,
|
||||
style: 'itemNumber'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $item_tax, $quote_currency_code)) ?>,
|
||||
style: 'itemNumber'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $item_total, $quote_currency_code)) ?>,
|
||||
style: 'itemNumber'
|
||||
}
|
||||
],
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
@ -751,21 +732,19 @@ require_once "footer.php";
|
|||
// headers are automatically repeated if the table spans over multiple pages
|
||||
// you can declare how many rows should be treated as headers
|
||||
headerRows: 0,
|
||||
widths: [ '*','auto', 80 ],
|
||||
widths: ['*', 'auto', 80],
|
||||
|
||||
body: [
|
||||
// Total
|
||||
[
|
||||
{
|
||||
[{
|
||||
text: 'Notes',
|
||||
style: 'notesTitle'
|
||||
},
|
||||
{},
|
||||
{}
|
||||
],
|
||||
[
|
||||
{
|
||||
rowSpan: 3,
|
||||
[{
|
||||
rowSpan: '*',
|
||||
text: <?php echo json_encode(html_entity_decode($quote_note)) ?>,
|
||||
style: 'notesText'
|
||||
},
|
||||
|
|
@ -778,28 +757,28 @@ require_once "footer.php";
|
|||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
[
|
||||
{},
|
||||
{
|
||||
<?php if ($quote_discount > 0) { ?>[{}, {
|
||||
text: 'Discount',
|
||||
style: 'itemsFooterSubTitle'
|
||||
}, {
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, -$quote_discount, $quote_currency_code)) ?>,
|
||||
style: 'itemsFooterSubValue'
|
||||
}],
|
||||
<?php } ?>
|
||||
<?php if ($total_tax > 0) { ?>[{}, {
|
||||
text: 'Tax',
|
||||
style: 'itemsFooterSubTitle'
|
||||
},
|
||||
{
|
||||
}, {
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $total_tax, $quote_currency_code)) ?>,
|
||||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
[
|
||||
{},
|
||||
{
|
||||
text: 'Total',
|
||||
style: 'itemsFooterSubTitle'
|
||||
},
|
||||
{
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $quote_amount, $quote_currency_code)) ?>,
|
||||
style: 'itemsFooterSubValue'
|
||||
}
|
||||
],
|
||||
}],
|
||||
<?php } ?>[{}, {
|
||||
text: 'Total',
|
||||
style: 'itemsFooterTotalTitle'
|
||||
}, {
|
||||
text: <?php echo json_encode(numfmt_format_currency($currency_format, $quote_amount, $quote_currency_code)) ?>,
|
||||
style: 'itemsFooterTotalValue'
|
||||
}],
|
||||
]
|
||||
}, // table
|
||||
layout: 'lightHorizontalLines'
|
||||
|
|
@ -814,7 +793,7 @@ require_once "footer.php";
|
|||
// Document Footer
|
||||
documentFooterCenter: {
|
||||
fontSize: 9,
|
||||
margin: [10,50,10,10],
|
||||
margin: [10, 50, 10, 10],
|
||||
alignment: 'center'
|
||||
},
|
||||
// Invoice Title
|
||||
|
|
@ -822,25 +801,25 @@ require_once "footer.php";
|
|||
fontSize: 18,
|
||||
bold: true,
|
||||
alignment: 'right',
|
||||
margin: [0,0,0,3]
|
||||
margin: [0, 0, 0, 3]
|
||||
},
|
||||
// Invoice Number
|
||||
invoiceNumber: {
|
||||
fontSize: 14,
|
||||
alignment:'right'
|
||||
alignment: 'right'
|
||||
},
|
||||
// Billing Headers
|
||||
invoiceBillingTitle: {
|
||||
fontSize: 14,
|
||||
bold: true,
|
||||
alignment: 'left',
|
||||
margin: [0,20,0,5]
|
||||
margin: [0, 20, 0, 5]
|
||||
},
|
||||
invoiceBillingTitleClient: {
|
||||
fontSize: 14,
|
||||
bold: true,
|
||||
alignment: 'right',
|
||||
margin: [0,20,0,5]
|
||||
margin: [0, 20, 0, 5]
|
||||
},
|
||||
// Billing Details
|
||||
invoiceBillingAddress: {
|
||||
|
|
@ -851,23 +830,36 @@ require_once "footer.php";
|
|||
fontSize: 10,
|
||||
lineHeight: 1.2,
|
||||
alignment: 'right',
|
||||
margin: [0,0,0,30]
|
||||
margin: [0, 0, 0, 30]
|
||||
},
|
||||
// Invoice Dates
|
||||
invoiceDateTitle: {
|
||||
fontSize: 10,
|
||||
alignment: 'left',
|
||||
margin: [0,5,0,5]
|
||||
margin: [0, 5, 0, 5]
|
||||
},
|
||||
invoiceDateValue: {
|
||||
fontSize: 10,
|
||||
alignment: 'right',
|
||||
margin: [0,5,0,5]
|
||||
margin: [0, 5, 0, 5]
|
||||
},
|
||||
// Invoice Due Dates
|
||||
invoiceDueDateTitle: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
alignment: 'left',
|
||||
margin: [0, 5, 0, 5]
|
||||
},
|
||||
invoiceDueDateValue: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
alignment: 'right',
|
||||
margin: [0, 5, 0, 5]
|
||||
},
|
||||
// Items Header
|
||||
itemsHeader: {
|
||||
fontSize: 10,
|
||||
margin: [0,5,0,5],
|
||||
margin: [0, 5, 0, 5],
|
||||
bold: true,
|
||||
alignment: 'right'
|
||||
},
|
||||
|
|
@ -875,62 +867,62 @@ require_once "footer.php";
|
|||
itemTitle: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
margin: [0,5,0,3]
|
||||
margin: [0, 5, 0, 3]
|
||||
},
|
||||
itemDescription: {
|
||||
italics: true,
|
||||
fontSize: 9,
|
||||
lineHeight: 1.1,
|
||||
margin: [0,3,0,5]
|
||||
margin: [0, 3, 0, 5]
|
||||
},
|
||||
itemQty: {
|
||||
fontSize: 10,
|
||||
margin: [0,5,0,5],
|
||||
margin: [0, 5, 0, 5],
|
||||
alignment: 'center'
|
||||
},
|
||||
itemNumber: {
|
||||
fontSize: 10,
|
||||
margin: [0,5,0,5],
|
||||
margin: [0, 5, 0, 5],
|
||||
alignment: 'right'
|
||||
},
|
||||
itemTotal: {
|
||||
fontSize: 10,
|
||||
margin: [0,5,0,5],
|
||||
margin: [0, 5, 0, 5],
|
||||
bold: true,
|
||||
alignment: 'right'
|
||||
},
|
||||
// Items Footer (Subtotal, Total, Tax, etc)
|
||||
itemsFooterSubTitle: {
|
||||
fontSize: 10,
|
||||
margin: [0,5,0,5],
|
||||
margin: [0, 5, 0, 5],
|
||||
alignment: 'right'
|
||||
},
|
||||
itemsFooterSubValue: {
|
||||
fontSize: 10,
|
||||
margin: [0,5,0,5],
|
||||
margin: [0, 5, 0, 5],
|
||||
bold: false,
|
||||
alignment: 'right'
|
||||
},
|
||||
itemsFooterTotalTitle: {
|
||||
fontSize: 10,
|
||||
margin: [0,5,0,5],
|
||||
margin: [0, 5, 0, 5],
|
||||
bold: true,
|
||||
alignment: 'right'
|
||||
},
|
||||
itemsFooterTotalValue: {
|
||||
fontSize: 10,
|
||||
margin: [0,5,0,5],
|
||||
margin: [0, 5, 0, 5],
|
||||
bold: true,
|
||||
alignment: 'right'
|
||||
},
|
||||
notesTitle: {
|
||||
fontSize: 10,
|
||||
bold: true,
|
||||
margin: [0,5,0,5]
|
||||
margin: [0, 5, 0, 5]
|
||||
},
|
||||
notesText: {
|
||||
fontSize: 9,
|
||||
margin: [0,5,50,5]
|
||||
margin: [0, 5, 50, 5]
|
||||
},
|
||||
left: {
|
||||
alignment: 'left'
|
||||
|
|
@ -943,4 +935,4 @@ require_once "footer.php";
|
|||
columnGap: 20
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
<select class="form-control select2" name="category" id="editQuoteCategory" required>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
<div class='input-group-prepend'>
|
||||
<span class='input-group-text'><i class='fa fa-fw fa-dollar-sign'></i></span>
|
||||
</div>
|
||||
<input type='number' class='form-control' step="0.01" name='quote_discount' placeholder='Discount Amount' value='<?php echo $quote_discount; ?>'>
|
||||
<input type='text' class='form-control' inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name='quote_discount' placeholder='0.00' value="<?php echo number_format($quote_discount, 2, '.', ''); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -38,13 +38,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search Quotes">
|
||||
<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 class="col-sm-8">
|
||||
<div class="float-right">
|
||||
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -206,7 +207,5 @@ require_once "quote_add_modal.php";
|
|||
|
||||
require_once "quote_edit_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
require_once "footer.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="^(?:\d{1,3}(?:,\d{3})*|\d+)(?:\.\d{0,2})?$" name="amount" placeholder="0.00" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="amount" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickVendorModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="vendors.php" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -182,7 +182,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryExpenseModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Expense" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="^(?:\d{1,3}(?:,\d{3})*|\d+)(?:\.\d{0,2})?$" name="amount" value="<?php echo number_format($recurring_expense_amount,2); ?>" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($recurring_expense_amount, 2, '.', ''); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -141,7 +141,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickVendorModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="vendors.php" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryExpenseModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Expense" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -356,31 +356,25 @@ if (isset($_GET['recurring_id'])) {
|
|||
<div class="col-sm-3 offset-sm-2">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<?php
|
||||
if ($recurring_discount > 0) {
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $recurring_discount, $recurring_currency_code); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$sub_total = $sub_total - $invoice_discount;
|
||||
}
|
||||
?>
|
||||
<tr class="border-bottom">
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $sub_total, $recurring_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php if ($recurring_discount > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $recurring_discount, $recurring_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($total_tax > 0) { ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Tax</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $total_tax, $recurring_currency_code); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr class="border-bottom">
|
||||
<td><strong>Total</strong></td>
|
||||
<td class="text-right"><strong><?php echo numfmt_format_currency($currency_format, $recurring_amount, $recurring_currency_code); ?></strong></td>
|
||||
<tr class="border-bottom text-bold">
|
||||
<td>Total</td>
|
||||
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $recurring_amount, $recurring_currency_code); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -441,9 +435,6 @@ if (isset($_GET['recurring_id'])) {
|
|||
|
||||
require_once "recurring_invoice_note_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
|
||||
}
|
||||
|
||||
require_once "footer.php";
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
<div class='input-group-prepend'>
|
||||
<span class='input-group-text'><i class='fa fa-fw fa-dollar-sign'></i></span>
|
||||
</div>
|
||||
<input type='number' class='form-control' name='recurring_discount' placeholder='Discount Amount' value='<?php echo $recurring_discount; ?>'>
|
||||
<input type='text' class='form-control' inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name='recurring_discount' placeholder='0.00' value="<?php echo number_format($recurring_discount, 2, '.', ''); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -183,9 +183,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
require_once "recurring_invoice_add_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
require_once "footer.php";
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo $revenue_amount; ?>" placeholder="0.00" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" value="<?php echo number_format($revenue_amount, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
<a class="btn btn-secondary" href="categories.php?category=Income" target="_blank"><i class="fas fa-fw fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
}
|
||||
$revenue_date = nullable_htmlentities($row['revenue_date']);
|
||||
$revenue_payment_method = nullable_htmlentities($row['revenue_payment_method']);
|
||||
$revenue_amount = number_format(floatval($row['revenue_amount']),2);
|
||||
$revenue_amount = floatval($row['revenue_amount']);
|
||||
$revenue_currency_code = nullable_htmlentities($row['revenue_currency_code']);
|
||||
$revenue_created_at = nullable_htmlentities($row['revenue_created_at']);
|
||||
$account_id = intval($row['account_id']);
|
||||
|
|
@ -161,10 +161,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
require_once "revenue_add_modal.php";
|
||||
|
||||
require_once "category_quick_add_modal.php";
|
||||
|
||||
|
||||
require_once "footer.php";
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,17 @@ require_once "inc_all_settings.php";
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-home"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="start_page" value="<?php echo nullable_htmlentities($config_start_page); ?>">
|
||||
<select class="form-control select2" name="start_page" data-tags="true" required>
|
||||
<?php if (!in_array($config_start_page, array_keys($start_page_select_array))) { ?>
|
||||
<option selected> <?php echo nullable_htmlentities($config_start_page); ?></option>
|
||||
<?php } ?>
|
||||
<?php foreach ($start_page_select_array as $start_page_value => $start_page_name) { ?>
|
||||
<option <?php if ($start_page_value == $config_start_page) { echo "selected"; } ?>
|
||||
value="<?php echo nullable_htmlentities($start_page_value); ?>">
|
||||
<?php echo nullable_htmlentities($start_page_name); ?>
|
||||
</option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -197,6 +207,16 @@ require_once "inc_all_settings.php";
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Client Hourly Rate</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="hourly_rate" value="<?php echo number_format($config_default_hourly_rate, 2, '.', ''); ?>" placeholder="0.00" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_default_settings" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
|
|
|
|||
29
side_nav.php
29
side_nav.php
|
|
@ -43,9 +43,16 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<?php }
|
||||
<?php } ?>
|
||||
|
||||
if ($config_module_enable_accounting == 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="calendar_events.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "calendar_events.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-calendar-alt"></i>
|
||||
<p>Calendar</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if ($config_module_enable_accounting == 1) { ?>
|
||||
|
||||
<li class="nav-header mt-3">SALES</li>
|
||||
<li class="nav-item">
|
||||
|
|
@ -126,25 +133,17 @@
|
|||
<p>Budget</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-header mt-3">MORE</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="calendar_events.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "calendar_events.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-calendar-alt"></i>
|
||||
<p>Calendar</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<li class="nav-item">
|
||||
<a href="trips.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "trips.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-route"></i>
|
||||
<p>Trips</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-header mt-3">MORE</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="report_income_summary.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "report_income_summary.php") { echo "active"; } ?>">
|
||||
<i class="fas fa-chart-line nav-icon"></i>
|
||||
|
|
|
|||
|
|
@ -169,8 +169,22 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label>Watchers</label>
|
||||
<div class="watchers"></div>
|
||||
<button type="button" class="btn btn-primary" onclick="addWatcher(this)"><i class="fas fa-fw fa-plus"></i> Add Watcher</button>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="watchers[]" data-tags="true" data-placeholder="Enter or select email address" multiple>
|
||||
<option value="">aa</option>
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL AND contact_email IS NOT NULL ORDER BY contact_email ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$contact_email = nullable_htmlentities($row['contact_email']);
|
||||
?>
|
||||
<option><?php echo $contact_email; ?></option>
|
||||
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="price" value="<?php echo number_format($client_rate,2); ?>" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="-?[0-9]*\.?[0-9]{0,2}" name="price" value="<?php echo number_format($client_rate, 2, '.', ''); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
|||
max-width: 600px;
|
||||
}
|
||||
</style>
|
||||
<div class="card card-dark elevation-3">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-life-ring mr-2"></i>Support Tickets
|
||||
<small class="ml-3">
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" placeholder="0.00" value="<?php echo number_format($transfer_amount,2); ?>" required>
|
||||
<input type="text" class="form-control" inputmode="numeric" pattern="[0-9]*\.?[0-9]{0,2}" name="amount" placeholder="0.00" value="<?php echo number_format($transfer_amount, 2, '.', ''); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,25 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-arrow-right"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="destination" placeholder="Enter your destination" required>
|
||||
<select class="form-control select2" name="destination" data-tags="true" data-placeholder="- Select / Input Destination -" required>
|
||||
<option value=""></option>
|
||||
<?php
|
||||
|
||||
$sql_locations = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_locations)) {
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
$location_address = nullable_htmlentities($row['location_address']);
|
||||
$location_city = nullable_htmlentities($row['location_city']);
|
||||
$location_state = nullable_htmlentities($row['location_state']);
|
||||
$location_zip = nullable_htmlentities($row['location_zip']);
|
||||
|
||||
?>
|
||||
<option><?php echo "$location_address $location_city $location_state $location_zip"; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -72,8 +90,10 @@
|
|||
<option value="">- Driver -</option>
|
||||
<?php
|
||||
|
||||
// WIP Need to only show users within the session company
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM users ORDER BY user_name ASC");
|
||||
$sql = mysqli_query($mysqli, "SELECT users.user_id, user_name FROM users
|
||||
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
||||
WHERE user_role > 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$user_id = intval($row['user_id']);
|
||||
$user_name = nullable_htmlentities($row['user_name']);
|
||||
|
|
|
|||
|
|
@ -54,13 +54,32 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-arrow-right"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="Enter a purpose" name="destination" value="<?php echo $trip_destination; ?>" required>
|
||||
<select class="form-control select2" name="destination" data-tags="true" data-placeholder="- Select / Input Destination -" required>
|
||||
<option><?php echo $trip_destination; ?></option>
|
||||
<?php
|
||||
|
||||
$sql_locations_select = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_locations_select)) {
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
$location_address = nullable_htmlentities($row['location_address']);
|
||||
$location_city = nullable_htmlentities($row['location_city']);
|
||||
$location_state = nullable_htmlentities($row['location_state']);
|
||||
$location_zip = nullable_htmlentities($row['location_zip']);
|
||||
$location_full_address = "$location_address $location_city $location_state $location_zip";
|
||||
|
||||
?>
|
||||
<option><?php echo $location_full_address; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Purpose <strong class="text-danger">*</strong></label>
|
||||
<textarea rows="4" class="form-control" name="purpose" required><?php echo $trip_purpose; ?></textarea>
|
||||
<textarea rows="4" class="form-control" placeholder="Enter a purpose" name="purpose" required><?php echo $trip_purpose; ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -73,9 +92,11 @@
|
|||
<option value="">- Driver -</option>
|
||||
<?php
|
||||
|
||||
// WIP Need to only show users within the session company
|
||||
$sql_trips = mysqli_query($mysqli, "SELECT * FROM users ORDER BY user_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_trips)) {
|
||||
$sql_users = mysqli_query($mysqli, "SELECT users.user_id, user_name FROM users
|
||||
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
||||
WHERE user_role > 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_users)) {
|
||||
$user_id_select = intval($row['user_id']);
|
||||
$user_name_select = nullable_htmlentities($row['user_name']);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -56,7 +56,26 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-arrow-right"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="destination" value="<?php echo $trip_destination; ?>" required>
|
||||
<select class="form-control select2" name="destination" data-tags="true" data-placeholder="- Select / Input Destination -" required>
|
||||
<option><?php echo $trip_destination; ?></option>
|
||||
<?php
|
||||
|
||||
$sql_locations_select = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_locations_select)) {
|
||||
$location_name = nullable_htmlentities($row['location_name']);
|
||||
$location_address = nullable_htmlentities($row['location_address']);
|
||||
$location_city = nullable_htmlentities($row['location_city']);
|
||||
$location_state = nullable_htmlentities($row['location_state']);
|
||||
$location_zip = nullable_htmlentities($row['location_zip']);
|
||||
$location_full_address = "$location_address $location_city $location_state $location_zip";
|
||||
|
||||
?>
|
||||
<option><?php echo $location_full_address; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -75,9 +94,11 @@
|
|||
<option value="">- Driver -</option>
|
||||
<?php
|
||||
|
||||
// WIP Need to only show users within the session company
|
||||
$sql_trips = mysqli_query($mysqli, "SELECT * FROM users ORDER BY user_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql_trips)) {
|
||||
$sql_users = mysqli_query($mysqli, "SELECT users.user_id, user_name FROM users
|
||||
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
||||
WHERE user_role > 1 AND user_archived_at > '$trip_created_at' ORDER BY user_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_users)) {
|
||||
$user_id_select = intval($row['user_id']);
|
||||
$user_name_select = nullable_htmlentities($row['user_name']);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-default btn-lg" data-toggle="modal" data-target="#exportTripsModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -81,6 +80,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<input type="date" class="form-control" name="dtt" max="2999-12-31" value="<?php echo nullable_htmlentities($dtt); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="float-right">
|
||||
<br>
|
||||
<button type="button" class="btn btn-default mt-2" data-toggle="modal" data-target="#exportTripsModal"><i class="fa fa-fw fa-download mr-2"></i>Export</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Reference in New Issue