+6
-7
@@ -1,4 +1,6 @@
|
||||
<?php require_once("inc_all_settings.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all_settings.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
@@ -97,14 +99,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("account_add_modal.php");
|
||||
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
require_once("account_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -55,10 +55,8 @@
|
||||
$calendar_color = htmlentities($row['calendar_color']);
|
||||
?>
|
||||
<option <?php if ($config_default_calendar == $calendar_id) { echo "selected"; } ?> data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color; ?>;'></i> <?php echo $calendar_name; ?>" value="<?php echo $calendar_id; ?>"><?php echo $calendar_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?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>
|
||||
@@ -106,10 +104,8 @@
|
||||
<div class="tab-pane fade" id="pills-attendees">
|
||||
|
||||
<?php if (isset($client_id)) { ?>
|
||||
|
||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||
|
||||
<?php }else{ ?>
|
||||
<?php } else{ ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Client</label>
|
||||
@@ -129,9 +125,7 @@
|
||||
?>
|
||||
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,9 +58,7 @@
|
||||
?>
|
||||
<option data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color_select; ?>;'></i> <?php echo $calendar_name_select; ?>"<?php if ($calendar_id == $calendar_id_select) { echo "selected"; } ?> value="<?php echo $calendar_id_select; ?>"><?php echo $calendar_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,10 +103,8 @@
|
||||
<div class="tab-pane fade" id="pills-attendees<?php echo $event_id; ?>">
|
||||
|
||||
<?php if (isset($_GET['client_id'])) { ?>
|
||||
|
||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Client</label>
|
||||
@@ -128,9 +124,8 @@
|
||||
?>
|
||||
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+9
-24
@@ -1,26 +1,22 @@
|
||||
<?php include("inc_all.php"); ?>
|
||||
|
||||
<link href='plugins/fullcalendar/main.min.css' rel='stylesheet' />
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all.php");
|
||||
|
||||
if (isset($_GET['calendar_id'])) {
|
||||
$calendar_selected_id = intval($_GET['calendar_id']);
|
||||
}
|
||||
|
||||
?>
|
||||
<link href='plugins/fullcalendar/main.min.css' rel='stylesheet' />
|
||||
|
||||
<div id='calendar'></div>
|
||||
|
||||
<?php
|
||||
|
||||
include("calendar_event_add_modal.php");
|
||||
include("calendar_add_modal.php");
|
||||
include("category_quick_add_modal.php");
|
||||
require_once("calendar_event_add_modal.php");
|
||||
require_once("calendar_add_modal.php");
|
||||
require_once("category_quick_add_modal.php");
|
||||
|
||||
?>
|
||||
|
||||
<?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 WHERE calendars.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
@@ -35,13 +31,13 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
$calendar_color = htmlentities($row['calendar_color']);
|
||||
$client_id = $row['event_client_id'];
|
||||
|
||||
include("calendar_event_edit_modal.php");
|
||||
require("calendar_event_edit_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php require_once("footer.php"); ?>
|
||||
|
||||
<script src='plugins/fullcalendar/main.min.js'></script>
|
||||
|
||||
@@ -86,9 +82,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
echo "{ id: $event_id, title: $event_title, start: $event_start, end: $event_end, color: $calendar_color },";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
//Invoices Created
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN invoices ON client_id = invoice_client_id WHERE clients.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
@@ -98,9 +92,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
echo "{ id: $event_id, title: $event_title, start: $event_start, color: 'blue', url: 'invoice.php?invoice_id=$event_id' },";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
//Quotes Created
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN quotes ON client_id = quote_client_id WHERE clients.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
@@ -110,9 +102,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
echo "{ id: $event_id, title: $event_title, start: $event_start, color: 'purple', url: 'quote.php?quote_id=$event_id' },";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
//Tickets Created
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN tickets ON client_id = ticket_client_id WHERE clients.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
@@ -124,9 +114,6 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
//Vendors Added Created
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN vendors ON client_id = vendor_client_id WHERE vendor_template = 0 AND clients.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
@@ -136,9 +123,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
|
||||
echo "{ id: $event_id, title: $event_title, start: $event_start, color: 'brown', url: 'client_vendors.php?client_id=$event_id' },";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
//Clients Added
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients WHERE clients.company_id = $session_company_id");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
@@ -160,7 +145,7 @@ while ($row = mysqli_fetch_array($sql)) {
|
||||
calendar.render();
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<!-- Automatically set new event end date to 1 hr after start date -->
|
||||
<script>
|
||||
|
||||
+6
-8
@@ -1,4 +1,6 @@
|
||||
<?php require_once("inc_all_settings.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all_settings.php");
|
||||
|
||||
if (isset($_GET['category'])) {
|
||||
$category = strip_tags(mysqli_real_escape_string($mysqli,$_GET['category']));
|
||||
@@ -119,14 +121,10 @@ $colors_diff = array_diff($colors_array, $colors_used_array);
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("category_add_modal.php");
|
||||
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
require_once("category_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -22,9 +22,7 @@
|
||||
|
||||
<?php
|
||||
|
||||
foreach ($colors_diff as $color) {
|
||||
|
||||
?>
|
||||
foreach ($colors_diff as $color) { ?>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<div class="form-check">
|
||||
@@ -34,8 +32,8 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
|
||||
<?php
|
||||
|
||||
foreach($colors_diff as $color) {
|
||||
?>
|
||||
foreach($colors_diff as $color) { ?>
|
||||
<div class="col-3 mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="color" value="<?php echo $color; ?>">
|
||||
@@ -40,8 +39,8 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
+1
-3
@@ -22,10 +22,8 @@ if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// SESSION FINGERPRINT
|
||||
// User IP & UA
|
||||
$session_ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||
|
||||
// User agent
|
||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
$session_user_id = $_SESSION['user_id'];
|
||||
|
||||
+4
-10
@@ -66,13 +66,10 @@
|
||||
|
||||
$referral_sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($referral_sql)) {
|
||||
$referral = htmlentities($row['category_name']);
|
||||
?>
|
||||
$referral = htmlentities($row['category_name']); ?>
|
||||
<option><?php echo $referral; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?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>
|
||||
@@ -257,8 +254,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }else{ ?>
|
||||
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="currency_code" value="<?php echo $session_company_currency; ?>">
|
||||
<input type="hidden" name="net_terms" value="0">
|
||||
<?php } ?>
|
||||
@@ -295,9 +291,7 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -128,10 +128,8 @@
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
?>
|
||||
<option value="<?php echo $location_id; ?>"><?php echo $location_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -154,9 +152,8 @@
|
||||
?>
|
||||
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -196,9 +193,7 @@
|
||||
?>
|
||||
<option value="<?php echo $network_id; ?>"><?php echo $network_name; ?> - <?php echo $network; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -244,9 +239,7 @@
|
||||
?>
|
||||
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<div class="modal" id="copyAssetModal<?php echo $asset_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content bg-dark">
|
||||
@@ -126,10 +125,8 @@
|
||||
$location_name_select = htmlentities($row['location_name']);
|
||||
?>
|
||||
<option <?php if ($asset_location_id == $location_id_select) { echo "selected"; } ?> value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -151,10 +148,8 @@
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
?>
|
||||
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,9 +188,7 @@
|
||||
?>
|
||||
<option <?php if ($asset_network_id == $network_id_select) { echo "selected"; } ?> value="<?php echo $network_id_select; ?>"><?php echo $network_name_select; ?> - <?php echo $network_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,9 +234,7 @@
|
||||
?>
|
||||
<option <?php if ($asset_vendor_id == $vendor_id_select) { echo "selected"; } ?> value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
<i class="fas fa-fw fa-document text-secondary"></i>
|
||||
<?php echo $related_document_name; ?> <a href="client_documents.php?q=<?php echo $related_document_name; ?>"><?php echo $related_document_name; ?></a>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
||||
@@ -128,9 +128,7 @@
|
||||
?>
|
||||
<option <?php if ($asset_location_id == $location_id_select) { echo "selected"; } ?> value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -154,9 +152,7 @@
|
||||
<?php echo $contact_name_select; ?> <?php if (!empty($row['contact_archived_at'])) { echo " (Archived " . date('Y-m-d',strtotime($row['contact_archived_at'])) .")"; } ?>
|
||||
</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -194,9 +190,7 @@
|
||||
?>
|
||||
<option <?php if ($asset_network_id == $network_id_select) { echo "selected"; } ?> value="<?php echo $network_id_select; ?>"><?php echo $network_name_select; ?> - <?php echo $network_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,9 +236,7 @@
|
||||
?>
|
||||
<option <?php if ($asset_vendor_id == $vendor_id_select) { echo "selected"; } ?> value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -83,10 +83,7 @@
|
||||
|
||||
?>
|
||||
<option value="<?php echo $network_id; ?>"><?php echo $network_name; ?> - <?php echo $network; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
<i class="fas fa-fw fa-ticket-alt"></i>
|
||||
Ticket: <a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>"><?php echo "$ticket_prefix$ticket_number" ?></a> on <?php echo $ticket_created_at; ?> <?php echo $ticket_subject; ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
||||
+11
-41
@@ -97,23 +97,19 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
if ($workstation_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=workstation" class="btn <?php if ($_GET['type'] == 'workstation') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-desktop"></i> Workstations <span class="right badge badge-light"><?php echo $workstation_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
}
|
||||
if ($server_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=server" class="btn <?php if ($_GET['type'] == 'server') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-server"></i> Servers <span class="right badge badge-light"><?php echo $server_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
}
|
||||
if ($virtual_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=virtual" class="btn <?php if ($_GET['type'] == 'virtual') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-cloud"></i> Virtual <span class="right badge badge-light"><?php echo $virtual_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
}
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=network" class="btn <?php if ($_GET['type'] == 'network') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-network-wired"></i> Network <span class="right badge badge-light"><?php echo $network_count; ?></span></a>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
}
|
||||
if ($network_count > 0) { ?>
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&type=other" class="btn <?php if ($_GET['type'] == 'other') { echo 'btn-primary'; } else { echo 'btn-default'; } ?>"><i class="fa fa-fw fa-tag"></i> Other <span class="right badge badge-light"><?php echo $other_count; ?></span></a>
|
||||
<?php
|
||||
@@ -138,14 +134,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_name&o=<?php echo $disp; ?>">Name</a></th>
|
||||
<?php if ($_GET['type'] !== 'virtual' && $_GET['type'] !== 'servers') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_type&o=<?php echo $disp; ?>">Type</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<?php }
|
||||
if ($_GET['type'] !== 'virtual') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_make&o=<?php echo $disp; ?>">Make/Model</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'virtual') { ?>
|
||||
<?php }
|
||||
if ($_GET['type'] !== 'virtual') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_serial&o=<?php echo $disp; ?>">Serial Number</a></th>
|
||||
<?php } ?>
|
||||
<?php if ($_GET['type'] !== 'network' && $_GET['type'] !== 'other') { ?>
|
||||
<?php }
|
||||
if ($_GET['type'] !== 'network' && $_GET['type'] !== 'other') { ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_os&o=<?php echo $disp; ?>">Operating System</a></th>
|
||||
<?php } ?>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_install_date&o=<?php echo $disp; ?>">Install Date</a></th>
|
||||
@@ -201,33 +197,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$asset_contact_id = $row['asset_contact_id'];
|
||||
$asset_network_id = $row['asset_network_id'];
|
||||
|
||||
if ($asset_type == 'Laptop') {
|
||||
$device_icon = "laptop";
|
||||
} elseif ($asset_type == 'Desktop') {
|
||||
$device_icon = "desktop";
|
||||
} elseif ($asset_type == 'Server') {
|
||||
$device_icon = "server";
|
||||
} elseif ($asset_type == 'Printer') {
|
||||
$device_icon = "print";
|
||||
} elseif ($asset_type == 'Camera') {
|
||||
$device_icon = "video";
|
||||
} elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
||||
$device_icon = "network-wired";
|
||||
} elseif ($asset_type == 'Access Point') {
|
||||
$device_icon = "wifi";
|
||||
} elseif ($asset_type == 'Phone') {
|
||||
$device_icon = "phone";
|
||||
} elseif ($asset_type == 'Mobile Phone') {
|
||||
$device_icon = "mobile-alt";
|
||||
} elseif ($asset_type == 'Tablet') {
|
||||
$device_icon = "tablet-alt";
|
||||
} elseif ($asset_type == 'TV') {
|
||||
$device_icon = "tv";
|
||||
} elseif ($asset_type == 'Virtual Machine') {
|
||||
$device_icon = "cloud";
|
||||
} else {
|
||||
$device_icon = "tag";
|
||||
}
|
||||
$device_icon = getAssetIcon($asset_type);
|
||||
|
||||
$contact_name = $row['contact_name'];
|
||||
if (empty($contact_name)) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -126,10 +126,8 @@
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
?>
|
||||
<option value="<?php echo $location_id; ?>"><?php echo $location_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+28
-47
@@ -1,4 +1,6 @@
|
||||
<?php include("inc_all_client.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (isset($_GET['contact_id'])) {
|
||||
$contact_id = intval($_GET['contact_id']);
|
||||
@@ -39,7 +41,7 @@ if (isset($_GET['contact_id'])) {
|
||||
$auth_method = htmlentities($row['contact_auth_method']);
|
||||
|
||||
// Related Assets Query
|
||||
$sql_related_assets = mysqli_query($mysqli, "SELECT * FROM assets WHERE asset_contact_id = $contact_id AND company_id = $session_company_id ORDER BY asset_name DESC");
|
||||
$sql_related_assets = mysqli_query($mysqli, "SELECT * FROM assets LEFT JOIN logins ON logins.login_asset_id = assets.asset_id WHERE asset_contact_id = $contact_id AND assets.company_id = $session_company_id ORDER BY asset_name DESC");
|
||||
$asset_count = mysqli_num_rows($sql_related_assets);
|
||||
|
||||
// Related Logins Query
|
||||
@@ -82,14 +84,14 @@ if (isset($_GET['contact_id'])) {
|
||||
<hr>
|
||||
<?php if (!empty($location_name)) { ?>
|
||||
<div class="mb-1"><i class="fa fa-fw fa-map-marker-alt text-secondary mr-3"></i><?php echo $location_name_display; ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_email)) { ?>
|
||||
<?php }
|
||||
if (!empty($contact_email)) { ?>
|
||||
<div><i class="fa fa-fw fa-envelope text-secondary mr-3"></i><a href='mailto:<?php echo $contact_email; ?>'><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_phone)) { ?>
|
||||
<?php }
|
||||
if (!empty($contact_phone)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-phone text-secondary mr-3"></i><?php echo "$contact_phone $contact_extension"; ?></div>
|
||||
<?php } ?>
|
||||
<?php if (!empty($contact_mobile)) { ?>
|
||||
<?php }
|
||||
if (!empty($contact_mobile)) { ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-mobile-alt text-secondary mr-3"></i><?php echo $contact_mobile; ?></div>
|
||||
<?php } ?>
|
||||
<div class="mb-2"><i class="fa fa-fw fa-clock text-secondary mr-3"></i><?php echo date('Y-m-d',strtotime($contact_created_at)); ?></div>
|
||||
@@ -98,7 +100,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<i class="fas fa-fw fa-user-edit"></i> Edit
|
||||
</button>
|
||||
|
||||
<?php include("client_contact_edit_modal.php"); ?>
|
||||
<?php require_once("client_contact_edit_modal.php"); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -195,33 +197,12 @@ if (isset($_GET['contact_id'])) {
|
||||
$asset_location_id = $row['asset_location_id'];
|
||||
$asset_network_id = $row['asset_network_id'];
|
||||
$asset_contact_id = $row['asset_contact_id'];
|
||||
if ($asset_type == 'Laptop') {
|
||||
$device_icon = "laptop";
|
||||
} elseif ($asset_type == 'Desktop') {
|
||||
$device_icon = "desktop";
|
||||
} elseif ($asset_type == 'Server') {
|
||||
$device_icon = "server";
|
||||
} elseif ($asset_type == 'Printer') {
|
||||
$device_icon = "print";
|
||||
} elseif ($asset_type == 'Camera') {
|
||||
$device_icon = "video";
|
||||
} elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
||||
$device_icon = "network-wired";
|
||||
} elseif ($asset_type == 'Access Point') {
|
||||
$device_icon = "wifi";
|
||||
} elseif ($asset_type == 'Phone') {
|
||||
$device_icon = "phone";
|
||||
} elseif ($asset_type == 'Mobile Phone') {
|
||||
$device_icon = "mobile-alt";
|
||||
} elseif ($asset_type == 'Tablet') {
|
||||
$device_icon = "tablet-alt";
|
||||
} elseif ($asset_type == 'TV') {
|
||||
$device_icon = "tv";
|
||||
} elseif ($asset_type == 'Virtual Machine') {
|
||||
$device_icon = "cloud";
|
||||
} else {
|
||||
$device_icon = "tag";
|
||||
}
|
||||
|
||||
$login_id = $row['login_id'];
|
||||
$login_username = htmlentities(decryptLoginEntry($row['login_username']));
|
||||
$login_password = htmlentities(decryptLoginEntry($row['login_password']));
|
||||
|
||||
$device_icon = getAssetIcon($asset_type);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
@@ -254,10 +235,9 @@ if (isset($_GET['contact_id'])) {
|
||||
|
||||
<?php
|
||||
|
||||
include("client_asset_edit_modal.php");
|
||||
include("client_asset_copy_modal.php");
|
||||
//include("client_asset_tickets_modal.php");
|
||||
include("client_asset_interface_add_modal.php");
|
||||
require("client_asset_edit_modal.php");
|
||||
require("client_asset_copy_modal.php");
|
||||
require("client_asset_interface_add_modal.php");
|
||||
|
||||
}
|
||||
|
||||
@@ -352,7 +332,7 @@ if (isset($_GET['contact_id'])) {
|
||||
|
||||
<?php
|
||||
|
||||
include("client_login_edit_modal.php");
|
||||
require("client_login_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -444,7 +424,7 @@ if (isset($_GET['contact_id'])) {
|
||||
|
||||
<?php
|
||||
|
||||
include("client_software_edit_modal.php");
|
||||
require("client_software_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -554,17 +534,17 @@ if (isset($_GET['contact_id'])) {
|
||||
|
||||
<?php
|
||||
|
||||
include("share_modal.php");
|
||||
require_once("share_modal.php");
|
||||
|
||||
?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<script>
|
||||
function updateContactNotes(contact_id) {
|
||||
function updateContactNotes(contact_id) {
|
||||
var notes = document.getElementById("contactNotes").value;
|
||||
|
||||
// Send a POST request to ajax.php as ajax.php with data client_set_notes=true, client_id=NUM, notes=NOTES
|
||||
// Send a POST request to ajax.php as ajax.php with data contact_set_notes=true, contact_id=NUM, notes=NOTES
|
||||
jQuery.post(
|
||||
"ajax.php",
|
||||
{
|
||||
@@ -573,7 +553,8 @@ function updateContactNotes(contact_id) {
|
||||
notes: notes
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -45,9 +45,7 @@
|
||||
|
||||
<li><?php echo $asset_name; ?></li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -71,9 +69,7 @@
|
||||
|
||||
<li><?php echo "$login_name - $login_username"; ?></li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -92,9 +88,7 @@
|
||||
|
||||
<li><?php echo "$software_name - $software_type"; ?></li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -113,9 +107,7 @@
|
||||
|
||||
<li><a href="ticket.php?ticket_id=<?=$ticket_id ?>"><?php echo "[$ticket_prefix$ticket_number] - $ticket_subject"; ?></a></li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -128,10 +128,8 @@
|
||||
$location_name_select = htmlentities($row['location_name']);
|
||||
?>
|
||||
<option <?php if ($contact_location_id == $location_id_select) { echo "selected"; } ?> value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -212,7 +210,7 @@
|
||||
<div class="mb-3 text-center">
|
||||
<?php if (!empty($contact_photo)) { ?>
|
||||
<img class="img-fluid" alt="contact_photo" src="<?php echo "uploads/clients/$session_company_id/$client_id/$contact_photo"; ?>">
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
<span class="fa-stack fa-4x">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
||||
|
||||
+19
-21
@@ -1,7 +1,7 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (isset($_GET['q'])) {
|
||||
$q = strip_tags(mysqli_real_escape_string($mysqli,$_GET['q']));
|
||||
//Phone Numbers
|
||||
@@ -9,7 +9,7 @@ if (isset($_GET['q'])) {
|
||||
if (empty($n)) {
|
||||
$n = $q;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$q = "";
|
||||
//Phone Numbers
|
||||
$n = "";
|
||||
@@ -17,7 +17,7 @@ if (isset($_GET['q'])) {
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "contact_name";
|
||||
}
|
||||
|
||||
@@ -95,32 +95,32 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$contact_title = htmlentities($row['contact_title']);
|
||||
if (empty($contact_title)) {
|
||||
$contact_title_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$contact_title_display = "<small class='text-secondary'>$contact_title</small>";
|
||||
}
|
||||
$contact_department =htmlentities($row['contact_department']);
|
||||
if (empty($contact_department)) {
|
||||
$contact_department_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$contact_department_display = $contact_department;
|
||||
}
|
||||
$contact_phone = formatPhoneNumber($row['contact_phone']);
|
||||
if (empty($contact_phone)) {
|
||||
$contact_phone_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$contact_phone_display = "$contact_phone";
|
||||
}
|
||||
$contact_extension = htmlentities($row['contact_extension']);
|
||||
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
|
||||
if (empty($contact_mobile)) {
|
||||
$contact_mobile_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$contact_mobile_display = "$contact_mobile";
|
||||
}
|
||||
$contact_email = htmlentities($row['contact_email']);
|
||||
if (empty($contact_email)) {
|
||||
$contact_email_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$contact_email_display = "<a href='mailto:$contact_email'>$contact_email</a><button class='btn btn-sm clipboardjs' data-clipboard-text='$contact_email'><i class='far fa-copy text-secondary'></i></button>";
|
||||
}
|
||||
$contact_photo = htmlentities($row['contact_photo']);
|
||||
@@ -132,14 +132,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$contact_created_at = $row['contact_created_at'];
|
||||
if ($contact_id == $primary_contact) {
|
||||
$primary_contact_display = "<small class='text-success'>Primary Contact</small>";
|
||||
}else{
|
||||
} else {
|
||||
$primary_contact_display = FALSE;
|
||||
}
|
||||
$contact_location_id = $row['contact_location_id'];
|
||||
$location_name = htmlentities($row['location_name']);
|
||||
if (empty($location_name)) {
|
||||
$location_name_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$location_name_display = $location_name;
|
||||
}
|
||||
$auth_method = htmlentities($row['contact_auth_method']);
|
||||
@@ -168,12 +168,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
<img class="img-size-50 img-circle" src="<?php echo "uploads/clients/$session_company_id/$client_id/$contact_photo"; ?>">
|
||||
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
|
||||
<span class="fa-stack fa-2x">
|
||||
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
|
||||
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
|
||||
</span>
|
||||
|
||||
<br>
|
||||
|
||||
<?php } ?>
|
||||
@@ -209,7 +210,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
|
||||
include("client_contact_edit_modal.php");
|
||||
require("client_contact_edit_modal.php");
|
||||
|
||||
}
|
||||
|
||||
@@ -218,16 +219,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_contact_add_modal.php");
|
||||
include("client_contact_invite_modal.php");
|
||||
include("client_contact_import_modal.php");
|
||||
|
||||
?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
require_once("client_contact_add_modal.php");
|
||||
require_once("client_contact_invite_modal.php");
|
||||
require_once("client_contact_import_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
+1
-11
@@ -1,14 +1,3 @@
|
||||
<script>
|
||||
function validateClientNameDelete(client_id) {
|
||||
if (document.getElementById("clientNameProvided" + client_id).value === document.getElementById("clientName" + client_id).value) {
|
||||
document.getElementById("clientDeleteButton" + client_id).className = "btn btn-danger btn-lg px-5";
|
||||
}
|
||||
else{
|
||||
document.getElementById("clientDeleteButton" + client_id).className = "btn btn-danger btn-lg px-5 disabled";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="modal" id="deleteClientModal<?php echo $client_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@@ -28,3 +17,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/client_delete_confirm.js"></script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+18
-20
@@ -1,25 +1,25 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
// Folder
|
||||
if (!empty($_GET['folder_id'])) {
|
||||
$folder = intval($_GET['folder_id']);
|
||||
}else{
|
||||
} else {
|
||||
$folder = 0;
|
||||
}
|
||||
|
||||
// Sort by
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "document_name";
|
||||
}
|
||||
|
||||
// Search query SQL snippet
|
||||
if (!empty($q)) {
|
||||
$query_snippet = "AND (MATCH(document_content_raw) AGAINST ('$q') OR document_name LIKE '%$q%')";
|
||||
}else{
|
||||
} else {
|
||||
$query_snippet = ""; // empty
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2">
|
||||
<i class="fa fa-fw fa-file-alt"></i> Documents
|
||||
@@ -99,9 +99,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
<?php
|
||||
if ($get_folder_id == $folder_id) { ?>
|
||||
<i class="fas fa-fw fa-folder-open"></i>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<?php } else { ?>
|
||||
<i class="fas fa-fw fa-folder"></i>
|
||||
<?php } ?>
|
||||
|
||||
@@ -126,12 +124,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</li>
|
||||
|
||||
<?php
|
||||
include("client_document_folder_rename_modal.php");
|
||||
require("client_document_folder_rename_modal.php");
|
||||
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php include("client_document_folder_add_modal.php"); ?>
|
||||
<?php require_once("client_document_folder_add_modal.php"); ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
@@ -198,13 +196,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("client_document_view_modal.php"); ?>
|
||||
<?php require("client_document_view_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_document_edit_modal.php");
|
||||
require("client_document_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -213,15 +211,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</table>
|
||||
<br>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php include("share_modal.php"); ?>
|
||||
<?php include("client_document_add_modal.php"); ?>
|
||||
<?php include("client_document_add_from_template_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("share_modal.php");
|
||||
require_once("client_document_add_modal.php");
|
||||
require_once("client_document_add_from_template_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -37,10 +37,7 @@
|
||||
$vendor_name = htmlentities($row['vendor_name']);
|
||||
?>
|
||||
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,10 +58,7 @@
|
||||
$vendor_name = htmlentities($row['vendor_name']);
|
||||
?>
|
||||
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+10
-88
@@ -1,10 +1,10 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "domain_name";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-globe"></i> Domains</h3>
|
||||
<div class="card-tools">
|
||||
@@ -111,90 +111,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/domain_edit_modal.js"></script>
|
||||
|
||||
<?php
|
||||
include("client_domain_edit_modal.php");
|
||||
include("client_domain_add_modal.php");
|
||||
?>
|
||||
|
||||
<script>
|
||||
function populateDomainEditModal(client_id, domain_id) {
|
||||
|
||||
// Send a GET request to post.php as post.php?domain_get_json_details=true&client_id=NUM&domain_id=NUM
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{domain_get_json_details: 'true', client_id: client_id, domain_id: domain_id},
|
||||
function(data) {
|
||||
|
||||
// If we get a response from post.php, parse it as JSON
|
||||
const response = JSON.parse(data);
|
||||
|
||||
// Access the domain info (one), registrars (multiple) and webhosts (multiple)
|
||||
const domain = response.domain[0];
|
||||
const vendors = response.vendors;
|
||||
|
||||
// Populate the domain modal fields
|
||||
document.getElementById("editHeader").innerText = domain.domain_name;
|
||||
document.getElementById("editDomainId").value = domain_id;
|
||||
document.getElementById("editDomainName").value = domain.domain_name;
|
||||
document.getElementById("editExpire").value = domain.domain_expire;
|
||||
document.getElementById("editDomainIP").value = domain.domain_ip;
|
||||
document.getElementById("editNameServers").value = domain.domain_name_servers;
|
||||
document.getElementById("editMailServers").value = domain.domain_mail_servers;
|
||||
document.getElementById("editTxtRecords").value = domain.domain_txt;
|
||||
document.getElementById("editRawWhois").value = domain.domain_raw_whois;
|
||||
|
||||
/* DROPDOWNS */
|
||||
|
||||
// Registrar dropdown
|
||||
var registrarDropdown = document.getElementById("editRegistrarId");
|
||||
|
||||
// Clear registrar dropdown
|
||||
var i, L = registrarDropdown.options.length -1;
|
||||
for(i = L; i >= 0; i--) {
|
||||
registrarDropdown.remove(i);
|
||||
}
|
||||
registrarDropdown[registrarDropdown.length] = new Option('- Vendor -', '0');
|
||||
|
||||
// Populate dropdown
|
||||
vendors.forEach(vendor => {
|
||||
if (parseInt(vendor.vendor_id) == parseInt(domain.domain_registrar)) {
|
||||
// Selected domain
|
||||
registrarDropdown[registrarDropdown.length] = new Option(vendor.vendor_name, vendor.vendor_id, true, true);
|
||||
}
|
||||
else{
|
||||
registrarDropdown[registrarDropdown.length] = new Option(vendor.vendor_name, vendor.vendor_id);
|
||||
}
|
||||
});
|
||||
|
||||
// Webhost dropdown
|
||||
var webhostDropdown = document.getElementById("editWebhostId");
|
||||
|
||||
// Clear registrar dropdown
|
||||
var i, L = webhostDropdown.options.length -1;
|
||||
for(i = L; i >= 0; i--) {
|
||||
webhostDropdown.remove(i);
|
||||
}
|
||||
webhostDropdown[webhostDropdown.length] = new Option('- Vendor -', '0');
|
||||
|
||||
// Populate dropdown
|
||||
vendors.forEach(vendor => {
|
||||
if (parseInt(vendor.vendor_id) == parseInt(domain.domain_webhost)) {
|
||||
// Selected domain
|
||||
webhostDropdown[webhostDropdown.length] = new Option(vendor.vendor_name, vendor.vendor_id, true, true);
|
||||
}
|
||||
else{
|
||||
webhostDropdown[webhostDropdown.length] = new Option(vendor.vendor_name, vendor.vendor_id);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
require_once("client_domain_edit_modal.php");
|
||||
require_once("client_domain_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -116,8 +116,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }else{ ?>
|
||||
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="currency_code" value="<?php echo $currency_code; ?>">
|
||||
<input type="hidden" name="net_terms" value="<?php echo $net_term_value; ?>">
|
||||
<?php } ?>
|
||||
@@ -158,9 +157,7 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<link href='plugins/fullcalendar/main.min.css' rel='stylesheet' />
|
||||
|
||||
|
||||
+5
-6
@@ -1,4 +1,6 @@
|
||||
<?php require_once("inc_all_client.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
$sql_files_images = mysqli_query($mysqli, "SELECT * FROM files WHERE file_client_id = $client_id AND (file_ext LIKE 'JPG' OR file_ext LIKE 'jpg' OR file_ext LIKE 'JPEG' OR file_ext LIKE 'jpeg' OR file_ext LIKE 'png' OR file_ext LIKE 'PNG') ORDER BY file_name ASC");
|
||||
|
||||
@@ -19,11 +21,8 @@ $num_of_files = mysqli_num_rows($sql_files_images) + mysqli_num_rows($sql_files_
|
||||
|
||||
<?php
|
||||
if ($num_of_files == 0) {
|
||||
|
||||
echo "<div style='text-align: center;'><h3 class='text-secondary'>No Records Here</h3></div>";
|
||||
}
|
||||
|
||||
?>
|
||||
} ?>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@@ -54,7 +53,7 @@ $num_of_files = mysqli_num_rows($sql_files_images) + mysqli_num_rows($sql_files_
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include("client_file_view_modal.php");
|
||||
require("client_file_view_modal.php");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -119,10 +119,8 @@
|
||||
$contact_name = htmlentities($row['contact_name']);
|
||||
?>
|
||||
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -122,10 +122,8 @@
|
||||
|
||||
?>
|
||||
<option <?php if ($location_contact_id == $contact_id_select) { echo "selected"; } ?> value="<?php echo $contact_id_select; ?>"><?php echo $contact_name_select; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -120,10 +120,7 @@
|
||||
$contact_name_select = htmlentities($row['contact_name']);
|
||||
?>
|
||||
<option <?php if ($login_contact_id == $contact_id_select) { echo "selected"; } ?> value="<?php echo $contact_id_select; ?>"><?php echo $contact_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -144,10 +141,8 @@
|
||||
$vendor_name_select = htmlentities($row['vendor_name']);
|
||||
?>
|
||||
<option <?php if ($login_vendor_id == $vendor_id_select) { echo "selected"; } ?> value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -169,9 +164,7 @@
|
||||
?>
|
||||
<option <?php if ($login_asset_id == $asset_id_select) { echo "selected"; } ?> value="<?php echo $asset_id_select; ?>"><?php echo $asset_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,9 +186,7 @@
|
||||
?>
|
||||
<option <?php if ($login_software_id == $software_id_select) { echo "selected"; } ?> value="<?php echo $software_id_select; ?>"><?php echo $software_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+17
-17
@@ -1,10 +1,10 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "quote_number";
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-file"></i> Quotes</h3>
|
||||
<div class="card-tools">
|
||||
@@ -80,7 +80,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$quote_scope = htmlentities($row['quote_scope']);
|
||||
if (empty($quote_scope)) {
|
||||
$quote_scope_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$quote_scope_display = $quote_scope;
|
||||
}
|
||||
$quote_status = htmlentities($row['quote_status']);
|
||||
@@ -94,15 +94,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
//Set Badge color based off of quote status
|
||||
if ($quote_status == "Sent") {
|
||||
$quote_badge_color = "warning text-white";
|
||||
}elseif ($quote_status == "Viewed") {
|
||||
} elseif ($quote_status == "Viewed") {
|
||||
$quote_badge_color = "primary";
|
||||
}elseif ($quote_status == "Accepted") {
|
||||
} elseif ($quote_status == "Accepted") {
|
||||
$quote_badge_color = "success";
|
||||
}elseif ($quote_status == "Declined") {
|
||||
} elseif ($quote_status == "Declined") {
|
||||
$quote_badge_color = "danger";
|
||||
}elseif ($quote_status == "Invoiced") {
|
||||
} elseif ($quote_status == "Invoiced") {
|
||||
$quote_badge_color = "info";
|
||||
}else{
|
||||
} else {
|
||||
$quote_badge_color = "secondary";
|
||||
}
|
||||
|
||||
@@ -140,8 +140,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
|
||||
include("quote_edit_modal.php");
|
||||
include("quote_copy_modal.php");
|
||||
require("quote_edit_modal.php");
|
||||
require("quote_copy_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -149,10 +149,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("quote_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("quote_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "scheduled_ticket_subject";
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
|
||||
?>
|
||||
<script src="js/scheduledTickets.js"></script>
|
||||
<script src="js/scheduled_tickets_edit_modal.js"></script>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-sync"></i> Scheduled Tickets</h3>
|
||||
<button type="button" class="btn btn-dark dropdown-toggle ml-1" data-toggle="dropdown"></button>
|
||||
@@ -78,8 +78,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><a href="#" data-toggle="modal" data-target="#editScheduledTicketModal"
|
||||
onclick="populateScheduledTicketEditModal(<?php echo $client_id, ",", $scheduled_ticket_id ?>)"> <?php echo $scheduled_ticket_subject ?> </a></td>
|
||||
<td><a href="#" data-toggle="modal" data-target="#editScheduledTicketModal" onclick="populateScheduledTicketEditModal(<?php echo $client_id, ',', $scheduled_ticket_id ?>)"> <?php echo $scheduled_ticket_subject ?> </a></td>
|
||||
<td><a> <?php echo $scheduled_ticket_priority ?></a></td>
|
||||
<td><a> <?php echo $scheduled_ticket_frequency ?></a></td>
|
||||
<td><a> <?php echo $scheduled_ticket_next_run ?></a></td>
|
||||
@@ -91,33 +90,28 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal"
|
||||
data-target="#editScheduledTicketModal" onclick="populateScheduledTicketEditModal(<?php echo $client_id, ",", $scheduled_ticket_id ?>)">Edit</a>
|
||||
data-target="#editScheduledTicketModal" onclick="populateScheduledTicketEditModal(<?php echo $client_id, ',', $scheduled_ticket_id ?>)">Edit</a>
|
||||
<?php
|
||||
if ($session_user_role == 3) {
|
||||
?>
|
||||
if ($session_user_role == 3) { ?>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger"
|
||||
href="post.php?delete_scheduled_ticket=<?php echo $scheduled_ticket_id; ?>">Delete</a>
|
||||
<a class="dropdown-item text-danger" href="post.php?delete_scheduled_ticket=<?php echo $scheduled_ticket_id; ?>">Delete</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
include('pagination.php');
|
||||
include("scheduled_ticket_edit_modal.php")
|
||||
require_once('pagination.php');
|
||||
require_once("scheduled_ticket_edit_modal.php")
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
+14
-16
@@ -1,15 +1,15 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "service_name";
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
// Overview SQL query
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM services
|
||||
@@ -71,11 +71,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
// Service Importance
|
||||
if ($service_importance == "High") {
|
||||
$service_importance_display = "<span class='p-2 badge badge-danger'>$service_importance</span>";
|
||||
}elseif ($service_importance == "Medium") {
|
||||
} elseif ($service_importance == "Medium") {
|
||||
$service_importance_display = "<span class='p-2 badge badge-warning'>$service_importance</span>";
|
||||
}elseif ($service_importance == "Low") {
|
||||
} elseif ($service_importance == "Low") {
|
||||
$service_importance_display = "<span class='p-2 badge badge-info'>$service_importance</span>";
|
||||
}else{
|
||||
} else {
|
||||
$service_importance_display = "-";
|
||||
}
|
||||
|
||||
@@ -165,8 +165,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
WHERE service_id = '$service_id'"
|
||||
);
|
||||
|
||||
include("client_service_edit_modal.php");
|
||||
include("client_service_view_modal.php");
|
||||
require("client_service_edit_modal.php");
|
||||
require("client_service_view_modal.php");
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -174,12 +174,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
include ('pagination.php');
|
||||
?>
|
||||
<?php require_once('pagination.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("client_service_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("client_service_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
|
||||
?>
|
||||
<option value="<?php echo $software_template_id ?>"><?php echo $software_template_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -152,9 +152,7 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -184,9 +182,7 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -152,9 +152,7 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -184,9 +182,7 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+14
-14
@@ -1,10 +1,10 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "trip_date";
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ if (!isset($_GET['o'])) {
|
||||
if (isset($_GET['dtf'])) {
|
||||
$dtf = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtf']));
|
||||
$dtt = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtt']));
|
||||
}else{
|
||||
} else {
|
||||
$dtf = "0000-00-00";
|
||||
$dtt = "9999-00-00";
|
||||
}
|
||||
@@ -38,7 +38,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-route"></i> Trips</h3>
|
||||
<div class="card-tools">
|
||||
@@ -98,13 +98,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
if ($round_trip == 1) {
|
||||
$round_trip_display = "<i class='fa fa-fw fa-sync-alt text-secondary'></i>";
|
||||
}else{
|
||||
} else {
|
||||
$round_trip_display = "";
|
||||
}
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
if (empty($user_name)) {
|
||||
$user_name_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$user_name_display = $user_name;
|
||||
}
|
||||
|
||||
@@ -135,8 +135,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
|
||||
include("trip_copy_modal.php");
|
||||
include("trip_edit_modal.php");
|
||||
require("trip_copy_modal.php");
|
||||
require("trip_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -144,10 +144,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("trip_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("trip_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
<?php require_once("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
+25
-39
@@ -1,7 +1,7 @@
|
||||
<?php include("inc_all_client.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
|
||||
if (isset($_GET['q'])) {
|
||||
$q = strip_tags(mysqli_real_escape_string($mysqli,$_GET['q']));
|
||||
//Phone Numbers
|
||||
@@ -9,14 +9,14 @@ if (isset($_GET['q'])) {
|
||||
if (empty($phone_query)) {
|
||||
$phone_query = $q;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$q = "";
|
||||
$phone_query = "";
|
||||
}
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "vendor_name";
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2">
|
||||
<i class="fa fa-fw fa-building"></i> Vendors
|
||||
@@ -92,14 +92,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$vendor_description = htmlentities($row['vendor_description']);
|
||||
if (empty($vendor_description)) {
|
||||
$vendor_description_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$vendor_description_display = $vendor_description;
|
||||
}
|
||||
$vendor_account_number = htmlentities($row['vendor_account_number']);
|
||||
$vendor_contact_name = htmlentities($row['vendor_contact_name']);
|
||||
if (empty($vendor_contact_name)) {
|
||||
$vendor_contact_name_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$vendor_contact_name_display = $vendor_contact_name;
|
||||
}
|
||||
$vendor_phone = formatPhoneNumber($row['vendor_phone']);
|
||||
@@ -118,42 +118,30 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
<i class="fa fa-fw fa-building text-secondary"></i>
|
||||
<a class="text-dark" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></a>
|
||||
<?php
|
||||
if (!empty($vendor_account_number)) {
|
||||
?>
|
||||
if (!empty($vendor_account_number)) { ?>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $vendor_account_number; ?></small>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</th>
|
||||
<td><?php echo $vendor_description_display; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if (!empty($vendor_contact_name)) {
|
||||
?>
|
||||
if (!empty($vendor_contact_name)) { ?>
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><?php echo $vendor_contact_name_display; ?>
|
||||
<br>
|
||||
<?php
|
||||
}else{
|
||||
<?php } else {
|
||||
echo $vendor_contact_name_display;
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($vendor_phone)) {
|
||||
?>
|
||||
|
||||
if (!empty($vendor_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $vendor_phone; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($vendor_email)) {
|
||||
?>
|
||||
<?php }
|
||||
|
||||
if (!empty($vendor_email)) { ?>
|
||||
<i class="fa fa-fw fa-envelope text-secondary mr-2 mb-2"></i><?php echo $vendor_email; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
@@ -173,19 +161,17 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
|
||||
include("vendor_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
require("vendor_edit_modal.php");
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("vendor_add_modal.php"); ?>
|
||||
<?php include("vendor_add_from_template_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("vendor_add_modal.php");
|
||||
require_once("vendor_add_from_template_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
+39
-55
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
include("inc_all.php");
|
||||
require_once("inc_all.php");
|
||||
|
||||
//Paging
|
||||
if (isset($_GET['p'])) {
|
||||
$p = intval($_GET['p']);
|
||||
$record_from = (($p)-1)*$_SESSION['records_per_page'];
|
||||
$record_to = $_SESSION['records_per_page'];
|
||||
}else{
|
||||
} else {
|
||||
$record_from = 0;
|
||||
$record_to = $_SESSION['records_per_page'];
|
||||
$p = 1;
|
||||
@@ -21,7 +21,7 @@ if (isset($_GET['query'])) {
|
||||
if (empty($phone_query)) {
|
||||
$phone_query = $query;
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$query = "";
|
||||
$phone_query = "";
|
||||
}
|
||||
@@ -29,7 +29,7 @@ if (isset($_GET['query'])) {
|
||||
//Column Filter
|
||||
if (!empty($_GET['sortby'])) {
|
||||
$sortby = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sortby']));
|
||||
}else{
|
||||
} else {
|
||||
$sortby = "client_accessed_at";
|
||||
}
|
||||
|
||||
@@ -38,11 +38,11 @@ if (isset($_GET['order'])) {
|
||||
if ($_GET['order'] == 'ASC') {
|
||||
$order = "ASC";
|
||||
$order_display = "DESC";
|
||||
}else{
|
||||
} else {
|
||||
$order = "DESC";
|
||||
$order_display = "ASC";
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$order = "DESC";
|
||||
$order_display = "ASC";
|
||||
}
|
||||
@@ -57,31 +57,31 @@ if (empty($_GET['canned_date'])) {
|
||||
if ($_GET['canned_date'] == "custom" && !empty($_GET['date_from'])) {
|
||||
$date_from = strip_tags(mysqli_real_escape_string($mysqli,$_GET['date_from']));
|
||||
$date_to = strip_tags(mysqli_real_escape_string($mysqli,$_GET['date_to']));
|
||||
}elseif ($_GET['canned_date'] == "today") {
|
||||
} elseif ($_GET['canned_date'] == "today") {
|
||||
$date_from = date('Y-m-d');
|
||||
$date_to = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "yesterday") {
|
||||
} elseif ($_GET['canned_date'] == "yesterday") {
|
||||
$date_from = date('Y-m-d',strtotime("yesterday"));
|
||||
$date_to = date('Y-m-d',strtotime("yesterday"));
|
||||
}elseif ($_GET['canned_date'] == "thisweek") {
|
||||
} elseif ($_GET['canned_date'] == "thisweek") {
|
||||
$date_from = date('Y-m-d',strtotime("monday this week"));
|
||||
$date_to = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastweek") {
|
||||
} elseif ($_GET['canned_date'] == "lastweek") {
|
||||
$date_from = date('Y-m-d',strtotime("monday last week"));
|
||||
$date_to = date('Y-m-d',strtotime("sunday last week"));
|
||||
}elseif ($_GET['canned_date'] == "thismonth") {
|
||||
} elseif ($_GET['canned_date'] == "thismonth") {
|
||||
$date_from = date('Y-m-01');
|
||||
$date_to = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
} elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
$date_from = date('Y-m-d',strtotime("first day of last month"));
|
||||
$date_to = date('Y-m-d',strtotime("last day of last month"));
|
||||
}elseif ($_GET['canned_date'] == "thisyear") {
|
||||
} elseif ($_GET['canned_date'] == "thisyear") {
|
||||
$date_from = date('Y-01-01');
|
||||
$date_to = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastyear") {
|
||||
} elseif ($_GET['canned_date'] == "lastyear") {
|
||||
$date_from = date('Y-m-d',strtotime("first day of january last year"));
|
||||
$date_to = date('Y-m-d',strtotime("last day of december last year"));
|
||||
}else{
|
||||
} else {
|
||||
$date_from = "0000-00-00";
|
||||
$date_to = "9999-00-00";
|
||||
}
|
||||
@@ -187,7 +187,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$location_zip = htmlentities($row['location_zip']);
|
||||
if (empty($location_address) && empty($location_city) && empty($location_state) && empty($location_zip)) {
|
||||
$location_address_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$location_address_display = "$location_address<br>$location_city $location_state $location_zip";
|
||||
}
|
||||
$contact_id = $row['contact_id'];
|
||||
@@ -224,7 +224,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$client_tag_id_array[] = $client_tag_id;
|
||||
if (empty($client_tag_color)) {
|
||||
$client_tag_name_display_array[] = "<small class='text-secondary'>$client_tag_name</small> ";
|
||||
}else{
|
||||
} else {
|
||||
$client_tag_name_display_array[] = "<span class='badge bg-$client_tag_color'><i class='fa fa-fw fa-$client_tag_icon'></i> $client_tag_name</span> ";
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
//set Text color on balance
|
||||
if ($balance > 0) {
|
||||
$balance_text_color = "text-danger font-weight-bold";
|
||||
}else{
|
||||
} else {
|
||||
$balance_text_color = "";
|
||||
}
|
||||
|
||||
@@ -274,8 +274,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
<small class="text-secondary"><?php echo $client_type; ?></small>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (!empty($client_tags_display)) {
|
||||
?>
|
||||
if (!empty($client_tags_display)) { ?>
|
||||
<br>
|
||||
<?php echo $client_tags_display; ?>
|
||||
<?php } ?>
|
||||
@@ -288,40 +287,27 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
if (empty($contact_name) && empty($contact_phone) && empty($contact_mobile) && empty($client_email)) {
|
||||
echo "-";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($contact_name)) {
|
||||
?>
|
||||
|
||||
if (!empty($contact_name)) { ?>
|
||||
<i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i><strong><?php echo $contact_name; ?></strong>
|
||||
<br>
|
||||
<?php
|
||||
}else{
|
||||
<?php } else {
|
||||
echo "-";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($contact_phone)) {
|
||||
?>
|
||||
|
||||
if (!empty($contact_phone)) { ?>
|
||||
<i class="fa fa-fw fa-phone text-secondary mr-2 mb-2"></i><?php echo $contact_phone; ?> <?php if (!empty($contact_extension)) { echo "x$contact_extension"; } ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($contact_mobile)) {
|
||||
?>
|
||||
<?php }
|
||||
|
||||
if (!empty($contact_mobile)) { ?>
|
||||
<i class="fa fa-fw fa-mobile-alt text-secondary mr-2"></i><?php echo $contact_mobile; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if (!empty($contact_email)) {
|
||||
?>
|
||||
<?php }
|
||||
|
||||
if (!empty($contact_email)) { ?>
|
||||
<i class="fa fa-fw fa-envelope text-secondary mr-2"></i><a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a><button class='btn btn-sm clipboardjs' data-clipboard-text='<?php echo $contact_email; ?>'><i class='far fa-copy text-secondary'></i></button>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
<!-- Show Billing for Admin/Accountant roles only and if accounting module is enabled -->
|
||||
@@ -356,21 +342,19 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
|
||||
include("client_edit_modal.php");
|
||||
include("client_delete_modal.php");
|
||||
require("client_edit_modal.php");
|
||||
require("client_delete_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("client_add_modal.php"); ?>
|
||||
<?php include("category_quick_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("client_add_modal.php");
|
||||
require_once("category_quick_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
+10
-9
@@ -1,8 +1,9 @@
|
||||
<?php require_once("inc_all_settings.php");
|
||||
<?php
|
||||
require_once("inc_all_settings.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "company_name";
|
||||
}
|
||||
|
||||
@@ -18,7 +19,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-building"></i> Companies</h3>
|
||||
<div class="card-tools">
|
||||
@@ -113,7 +114,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
|
||||
include("company_edit_modal.php");
|
||||
require("company_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -121,10 +122,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("company_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("company_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
<?php require_once("config.php"); ?>
|
||||
<?php require_once("functions.php"); ?>
|
||||
<?php
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once("config.php");
|
||||
require_once("functions.php");
|
||||
|
||||
$sql_companies = mysqli_query($mysqli,"SELECT * FROM companies, settings WHERE companies.company_id = settings.company_id");
|
||||
|
||||
@@ -50,7 +47,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
||||
// Set Currency Format
|
||||
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
|
||||
|
||||
if($config_enable_cron == 1){
|
||||
if ($config_enable_cron == 1) {
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Cron', log_action = 'Started', log_description = 'Cron started for $company_name', company_id = $company_id");
|
||||
@@ -683,4 +680,4 @@ while($row = mysqli_fetch_array($sql_companies)){
|
||||
|
||||
} //End Company Loop through
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php include_once("inc_all.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all.php");
|
||||
|
||||
if (isset($_GET['year'])) {
|
||||
$year = intval($_GET['year']);
|
||||
} else {
|
||||
@@ -172,5 +172,6 @@ $expiring_certificates = $sql_certs_expiring['expiring_certs'];
|
||||
|
||||
</div> <!-- rows -->
|
||||
|
||||
<?php include_once("footer.php"); ?>
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
|
||||
+42
-42
@@ -7,17 +7,17 @@
|
||||
|
||||
// Check if our database versions are defined
|
||||
// If undefined, the file is probably being accessed directly rather than called via post.php?update_db
|
||||
if(!defined("LATEST_DATABASE_VERSION") || !defined("CURRENT_DATABASE_VERSION") || !isset($mysqli)){
|
||||
if (!defined("LATEST_DATABASE_VERSION") || !defined("CURRENT_DATABASE_VERSION") || !isset($mysqli)) {
|
||||
echo "Cannot access this file directly.";
|
||||
exit();
|
||||
}
|
||||
|
||||
// Check if we need an update
|
||||
if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
||||
|
||||
// We need updates!
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.1'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.1') {
|
||||
// Insert queries here required to update to DB version 0.0.2
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_module_enable_itdoc` TINYINT(1) DEFAULT 1 AFTER `config_backup_path`");
|
||||
@@ -28,7 +28,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.0.2'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.2'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.2') {
|
||||
// Insert queries here required to update to DB version 0.0.3
|
||||
|
||||
// Add document content raw column & index
|
||||
@@ -36,7 +36,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
|
||||
// Populate content raw column with existing document data
|
||||
$documents_sql = mysqli_query($mysqli, "SELECT * FROM `documents`");
|
||||
while($row = mysqli_fetch_array($documents_sql)){
|
||||
while($row = mysqli_fetch_array($documents_sql)) {
|
||||
$id = $row['document_id'];
|
||||
$name = $row['document_name'];
|
||||
$content = $row['document_content'];
|
||||
@@ -52,7 +52,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.0.3'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.3'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.3') {
|
||||
// Insert queries here required to update to DB version 0.0.4
|
||||
// mysqli_query($mysqli, "ALTER TABLE .....");
|
||||
|
||||
@@ -151,7 +151,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.4'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.4') {
|
||||
// Queries here required to update to DB version 0.0.5
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `assets` DROP `asset_meshcentral_id`;");
|
||||
@@ -162,7 +162,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.0.5'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.5'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.5') {
|
||||
// Insert queries here required to update to DB version 0.0.6
|
||||
|
||||
mysqli_query($mysqli, "UPDATE documents SET document_folder_id = 0");
|
||||
@@ -175,7 +175,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE settings SET config_current_database_version = '0.0.6'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.6'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.6') {
|
||||
// Insert queries here required to update to DB version 0.0.7
|
||||
mysqli_query($mysqli, "ALTER TABLE contacts ADD contact_department VARCHAR(200) NULL AFTER contact_title");
|
||||
mysqli_query($mysqli, "DROP TABLE departments");
|
||||
@@ -184,7 +184,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.0.7'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.7'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.7') {
|
||||
// Insert queries here required to update to DB version 0.0.8
|
||||
|
||||
// Add contact_department column to tables without it (fresh installs) - this will cause an error if it already exists so catch and discard it
|
||||
@@ -198,7 +198,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.0.8'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.8'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.8') {
|
||||
// Insert queries here required to update to DB version 0.0.9
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `revenues` CHANGE `revenue_created_at` `revenue_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, CHANGE `revenue_updated_at` `revenue_updated_at` DATETIME on update CURRENT_TIMESTAMP NULL DEFAULT NULL; ");
|
||||
@@ -207,7 +207,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.0.9'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.0.9'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.0.9') {
|
||||
// Insert queries here required to update to DB version 0.0.9
|
||||
// Remove unused tables
|
||||
mysqli_query($mysqli, "DROP TABLE contracts");
|
||||
@@ -221,7 +221,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.0'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.0'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.0') {
|
||||
// Insert queries here required to update to DB version 0.1.1
|
||||
// Logs don't get archived
|
||||
mysqli_query($mysqli, "ALTER TABLE `logs` DROP `log_archived_at`");
|
||||
@@ -241,7 +241,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.1'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.1'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.1') {
|
||||
// Insert queries here required to update to DB version 0.1.2
|
||||
// Create Many to Many Relationship tables for Assets, Contacts, Software and Vendors
|
||||
|
||||
@@ -265,7 +265,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.2'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.2'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.2') {
|
||||
// Insert queries here required to update to DB version 0.1.3
|
||||
mysqli_query($mysqli, "ALTER TABLE `logs` ADD `log_entity_id` INT NOT NULL DEFAULT '0' AFTER `log_user_id`");
|
||||
|
||||
@@ -273,7 +273,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.3'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.3'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.3') {
|
||||
// Insert queries here required to update to DB version 0.1.4
|
||||
mysqli_query($mysqli, "ALTER TABLE assets ADD asset_status VARCHAR(200) NULL AFTER asset_mac");
|
||||
|
||||
@@ -281,7 +281,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.4'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.4'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.4') {
|
||||
// Insert queries here required to update to DB version 0.1.5
|
||||
mysqli_query($mysqli, "ALTER TABLE `domains` ADD `domain_txt` TEXT NULL DEFAULT NULL AFTER `domain_mail_servers`");
|
||||
|
||||
@@ -289,7 +289,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.5'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.5'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.5') {
|
||||
// Insert queries here required to update to DB version 0.1.6
|
||||
// Remove Mailing List Tables
|
||||
mysqli_query($mysqli, "DROP TABLE campaigns");
|
||||
@@ -299,7 +299,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.6'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.6'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.6') {
|
||||
// Insert queries here required to update to DB version 0.1.7
|
||||
//Remove custom links
|
||||
mysqli_query($mysqli, "DROP TABLE custom_links");
|
||||
@@ -307,7 +307,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.7'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.7'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.7') {
|
||||
// Insert queries here required to update to DB version 0.1.8
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` DROP `config_backup_enable`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` DROP `config_backup_path`");
|
||||
@@ -316,14 +316,14 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.8'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.8'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.8') {
|
||||
// Insert queries here required to update to DB version 0.1.9
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` DROP `config_base_url`");
|
||||
// Then, update the database to the next sequential version
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.1.9'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.1.9'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.1.9') {
|
||||
// Insert queries here required to update to DB version 0.2.0
|
||||
// Allow contacts to reset their portal password
|
||||
mysqli_query($mysqli, "ALTER TABLE contacts ADD contact_password_reset_token VARCHAR(200) NULL DEFAULT NULL AFTER contact_password_hash");
|
||||
@@ -332,7 +332,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.0'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.0'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.0') {
|
||||
//Insert queries here required to update to DB version 0.2.1
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `vendors`
|
||||
@@ -369,7 +369,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.1'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.1'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.1') {
|
||||
// Insert queries here required to update to DB version 0.2.2
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ticket_email_parse` INT(1) NOT NULL DEFAULT '0' AFTER `config_ticket_from_email`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_imap_host` VARCHAR(200) NULL DEFAULT NULL AFTER `config_mail_from_name`, ADD `config_imap_port` INT(5) NULL DEFAULT NULL AFTER `config_imap_host`, ADD `config_imap_encryption` VARCHAR(200) NULL DEFAULT NULL AFTER `config_imap_port`;");
|
||||
@@ -378,7 +378,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.2'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.2'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.2') {
|
||||
// Insert queries here required to update to DB version 0.2.3
|
||||
|
||||
// Add contact_important field to those who don't have it (installed before March 2022)
|
||||
@@ -392,7 +392,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.3'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.3'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.3') {
|
||||
|
||||
//Create New interfaces Table
|
||||
mysqli_query($mysqli, "CREATE TABLE `interfaces` (`interface_id` int(11) AUTO_INCREMENT PRIMARY KEY,
|
||||
@@ -413,18 +413,18 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.4'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.4') {
|
||||
mysqli_query($mysqli, "CREATE TABLE `contact_assets` (`contact_id` int(11) NOT NULL,`asset_id` int(11) NOT NULL, PRIMARY KEY (`contact_id`,`asset_id`))");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.5'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.5'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.5') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `users` ADD `user_status` TINYINT(1) DEFAULT 1 AFTER `user_password`");
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.6'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.6'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.6') {
|
||||
// Insert queries here required to update to DB version 0.2.7
|
||||
mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_token_expire` DATETIME NULL DEFAULT NULL AFTER `contact_password_reset_token`");
|
||||
|
||||
@@ -436,7 +436,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.7'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.7'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.7') {
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `vendors` ADD `vendor_template` TINYINT(1) DEFAULT 0 AFTER `vendor_notes`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `software` ADD `software_template` TINYINT(1) DEFAULT 0 AFTER `software_notes`");
|
||||
@@ -446,21 +446,21 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.8'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.8'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.8') {
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_theme` VARCHAR(200) DEFAULT 'blue' AFTER `config_module_enable_ticketing`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.9'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.2.9'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.2.9') {
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_ticket_client_general_notifications` INT(1) NOT NULL DEFAULT '1' AFTER `config_ticket_email_parse`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.0'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.0'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.0') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `notifications` ADD `notification_user_id` TINYINT(1) DEFAULT 0 AFTER `notification_client_id`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.1'");
|
||||
@@ -761,20 +761,20 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.2'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.2'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.2') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_billing` TINYINT(1) DEFAULT 0 AFTER `contact_important`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_technical` TINYINT(1) DEFAULT 0 AFTER `contact_billing`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.3'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.3'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.3') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_telemetry` TINYINT(1) DEFAULT 0 AFTER `config_theme`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.4'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.4'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.4') {
|
||||
// Insert queries here required to update to DB version 0.3.5
|
||||
|
||||
//Get & upgrade user login encryption
|
||||
@@ -790,7 +790,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.5'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.5'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.5') {
|
||||
$installation_id = randomString(32);
|
||||
|
||||
// Update config.php var with new version var for use with docker
|
||||
@@ -800,7 +800,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.6'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.6'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.6') {
|
||||
// Insert queries here required to update to DB version 0.3.7
|
||||
mysqli_query($mysqli, "ALTER TABLE `shared_items` ADD `item_encrypted_username` VARCHAR(255) NULL DEFAULT NULL AFTER `item_related_id`");
|
||||
|
||||
@@ -808,14 +808,14 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.7'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.7'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.7') {
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `logins` ADD `login_important` TINYINT(1) NOT NULL DEFAULT 0 AFTER `login_note`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.8'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.8'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.8') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_accessed_at` DATETIME NULL DEFAULT NULL AFTER `contact_archived_at`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `locations` ADD `location_accessed_at` DATETIME NULL DEFAULT NULL AFTER `location_archived_at`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `assets` ADD `asset_accessed_at` DATETIME NULL DEFAULT NULL AFTER `asset_archived_at`");
|
||||
@@ -832,7 +832,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.9'");
|
||||
}
|
||||
|
||||
if(CURRENT_DATABASE_VERSION == '0.3.9'){
|
||||
if (CURRENT_DATABASE_VERSION == '0.3.9') {
|
||||
|
||||
mysqli_query($mysqli, "ALTER TABLE `vendors` ADD `vendor_template_id` INT(11) NOT NULL DEFAULT 0 AFTER `vendor_client_id`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `software` ADD `software_template_id` INT(11) NOT NULL DEFAULT 0 AFTER `software_client_id`");
|
||||
@@ -840,7 +840,7 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.4.0'");
|
||||
}
|
||||
|
||||
//if(CURRENT_DATABASE_VERSION == '0.4.0'){
|
||||
//if (CURRENT_DATABASE_VERSION == '0.4.0') {
|
||||
// Insert queries here required to update to DB version 0.4.1
|
||||
|
||||
// Then, update the database to the next sequential version
|
||||
|
||||
+27
-28
@@ -1,10 +1,12 @@
|
||||
<?php include("inc_all.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all.php");
|
||||
|
||||
//$o = "DESC";
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "expense_date";
|
||||
}
|
||||
|
||||
@@ -24,31 +26,31 @@ if (empty($_GET['canned_date'])) {
|
||||
if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
||||
$dtf = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtf']));
|
||||
$dtt = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtt']));
|
||||
}elseif ($_GET['canned_date'] == "today") {
|
||||
} elseif ($_GET['canned_date'] == "today") {
|
||||
$dtf = date('Y-m-d');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "yesterday") {
|
||||
} elseif ($_GET['canned_date'] == "yesterday") {
|
||||
$dtf = date('Y-m-d',strtotime("yesterday"));
|
||||
$dtt = date('Y-m-d',strtotime("yesterday"));
|
||||
}elseif ($_GET['canned_date'] == "thisweek") {
|
||||
} elseif ($_GET['canned_date'] == "thisweek") {
|
||||
$dtf = date('Y-m-d',strtotime("monday this week"));
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastweek") {
|
||||
} elseif ($_GET['canned_date'] == "lastweek") {
|
||||
$dtf = date('Y-m-d',strtotime("monday last week"));
|
||||
$dtt = date('Y-m-d',strtotime("sunday last week"));
|
||||
}elseif ($_GET['canned_date'] == "thismonth") {
|
||||
} elseif ($_GET['canned_date'] == "thismonth") {
|
||||
$dtf = date('Y-m-01');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
} elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
$dtf = date('Y-m-d',strtotime("first day of last month"));
|
||||
$dtt = date('Y-m-d',strtotime("last day of last month"));
|
||||
}elseif ($_GET['canned_date'] == "thisyear") {
|
||||
} elseif ($_GET['canned_date'] == "thisyear") {
|
||||
$dtf = date('Y-01-01');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastyear") {
|
||||
} elseif ($_GET['canned_date'] == "lastyear") {
|
||||
$dtf = date('Y-m-d',strtotime("first day of january last year"));
|
||||
$dtt = date('Y-m-d',strtotime("last day of december last year"));
|
||||
}else{
|
||||
} else {
|
||||
$dtf = "0000-00-00";
|
||||
$dtt = "9999-00-00";
|
||||
}
|
||||
@@ -70,7 +72,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-shopping-cart"></i> Expenses</h3>
|
||||
<div class="card-tools">
|
||||
@@ -164,7 +166,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
if (empty($expense_receipt)) {
|
||||
$receipt_attached = "";
|
||||
}else{
|
||||
} else {
|
||||
$receipt_attached = "<a class='text-secondary mr-2' target='_blank' href='uploads/expenses/$session_company_id/$expense_receipt'><i class='fa fa-file-pdf'></i></a>";
|
||||
}
|
||||
|
||||
@@ -184,13 +186,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<?php
|
||||
if (!empty($expense_receipt)) {
|
||||
?>
|
||||
if (!empty($expense_receipt)) { ?>
|
||||
<a class="dropdown-item" href="<?php echo "uploads/expenses/$session_company_id/$expense_receipt"; ?>" download="<?php echo "$expense_date-$vendor_name-$category_name-$expense_id.pdf"; ?>">Download</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editExpenseModal<?php echo $expense_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addExpenseCopyModal<?php echo $expense_id; ?>">Copy</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@@ -204,10 +203,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
<?php
|
||||
|
||||
include("expense_edit_modal.php");
|
||||
include("expense_copy_modal.php");
|
||||
include("expense_refund_modal.php");
|
||||
include("expense_export_modal.php");
|
||||
require("expense_edit_modal.php");
|
||||
require("expense_copy_modal.php");
|
||||
require("expense_refund_modal.php");
|
||||
require("expense_export_modal.php");
|
||||
|
||||
}
|
||||
|
||||
@@ -216,11 +215,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("expense_add_modal.php"); ?>
|
||||
<?php include("category_quick_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("expense_add_modal.php");
|
||||
require_once("category_quick_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
+24
-24
@@ -1,31 +1,31 @@
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
</div>
|
||||
<!-- ./wrapper -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
</div>
|
||||
<!-- ./wrapper -->
|
||||
|
||||
<!-- REQUIRED SCRIPTS -->
|
||||
<!-- REQUIRED SCRIPTS -->
|
||||
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Custom js-->
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<script src="plugins/moment/moment.min.js"></script>
|
||||
<script src="plugins/chart.js/Chart.min.js"></script>
|
||||
<script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
|
||||
<script src='plugins/daterangepicker/daterangepicker.js'></script>
|
||||
<script src='plugins/select2/js/select2.min.js'></script>
|
||||
<script src='plugins/inputmask/jquery.inputmask.min.js'></script>
|
||||
<script src="plugins/summernote/summernote-bs4.min.js"></script>
|
||||
<script src="plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
|
||||
<script src="plugins/clipboardjs/clipboard.min.js"></script>
|
||||
<!-- Custom js-->
|
||||
<script src="plugins/moment/moment.min.js"></script>
|
||||
<script src="plugins/chart.js/Chart.min.js"></script>
|
||||
<script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
|
||||
<script src='plugins/daterangepicker/daterangepicker.js'></script>
|
||||
<script src='plugins/select2/js/select2.min.js'></script>
|
||||
<script src='plugins/inputmask/jquery.inputmask.min.js'></script>
|
||||
<script src="plugins/summernote/summernote-bs4.min.js"></script>
|
||||
<script src="plugins/Show-Hide-Passwords-Bootstrap-4/bootstrap-show-password.min.js"></script>
|
||||
<script src="plugins/clipboardjs/clipboard.min.js"></script>
|
||||
|
||||
<!-- AdminLTE App -->
|
||||
<script src="dist/js/adminlte.min.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
</body>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="dist/js/adminlte.min.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -540,3 +540,55 @@ function roundUpToNearestMultiple($n, $increment = 1000)
|
||||
{
|
||||
return (int) ($increment * ceil($n / $increment));
|
||||
}
|
||||
|
||||
function getAssetIcon($asset_type)
|
||||
{
|
||||
if ($asset_type == 'Laptop') {
|
||||
$device_icon = "laptop";
|
||||
} elseif ($asset_type == 'Desktop') {
|
||||
$device_icon = "desktop";
|
||||
} elseif ($asset_type == 'Server') {
|
||||
$device_icon = "server";
|
||||
} elseif ($asset_type == 'Printer') {
|
||||
$device_icon = "print";
|
||||
} elseif ($asset_type == 'Camera') {
|
||||
$device_icon = "video";
|
||||
} elseif ($asset_type == 'Switch' || $asset_type == 'Firewall/Router') {
|
||||
$device_icon = "network-wired";
|
||||
} elseif ($asset_type == 'Access Point') {
|
||||
$device_icon = "wifi";
|
||||
} elseif ($asset_type == 'Phone') {
|
||||
$device_icon = "phone";
|
||||
} elseif ($asset_type == 'Mobile Phone') {
|
||||
$device_icon = "mobile-alt";
|
||||
} elseif ($asset_type == 'Tablet') {
|
||||
$device_icon = "tablet-alt";
|
||||
} elseif ($asset_type == 'TV') {
|
||||
$device_icon = "tv";
|
||||
} elseif ($asset_type == 'Virtual Machine') {
|
||||
$device_icon = "cloud";
|
||||
} else {
|
||||
$device_icon = "tag";
|
||||
}
|
||||
|
||||
return $device_icon;
|
||||
}
|
||||
|
||||
function getInvoiceBadgeColor($invoice_status)
|
||||
{
|
||||
if ($invoice_status == "Sent") {
|
||||
$invoice_badge_color = "warning text-white";
|
||||
} elseif ($invoice_status == "Viewed") {
|
||||
$invoice_badge_color = "info";
|
||||
} elseif ($invoice_status == "Partial") {
|
||||
$invoice_badge_color = "primary";
|
||||
} elseif ($invoice_status == "Paid") {
|
||||
$invoice_badge_color = "success";
|
||||
} elseif ($invoice_status == "Cancelled") {
|
||||
$invoice_badge_color = "danger";
|
||||
} else{
|
||||
$invoice_badge_color = "secondary";
|
||||
}
|
||||
|
||||
return $invoice_badge_color;
|
||||
}
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ if (isset($_SERVER['HTTP_ORIGIN'])) {
|
||||
}
|
||||
}
|
||||
|
||||
include_once("config.php");
|
||||
include_once("functions.php");
|
||||
require_once("config.php");
|
||||
require_once("functions.php");
|
||||
|
||||
// IP & User Agent for logging
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||
|
||||
+17
-24
@@ -1,7 +1,7 @@
|
||||
<?php include("inc_all.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
require_once("inc_all.php");
|
||||
|
||||
if (isset($_GET['query'])) {
|
||||
|
||||
$query = trim(strip_tags(mysqli_real_escape_string($mysqli,$_GET['query'])));
|
||||
@@ -60,9 +60,7 @@ if (isset($_GET['query'])) {
|
||||
<td><?php echo $location_phone; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -118,9 +116,8 @@ if (isset($_GET['query'])) {
|
||||
<td><?php echo $contact_mobile; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -161,9 +158,8 @@ if (isset($_GET['query'])) {
|
||||
<td><?php echo $vendor_phone; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -201,9 +197,8 @@ if (isset($_GET['query'])) {
|
||||
<td><?php echo $product_description; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -246,9 +241,8 @@ if (isset($_GET['query'])) {
|
||||
<td><?php echo $document_updated ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -296,9 +290,8 @@ if (isset($_GET['query'])) {
|
||||
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -343,9 +336,8 @@ if (isset($_GET['query'])) {
|
||||
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -360,4 +352,5 @@ if (isset($_GET['query'])) {
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
// Not including the guest header as we don't want any HTML output
|
||||
include("config.php");
|
||||
include("functions.php");
|
||||
require_once("config.php");
|
||||
require_once("functions.php");
|
||||
|
||||
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,getIP())));
|
||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
@@ -32,8 +33,7 @@ if (isset($_GET['id']) && isset($_GET['key'])) {
|
||||
|
||||
if (empty($row['item_views'])) {
|
||||
$item_views = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$item_views = intval($row['item_views']);
|
||||
}
|
||||
|
||||
@@ -64,5 +64,4 @@ if (isset($_GET['id']) && isset($_GET['key'])) {
|
||||
// Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Sharing', log_action = 'View', log_description = 'Downloaded shared file $file_name via link', log_client_id = '$client_id', log_created_at = NOW(), log_ip = '$ip', log_user_agent = '$user_agent', company_id = '1'");
|
||||
|
||||
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
include("config.php");
|
||||
include("functions.php");
|
||||
require_once("config.php");
|
||||
require_once("functions.php");
|
||||
|
||||
session_start();
|
||||
|
||||
@@ -22,8 +22,8 @@ if (isset($_GET['accept_quote'], $_GET['company_id'], $_GET['url_key'])) {
|
||||
$_SESSION['alert_message'] = "Quote Accepted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}else{
|
||||
echo "GTFO!!";
|
||||
} else {
|
||||
echo "Invalid!!";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,8 +46,8 @@ if (isset($_GET['decline_quote'], $_GET['company_id'], $_GET['url_key'])) {
|
||||
$_SESSION['alert_message'] = "Quote Declined";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}else{
|
||||
echo "GTFO!!";
|
||||
} else {
|
||||
echo "Invalid!!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-13
@@ -76,19 +76,7 @@ if (isset($_GET['invoice_id'], $_GET['url_key'])) {
|
||||
$invoice_tally_total = 0; // Default
|
||||
|
||||
//Set Badge color based off of invoice status
|
||||
if ($invoice_status == "Sent") {
|
||||
$invoice_badge_color = "warning text-white";
|
||||
}elseif ($invoice_status == "Viewed") {
|
||||
$invoice_badge_color = "info";
|
||||
}elseif ($invoice_status == "Partial") {
|
||||
$invoice_badge_color = "primary";
|
||||
}elseif ($invoice_status == "Paid") {
|
||||
$invoice_badge_color = "success";
|
||||
}elseif ($invoice_status == "Cancelled") {
|
||||
$invoice_badge_color = "danger";
|
||||
}else{
|
||||
$invoice_badge_color = "secondary";
|
||||
}
|
||||
$invoice_badge_color = getInvoiceBadgeColor($invoice_status);
|
||||
|
||||
//Update status to Viewed only if invoice_status = "Sent"
|
||||
if ($invoice_status == 'Sent') {
|
||||
|
||||
+8
-8
@@ -4,11 +4,11 @@ header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
include("guest_header.php"); ?>
|
||||
require_once("guest_header.php"); ?>
|
||||
|
||||
<br>
|
||||
<h1> <?php echo $config_app_name ?> Guest sharing </h1>
|
||||
<hr>
|
||||
<br>
|
||||
<h1> <?php echo $config_app_name ?> Guest sharing </h1>
|
||||
<hr>
|
||||
|
||||
<?php
|
||||
if (!isset($_GET['id']) || !isset($_GET['key'])) {
|
||||
@@ -56,7 +56,7 @@ if ($item_type == "Document") {
|
||||
|
||||
if (mysqli_num_rows($doc_sql) !== 1 || !$doc_row) {
|
||||
echo "<div class=\"alert alert-danger\" role=\"alert\">Error retrieving document to view.</div>";
|
||||
include("guest_footer.php");
|
||||
require_once("guest_footer.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ if ($item_type == "Document") {
|
||||
$name = mysqli_real_escape_string($mysqli, $doc_title);
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Sharing', log_action = 'View', log_description = 'Viewed shared $item_type $name via link', log_client_id = '$client_id', log_created_at = NOW(), log_ip = '$ip', log_user_agent = '$user_agent', company_id = '1'");
|
||||
|
||||
}elseif ($item_type == "File") {
|
||||
} elseif ($item_type == "File") {
|
||||
$file_sql = mysqli_query($mysqli, "SELECT * FROM files WHERE file_id = '$item_related_id' AND file_client_id = '$client_id' LIMIT 1");
|
||||
$file_row = mysqli_fetch_array($file_sql);
|
||||
|
||||
@@ -98,7 +98,7 @@ if ($item_type == "Document") {
|
||||
echo "<a href=\"guest_download_file.php?id=$item_id&key=$item_key\" download=\"$file_name;\">Download $file_name</a>";
|
||||
|
||||
|
||||
}elseif ($item_type == "Login") {
|
||||
} elseif ($item_type == "Login") {
|
||||
$encryption_key = $_GET['ek'];
|
||||
|
||||
$login_sql = mysqli_query($mysqli, "SELECT * FROM logins WHERE login_id = '$item_related_id' AND login_client_id = '$client_id' LIMIT 1");
|
||||
@@ -148,4 +148,4 @@ if ($item_type == "Document") {
|
||||
|
||||
echo "<br><hr>";
|
||||
echo $config_app_name;
|
||||
include("guest_footer.php");
|
||||
require_once("guest_footer.php");
|
||||
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
include("config.php");
|
||||
require_once("config.php");
|
||||
include_once("functions.php");
|
||||
include("check_login.php");
|
||||
include("header.php");
|
||||
include("top_nav.php");
|
||||
include("side_nav.php");
|
||||
include("inc_wrapper.php");
|
||||
include("inc_alert_feedback.php");
|
||||
include("pagination_head.php");
|
||||
require_once("check_login.php");
|
||||
require_once("header.php");
|
||||
require_once("top_nav.php");
|
||||
require_once("side_nav.php");
|
||||
require_once("inc_wrapper.php");
|
||||
require_once("inc_alert_feedback.php");
|
||||
require_once("pagination_head.php");
|
||||
|
||||
|
||||
+11
-21
@@ -1,14 +1,10 @@
|
||||
<?php
|
||||
|
||||
include("config.php");
|
||||
include_once("functions.php");
|
||||
include("check_login.php");
|
||||
include("header.php");
|
||||
include("top_nav.php");
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once("config.php");
|
||||
require_once("functions.php");
|
||||
require_once("check_login.php");
|
||||
require_once("header.php");
|
||||
require_once("top_nav.php");
|
||||
|
||||
if (isset($_GET['client_id'])) {
|
||||
$client_id = intval($_GET['client_id']);
|
||||
@@ -24,7 +20,7 @@ if (isset($_GET['client_id'])) {
|
||||
if (mysqli_num_rows($sql) == 0) {
|
||||
include("header.php");
|
||||
echo "<center><h1 class='text-secondary mt-5'>Nothing to see here</h1></center>";
|
||||
}else{
|
||||
} else {
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
@@ -237,14 +233,8 @@ if (isset($_GET['client_id'])) {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_side_nav.php");
|
||||
include("inc_wrapper.php");
|
||||
include("inc_alert_feedback.php");
|
||||
include("inc_client_top_head.php");
|
||||
include("pagination_head.php");
|
||||
|
||||
?>
|
||||
require_once("client_side_nav.php");
|
||||
require_once("inc_wrapper.php");
|
||||
require_once("inc_alert_feedback.php");
|
||||
require_once("inc_client_top_head.php");
|
||||
require_once("pagination_head.php");
|
||||
|
||||
+1
-13
@@ -82,19 +82,7 @@ if (isset($_GET['invoice_id'])) {
|
||||
}
|
||||
|
||||
//Set Badge color based off of invoice status
|
||||
if ($invoice_status == "Sent") {
|
||||
$invoice_badge_color = "warning text-white";
|
||||
} elseif ($invoice_status == "Viewed") {
|
||||
$invoice_badge_color = "info";
|
||||
} elseif ($invoice_status == "Partial") {
|
||||
$invoice_badge_color = "primary";
|
||||
} elseif ($invoice_status == "Paid") {
|
||||
$invoice_badge_color = "success";
|
||||
} elseif ($invoice_status == "Cancelled") {
|
||||
$invoice_badge_color = "danger";
|
||||
} else {
|
||||
$invoice_badge_color = "secondary";
|
||||
}
|
||||
$invoice_badge_color = getInvoiceBadgeColor($invoice_status);
|
||||
|
||||
//Product autocomplete
|
||||
$products_sql = mysqli_query($mysqli, "SELECT product_name AS label, product_description AS description, product_price AS price FROM products WHERE company_id = $session_company_id");
|
||||
|
||||
+27
-43
@@ -1,51 +1,51 @@
|
||||
<?php
|
||||
|
||||
include("inc_all.php");
|
||||
require_once("inc_all.php");
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Sent' AND company_id = $session_company_id"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Sent' AND company_id = $session_company_id"));
|
||||
$sent_count = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Viewed' AND company_id = $session_company_id"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Viewed' AND company_id = $session_company_id"));
|
||||
$viewed_count = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Partial' AND company_id = $session_company_id"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Partial' AND company_id = $session_company_id"));
|
||||
$partial_count = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Draft' AND company_id = $session_company_id"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Draft' AND company_id = $session_company_id"));
|
||||
$draft_count = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Cancelled' AND company_id = $session_company_id"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Cancelled' AND company_id = $session_company_id"));
|
||||
$cancelled_count = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_due > CURDATE() AND company_id = $session_company_id"));
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_due > CURDATE() AND company_id = $session_company_id"));
|
||||
$overdue_count = $row['num'];
|
||||
|
||||
$sql_total_draft = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS total_draft FROM invoices WHERE invoice_status = 'Draft' AND company_id = $session_company_id");
|
||||
$sql_total_draft = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_draft FROM invoices WHERE invoice_status = 'Draft' AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_total_draft);
|
||||
$total_draft = $row['total_draft'];
|
||||
|
||||
$sql_total_sent = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS total_sent FROM invoices WHERE invoice_status = 'Sent' AND company_id = $session_company_id");
|
||||
$sql_total_sent = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_sent FROM invoices WHERE invoice_status = 'Sent' AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_total_sent);
|
||||
$total_sent = $row['total_sent'];
|
||||
|
||||
$sql_total_viewed = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS total_viewed FROM invoices WHERE invoice_status = 'Viewed' AND company_id = $session_company_id");
|
||||
$sql_total_viewed = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_viewed FROM invoices WHERE invoice_status = 'Viewed' AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_total_viewed);
|
||||
$total_viewed = $row['total_viewed'];
|
||||
|
||||
$sql_total_cancelled = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS total_cancelled FROM invoices WHERE invoice_status = 'Cancelled' AND company_id = $session_company_id");
|
||||
$sql_total_cancelled = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_cancelled FROM invoices WHERE invoice_status = 'Cancelled' AND company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_total_cancelled);
|
||||
$total_cancelled = $row['total_cancelled'];
|
||||
|
||||
$sql_total_partial = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS total_partial FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_status = 'Partial' AND invoices.company_id = $session_company_id");
|
||||
$sql_total_partial = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_partial FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_status = 'Partial' AND invoices.company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_total_partial);
|
||||
$total_partial = $row['total_partial'];
|
||||
$total_partial_count = mysqli_num_rows($sql_total_partial);
|
||||
|
||||
$sql_total_overdue_partial = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_overdue_partial FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_status = 'Partial' AND invoice_due < CURDATE() AND invoices.company_id = $session_company_id");
|
||||
$sql_total_overdue_partial = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_overdue_partial FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_status = 'Partial' AND invoice_due < CURDATE() AND invoices.company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_total_overdue_partial);
|
||||
$total_overdue_partial = $row['total_overdue_partial'];
|
||||
|
||||
$sql_total_overdue = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS total_overdue FROM invoices WHERE invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Paid' AND invoice_due < CURDATE() AND invoices.company_id = $session_company_id");
|
||||
$sql_total_overdue = mysqli_query($mysqli, "SELECT SUM(invoice_amount) AS total_overdue FROM invoices WHERE invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Paid' AND invoice_due < CURDATE() AND invoices.company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_total_overdue);
|
||||
$total_overdue = $row['total_overdue'];
|
||||
|
||||
@@ -119,7 +119,7 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM invoices
|
||||
$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM invoices
|
||||
LEFT JOIN clients ON invoice_client_id = client_id
|
||||
LEFT JOIN categories ON invoice_category_id = category_id
|
||||
WHERE invoices.company_id = $session_company_id
|
||||
@@ -128,11 +128,11 @@ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM invoices
|
||||
AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR invoice_scope LIKE '%$q%' OR client_name LIKE '%$q%' OR invoice_status LIKE '%$q%' OR invoice_amount LIKE '%$q%' OR category_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<!-- small box -->
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&status=Draft" class="small-box bg-secondary">
|
||||
@@ -189,9 +189,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-file"></i> Invoices</h3>
|
||||
<div class="card-tools">
|
||||
@@ -299,19 +299,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$overdue_color = "";
|
||||
}
|
||||
|
||||
if ($invoice_status == "Sent") {
|
||||
$invoice_badge_color = "warning text-white";
|
||||
} elseif ($invoice_status == "Viewed") {
|
||||
$invoice_badge_color = "info";
|
||||
} elseif ($invoice_status == "Partial") {
|
||||
$invoice_badge_color = "primary";
|
||||
} elseif ($invoice_status == "Paid") {
|
||||
$invoice_badge_color = "success";
|
||||
} elseif ($invoice_status == "Cancelled") {
|
||||
$invoice_badge_color = "danger";
|
||||
} else{
|
||||
$invoice_badge_color = "secondary";
|
||||
}
|
||||
$invoice_badge_color = getInvoiceBadgeColor($invoice_status);
|
||||
|
||||
?>
|
||||
|
||||
@@ -350,8 +338,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
<?php
|
||||
|
||||
|
||||
include("invoice_edit_modal.php");
|
||||
include("invoice_copy_modal.php");
|
||||
require("invoice_edit_modal.php");
|
||||
require("invoice_copy_modal.php");
|
||||
|
||||
}
|
||||
|
||||
@@ -360,15 +348,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("invoice_add_modal.php");
|
||||
include("category_quick_add_modal.php");
|
||||
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
require_once("invoice_add_modal.php");
|
||||
require_once("category_quick_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// Force the user to correctly type the client name to be deleted before activating the button to delete a client
|
||||
function validateClientNameDelete(client_id) {
|
||||
if (document.getElementById("clientNameProvided" + client_id).value === document.getElementById("clientName" + client_id).value) {
|
||||
document.getElementById("clientDeleteButton" + client_id).className = "btn btn-danger btn-lg px-5";
|
||||
}
|
||||
else{
|
||||
document.getElementById("clientDeleteButton" + client_id).className = "btn btn-danger btn-lg px-5 disabled";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
function populateDomainEditModal(client_id, domain_id) {
|
||||
|
||||
// Send a GET request to post.php as post.php?domain_get_json_details=true&client_id=NUM&domain_id=NUM
|
||||
jQuery.get(
|
||||
"ajax.php",
|
||||
{domain_get_json_details: 'true', client_id: client_id, domain_id: domain_id},
|
||||
function(data) {
|
||||
|
||||
// If we get a response from post.php, parse it as JSON
|
||||
const response = JSON.parse(data);
|
||||
|
||||
// Access the domain info (one), registrars (multiple) and webhosts (multiple)
|
||||
const domain = response.domain[0];
|
||||
const vendors = response.vendors;
|
||||
|
||||
// Populate the domain modal fields
|
||||
document.getElementById("editHeader").innerText = domain.domain_name;
|
||||
document.getElementById("editDomainId").value = domain_id;
|
||||
document.getElementById("editDomainName").value = domain.domain_name;
|
||||
document.getElementById("editExpire").value = domain.domain_expire;
|
||||
document.getElementById("editDomainIP").value = domain.domain_ip;
|
||||
document.getElementById("editNameServers").value = domain.domain_name_servers;
|
||||
document.getElementById("editMailServers").value = domain.domain_mail_servers;
|
||||
document.getElementById("editTxtRecords").value = domain.domain_txt;
|
||||
document.getElementById("editRawWhois").value = domain.domain_raw_whois;
|
||||
|
||||
/* DROPDOWNS */
|
||||
|
||||
// Registrar dropdown
|
||||
var registrarDropdown = document.getElementById("editRegistrarId");
|
||||
|
||||
// Clear registrar dropdown
|
||||
var i, L = registrarDropdown.options.length -1;
|
||||
for(i = L; i >= 0; i--) {
|
||||
registrarDropdown.remove(i);
|
||||
}
|
||||
registrarDropdown[registrarDropdown.length] = new Option('- Vendor -', '0');
|
||||
|
||||
// Populate dropdown
|
||||
vendors.forEach(vendor => {
|
||||
if (parseInt(vendor.vendor_id) == parseInt(domain.domain_registrar)) {
|
||||
// Selected domain
|
||||
registrarDropdown[registrarDropdown.length] = new Option(vendor.vendor_name, vendor.vendor_id, true, true);
|
||||
}
|
||||
else{
|
||||
registrarDropdown[registrarDropdown.length] = new Option(vendor.vendor_name, vendor.vendor_id);
|
||||
}
|
||||
});
|
||||
|
||||
// Webhost dropdown
|
||||
var webhostDropdown = document.getElementById("editWebhostId");
|
||||
|
||||
// Clear registrar dropdown
|
||||
var i, L = webhostDropdown.options.length -1;
|
||||
for(i = L; i >= 0; i--) {
|
||||
webhostDropdown.remove(i);
|
||||
}
|
||||
webhostDropdown[webhostDropdown.length] = new Option('- Vendor -', '0');
|
||||
|
||||
// Populate dropdown
|
||||
vendors.forEach(vendor => {
|
||||
if (parseInt(vendor.vendor_id) == parseInt(domain.domain_webhost)) {
|
||||
// Selected domain
|
||||
webhostDropdown[webhostDropdown.length] = new Option(vendor.vendor_name, vendor.vendor_id, true, true);
|
||||
}
|
||||
else{
|
||||
webhostDropdown[webhostDropdown.length] = new Option(vendor.vendor_name, vendor.vendor_id);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php require_once("inc_all_settings.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all_settings.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
@@ -148,14 +150,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
if (empty($user_name)) {
|
||||
$user_name_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$user_name_display = $user_name;
|
||||
}
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
$client_id = $row['client_id'];
|
||||
if (empty($client_name)) {
|
||||
$client_name_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$client_name_display = "<a href='client_logs.php?client_id=$client_id&tab=logs'>$client_name</a>";
|
||||
}
|
||||
|
||||
@@ -179,8 +181,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
+7
-5
@@ -1,4 +1,6 @@
|
||||
<?php require_once("inc_all.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all.php");
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM notifications LEFT JOIN clients ON notification_client_id = client_id WHERE notification_dismissed_at IS NULL AND (notification_user_id = $session_user_id OR notification_user_id = 0) AND notifications.company_id = $session_company_id ORDER BY notification_id DESC");
|
||||
|
||||
@@ -52,9 +54,8 @@ $sql = mysqli_query($mysqli, "SELECT * FROM notifications LEFT JOIN clients ON n
|
||||
<td class="text-center"><a class="btn btn-info btn-sm" href="post.php?dismiss_notification=<?php echo $notification_id; ?>"><i class="fa fa-check"></a></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -69,4 +70,5 @@ $sql = mysqli_query($mysqli, "SELECT * FROM notifications LEFT JOIN clients ON n
|
||||
|
||||
</div>
|
||||
|
||||
<?php require_once("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
+11
-12
@@ -1,9 +1,10 @@
|
||||
<?php include("inc_all.php");
|
||||
<?php
|
||||
require_once("inc_all.php");
|
||||
|
||||
//Column Filter
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "notification_timestamp";
|
||||
}
|
||||
|
||||
@@ -17,7 +18,7 @@ if (!isset($_GET['o'])) {
|
||||
if (!empty($_GET['dtf'])) {
|
||||
$dtf = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtf']));
|
||||
$dtt = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtt']));
|
||||
}else{
|
||||
} else {
|
||||
$dtf = "0000-00-00";
|
||||
$dtt = "9999-00-00";
|
||||
}
|
||||
@@ -42,7 +43,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-bell"></i> Dismissed Notications</h3>
|
||||
</div>
|
||||
@@ -105,7 +106,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$client_id = $row['client_id'];
|
||||
if (empty($client_name)) {
|
||||
$client_name_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$client_name_display = "<a href='client_overview.php?client_id=$client_id'>$client_name</a>";
|
||||
}
|
||||
|
||||
@@ -118,17 +119,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
<td><?php echo $notification_dismissed_at; ?></td>
|
||||
<td><?php echo $user_name; ?></td>
|
||||
|
||||
<?php
|
||||
<?php } ?>
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -5345,10 +5345,10 @@ if(isset($_POST['add_asset'])){
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_mac = '$mac', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_status = '$status', asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_install_date = '$install_date', asset_notes = '$notes', asset_network_id = $network, asset_client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
if(!empty($_POST['username'])) {
|
||||
if (!empty($_POST['username'])) {
|
||||
$asset_id = mysqli_insert_id($mysqli);
|
||||
$username = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['username'])));
|
||||
$password = trim(mysqli_real_escape_string($mysqli,encryptLoginEntry($_POST['password'])));
|
||||
$username = trim(mysqli_real_escape_string($mysqli, encryptLoginEntry($_POST['username'])));
|
||||
$password = trim(mysqli_real_escape_string($mysqli, encryptLoginEntry($_POST['password'])));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_name = '$name', login_username = '$username', login_password = '$password', login_asset_id = $asset_id, login_client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
@@ -5396,8 +5396,8 @@ if(isset($_POST['edit_asset'])){
|
||||
$install_date = "0000-00-00";
|
||||
}
|
||||
$notes = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes'])));
|
||||
$username = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['username'])));
|
||||
$password = trim(mysqli_real_escape_string($mysqli,encryptLoginEntry($_POST['password'])));
|
||||
$username = trim(mysqli_real_escape_string($mysqli, encryptLoginEntry($_POST['username'])));
|
||||
$password = trim(mysqli_real_escape_string($mysqli, encryptLoginEntry($_POST['password'])));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_mac = '$mac', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_status = '$status', asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_install_date = '$install_date', asset_notes = '$notes', asset_network_id = $network WHERE asset_id = $asset_id AND company_id = $session_company_id");
|
||||
|
||||
|
||||
+4
-7
@@ -13,7 +13,7 @@
|
||||
|
||||
<?php if (isset($_GET['client_id'])) { ?>
|
||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Client <strong class="text-danger">*</strong></label>
|
||||
@@ -31,10 +31,8 @@
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
?>
|
||||
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,9 +66,8 @@
|
||||
?>
|
||||
<option value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</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>
|
||||
|
||||
+20
-21
@@ -1,8 +1,10 @@
|
||||
<?php include("inc_all.php");
|
||||
<?php
|
||||
|
||||
require_once("inc_all.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "revenue_date";
|
||||
}
|
||||
|
||||
@@ -22,31 +24,31 @@ if (empty($_GET['canned_date'])) {
|
||||
if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
||||
$dtf = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtf']));
|
||||
$dtt = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtt']));
|
||||
}elseif ($_GET['canned_date'] == "today") {
|
||||
} elseif ($_GET['canned_date'] == "today") {
|
||||
$dtf = date('Y-m-d');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "yesterday") {
|
||||
} elseif ($_GET['canned_date'] == "yesterday") {
|
||||
$dtf = date('Y-m-d',strtotime("yesterday"));
|
||||
$dtt = date('Y-m-d',strtotime("yesterday"));
|
||||
}elseif ($_GET['canned_date'] == "thisweek") {
|
||||
} elseif ($_GET['canned_date'] == "thisweek") {
|
||||
$dtf = date('Y-m-d',strtotime("monday this week"));
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastweek") {
|
||||
} elseif ($_GET['canned_date'] == "lastweek") {
|
||||
$dtf = date('Y-m-d',strtotime("monday last week"));
|
||||
$dtt = date('Y-m-d',strtotime("sunday last week"));
|
||||
}elseif ($_GET['canned_date'] == "thismonth") {
|
||||
} elseif ($_GET['canned_date'] == "thismonth") {
|
||||
$dtf = date('Y-m-01');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
} elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
$dtf = date('Y-m-d',strtotime("first day of last month"));
|
||||
$dtt = date('Y-m-d',strtotime("last day of last month"));
|
||||
}elseif ($_GET['canned_date'] == "thisyear") {
|
||||
} elseif ($_GET['canned_date'] == "thisyear") {
|
||||
$dtf = date('Y-01-01');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastyear") {
|
||||
} elseif ($_GET['canned_date'] == "lastyear") {
|
||||
$dtf = date('Y-m-d',strtotime("first day of january last year"));
|
||||
$dtt = date('Y-m-d',strtotime("last day of december last year"));
|
||||
}else{
|
||||
} else {
|
||||
$dtf = "0000-00-00";
|
||||
$dtt = "9999-00-00";
|
||||
}
|
||||
@@ -143,7 +145,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$revenue_reference = htmlentities($row['revenue_reference']);
|
||||
if (empty($revenue_reference)) {
|
||||
$revenue_reference_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$revenue_reference_display = $revenue_reference;
|
||||
}
|
||||
$revenue_date = $row['revenue_date'];
|
||||
@@ -178,30 +180,27 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("revenue_edit_modal.php");
|
||||
require("revenue_edit_modal.php");
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
<?php } ?>
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("revenue_add_modal.php");
|
||||
include("category_quick_add_modal.php");
|
||||
require_once("revenue_add_modal.php");
|
||||
require_once("category_quick_add_modal.php");
|
||||
|
||||
include("footer.php");
|
||||
require_once("footer.php");
|
||||
|
||||
?>
|
||||
@@ -20,7 +20,7 @@ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM scheduled_tickets
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
?>
|
||||
|
||||
<script src="js/scheduledTickets.js"></script>
|
||||
<script src="js/scheduled_tickets_edit_modal.js"></script>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
|
||||
+18
-24
@@ -1,25 +1,27 @@
|
||||
<?php require_once("inc_all_settings.php");
|
||||
<?php
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
require_once("inc_all_settings.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli, $_GET['sb']));
|
||||
} else {
|
||||
$sb = "api_key_name";
|
||||
}
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM api_keys
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM api_keys
|
||||
LEFT JOIN clients on api_keys.api_key_client_id = clients.client_id
|
||||
WHERE (api_key_name LIKE '%$q%')
|
||||
AND api_keys.company_id = $session_company_id
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-key"></i> API Keys</h3>
|
||||
<div class="card-tools">
|
||||
@@ -63,8 +65,7 @@
|
||||
|
||||
if ($row['api_key_client_id'] == 0) {
|
||||
$api_key_client = "<i>All Clients</i>";
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$api_key_client = htmlentities($row['client_name']);
|
||||
}
|
||||
|
||||
@@ -87,23 +88,16 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
<?php } ?>
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
include("api_key_add_modal.php");
|
||||
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
require_once("api_key_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
+4
-2
@@ -1,4 +1,5 @@
|
||||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark mb-3">
|
||||
<div class="card-header py-3">
|
||||
@@ -30,4 +31,5 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
+21
-46
@@ -1,6 +1,8 @@
|
||||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
|
||||
<div class="card card-dark">
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-cog"></i> Defaults</h3>
|
||||
</div>
|
||||
@@ -20,14 +22,10 @@
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$account_id = $row['account_id'];
|
||||
$account_name = htmlentities($row['account_name']);
|
||||
|
||||
?>
|
||||
$account_name = htmlentities($row['account_name']); ?>
|
||||
<option <?php if ($config_default_transfer_from_account == $account_id) { echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,14 +43,10 @@
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$account_id = $row['account_id'];
|
||||
$account_name = htmlentities($row['account_name']);
|
||||
|
||||
?>
|
||||
$account_name = htmlentities($row['account_name']); ?>
|
||||
<option <?php if ($config_default_transfer_to_account == $account_id) { echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,14 +64,10 @@
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$account_id = $row['account_id'];
|
||||
$account_name = htmlentities($row['account_name']);
|
||||
|
||||
?>
|
||||
$account_name = htmlentities($row['account_name']); ?>
|
||||
<option <?php if ($config_default_payment_account == $account_id) { echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,14 +85,10 @@
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$account_id = $row['account_id'];
|
||||
$account_name = htmlentities($row['account_name']);
|
||||
|
||||
?>
|
||||
$account_name = htmlentities($row['account_name']); ?>
|
||||
<option <?php if ($config_default_expense_account == $account_id) { echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -119,14 +105,10 @@
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Payment Method' AND company_id = $session_company_id ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$payment_method = htmlentities($row['category_name']);
|
||||
|
||||
?>
|
||||
$payment_method = htmlentities($row['category_name']); ?>
|
||||
<option <?php if ($config_default_payment_method == $payment_method) { echo "selected"; } ?>><?php echo $payment_method; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,14 +125,10 @@
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Payment Method' AND company_id = $session_company_id ORDER BY category_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$payment_method = htmlentities($row['category_name']);
|
||||
|
||||
?>
|
||||
$payment_method = htmlentities($row['category_name']); ?>
|
||||
<option <?php if ($config_default_expense_payment_method == $payment_method) { echo "selected"; } ?>><?php echo $payment_method; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -168,14 +146,10 @@
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM calendars WHERE company_id = $session_company_id ORDER BY calendar_name ASC");
|
||||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$calendar_id = $row['calendar_id'];
|
||||
$calendar_name = htmlentities($row['calendar_name']);
|
||||
|
||||
?>
|
||||
$calendar_name = htmlentities($row['calendar_name']); ?>
|
||||
<option <?php if ($config_default_calendar == $calendar_id) { echo "selected"; } ?> value="<?php echo $calendar_id; ?>"><?php echo $calendar_name; ?></option>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -200,6 +174,7 @@
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
|
||||
<div class="card card-dark">
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-puzzle-piece"></i> Modules</h3>
|
||||
</div>
|
||||
@@ -34,6 +36,7 @@
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
|
||||
<div class="alert alert-warning">
|
||||
Work in Progress
|
||||
</div>
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="alert alert-warning">
|
||||
Work in Progress - Not yet functioning
|
||||
</div>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fa fa-fw fa-credit-card"></i> Online Payment</h3>
|
||||
</div>
|
||||
@@ -48,6 +50,6 @@
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php require_once("footer.php");
|
||||
|
||||
+4
-2
@@ -1,4 +1,5 @@
|
||||
<?php require_once("inc_all_settings.php"); ?>
|
||||
<?php
|
||||
require_once("inc_all_settings.php"); ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
@@ -69,4 +70,5 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -899,7 +899,7 @@ if (isset($_POST['add_user'])) {
|
||||
mysqli_query($mysqli,"UPDATE users SET user_avatar = '$new_file_name' WHERE user_id = $user_id");
|
||||
|
||||
$_SESSION['alert_message'] = 'File successfully uploaded.';
|
||||
}else{
|
||||
} else {
|
||||
|
||||
$_SESSION['alert_message'] = 'There was an error moving the file to upload directory. Please make sure the upload directory is writable by web server.';
|
||||
}
|
||||
@@ -982,7 +982,7 @@ if (isset($_POST['add_company_settings'])) {
|
||||
mysqli_query($mysqli,"UPDATE companies SET company_logo = '$new_file_name' WHERE company_id = $company_id");
|
||||
|
||||
$_SESSION['alert_message'] = 'File successfully uploaded.';
|
||||
}else{
|
||||
} else {
|
||||
|
||||
$_SESSION['alert_message'] = 'There was an error moving the file to upload directory. Please make sure the upload directory is writable by web server.';
|
||||
}
|
||||
@@ -1263,7 +1263,7 @@ if (isset($_POST['add_telemetry'])) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }elseif (isset($_GET['user'])) { ?>
|
||||
<?php } elseif (isset($_GET['user'])) { ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
@@ -1317,7 +1317,7 @@ if (isset($_POST['add_telemetry'])) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }elseif (isset($_GET['company'])) { ?>
|
||||
<?php } elseif (isset($_GET['company'])) { ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
@@ -1326,7 +1326,7 @@ if (isset($_POST['add_telemetry'])) {
|
||||
<div class="card-body">
|
||||
<?php if (mysqli_num_rows(mysqli_query($mysqli,"SELECT COUNT(*) FROM users")) < 0) { ?>
|
||||
Database config invalid, or users already exist in the database.
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
<form method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
@@ -1469,7 +1469,7 @@ if (isset($_POST['add_telemetry'])) {
|
||||
</div>
|
||||
|
||||
|
||||
<?php }elseif (isset($_GET['telemetry'])) { ?>
|
||||
<?php } elseif (isset($_GET['telemetry'])) { ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
@@ -1506,7 +1506,7 @@ if (isset($_POST['add_telemetry'])) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
@@ -1521,7 +1521,7 @@ if (isset($_POST['add_telemetry'])) {
|
||||
// Check that there is access to write config.php
|
||||
if (!file_put_contents("config.php", "Test")) {
|
||||
echo "<div class='alert alert-danger'>Warning: config.php is not writable. Ensure the webserver process has write access (chmod/chown). Check the <a href='https://wiki.itflow.org/doku.php?id=wiki:installation#ubuntu_setup_guide'>docs</a> for info.</div>";
|
||||
}else{
|
||||
} else {
|
||||
// Else, able to write. Tidy up
|
||||
unlink("config.php");
|
||||
}
|
||||
|
||||
@@ -67,9 +67,8 @@
|
||||
?>
|
||||
<option <?php if ($config_default_transfer_from_account == $account_id) { echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -106,9 +105,7 @@
|
||||
?>
|
||||
<option <?php if ($config_default_transfer_to_account == $account_id) { echo "selected"; } ?> value="<?php echo $account_id; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+3
-7
@@ -81,16 +81,14 @@
|
||||
?>
|
||||
<option <?php if ($trip_user_id == $user_id_select) { echo "selected"; } ?> value="<?php echo $user_id_select; ?>"><?php echo $user_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($_GET['client_id'])) { ?>
|
||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Client</label>
|
||||
@@ -109,9 +107,7 @@
|
||||
?>
|
||||
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+3
-4
@@ -82,16 +82,15 @@
|
||||
?>
|
||||
<option <?php if ($trip_user_id == $user_id_select) { echo "selected"; } ?> value="<?php echo $user_id_select; ?>"><?php echo $user_name_select; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($_GET['client_id'])) { ?>
|
||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||
<?php }else{ ?>
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Client</label>
|
||||
|
||||
@@ -1,77 +1,77 @@
|
||||
<?php include("inc_all.php");
|
||||
|
||||
if (!empty($_GET['sb'])) {
|
||||
if (!empty($_GET['sb'])) {
|
||||
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
|
||||
}else{
|
||||
} else {
|
||||
$sb = "trip_date";
|
||||
}
|
||||
}
|
||||
|
||||
// Reverse default sort
|
||||
if (!isset($_GET['o'])) {
|
||||
// Reverse default sort
|
||||
if (!isset($_GET['o'])) {
|
||||
$o = "DESC";
|
||||
$disp = "ASC";
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($_GET['canned_date'])) {
|
||||
if (empty($_GET['canned_date'])) {
|
||||
//Prevents lots of undefined variable errors.
|
||||
// $dtf and $dtt will be set by the below else to 0000-00-00 / 9999-00-00
|
||||
$_GET['canned_date'] = 'custom';
|
||||
}
|
||||
}
|
||||
|
||||
//Date Filter
|
||||
if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
||||
//Date Filter
|
||||
if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) {
|
||||
$dtf = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtf']));
|
||||
$dtt = strip_tags(mysqli_real_escape_string($mysqli,$_GET['dtt']));
|
||||
}elseif ($_GET['canned_date'] == "today") {
|
||||
} elseif ($_GET['canned_date'] == "today") {
|
||||
$dtf = date('Y-m-d');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "yesterday") {
|
||||
} elseif ($_GET['canned_date'] == "yesterday") {
|
||||
$dtf = date('Y-m-d',strtotime("yesterday"));
|
||||
$dtt = date('Y-m-d',strtotime("yesterday"));
|
||||
}elseif ($_GET['canned_date'] == "thisweek") {
|
||||
} elseif ($_GET['canned_date'] == "thisweek") {
|
||||
$dtf = date('Y-m-d',strtotime("monday this week"));
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastweek") {
|
||||
} elseif ($_GET['canned_date'] == "lastweek") {
|
||||
$dtf = date('Y-m-d',strtotime("monday last week"));
|
||||
$dtt = date('Y-m-d',strtotime("sunday last week"));
|
||||
}elseif ($_GET['canned_date'] == "thismonth") {
|
||||
} elseif ($_GET['canned_date'] == "thismonth") {
|
||||
$dtf = date('Y-m-01');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
} elseif ($_GET['canned_date'] == "lastmonth") {
|
||||
$dtf = date('Y-m-d',strtotime("first day of last month"));
|
||||
$dtt = date('Y-m-d',strtotime("last day of last month"));
|
||||
}elseif ($_GET['canned_date'] == "thisyear") {
|
||||
} elseif ($_GET['canned_date'] == "thisyear") {
|
||||
$dtf = date('Y-01-01');
|
||||
$dtt = date('Y-m-d');
|
||||
}elseif ($_GET['canned_date'] == "lastyear") {
|
||||
} elseif ($_GET['canned_date'] == "lastyear") {
|
||||
$dtf = date('Y-m-d',strtotime("first day of january last year"));
|
||||
$dtt = date('Y-m-d',strtotime("last day of december last year"));
|
||||
}else{
|
||||
} else {
|
||||
$dtf = "0000-00-00";
|
||||
$dtt = "9999-00-00";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM trips
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM trips
|
||||
LEFT JOIN clients ON trip_client_id = client_id
|
||||
LEFT JOIN users ON trip_user_id = user_id
|
||||
WHERE (trip_purpose LIKE '%$q%' OR trip_source LIKE '%$q%' OR trip_destination LIKE '%$q%' OR trip_miles LIKE '%$q%' OR client_name LIKE '%$q%' OR user_name LIKE '%$q%')
|
||||
AND DATE(trip_date) BETWEEN '$dtf' AND '$dtt'
|
||||
AND trips.company_id = $session_company_id
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
);
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$total_found_rows = $num_rows[0];
|
||||
$total_pages = ceil($total_found_rows / 10);
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
$total_found_rows = $num_rows[0];
|
||||
$total_pages = ceil($total_found_rows / 10);
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-route"></i> Trips</h3>
|
||||
<div class="card-tools">
|
||||
@@ -161,18 +161,18 @@
|
||||
$client_name = htmlentities($row['client_name']);
|
||||
if (empty($client_name)) {
|
||||
$client_name_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$client_name_display = "<a href='client_trips.php?client_id=$client_id'>$client_name</a>";
|
||||
}
|
||||
if ($round_trip == 1) {
|
||||
$round_trip_display = "<i class='fa fa-fw fa-sync-alt text-secondary'></i>";
|
||||
}else{
|
||||
} else {
|
||||
$round_trip_display = "";
|
||||
}
|
||||
$user_name = htmlentities($row['user_name']);
|
||||
if (empty($user_name)) {
|
||||
$user_name_display = "-";
|
||||
}else{
|
||||
} else {
|
||||
$user_name_display = $user_name;
|
||||
}
|
||||
|
||||
@@ -204,21 +204,20 @@
|
||||
|
||||
<?php
|
||||
|
||||
include("trip_copy_modal.php");
|
||||
include("trip_edit_modal.php");
|
||||
include("trip_export_modal.php");
|
||||
require("trip_copy_modal.php");
|
||||
require("trip_edit_modal.php");
|
||||
require("trip_export_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include("pagination.php"); ?>
|
||||
<?php require_once("pagination.php"); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("trip_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
<?php
|
||||
require_once("trip_add_modal.php");
|
||||
require_once("footer.php");
|
||||
|
||||
+5
-5
@@ -1,4 +1,5 @@
|
||||
<?php include("inc_all.php");
|
||||
<?php
|
||||
require_once("inc_all.php");
|
||||
|
||||
$sql_recent_logins = mysqli_query($mysqli, "SELECT * FROM logs
|
||||
WHERE log_type = 'Login' OR log_type = 'Login 2FA' AND log_action = 'Success' AND log_user_id = $session_user_id
|
||||
@@ -167,9 +168,7 @@ $sql_recent_logs = mysqli_query($mysqli, "SELECT * FROM logs
|
||||
<td><?php echo "<strong>$log_user_os</strong><br>$log_user_browser<br><i class='fa fa-fw fa-globe text-secondary'></i> $log_ip"; ?></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card-footer">
|
||||
@@ -229,4 +228,5 @@ $sql_recent_logs = mysqli_query($mysqli, "SELECT * FROM logs
|
||||
|
||||
</div>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
<?php
|
||||
require_once("footer.php");
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<input type="hidden" name="client_id" value="<?php if (isset($_GET['client_id'])) { echo $client_id; }else{ echo 0; } ?>">
|
||||
<input type="hidden" name="client_id" value="<?php if (isset($_GET['client_id'])) { echo $client_id; } else { echo 0; } ?>">
|
||||
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
@@ -29,9 +29,7 @@
|
||||
|
||||
?>
|
||||
<option value="<?php echo $vendor_template_id ?>"><?php echo $vendor_template_name; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user