mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
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:
43
clients.php
43
clients.php
@@ -44,7 +44,7 @@ if(isset($_GET['o'])){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Date From and Date To Filter
|
//Date From and Date To Filter
|
||||||
if(isset($_GET['dtf'])){
|
if(!empty($_GET['dtf'])){
|
||||||
$dtf = $_GET['dtf'];
|
$dtf = $_GET['dtf'];
|
||||||
$dtt = $_GET['dtt'];
|
$dtt = $_GET['dtt'];
|
||||||
}else{
|
}else{
|
||||||
@@ -65,11 +65,34 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form class="mb-4" autocomplete="off">
|
<form class="mb-4" autocomplete="off">
|
||||||
<div class="input-group">
|
<div class="row">
|
||||||
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Clients">
|
<div class="col-sm-4">
|
||||||
<div class="input-group-append">
|
<div class="input-group">
|
||||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
<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>
|
||||||
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="table-responsive">
|
<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"; } ?>">
|
<thead class="<?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
|
||||||
<tr>
|
<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_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>Contact</th>
|
||||||
<th class="text-right">Balance</th>
|
<th class="text-right">Balance</th>
|
||||||
<th class="text-center">Action</th>
|
<th class="text-center">Action</th>
|
||||||
@@ -129,8 +151,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>&tab=contacts"><?php echo $client_name; ?></a></td>
|
<td>
|
||||||
<td><?php echo $client_type; ?></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>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($client_contact)){
|
if(!empty($client_contact)){
|
||||||
@@ -164,7 +189,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</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>
|
<td>
|
||||||
<div class="dropdown dropleft text-center">
|
<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">
|
<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">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><i class="fas fa-fw fa-chart-area"></i> Cash Flow</h3>
|
<h3 class="card-title"><i class="fas fa-fw fa-chart-area"></i> Cash Flow</h3>
|
||||||
<div class="card-tools">
|
<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">
|
<button type="button" class="btn btn-tool" data-card-widget="remove">
|
||||||
<i class="fas fa-times"></i>
|
<i class="fas fa-times"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -204,6 +207,25 @@ $total_recurring_invoice_amount = $row['total_recurring_invoice_amount'];
|
|||||||
</div>
|
</div>
|
||||||
</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="col-lg-6">
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<div class="card-header">
|
<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
|
// 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.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||||
Chart.defaults.global.defaultFontColor = '#292b2c';
|
Chart.defaults.global.defaultFontColor = '#292b2c';
|
||||||
|
|||||||
39
expenses.php
39
expenses.php
@@ -39,8 +39,14 @@
|
|||||||
$disp = "ASC";
|
$disp = "ASC";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($_GET['category'])){
|
||||||
|
$category = $_GET['category'];
|
||||||
|
}else{
|
||||||
|
$category = '%';
|
||||||
|
}
|
||||||
|
|
||||||
//Date From and Date To Filter
|
//Date From and Date To Filter
|
||||||
if(isset($_GET['dtf'])){
|
if(!empty($_GET['dtf'])){
|
||||||
$dtf = $_GET['dtf'];
|
$dtf = $_GET['dtf'];
|
||||||
$dtt = $_GET['dtt'];
|
$dtt = $_GET['dtt'];
|
||||||
}else{
|
}else{
|
||||||
@@ -70,11 +76,34 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form autocomplete="off">
|
<form autocomplete="off">
|
||||||
<div class="input-group">
|
<div class="row">
|
||||||
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){echo stripslashes($q);} ?>" placeholder="Search Expenses">
|
<div class="col-md-4">
|
||||||
<div class="input-group-append">
|
<div class="input-group">
|
||||||
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
|
<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>
|
||||||
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
20
post.php
20
post.php
@@ -15,8 +15,8 @@ use PHPMailer\PHPMailer\Exception;
|
|||||||
|
|
||||||
if(isset($_POST['add_user'])){
|
if(isset($_POST['add_user'])){
|
||||||
|
|
||||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||||
$password = md5($_POST['password']);
|
$password = md5($_POST['password']);
|
||||||
$client_id = intval($_POST['client']);
|
$client_id = intval($_POST['client']);
|
||||||
|
|
||||||
@@ -53,8 +53,8 @@ if(isset($_POST['add_user'])){
|
|||||||
if(isset($_POST['edit_user'])){
|
if(isset($_POST['edit_user'])){
|
||||||
|
|
||||||
$user_id = intval($_POST['user_id']);
|
$user_id = intval($_POST['user_id']);
|
||||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])));
|
||||||
$current_password_hash = $_POST['current_password_hash'];
|
$current_password_hash = $_POST['current_password_hash'];
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
if($current_password_hash == $password){
|
if($current_password_hash == $password){
|
||||||
@@ -87,14 +87,14 @@ if(isset($_POST['edit_user'])){
|
|||||||
|
|
||||||
if(isset($_POST['add_company'])){
|
if(isset($_POST['add_company'])){
|
||||||
|
|
||||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])));
|
||||||
$address = strip_tags(mysqli_real_escape_string($mysqli,$_POST['address']));
|
$address = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['address'])));
|
||||||
$city = strip_tags(mysqli_real_escape_string($mysqli,$_POST['city']));
|
$city = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['city'])));
|
||||||
$state = strip_tags(mysqli_real_escape_string($mysqli,$_POST['state']));
|
$state = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['state'])));
|
||||||
$zip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip']));
|
$zip = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['zip'])));
|
||||||
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
|
$phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['phone']));
|
||||||
$phone = preg_replace("/[^0-9]/", '',$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()");
|
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><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 $category_name; ?></td>
|
||||||
<td><?php echo $product_description; ?></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>
|
<td>
|
||||||
<div class="dropdown dropleft text-center">
|
<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">
|
<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>
|
<tr>
|
||||||
<td><a href="quote.php?quote_id=<?php echo $quote_id; ?>"><?php echo $quote_number; ?></a></td>
|
<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><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 $quote_date; ?></td>
|
||||||
<td><?php echo $category_name; ?></td>
|
<td><?php echo $category_name; ?></td>
|
||||||
<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>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?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>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -35,7 +35,12 @@
|
|||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file">
|
||||||
</div>
|
</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>
|
<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">
|
<div class="row">
|
||||||
<input type="hidden" name="current_avatar_path" value="<?php echo $session_avatar; ?>">
|
<div class="col-md-3">
|
||||||
<div class="modal-body bg-white">
|
<div class="card">
|
||||||
<center class="mb-3">
|
<div class="card-header">
|
||||||
<?php if(!empty($session_avatar)){ ?>
|
<h3 class="card-title">User Details</h3>
|
||||||
<img class="img-fluid rounded-circle" src="<?php echo $session_avatar; ?>" height="128" width="128">
|
</div>
|
||||||
<?php }else{ ?>
|
<div class="card-body">
|
||||||
<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="form-group">
|
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||||
<label>Email <strong class="text-danger">*</strong></label>
|
<input type="hidden" name="current_avatar_path" value="<?php echo $session_avatar; ?>">
|
||||||
<div class="input-group">
|
<center class="mb-3">
|
||||||
<div class="input-group-prepend">
|
<img src="<?php echo "$session_avatar"; ?>" class="img-circle img-fluid elevation-2" alt="User Image">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
|
</center>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<input type="email" class="form-control" name="email" placeholder="Email Address" value="<?php echo $session_email; ?>" required>
|
<label>Name <strong class="text-danger">*</strong></label>
|
||||||
</div>
|
<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>
|
||||||
|
<input type="text" class="form-control" name="name" placeholder="Full Name" value="<?php echo $session_name; ?>" required>
|
||||||
<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>
|
|
||||||
</div>
|
</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>
|
</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>
|
</div>
|
||||||
|
<hr>
|
||||||
|
<button type="submit" name="verify" class="btn btn-primary">Verify</button>
|
||||||
|
</form>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
</div>
|
||||||
<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>
|
</div>
|
||||||
|
|
||||||
<?php include("footer.php"); ?>
|
<?php include("footer.php"); ?>
|
||||||
53
ticket.php
53
ticket.php
@@ -128,46 +128,6 @@ if(isset($_GET['ticket_id'])){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<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 mb-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
@@ -187,7 +147,7 @@ if(isset($_GET['ticket_id'])){
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="mb-4">
|
<div>
|
||||||
<h4 class="text-secondary">Client</h4>
|
<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; ?>
|
<i class="fa fa-fw fa-user text-secondary ml-1 mr-2 mb-2"></i> <?php echo $client_name; ?>
|
||||||
<br>
|
<br>
|
||||||
@@ -208,14 +168,15 @@ if(isset($_GET['ticket_id'])){
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</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>
|
</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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user