mirror of https://github.com/itflow-org/itflow
Added Adavnced Filter to customers and expenses, removed some text-mono, ui updates to ticket details, added quick links to reports under dashboard
This commit is contained in:
parent
2cab7463d3
commit
a28d1d6e57
43
clients.php
43
clients.php
|
|
@ -44,7 +44,7 @@ if(isset($_GET['o'])){
|
|||
}
|
||||
|
||||
//Date From and Date To Filter
|
||||
if(isset($_GET['dtf'])){
|
||||
if(!empty($_GET['dtf'])){
|
||||
$dtf = $_GET['dtf'];
|
||||
$dtt = $_GET['dtt'];
|
||||
}else{
|
||||
|
|
@ -65,11 +65,34 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
<div class="card-body">
|
||||
<form class="mb-4" autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Clients">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Clients">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<button class="btn btn-primary float-right" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse mt-3 <?php if(isset($_GET['dtf'])){ echo "show"; } ?>" id="advancedFilter">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date From</label>
|
||||
<input type="date" class="form-control" name="dtf" value="<?php echo $dtf; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date To</label>
|
||||
<input type="date" class="form-control" name="dtt" value="<?php echo $dtt; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="table-responsive">
|
||||
|
|
@ -77,7 +100,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
<thead class="<?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Name <i class="fa fa-sort-alpha<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_type&o=<?php echo $disp; ?>">Type <i class="fa fa-sort"></i></a></th>
|
||||
<th>Contact</th>
|
||||
<th class="text-right">Balance</th>
|
||||
<th class="text-center">Action</th>
|
||||
|
|
@ -129,8 +151,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>&tab=contacts"><?php echo $client_name; ?></a></td>
|
||||
<td><?php echo $client_type; ?></td>
|
||||
<td>
|
||||
<a href="client.php?client_id=<?php echo $client_id; ?>&tab=contacts"><?php echo $client_name; ?></a>
|
||||
<br>
|
||||
<small class="text-secondary"><?php echo $client_type; ?></small>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if(!empty($client_contact)){
|
||||
|
|
@ -164,7 +189,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-right text-monospace <?php echo $balance_text_color; ?>">$<?php echo number_format($balance,2); ?></td>
|
||||
<td class="text-right <?php echo $balance_text_color; ?>">$<?php echo number_format($balance,2); ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
|
|
|
|||
100
dashboard.php
100
dashboard.php
|
|
@ -193,6 +193,9 @@ $total_recurring_invoice_amount = $row['total_recurring_invoice_amount'];
|
|||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-chart-area"></i> Cash Flow</h3>
|
||||
<div class="card-tools">
|
||||
<a href="report_income_summary.php" class="btn btn-tool">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
<button type="button" class="btn btn-tool" data-card-widget="remove">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
|
|
@ -204,6 +207,25 @@ $total_recurring_invoice_amount = $row['total_recurring_invoice_amount'];
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-chart-area"></i> Expense Flow</h3>
|
||||
<div class="card-tools">
|
||||
<a href="report_expense_summary.php" class="btn btn-tool">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
<button type="button" class="btn btn-tool" data-card-widget="remove">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<canvas id="expenseFlow" width="100%" height="20"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
|
|
@ -475,6 +497,84 @@ var myLineChart = new Chart(ctx, {
|
|||
}
|
||||
});
|
||||
|
||||
// Set new default font family and font color to mimic Bootstrap's default styling
|
||||
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||
Chart.defaults.global.defaultFontColor = '#292b2c';
|
||||
|
||||
// Area Chart Example
|
||||
var ctx = document.getElementById("expenseFlow");
|
||||
var myLineChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
||||
datasets: [{
|
||||
label: "Expense",
|
||||
lineTension: 0.3,
|
||||
backgroundColor: "rgba(2,117,216,0.2)",
|
||||
borderColor: "rgba(2,117,216,1)",
|
||||
pointRadius: 5,
|
||||
pointBackgroundColor: "rgba(2,117,216,1)",
|
||||
pointBorderColor: "rgba(255,255,255,0.8)",
|
||||
pointHoverRadius: 5,
|
||||
pointHoverBackgroundColor: "rgba(2,117,216,1)",
|
||||
pointHitRadius: 50,
|
||||
pointBorderWidth: 2,
|
||||
data: [
|
||||
<?php
|
||||
for($month = 1; $month<=12; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND expenses.company_id = $session_company_id");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$expenses_for_month = $row['expense_amount_for_month'];
|
||||
|
||||
if($expenses_for_month > 0 AND $expenses_for_month > $largest_expense_month){
|
||||
$largest_expense_month = $expenses_for_month;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<?php echo "$expenses_for_month,"; ?>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
],
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
xAxes: [{
|
||||
time: {
|
||||
unit: 'date'
|
||||
},
|
||||
gridLines: {
|
||||
display: false
|
||||
},
|
||||
ticks: {
|
||||
maxTicksLimit: 12
|
||||
}
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
min: 0,
|
||||
max: <?php echo roundUpToNearestMultiple($largest_expense_month); ?>,
|
||||
maxTicksLimit: 5
|
||||
},
|
||||
gridLines: {
|
||||
color: "rgba(0, 0, 0, .125)",
|
||||
}
|
||||
}],
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Set new default font family and font color to mimic Bootstrap's default styling
|
||||
Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||
Chart.defaults.global.defaultFontColor = '#292b2c';
|
||||
|
|
|
|||
39
expenses.php
39
expenses.php
|
|
@ -39,8 +39,14 @@
|
|||
$disp = "ASC";
|
||||
}
|
||||
|
||||
if(isset($_GET['category'])){
|
||||
$category = $_GET['category'];
|
||||
}else{
|
||||
$category = '%';
|
||||
}
|
||||
|
||||
//Date From and Date To Filter
|
||||
if(isset($_GET['dtf'])){
|
||||
if(!empty($_GET['dtf'])){
|
||||
$dtf = $_GET['dtf'];
|
||||
$dtt = $_GET['dtt'];
|
||||
}else{
|
||||
|
|
@ -70,11 +76,34 @@
|
|||
</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 stripslashes($q);} ?>" placeholder="Search Expenses">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Expenses">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<button class="btn btn-primary float-right" type="button" data-toggle="collapse" data-target="#advancedFilter"><i class="fas fa-filter"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse mt-3 <?php if(isset($_GET['dtf'])){ echo "show"; } ?>" id="advancedFilter">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date From</label>
|
||||
<input type="date" class="form-control" name="dtf" value="<?php if(isset($dtf)){echo $dtf;} ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>Date To</label>
|
||||
<input type="date" class="form-control" name="dtt" value="<?php if(isset($dtt)){echo $dtt;} ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
|
|
|
|||
20
post.php
20
post.php
|
|
@ -15,8 +15,8 @@ use PHPMailer\PHPMailer\Exception;
|
|||
|
||||
if(isset($_POST['add_user'])){
|
||||
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||
$password = md5($_POST['password']);
|
||||
$client_id = intval($_POST['client']);
|
||||
|
||||
|
|
@ -53,8 +53,8 @@ if(isset($_POST['add_user'])){
|
|||
if(isset($_POST['edit_user'])){
|
||||
|
||||
$user_id = intval($_POST['user_id']);
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||
$current_password_hash = $_POST['current_password_hash'];
|
||||
$password = $_POST['password'];
|
||||
if($current_password_hash == $password){
|
||||
|
|
@ -87,14 +87,14 @@ if(isset($_POST['edit_user'])){
|
|||
|
||||
if(isset($_POST['add_company'])){
|
||||
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$address = strip_tags(mysqli_real_escape_string($mysqli,$_POST['address']));
|
||||
$city = strip_tags(mysqli_real_escape_string($mysqli,$_POST['city']));
|
||||
$state = strip_tags(mysqli_real_escape_string($mysqli,$_POST['state']));
|
||||
$zip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip']));
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||
$address = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['address'])));
|
||||
$city = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['city'])));
|
||||
$state = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['state'])));
|
||||
$zip = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip'])));
|
||||
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
|
||||
$phone = preg_replace("/[^0-9]/", '',$phone);
|
||||
$site = strip_tags(mysqli_real_escape_string($mysqli,$_POST['site']));
|
||||
$site = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['site'])));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO companies SET company_name = '$name', company_created_at = NOW()");
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editProductModal<?php echo $product_id; ?>"><?php echo $product_name; ?></a></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td><?php echo $product_description; ?></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($product_cost,2); ?></td>
|
||||
<td class="text-right">$<?php echo number_format($product_cost,2); ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
<tr>
|
||||
<td><a href="quote.php?quote_id=<?php echo $quote_id; ?>"><?php echo $quote_number; ?></a></td>
|
||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>&tab=quotes"><?php echo $client_name; ?></a></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($quote_amount,2); ?></td>
|
||||
<td class="text-right">$<?php echo number_format($quote_amount,2); ?></td>
|
||||
<td><?php echo $quote_date; ?></td>
|
||||
<td><?php echo $category_name; ?></td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
|
|||
|
||||
?>
|
||||
|
||||
<td class="text-right text-monospace"><a class="text-dark" href="expenses.php?q=<?php echo $category_name; ?>&dtf=<?php echo $year; ?>-01-01&dtt=<?php echo $year; ?>-12-31">$<?php echo number_format($total_expense_for_all_months,2); ?></a></td>
|
||||
<th class="text-right text-monospace"><a class="text-dark" href="expenses.php?q=<?php echo $category_name; ?>&dtf=<?php echo $year; ?>-01-01&dtt=<?php echo $year; ?>-12-31">$<?php echo number_format($total_expense_for_all_months,2); ?></a></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
|
|||
|
||||
?>
|
||||
|
||||
<td class="text-right">$<?php echo number_format($total_payment_for_all_months,2); ?></td>
|
||||
<th class="text-right">$<?php echo number_format($total_payment_for_all_months,2); ?></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -35,7 +35,12 @@
|
|||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
|
||||
<img class="img-fluid" src="<?php echo $config_invoice_logo; ?>">
|
||||
<div class="card col-md-2">
|
||||
<div class="card-body">
|
||||
<img class="img-fluid" src="<?php echo $config_invoice_logo; ?>">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,175 +11,173 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs
|
|||
?>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-dark text-white">
|
||||
<h6 class="float-left mt-1"><i class="fa fa-fw fa-cog mr-2"></i>User Settings</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h5 class="text-secondary">User Details</h5>
|
||||
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="current_avatar_path" value="<?php echo $session_avatar; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
<center class="mb-3">
|
||||
<?php if(!empty($session_avatar)){ ?>
|
||||
<img class="img-fluid rounded-circle" src="<?php echo $session_avatar; ?>" height="128" width="128">
|
||||
<?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 $initials; ?></span>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</center>
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Full Name" value="<?php echo $session_name; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">User Details</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Email <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $session_email; ?>" required>
|
||||
</div>
|
||||
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="current_avatar_path" value="<?php echo $session_avatar; ?>">
|
||||
<center class="mb-3">
|
||||
<img src="<?php echo "$session_avatar"; ?>" class="img-circle img-fluid elevation-2" alt="User Image">
|
||||
</center>
|
||||
<div class="form-group">
|
||||
<label>Name <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Password <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="password" placeholder="Enter a password" value="<?php echo $password; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Avatar</label>
|
||||
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="file">
|
||||
</div>
|
||||
<button type="submit" name="edit_user" class="btn btn-primary mt-3"><i class="fa fa-fw fa-check"></i> Save</button>
|
||||
<input type="text" class="form-control" name="name" placeholder="Full Name" value="<?php echo $session_name; ?>" required>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<h5 class="text-secondary mb-4">Recent Logins</h5>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_recent_logins)){
|
||||
$log_id = $row['log_id'];
|
||||
$log_description = $row['log_description'];
|
||||
$log_created_at = $row['log_created_at'];
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><i class="fa fa-fw fa-sign-in-alt text-secondary"></i> <?php echo $log_description; ?></td>
|
||||
<td><i class="fa fa-fw fa-clock text-secondary"></i> <?php echo $log_created_at; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<h5 class="text-secondary mb-4">Recent Logs</h5>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_recent_logs)){
|
||||
$log_id = $row['log_id'];
|
||||
$log_type = $row['log_type'];
|
||||
$log_action = $row['log_action'];
|
||||
$log_description = $row['log_description'];
|
||||
$log_created_at = $row['log_created_at'];
|
||||
|
||||
if($log_action == 'Created'){
|
||||
$log_icon = "plus";
|
||||
}elseif($log_action == 'Modified'){
|
||||
$log_icon = "edit";
|
||||
}elseif($log_action == 'Deleted'){
|
||||
$log_icon = "trash-alt";
|
||||
}else{
|
||||
$log_icon = "pencil";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><i class="fa fa-fw text-secondary fa-<?php echo $log_icon; ?>"></i> <?php echo $log_type; ?></td>
|
||||
<td><i class="fa fa-fw fa-clock text-secondary"></i> <?php echo $log_created_at; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<?php
|
||||
|
||||
require_once('rfc6238.php');
|
||||
|
||||
//Generate a base32 Key
|
||||
$secretkey = key32gen();
|
||||
|
||||
if(!empty($session_token)){
|
||||
//Generate QR Code based off the generated key
|
||||
print sprintf('<img src="%s"/>',TokenAuth6238::getBarCodeUrl('','',$session_token,$config_company_name));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<input type="hidden" name="token" value="<?php echo $secretkey; ?>">
|
||||
|
||||
<hr>
|
||||
|
||||
<?php if(empty($session_token)){ ?>
|
||||
<button type="submit" name="enable_2fa" class="btn btn-primary"><i class="fa fa-fw fa-lock"></i> Enable 2FA</button>
|
||||
<?php }else{ ?>
|
||||
<button type="submit" name="disable_2fa" class="btn btn-danger"><i class="fa fa-fw fa-unlock"></i> Disable 2FA</button>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php if(!empty($session_token)){ ?>
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<div class="form-group">
|
||||
<label>Verify 2FA is Working</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="code" placeholder="Enter Code" required>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Email <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $session_email; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Password <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="password" placeholder="Enter a password" value="<?php echo $password; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Avatar</label>
|
||||
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="file">
|
||||
</div>
|
||||
<button type="submit" name="edit_user" class="btn btn-primary mt-3"><i class="fa fa-fw fa-check"></i> Save</button>
|
||||
|
||||
</form>
|
||||
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<?php
|
||||
|
||||
require_once('rfc6238.php');
|
||||
|
||||
//Generate a base32 Key
|
||||
$secretkey = key32gen();
|
||||
|
||||
if(!empty($session_token)){
|
||||
//Generate QR Code based off the generated key
|
||||
print sprintf('<img src="%s"/>',TokenAuth6238::getBarCodeUrl('','',$session_token,$config_company_name));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<input type="hidden" name="token" value="<?php echo $secretkey; ?>">
|
||||
|
||||
<hr>
|
||||
|
||||
<?php if(empty($session_token)){ ?>
|
||||
<button type="submit" name="enable_2fa" class="btn btn-primary"><i class="fa fa-fw fa-lock"></i> Enable 2FA</button>
|
||||
<?php }else{ ?>
|
||||
<button type="submit" name="disable_2fa" class="btn btn-danger"><i class="fa fa-fw fa-unlock"></i> Disable 2FA</button>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php if(!empty($session_token)){ ?>
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<div class="form-group">
|
||||
<label>Verify 2FA is Working</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="code" placeholder="Enter Code" required>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" name="verify" class="btn btn-primary">Verify</button>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" name="verify" class="btn btn-primary">Verify</button>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Recent Logins</h3>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_recent_logins)){
|
||||
$log_id = $row['log_id'];
|
||||
$log_description = $row['log_description'];
|
||||
$log_created_at = $row['log_created_at'];
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><i class="fa fa-fw fa-sign-in-alt text-secondary"></i> <?php echo $log_description; ?></td>
|
||||
<td><i class="fa fa-fw fa-clock text-secondary"></i> <?php echo $log_created_at; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Recent Logs</h3>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_recent_logs)){
|
||||
$log_id = $row['log_id'];
|
||||
$log_type = $row['log_type'];
|
||||
$log_action = $row['log_action'];
|
||||
$log_description = $row['log_description'];
|
||||
$log_created_at = $row['log_created_at'];
|
||||
|
||||
if($log_action == 'Created'){
|
||||
$log_icon = "plus";
|
||||
}elseif($log_action == 'Modified'){
|
||||
$log_icon = "edit";
|
||||
}elseif($log_action == 'Deleted'){
|
||||
$log_icon = "trash-alt";
|
||||
}else{
|
||||
$log_icon = "pencil";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><i class="fa fa-fw text-secondary fa-<?php echo $log_icon; ?>"></i> <?php echo $log_type; ?></td>
|
||||
<td><i class="fa fa-fw fa-clock text-secondary"></i> <?php echo $log_created_at; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
53
ticket.php
53
ticket.php
|
|
@ -128,46 +128,6 @@ if(isset($_GET['ticket_id'])){
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h2>
|
||||
Ticket <?php echo $ticket_number; ?>
|
||||
</h2>
|
||||
<span class="p-2 badge badge-<?php echo $ticket_badge_color; ?>">
|
||||
<?php echo $ticket_status; ?>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="mb-4">
|
||||
<h4 class="text-secondary">Client</h4>
|
||||
<i class="fa fa-fw fa-user text-secondary ml-1 mr-2 mb-2"></i> <?php echo $client_name; ?>
|
||||
<br>
|
||||
<?php
|
||||
if(!empty($client_email)){
|
||||
?>
|
||||
<i class="fa fa-fw fa-envelope text-secondary ml-1 mr-2 mb-2"></i> <a href="mailto:<?php echo $client_email; ?>"><?php echo $client_email; ?></a>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if(!empty($client_phone)){
|
||||
?>
|
||||
<i class="fa fa-fw fa-phone text-secondary ml-1 mr-2 mb-2"></i> <?php echo $client_phone; ?>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<h4 class="text-secondary">Details</h4>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i> <?php echo $name; ?></div>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-clock text-secondary mr-2 mb-2"></i> <?php echo $ticket_created_at; ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
|
|
@ -187,7 +147,7 @@ if(isset($_GET['ticket_id'])){
|
|||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="mb-4">
|
||||
<div>
|
||||
<h4 class="text-secondary">Client</h4>
|
||||
<i class="fa fa-fw fa-user text-secondary ml-1 mr-2 mb-2"></i> <?php echo $client_name; ?>
|
||||
<br>
|
||||
|
|
@ -208,14 +168,15 @@ if(isset($_GET['ticket_id'])){
|
|||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<h4 class="text-secondary">Details</h4>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i> <?php echo $name; ?></div>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-clock text-secondary mr-2 mb-2"></i> <?php echo $ticket_created_at; ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-body mb-3">
|
||||
<h4 class="text-secondary">Details</h4>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i> <?php echo $name; ?></div>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-clock text-secondary mr-2 mb-2"></i> <?php echo $ticket_created_at; ?></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue