moved all table listing to server side tables and set the header to dark for better contrast

This commit is contained in:
root 2019-06-18 18:31:13 -04:00
parent fd61728da5
commit 571223d920
34 changed files with 1522 additions and 271 deletions

View File

@ -1,21 +1,76 @@
<?php include("header.php"); ?>
<?php include("header.php");
//Rebuild URL
<?php $sql = mysqli_query($mysqli,"SELECT * FROM accounts ORDER BY account_id DESC"); ?>
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "account_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM accounts
WHERE account_name LIKE '%$q%'
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);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-piggy-bank mr-2"></i>Accounts</h6>
<button type="button" class="btn btn-primary btn-sm mr-auto float-right" data-toggle="modal" data-target="#addAccountModal"><i class="fas fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Accounts">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead class="thead-dark">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Name</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=account_name&o=<?php echo $disp; ?>">Name</a></th>
<th class="text-right">Balance</th>
<th class="text-center">Actions</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -60,6 +115,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,22 +1,76 @@
<?php include("header.php"); ?>
<?php include("header.php");
<?php $sql = mysqli_query($mysqli,"SELECT * FROM categories ORDER BY category_id DESC"); ?>
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "category_type";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM categories WHERE category_name LIKE '%$q%' OR category_type LIKE '%$q%' 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);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-list mr-2"></i>Categories</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addCategoryModal"><i class="fas fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Categories">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Name</th>
<th>Type</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_type&o=<?php echo $disp; ?>">Type</a></th>
<th>Color</th>
<th class="text-center">Actions</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -53,6 +107,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,23 +1,83 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM assets WHERE client_id = $client_id ORDER BY asset_id DESC"); ?>
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "asset_type";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM assets
WHERE client_id = $client_id
AND (asset_name LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%')
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);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-laptop"></i> Assets</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addAssetModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Type</th>
<th>Name</th>
<th>IP</th>
<th>Make</th>
<th>Model</th>
<th>Serial</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_type&o=<?php echo $disp; ?>">Type</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_ip&o=<?php echo $disp; ?>">IP</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_make&o=<?php echo $disp; ?>">Make</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_model&o=<?php echo $disp; ?>">Model</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=asset_serial&o=<?php echo $disp; ?>">Serial</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -143,6 +203,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -42,6 +42,9 @@ if(isset($_GET['o'])){
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM contacts WHERE client_id = $client_id AND (contact_name LIKE '%$q%') 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);
?>

View File

@ -1,21 +1,80 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM domains WHERE client_id = $client_id ORDER BY domain_id DESC"); ?>
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "domain_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM domains
WHERE client_id = $client_id AND (domain_name LIKE '%$q%')
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);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-globe"></i> Domains</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addDomainModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Domain</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=domain_name&o=<?php echo $disp; ?>">Domain</a></th>
<th>Registrar</th>
<th>WebHost</th>
<th>Expire</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=domain_expire&o=<?php echo $disp; ?>">Expire</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -64,6 +123,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
<?php $sql_files_other = mysqli_query($mysqli,"SELECT * FROM files WHERE client_id = $client_id AND file_ext NOT LIKE 'JPG' AND file_ext NOT LIKE 'jpg' AND file_ext NOT LIKE 'png' AND file_ext NOT LIKE 'PNG' ORDER BY file_id DESC"); ?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-file"></i> Uploaded Files</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addFileModal"><i class="fa fa-cloud-upload-alt"></i></button>
</div>
@ -25,12 +25,12 @@
<a href="#" data-toggle="modal" data-target="#viewFileModal<?php echo $file_id; ?>">
<img class="img-fluid" src="<?php echo $file_name; ?>">
</a>
<div class="card-footer p-1">
<div class="card-footer bg-dark text-white p-1">
<center>
<a href="<?php echo $file_name; ?>" download="<?php echo $file_name; ?>" class="text-secondary float-left ml-1"><i class="fa fa-cloud-download-alt"></i></a>
<small class="text-secondary"><?php echo basename($file_name); ?></small>
<a href="<?php echo $file_name; ?>" download="<?php echo $file_name; ?>" class="text-white float-left ml-1"><i class="fa fa-cloud-download-alt"></i></a>
<small><?php echo basename($file_name); ?></small>
<a href="post.php?delete_file=<?php echo $file_id; ?>" class="text-secondary float-right mr-1"><i class="fa fa-times"></i></a>
<a href="post.php?delete_file=<?php echo $file_id; ?>" class="text-white float-right mr-1"><i class="fa fa-times"></i></a>
</center>
</div>
</div>

View File

@ -1,27 +1,84 @@
<?php
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "invoice_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT * FROM invoices, categories WHERE invoices.client_id = $client_id AND invoices.category_id = categories.category_id ORDER BY invoice_number DESC");
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM invoices, categories
WHERE invoices.client_id = $client_id
AND invoices.category_id = categories.category_id
AND (invoice_number LIKE '%$q%' OR category_name LIKE '%$q%' OR invoice_status LIKE '%$q%')
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);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-file"></i> Invoices</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addInvoiceModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Number</th>
<th class="text-right">Amount</th>
<th>Date</th>
<th>Due</th>
<th>Category</th>
<th>Status</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_number&o=<?php echo $disp; ?>">Number</a></th>
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_amount&o=<?php echo $disp; ?>">Amount</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_date&o=<?php echo $disp; ?>">Date</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_due&o=<?php echo $disp; ?>">Due</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_status&o=<?php echo $disp; ?>">Status</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -98,6 +155,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,21 +1,81 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE client_id = $client_id ORDER BY location_id DESC"); ?>
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "location_name";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM locations
WHERE client_id = $client_id
AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$q%')
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);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-map-marker-alt"></i> Locations</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addLocationModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<table class="table table-striped table-borderless table-hover">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_address&o=<?php echo $disp; ?>">Address</a></th>
<th>Phone</th>
<th>Hours</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=location_hours&o=<?php echo $disp; ?>">Hours</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -65,6 +125,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,19 +1,81 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM logins WHERE client_id = $client_id ORDER BY login_id DESC"); ?>
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "login_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM logins
WHERE client_id = $client_id
AND (login_description LIKE '%$q%' OR login_username LIKE '%$q%' OR login_password LIKE '%$q%')
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);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-key"></i> Logins</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addLoginModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Description</th>
<th>Username</th>
<th>Password</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_description&o=<?php echo $disp; ?>">Description</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_username&o=<?php echo $disp; ?>">Username</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=login_password&o=<?php echo $disp; ?>">Password</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -58,6 +120,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,20 +1,81 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM networks WHERE client_id = $client_id ORDER BY network_id DESC"); ?>
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "network_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM networks
WHERE client_id = $client_id
AND (network_name LIKE '%$q%' OR network LIKE '%$q%' OR network_gateway LIKE '%$q%' OR network_dhcp_range LIKE '%$q%')
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);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-network-wired"></i> Networks</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addNetworkModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Name</th>
<th>Network</th>
<th>Gateway</th>
<th>DHCP Range</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network&o=<?php echo $disp; ?>">Network</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_gateway&o=<?php echo $disp; ?>">Gateway</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=network_dhcp_range&o=<?php echo $disp; ?>">DHCP Range</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -26,7 +87,6 @@
$network = $row['network'];
$network_gateway = $row['network_gateway'];
$network_dhcp_range = $row['network_dhcp_range'];
$network_dhcp_range = $row['network_dhcp_range'];
$location_id = $row['location_id'];
?>
@ -57,6 +117,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM notes WHERE client_id = $client_id ORDER BY note_id DESC"); ?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-edit"></i> Notes</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addNoteModal"><i class="fa fa-plus"></i></button>
</div>

View File

@ -1,26 +1,83 @@
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM payments, invoices, accounts
WHERE invoices.client_id = $client_id
AND payments.invoice_id = invoices.invoice_id
AND payments.account_id = accounts.account_id
ORDER BY payments.payment_id DESC");
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "payment_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT * FROM payments, invoices, accounts
WHERE invoices.client_id = $client_id
AND payments.invoice_id = invoices.invoice_id
AND payments.account_id = accounts.account_id
AND (invoice_number LIKE '%$q%' OR account_name LIKE '%$q%' OR payment_method LIKE '%$q%')
ORDER BY $sb $o LIMIT $record_from, $record_to");
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$total_found_rows = $num_rows[0];
$total_pages = ceil($total_found_rows / 10);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-credit-card"></i> Payments</h6>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Date</th>
<th>Invoice</th>
<th class="text-right">Amount</th>
<th>Account</th>
<th>Method</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_date&o=<?php echo $disp; ?>">Date</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_number&o=<?php echo $disp; ?>">Invoice</a></th>
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_amount&o=<?php echo $disp; ?>">Amount</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=account_name&o=<?php echo $disp; ?>">Account</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_method&o=<?php echo $disp; ?>">Method</a></th>
</tr>
</thead>
<tbody>
@ -53,6 +110,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,25 +1,83 @@
<?php
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "quote_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT * FROM quotes, categories WHERE client_id = $client_id AND categories.category_id = quotes.category_id ORDER BY quote_number DESC");
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM quotes, categories
WHERE client_id = $client_id
AND categories.category_id = quotes.category_id
AND (quote_id LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%')
ORDER BY $sb $o LIMIT $record_from, $record_to");
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$total_found_rows = $num_rows[0];
$total_pages = ceil($total_found_rows / 10);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-file"></i> Quotes</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addQuoteModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Number</th>
<th class="text-right">Amount</th>
<th>Date</th>
<th>Category</th>
<th>Status</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=quote_number&o=<?php echo $disp; ?>">Number</a></th>
<th class="text-right"><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=quote_amount&o=<?php echo $disp; ?>">Amount</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=quote_date&o=<?php echo $disp; ?>">Date</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=quote_status&o=<?php echo $disp; ?>">Status</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -89,6 +147,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,27 +1,83 @@
<?php
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "recurring_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT * FROM recurring, categories
WHERE recurring.client_id = $client_id
AND recurring.category_id = categories.category_id
ORDER BY recurring.recurring_id DESC");
$sql = mysqli_query($mysqli,"SELECT * FROM recurring, categories
WHERE recurring.client_id = $client_id
AND recurring.category_id = categories.category_id
AND (recurring_frequency 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()"));
$total_found_rows = $num_rows[0];
$total_pages = ceil($total_found_rows / 10);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-copy"></i> Recurring Invoices</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addRecurringModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Frequency</th>
<th>Last Sent</th>
<th>Next Date</th>
<th>Status</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_frequency&o=<?php echo $disp; ?>">Frequency</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_last_sent&o=<?php echo $disp; ?>">Last Sent</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_next_date&o=<?php echo $disp; ?>">Next Date</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_status&o=<?php echo $disp; ?>">Status</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -84,6 +140,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,20 +1,81 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM software WHERE client_id = $client_id ORDER BY software_id DESC"); ?>
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "software_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM software
WHERE client_id = $client_id
AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_license LIKE '%$q%')
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);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-rocket mr-2"></i>Software</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addSoftwareModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Software</th>
<th>Type</th>
<th>License</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_name&o=<?php echo $disp; ?>">Software</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_type&o=<?php echo $disp; ?>">Type</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=software_license&o=<?php echo $disp; ?>">License</a></th>
<th></th>
<th class="text-center">Actions</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -86,6 +147,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,20 +1,81 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM tickets WHERE client_id = $client_id ORDER BY ticket_id DESC"); ?>
<?php
<div class="card mb-3">
<div class="card-header">
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "ticket_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM tickets
WHERE client_id = $client_id
AND (ticket_id LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR ticket_status LIKE '%$q%')
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);
?>
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-2"><i class="fa fa-fw fa-tags mr-2"></i>Tickets</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addTicketModal"><i class="fas fa-fw fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead class="thead-dark">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Number</th>
<th>Subject</th>
<th>Date Opened</th>
<th>Status</th>
<th class="text-center">Actions</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_id&o=<?php echo $disp; ?>">Number</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_subject&o=<?php echo $disp; ?>">Subject</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_created_at&o=<?php echo $disp; ?>">Date Opened</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_status&o=<?php echo $disp; ?>">Status</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -78,6 +139,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,20 +1,81 @@
<?php $sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id ORDER BY vendor_id DESC"); ?>
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*6;
$record_to = 6;
}else{
$record_from = 0;
$record_to = 6;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "vendor_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "ASC";
$disp = "DESC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM vendors
WHERE client_id = $client_id
AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_number LIKE '%$q%' )
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);
?>
<div class="card">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-building mr-2"></i>Vendors</h6>
<button class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addVendorModal"><i class="fa fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
<input type="hidden" name="tab" value="<?php echo $_GET['tab']; ?>">
<div class="input-group">
<input type="search" class="form-control " name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search <?php echo ucwords($_GET['tab']); ?>">
<div class="input-group-append">
<button class="btn btn-secondary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Vendor</th>
<th>Description</th>
<th>Account Number</th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_name&o=<?php echo $disp; ?>">Vendor</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_description&o=<?php echo $disp; ?>">Description</a></th>
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_account_number&o=<?php echo $disp; ?>">Account Number</a></th>
<th></th>
<th class="text-center">Actions</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -112,6 +173,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,30 +1,82 @@
<?php include("header.php"); ?>
<?php include("header.php");
//Rebuild URL
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM expenses, categories, vendors, accounts
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "expense_date";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM expenses, categories, vendors, accounts
WHERE expenses.category_id = categories.category_id
AND expenses.vendor_id = vendors.vendor_id
AND expenses.account_id = accounts.account_id
ORDER BY expenses.expense_date DESC");
AND (vendor_name LIKE '%$q%' OR category_name LIKE '%$q%' OR account_name LIKE '%$q%')
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);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-shopping-cart mr-2"></i>Expenses</h6>
<button type="button" class="btn btn-primary btn-sm mr-auto float-right" data-toggle="modal" data-target="#addExpenseModal"><i class="fas fa-fw fa-cart-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Expenses">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead class="thead-dark">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Date</th>
<th class="text-right">Amount</th>
<th>Vendor</th>
<th>Category</th>
<th>Account</th>
<th class="text-center">Actions</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=expense_date&o=<?php echo $disp; ?>">Date</a></th>
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=expense_amount&o=<?php echo $disp; ?>">Amount</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=vendor_name&o=<?php echo $disp; ?>">Vendor</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=account_name&o=<?php echo $disp; ?>">Account</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -95,6 +147,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,30 +1,81 @@
<?php include("header.php"); ?>
<?php include("header.php");
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM payments, invoices, clients, accounts
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "payment_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM payments, invoices, clients, accounts
WHERE invoices.client_id = clients.client_id
AND payments.invoice_id = invoices.invoice_id
AND payments.account_id = accounts.account_id
ORDER BY payments.payment_id DESC");
AND (invoice_number LIKE '%$q%' OR client_name LIKE '%$q%' OR account_name LIKE '%$q%' OR payment_method LIKE '%$q%')
ORDER BY $sb $o LIMIT $record_from, $record_to");
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$total_found_rows = $num_rows[0];
$total_pages = ceil($total_found_rows / 10);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-credit-card mr-2"></i>Payments</h6>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Payments">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead class="thead-dark">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Date</th>
<th>Invoice</th>
<th>Client</th>
<th class="text-right">Amount</th>
<th>Account</th>
<th>Method</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_date&o=<?php echo $disp; ?>">Date</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_number&o=<?php echo $disp; ?>">Invoice</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_amount&o=<?php echo $disp; ?>">Amount</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=account_name&o=<?php echo $disp; ?>">Account</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=payment_method&o=<?php echo $disp; ?>">Method</a></th>
</tr>
</thead>
<tbody>
@ -61,6 +112,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,30 +1,82 @@
<?php include("header.php"); ?>
<?php include("header.php");
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "quote_number";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT * FROM quotes, clients, categories
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM quotes, clients, categories
WHERE quotes.client_id = clients.client_id
AND quotes.category_id = categories.category_id
ORDER BY quotes.quote_number DESC");
AND (quote_number LIKE '%$q%' OR client_name LIKE '%$q%')
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);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-file mr-2"></i>Quotes</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addQuoteModal"><i class="fas fa-fw fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Quotes">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead class="thead-dark">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Number</th>
<th>Client</th>
<th class="text-right">Amount</th>
<th>Date</th>
<th>Category</th>
<th>Status</th>
<th class="text-center">Actions</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=quote_number&o=<?php echo $disp; ?>">Number</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=quote_amount&o=<?php echo $disp; ?>">Amount</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=quote_date&o=<?php echo $disp; ?>">Date</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=quote_status&o=<?php echo $disp; ?>">Status</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -101,6 +153,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,30 +1,82 @@
<?php include("header.php"); ?>
<?php include("header.php");
<?php
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "recurring_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT * FROM recurring, clients, categories
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM recurring, clients, categories
WHERE recurring.client_id = clients.client_id
AND recurring.category_id = categories.category_id
ORDER BY recurring.recurring_id DESC");
AND (recurring_frequency LIKE '%$q%' OR client_name 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()"));
$total_found_rows = $num_rows[0];
$total_pages = ceil($total_found_rows / 10);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-copy mr-2"></i>Recurring Invoices</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addRecurringModal"><i class="fas fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Recurring Invoices">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead class="thead-dark">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Frequency</th>
<th>Client</th>
<th>Last Sent</th>
<th>Next Date</th>
<th>Category</th>
<th>Status</th>
<th class="text-center">Actions</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_frequency&o=<?php echo $disp; ?>">Frequency</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_last_sent&o=<?php echo $disp; ?>">Last Sent</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_next_date&o=<?php echo $disp; ?>">Next Date</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=recurring_status&o=<?php echo $disp; ?>">Status</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -89,6 +141,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -13,12 +13,14 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-coins mr-2"></i>Expense Summary</h6>
<button type="button" class="btn btn-primary btn-sm float-right d-print-none" onclick="window.print();"><i class="fas fa-fw fa-print"></i> Print</button>
<form>
<select onchange="this.form.submit()" class="form-control mt-5" name="year">
</div>
<div class="card-body">
<form class="mb-3">
<select onchange="this.form.submit()" class="form-control" name="year">
<?php
while($row = mysqli_fetch_array($sql_expense_years)){
@ -32,11 +34,9 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
</select>
</form>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<thead class="text-dark">
<tr>
<th>Category</th>
<th class="text-right">January</th>

View File

@ -13,12 +13,14 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-coins mr-2"></i>Income Summary</h6>
<button type="button" class="btn btn-primary btn-sm float-right d-print-none" onclick="window.print();"><i class="fas fa-fw fa-print"></i> Print</button>
<form>
<select onchange="this.form.submit()" class="form-control mt-5" name="year">
</div>
<div class="card-body">
<form class="mb-3">
<select onchange="this.form.submit()" class="form-control" name="year">
<?php
while($row = mysqli_fetch_array($sql_payment_years)){
@ -32,11 +34,9 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
</select>
</form>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<thead class="text-dark">
<tr>
<th>Category</th>
<th class="text-right">January</th>

View File

@ -18,12 +18,14 @@ $sql_categories_expense = mysqli_query($mysqli,"SELECT * FROM categories WHERE c
?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fw-fw fa-balance-scale mr-2"></i>Profit & Loss</h6>
<button type="button" class="btn btn-primary btn-sm float-right d-print-none" onclick="window.print();"><i class="fas fa-fw fa-print"></i> Print</button>
<form>
<select onchange="this.form.submit()" class="form-control mt-5" name="year">
</div>
<div class="card-body">
<form class="mb-3">
<select onchange="this.form.submit()" class="form-control" name="year">
<?php
while($row = mysqli_fetch_array($sql_all_years)){
@ -37,11 +39,9 @@ $sql_categories_expense = mysqli_query($mysqli,"SELECT * FROM categories WHERE c
</select>
</form>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<thead class="text-dark">
<tr>
<th></th>
<th class="text-right">Jan-Mar</th>

View File

@ -4,8 +4,8 @@
<?php include("settings-nav.php"); ?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-database mr-2"></i>Backup</h6>
</div>
<div class="card-body p-5">

View File

@ -2,8 +2,8 @@
<?php include("settings-nav.php"); ?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-address-book mr-2"></i>CardDAV Settings</h6>
</div>
<div class="card-body">

View File

@ -2,8 +2,8 @@
<?php include("settings-nav.php"); ?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-building mr-2"></i>Company Settings</h6>
</div>
<div class="card-body">

View File

@ -2,8 +2,8 @@
<?php include("settings-nav.php"); ?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-cog mr-2"></i>General Settings</h6>
</div>
<div class="card-body">

View File

@ -2,8 +2,8 @@
<?php include("settings-nav.php"); ?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-file mr-2"></i>Invoice Settings</h6>
</div>
<div class="card-body">

View File

@ -2,8 +2,8 @@
<?php include("settings-nav.php"); ?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-envelope mr-2"></i>Mail Settings</h6>
</div>
<div class="card-body">

View File

@ -1,11 +1,7 @@
<?php include("header.php");
<?php include("header.php"); ?>
?>
<div class="card mb-3">
<div class="card-header">
<div class="card">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-lock mr-2"></i>Two Factor Authentication</h6>
</div>
<div class="card-body">

View File

@ -1,27 +1,77 @@
<?php include("header.php"); ?>
<?php include("header.php");
//Rebuild URL
<?php
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
$sql = mysqli_query($mysqli,"SELECT * FROM transfers ORDER BY transfer_date DESC");
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "transfer_date";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM transfers 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);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-exchange-alt mr-2"></i>Transfers</h6>
<button type="button" class="btn btn-primary btn-sm mr-auto float-right" data-toggle="modal" data-target="#addTransferModal"><i class="fas fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Transfers">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead class="thead-dark">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Date</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=transfer_date&o=<?php echo $disp; ?>">Date</a></th>
<th>From Account</th>
<th>To Account</th>
<th class="text-right">Amount</th>
<th class="text-center">Actions</th>
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=transfer_amount&o=<?php echo $disp; ?>">Amount</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -72,6 +122,9 @@ $sql = mysqli_query($mysqli,"SELECT * FROM transfers ORDER BY transfer_date DESC
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,23 +1,79 @@
<?php include("header.php"); ?>
<?php include("header.php");
<?php $sql = mysqli_query($mysqli,"SELECT * FROM trips ORDER BY trip_id DESC"); ?>
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "trip_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM trips
WHERE trip_purpose LIKE '%$q%' OR trip_starting_location LIKE '%$q%' OR trip_destination LIKE '%$q%'
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);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-bicycle mr-2"></i>Trips</h6>
<button type="button" class="btn btn-primary btn-sm float-right" data-toggle="modal" data-target="#addTripModal"><i class="fas fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Trips">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead class="thead-dark">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th>Date</th>
<th>Purpose</th>
<th>From</th>
<th>To</th>
<th>Miles</th>
<th class="text-center">Actions</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=trip_date&o=<?php echo $disp; ?>">Date</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=trip_purpose&o=<?php echo $disp; ?>">Purpose</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=trip_starting_location&o=<?php echo $disp; ?>">From</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=trip_destination&o=<?php echo $disp; ?>">To</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=trip_miles&o=<?php echo $disp; ?>">Miles</a></th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -73,6 +129,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>

View File

@ -1,23 +1,78 @@
<?php include("header.php"); ?>
<?php include("header.php");
<?php $sql = mysqli_query($mysqli,"SELECT * FROM users ORDER BY user_id DESC"); ?>
//Rebuild URL
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
if(isset($_GET['p'])){
$p = intval($_GET['p']);
$record_from = (($p)-1)*10;
$record_to = 10;
}else{
$record_from = 0;
$record_to = 10;
$p = 1;
}
if(isset($_GET['q'])){
$q = $_GET['q'];
}else{
$q = "";
}
if(!empty($_GET['sb'])){
$sb = $_GET['sb'];
}else{
$sb = "user_id";
}
if(isset($_GET['o'])){
if($_GET['o'] == 'ASC'){
$o = "ASC";
$disp = "DESC";
}else{
$o = "DESC";
$disp = "ASC";
}
}else{
$o = "DESC";
$disp = "ASC";
}
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM users
WHERE name LIKE '%$q%' OR email LIKE '%$q%'
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);
?>
<div class="card mb-3">
<div class="card-header">
<div class="card-header bg-dark text-white">
<h6 class="float-left mt-1"><i class="fa fa-fw fa-users mr-2"></i>Users</h6>
<button type="button" class="btn btn-primary btn-sm mr-auto float-right" data-toggle="modal" data-target="#addUserModal"><i class="fas fa-fw fa-plus"></i></button>
</div>
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo $q;} ?>" placeholder="Search Users">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
<thead>
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark">
<tr>
<th class="text-center">Name</th>
<th>Email</th>
<th class="text-center"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=email&o=<?php echo $disp; ?>">Email</a></th>
<th>Type</th>
<th>Status</th>
<th class="text-center">Actions</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@ -72,6 +127,9 @@
</tbody>
</table>
<?php include("pagination.php"); ?>
</div>
</div>
</div>