mirror of https://github.com/itflow-org/itflow
Started working on Global Search and did some tidying up
This commit is contained in:
parent
df04ea7957
commit
333e885a39
|
|
@ -0,0 +1,65 @@
|
|||
<div class="modal" id="addClientInvoiceModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-file"></i> New Invoice</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col">
|
||||
<label>Invoice Date</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d"); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col">
|
||||
<label>Payment Due</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="due" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Category</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="category" required>
|
||||
<option value="">- Category -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income'");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$category_id = $row['category_id'];
|
||||
$category_name = $row['category_name'];
|
||||
?>
|
||||
<option value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="add_invoice" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -107,7 +107,7 @@ if(isset($_GET['client_id'])){
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientNetworkModal">New Network</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientDomainModal">New Domain</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientApplicationModal">New Application</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addInvoiceModal">New Invoice</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientInvoiceModal">New Invoice</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addQuoteModal">New Quote</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientAttachmentModal">New Attachment</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientNoteModal">New Note</a>
|
||||
|
|
@ -146,7 +146,7 @@ if(isset($_GET['client_id'])){
|
|||
<?php include("add_client_domain_modal.php"); ?>
|
||||
<?php include("add_client_application_modal.php"); ?>
|
||||
<?php include("add_client_note_modal.php"); ?>
|
||||
<?php include("add_invoice_modal.php"); ?>
|
||||
<?php include("add_client_invoice_modal.php"); ?>
|
||||
<?php include("add_invoice_payment_modal.php"); ?>
|
||||
<?php include("add_quote_modal.php"); ?>
|
||||
<?php include("add_client_attachment_modal.php"); ?>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Name</th>
|
||||
<th>Make</th>
|
||||
<th>Make/Model</th>
|
||||
<th>Serial</th>
|
||||
<th></th>
|
||||
<th class="text-center">Actions</th>
|
||||
|
|
@ -52,8 +52,9 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h2><?php echo $client_login_username; ?></h2>
|
||||
<h3><?php echo $client_login_password; ?></h3>
|
||||
<h3><i class="fa fa-user mr-4"></i> <?php echo $client_login_username; ?></h3>
|
||||
<hr>
|
||||
<h4><i class="fa fa-key mr-4"></i> <?php echo $client_login_password; ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM invoices WHERE client_id = $client_id ORDER BY invoices.invoice_date DESC");
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM invoices WHERE client_id = $client_id ORDER BY invoice_number DESC");
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -25,16 +25,40 @@
|
|||
$invoice_status = $row['invoice_status'];
|
||||
$invoice_date = $row['invoice_date'];
|
||||
$invoice_due = $row['invoice_due'];
|
||||
$invoice_balance = $row['invoice_balance'];
|
||||
$invoice_amount = $row['invoice_amount'];
|
||||
//check to see if overdue
|
||||
|
||||
$unixtime_invoice_due = strtotime($invoice_due);
|
||||
if($unixtime_invoice_due < time()){
|
||||
$invoice_status = "Overdue";
|
||||
$invoice_color = "text-danger";
|
||||
}
|
||||
|
||||
//Set Badge color based off of invoice status
|
||||
if($invoice_status == "Sent"){
|
||||
$invoice_badge_color = "warning";
|
||||
}elseif($invoice_status == "Partial"){
|
||||
$invoice_badge_color = "primary";
|
||||
}elseif($invoice_status == "Paid"){
|
||||
$invoice_badge_color = "success";
|
||||
}elseif($invoice_status == "Overdue"){
|
||||
$invoice_badge_color = "danger";
|
||||
}else{
|
||||
$invoice_badge_color = "secondary";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><a href="invoice.php?invoice_id=<?php echo $invoice_id; ?>">INV-<?php echo "$invoice_number"; ?></a></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($invoice_balance,2); ?></td>
|
||||
<td><?php echo "$invoice_date"; ?></td>
|
||||
<td><?php echo "$invoice_due"; ?></td>
|
||||
<td><?php echo "$invoice_status"; ?></td>
|
||||
<td><a href="invoice.php?invoice_id=<?php echo $invoice_id; ?>">INV-<?php echo $invoice_number; ?></a></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($invoice_amount,2); ?></td>
|
||||
<td><?php echo $invoice_date; ?></td>
|
||||
<td><div class="<?php echo $overdue_color; ?>"><?php echo $invoice_due; ?></div></td>
|
||||
<td>
|
||||
<span class="p-2 badge badge-<?php echo $invoice_badge_color; ?>">
|
||||
<?php echo $invoice_status; ?>
|
||||
</span>
|
||||
</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">
|
||||
|
|
@ -52,7 +76,7 @@
|
|||
|
||||
<?php
|
||||
|
||||
include("edit_invoice_modal.php");
|
||||
//include("edit_invoice_modal.php");
|
||||
include("add_invoice_copy_modal.php");
|
||||
}
|
||||
|
||||
|
|
|
|||
16
config.php
16
config.php
|
|
@ -13,6 +13,12 @@
|
|||
$config_date_format = "Y-m-d";
|
||||
$config_time_format = "h:ia";
|
||||
$config_no_records = "There is nothing here!";
|
||||
$config_default_expenes_account = "";
|
||||
$config_default_invoice_account = "";
|
||||
$config_default_net_terms = "";
|
||||
$config_default_starting_location = "";
|
||||
|
||||
|
||||
|
||||
$config_start_page = "clients.php";
|
||||
|
||||
|
|
@ -33,6 +39,14 @@
|
|||
$_SESSION['alert_message'] = '';
|
||||
$_SESSION['alert_type'] = "warning";
|
||||
|
||||
|
||||
|
||||
$net_terms_array = array(
|
||||
'0'=>'On Reciept',
|
||||
'7'=>'7 Days',
|
||||
'14'=>'14 Days',
|
||||
'30'=>'30 Days'
|
||||
);
|
||||
|
||||
$states_array = array(
|
||||
'AL'=>'Alabama',
|
||||
|
|
@ -85,7 +99,7 @@
|
|||
'WA'=>'Washington',
|
||||
'WV'=>'West Virginia',
|
||||
'WI'=>'Wisconsin',
|
||||
'WY'=>'Wyoming',
|
||||
'WY'=>'Wyoming'
|
||||
);
|
||||
|
||||
$timezones_array = array(
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
<?php include("header.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
if(isset($_GET['query'])){
|
||||
|
||||
$query = $_GET['query'];
|
||||
|
||||
$sql_clients = mysqli_query($mysqli,"SELECT * FROM clients WHERE client_name LIKE '%$query%' ORDER BY client_id DESC LIMIT 5");
|
||||
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_name LIKE '%$query%' ORDER BY vendor_id DESC LIMIT 5");
|
||||
$sql_products = mysqli_query($mysqli,"SELECT * FROM products WHERE product_name LIKE '%$query%' ORDER BY product_id DESC LIMIT 5");
|
||||
$sql_client_logins = mysqli_query($mysqli,"SELECT * FROM client_logins WHERE client_login_description LIKE '%$query%' ORDER BY client_login_id DESC LIMIT 5");
|
||||
|
||||
?>
|
||||
|
||||
<h3><i class="fa fa-search"></i> Welcome to Global Search...</h3>
|
||||
<hr>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-users"></i> Clients</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_clients)){
|
||||
$client_id = $row['client_id'];
|
||||
$client_name = $row['client_name'];
|
||||
$client_phone = $row['client_phone'];
|
||||
if(strlen($client_phone)>2){
|
||||
$client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4);
|
||||
}
|
||||
$client_email = $row['client_email'];
|
||||
$client_website = $row['client_website'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
|
||||
<td><a href="mailto:<?php echo$email; ?>"><?php echo $client_email; ?></a></td>
|
||||
<td><?php echo $client_phone; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-building"></i> Vendors</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_vendors)){
|
||||
$vendor_name = $row['vendor_name'];
|
||||
$vendor_description = $row['vendor_description'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $vendor_name; ?></td>
|
||||
<td><?php echo $vendor_description; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-box"></i> Products</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_products)){
|
||||
$product_name = $row['product_name'];
|
||||
$product_description = $row['product_description'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $product_name; ?></td>
|
||||
<td><?php echo $product_description; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-key"></i> Logins</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<th>Username</th>
|
||||
<th>Password</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_client_logins)){
|
||||
$client_login_description = $row['client_login_description'];
|
||||
$client_login_username = $row['client_login_username'];
|
||||
$client_login_password = $row['client_login_password'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $client_login_description; ?></td>
|
||||
<td><?php echo $client_login_username; ?></td>
|
||||
<td><?php echo $client_login_password; ?></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
|
|
@ -71,7 +71,7 @@ if(isset($_GET['invoice_id'])){
|
|||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="index.html">Invoices</a>
|
||||
<a href="invoices.php">Invoices</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">INV-<?php echo $invoice_number; ?></li>
|
||||
<span class="ml-3 p-2 badge badge-<?php echo $invoice_badge_color; ?>"><?php echo $invoice_status; ?></span>
|
||||
|
|
|
|||
12
invoices.php
12
invoices.php
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM invoices, clients
|
||||
WHERE invoices.client_id = clients.client_id
|
||||
ORDER BY invoices.invoice_date DESC");
|
||||
ORDER BY invoices.invoice_number DESC");
|
||||
?>
|
||||
|
||||
<div class="card mb-3">
|
||||
|
|
@ -59,14 +59,14 @@
|
|||
?>
|
||||
|
||||
<tr>
|
||||
<td><a href="invoice.php?invoice_id=<?php echo $invoice_id; ?>">INV-<?php echo "$invoice_number"; ?></a></td>
|
||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo "$client_name"; ?></a></td>
|
||||
<td><a href="invoice.php?invoice_id=<?php echo $invoice_id; ?>">INV-<?php echo $invoice_number; ?></a></td>
|
||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
|
||||
<td class="text-right text-monospace">$<?php echo number_format($invoice_amount,2); ?></td>
|
||||
<td><?php echo "$invoice_date"; ?></td>
|
||||
<td><div class="<?php echo $overdue_color; ?>"><?php echo "$invoice_due"; ?></div></td>
|
||||
<td><?php echo $invoice_date; ?></td>
|
||||
<td><div class="<?php echo $overdue_color; ?>"><?php echo $invoice_due; ?></div></td>
|
||||
<td>
|
||||
<span class="p-2 badge badge-<?php echo $invoice_badge_color; ?>">
|
||||
<?php echo "$invoice_status"; ?>
|
||||
<?php echo $invoice_status; ?>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
AND payments.invoice_id = invoices.invoice_id
|
||||
AND payments.account_id = accounts.account_id
|
||||
ORDER BY payments.payment_id DESC");
|
||||
|
||||
?>
|
||||
|
||||
<div class="card mb-3">
|
||||
|
|
|
|||
6
post.php
6
post.php
|
|
@ -456,7 +456,7 @@ if(isset($_POST['add_invoice'])){
|
|||
|
||||
$_SESSION['alert_message'] = "Invoice added";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
header("Location: invoice.php?invoice_id=$invoice_id");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -766,8 +766,8 @@ if(isset($_POST['add_client_asset'])){
|
|||
$asset_id = mysqli_insert_id($mysqli);
|
||||
$username = strip_tags(mysqli_real_escape_string($mysqli,$_POST['username']));
|
||||
$password = strip_tags(mysqli_real_escape_string($mysqli,$_POST['password']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO client_logins SET client_login_username = '$username', client_login_password = '$password', client_asset_id = $asset_id, client_id = $client_id");
|
||||
$description = "$type - $name";
|
||||
mysqli_query($mysqli,"INSERT INTO client_logins SET client_login_description = '$description', client_login_username = '$username', client_login_password = '$password', client_asset_id = $asset_id, client_id = $client_id");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
</button>
|
||||
|
||||
<!-- Navbar Search -->
|
||||
<form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0">
|
||||
<form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0" action="global_search.php">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2">
|
||||
<input type="text" class="form-control" placeholder="Search for..." name="query" value="<?php if(isset($_GET['query'])){ echo $_GET['query']; } ?>"aria-label="Search" aria-describedby="basic-addon2">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-dark" type="button">
|
||||
<i class="fas fa-search"></i>
|
||||
|
|
|
|||
Loading…
Reference in New Issue