Added alert feedback boxes, little ui fixes for quote invoice and recurring added rejected instead of cancelled for quotes, and other little ui cleanups

This commit is contained in:
root
2019-05-25 21:14:08 -04:00
parent b559b58f34
commit 889a749d88
20 changed files with 847 additions and 694 deletions
+25
View File
@@ -9,6 +9,31 @@
</div>
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
<div class="modal-body bg-white">
<div class="form-group">
<label>Assign a User to a Client</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>
<select class="form-control" name="client" <?php if(isset($_GET['client_id'])){ echo "disabled"; } ?>>
<option value="">- Client -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM clients");
while($row = mysqli_fetch_array($sql)){
$client_id = $row['client_id'];
$client_name = $row['client_name'];
?>
<option <?php if($_GET['client_id'] == $client_id) { echo "selected"; } ?> value="<?php echo "$client_id"; ?>"><?php echo "$client_name"; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<label>Name</label>
<div class="input-group">
-1
View File
@@ -14,7 +14,6 @@
$session_name = $row['name'];
$session_avatar = $row['avatar'];
//Detects if using an apple device and uses apple maps instead of google
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
+7 -5
View File
@@ -33,21 +33,23 @@
?>
<tr>
<td class="text-center">
<?php if(!empty($contact_photo)){ ?>
<td class="text-center">
<img height="48" width="48" class="img-fluid rounded-circle" src="<?php echo $contact_photo; ?>">
<div class="text-secondary"><?php echo $contact_name; ?></div>
</td>
<?php }else{ ?>
<td class="text-center">
<span class="fa-stack fa-2x">
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
</span>
<br>
<?php } ?>
<div class="text-secondary"><?php echo $contact_name; ?></div>
</td>
<?php } ?>
<td><?php echo $contact_title; ?></td>
<td><a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a></td>
<td><?php echo $contact_phone; ?></td>
+1 -1
View File
@@ -34,7 +34,7 @@
$invoice_date = $row['invoice_date'];
$invoice_due = $row['invoice_due'];
$invoice_amount = $row['invoice_amount'];
$invoice_category_id = $row['category_id'];
$category_id = $row['category_id'];
$category_name = $row['category_name'];
$now = time();
+8 -5
View File
@@ -40,7 +40,7 @@
$quote_badge_color = "primary";
}elseif($quote_status == "Approved"){
$quote_badge_color = "success";
}elseif($quote_status == "Cancelled"){
}elseif($quote_status == "Rejected"){
$quote_badge_color = "danger";
}else{
$quote_badge_color = "secondary";
@@ -64,8 +64,10 @@
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editquoteModal<?php echo $quote_id; ?>">Edit</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addquoteCopyModal<?php echo $quote_id; ?>">Copy</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editQuoteModal<?php echo $quote_id; ?>">Edit</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addQuoteCopyModal<?php echo $quote_id; ?>">Copy</a>
<a class="dropdown-item" href="post.php?email_quote=<?php echo $quote_id; ?>">Send</a>
<a class="dropdown-item" href="post.php?approve_quote=<?php echo $quote_id; ?>">Approve</a>
<a class="dropdown-item" href="post.php?pdf_quote=<?php echo $quote_id; ?>">PDF</a>
<a class="dropdown-item" href="post.php?delete_quote=<?php echo $quote_id; ?>">Delete</a>
</div>
@@ -75,8 +77,9 @@
<?php
//include("edit_invoice_modal.php");
include("add_invoice_copy_modal.php");
include("edit_quote_modal.php");
include("add_quote_copy_modal.php");
}
?>
+10 -1
View File
@@ -10,7 +10,16 @@
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="contact_id" value="<?php echo $contact_id; ?>">
<div class="modal-body bg-white">
<center><img class="img-fluid rounded-circle" src="<?php echo $contact_photo; ?>" height="256" width="256"></center>
<center>
<?php if(!empty($contact_photo)){ ?>
<img class="img-fluid rounded-circle" src="<?php echo $contact_photo; ?>" height="256" width="256">
<?php }else{ ?>
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
<span class="fa fa-stack-1x text-white"><?php echo $contact_initials; ?></span>
</span>
<?php } ?>
</center>
<div class="form-group">
<label>Name</label>
<div class="input-group">
+3 -3
View File
@@ -44,10 +44,10 @@
$sql_income_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income'");
while($row = mysqli_fetch_array($sql_income_category)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];
$category_id_select= $row['category_id'];
$category_name_select = $row['category_name'];
?>
<option <?php if($category_id == $invoice_category_id){ ?> selected <?php } ?> value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
<option <?php if($category_id == $category_id_select){ ?> selected <?php } ?> value="<?php echo $category_id_select; ?>"><?php echo $category_name_select; ?></option>
<?php
}
+7
View File
@@ -13,7 +13,14 @@
<input type="hidden" name="current_avatar_path" value="<?php echo $avatar; ?>">
<div class="modal-body bg-white">
<center class="mb-3">
<?php if(!empty($avatar)){ ?>
<img class="img-fluid rounded-circle" src="<?php echo $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</label>
+2
View File
@@ -1,5 +1,7 @@
<?php
function keygen()
{
$chars = "abcdefghijklmnopqrstuvwxyz";
+17
View File
@@ -53,3 +53,20 @@
<div id="content-wrapper">
<div class="container-fluid">
<?php
//Alert Feedback
if(!empty($_SESSION['alert_message'])){
?>
<div class="alert alert-info" id="alert">
<?php echo $_SESSION['alert_message']; ?>
<button class='close' data-dismiss='alert'>&times;</button>
</div>
<?php
$_SESSION['alert_type'] = '';
$_SESSION['alert_message'] = '';
}
?>
+17 -14
View File
@@ -84,8 +84,13 @@ if(isset($_GET['invoice_id'])){
<span class="p-2 ml-2 badge badge-<?php echo $invoice_badge_color; ?>"><?php echo $invoice_status; ?></span>
</ol>
<form action="post.php" method="post">
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
<div class="row mb-4 d-print-none">
<div class="col-md-4">
<button class="btn btn-success btn-sm" type="submit" name="save_invoice">Save</button>
</div>
<div class="col-md-8">
<div class="dropdown dropleft text-center">
@@ -171,12 +176,12 @@ if(isset($_GET['invoice_id'])){
<thead>
<tr>
<th class="d-print-none"></th>
<th>Item</th>
<th>Product</th>
<th>Description</th>
<th class="text-right">Unit Cost</th>
<th class="text-center">Quantity</th>
<th class="text-center">Qty</th>
<th class="text-right">Price</th>
<th class="text-right">Tax</th>
<th class="text-right">Line Total</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
@@ -200,8 +205,8 @@ if(isset($_GET['invoice_id'])){
<td class="text-center d-print-none"><a class="btn btn-sm btn-danger" href="post.php?delete_invoice_item=<?php echo $item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right text-monospace">$<?php echo number_format($item_price,2); ?></td>
<td class="text-center text-monospace"><?php echo $item_quantity; ?></td>
<td class="text-right text-monospace">$<?php echo number_format($item_tax,2); ?></td>
<td class="text-right text-monospace">$<?php echo number_format($item_total,2); ?></td>
</tr>
@@ -213,9 +218,8 @@ if(isset($_GET['invoice_id'])){
?>
<tr class="d-print-none">
<form action="post.php" method="post" autocomplete="off">
<td class="text-center"><button type="submit" class="btn btn-primary btn-sm" name="add_invoice_item"><i class="fa fa-check"></i></button></td>
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
<td></td>
<td><input type="text" class="form-control typeahead" name="name" id="item"></td>
<td><textarea class="form-control" rows="1" name="description"></textarea></td>
<td><input type="text" class="form-control" style="text-align: right;" name="price"></td>
@@ -227,7 +231,6 @@ if(isset($_GET['invoice_id'])){
</select>
</td>
<td></td>
</form>
</tr>
</tbody>
</table>
@@ -243,11 +246,9 @@ if(isset($_GET['invoice_id'])){
</div>
<div class="card-body">
<div class="d-none d-print-block"><?php echo $invoice_note; ?></div>
<form class="d-print-none" action="post.php" method="post">
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
<textarea rows="6" class="form-control mb-2" name="invoice_note"><?php echo $invoice_note; ?></textarea>
<button class="btn btn-primary btn-sm float-right" type="submit" name="edit_invoice_note"><i class="fa fa-fw fa-check"></i></button>
</form>
<textarea rows="6" class="form-control mb-2 d-print-none" name="invoice_note"><?php echo $invoice_note; ?></textarea>
</div>
</div>
</div>
@@ -285,6 +286,8 @@ if(isset($_GET['invoice_id'])){
</div>
</div>
</form>
<div class="row mb-3">
<div class="col-sm d-print-none">
<div class="card">
+2
View File
@@ -176,6 +176,7 @@
<i class="fas fa-ellipsis-h"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editInvoiceModal<?php echo $invoice_id; ?>">Edit</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addInvoiceCopyModal<?php echo $invoice_id; ?>"><i class="fa fa-fw fa-copy"></i> Copy</a>
<a class="dropdown-item" href="post.php?email_invoice=<?php echo $invoice_id; ?>"><i class="fa fa-fw fa-paper-plane"></i> Send</a>
<a class="dropdown-item" href="post.php?pdf_invoice=<?php echo $invoice_id; ?>"><i class="fa fa-fw fa-file-pdf"></i> PDF</a>
@@ -188,6 +189,7 @@
<?php
include("add_invoice_copy_modal.php");
include("edit_invoice_modal.php");
}
?>
+6
View File
@@ -25,6 +25,12 @@ $(function () {
});
});
//Slide alert up after 2 secs
$("#alert").fadeTo(2000, 500).slideUp(500, function(){
$("#alert").slideUp(500);
});
new EasyMDE({
autoDownloadFontAwesome: false,
element: document.getElementById('addClientNote')
+117 -116
View File
@@ -161,8 +161,6 @@ if(isset($_POST['add_user'])){
$avatar_path = "uploads/user_avatars/";
$avatar_path = $avatar_path . $user_id . '_' . time() . '_' . basename( $_FILES['avatar']['name']);
move_uploaded_file($_FILES['avatar']['tmp_name'], $avatar_path);
}else{
$avatar_path = "img/default_user_avatar.png";
}
mysqli_query($mysqli,"UPDATE users SET avatar = '$avatar_path' WHERE user_id = $user_id");
@@ -884,6 +882,49 @@ if(isset($_POST['add_quote'])){
}
if(isset($_POST['save_quote'])){
$quote_id = intval($_POST['quote_id']);
if(isset($_POST['name'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
$qty = $_POST['qty'];
$price = $_POST['price'];
$tax = $_POST['tax'];
$subtotal = $price * $qty;
$tax = $subtotal * $tax;
$total = $subtotal + $tax;
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', quote_id = $quote_id");
//Update Invoice Balances
$sql = mysqli_query($mysqli,"SELECT * FROM quotes WHERE quote_id = $quote_id");
$row = mysqli_fetch_array($sql);
$new_quote_amount = $row['quote_amount'] + $total;
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = '$new_quote_amount' WHERE quote_id = $quote_id");
$_SESSION['alert_message'] = "Item added";
}
if(isset($_POST['quote_note'])){
$quote_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['quote_note']));
mysqli_query($mysqli,"UPDATE quotes SET quote_note = '$quote_note' WHERE quote_id = $quote_id");
$_SESSION['alert_message'] = "Notes added";
}
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_POST['edit_quote'])){
$quote_id = intval($_POST['quote_id']);
@@ -1010,36 +1051,6 @@ if(isset($_POST['add_quote_to_invoice'])){
}
if(isset($_POST['add_quote_item'])){
$quote_id = intval($_POST['quote_id']);
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
$qty = $_POST['qty'];
$price = $_POST['price'];
$tax = $_POST['tax'];
$subtotal = $price * $qty;
$tax = $subtotal * $tax;
$total = $subtotal + $tax;
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', quote_id = $quote_id");
//Update Invoice Balances
$sql = mysqli_query($mysqli,"SELECT * FROM quotes WHERE quote_id = $quote_id");
$row = mysqli_fetch_array($sql);
$new_quote_amount = $row['quote_amount'] + $total;
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = '$new_quote_amount' WHERE quote_id = $quote_id");
$_SESSION['alert_message'] = "Item added";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_GET['delete_quote_item'])){
$item_id = intval($_GET['delete_quote_item']);
@@ -1065,19 +1076,6 @@ if(isset($_GET['delete_quote_item'])){
}
if(isset($_POST['edit_quote_note'])){
$quote_id = intval($_POST['quote_id']);
$quote_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['quote_note']));
mysqli_query($mysqli,"UPDATE quotes SET quote_note = '$quote_note' WHERE quote_id = $quote_id");
$_SESSION['alert_message'] = "Notes added";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_GET['approve_quote'])){
$quote_id = intval($_GET['approve_quote']);
@@ -1092,15 +1090,15 @@ if(isset($_GET['approve_quote'])){
}
if(isset($_GET['cancel_quote'])){
if(isset($_GET['reject_quote'])){
$quote_id = intval($_GET['cancel_quote']);
$quote_id = intval($_GET['reject_quote']);
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Cancelled' WHERE quote_id = $quote_id");
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Rejected' WHERE quote_id = $quote_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Cancelled', history_description = 'Quote cancelled!', quote_id = $quote_id");
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Cancelled', history_description = 'Quote rejected!', quote_id = $quote_id");
$_SESSION['alert_message'] = "Quote cancelled";
$_SESSION['alert_message'] = "Quote rejected";
header("Location: " . $_SERVER["HTTP_REFERER"]);
@@ -1155,8 +1153,8 @@ if(isset($_GET['pdf_quote'])){
<tr>
<td align='center'>$item_name</td>
<td>$item_description</td>
<td class='cost'>$$item_price</td>
<td align='center'>$item_quantity</td>
<td class='cost'>$$item_price</td>
<td class='cost'>$$item_tax</td>
<td class='cost'>$$item_total</td>
</tr>
@@ -1229,12 +1227,12 @@ if(isset($_GET['pdf_quote'])){
<table class="items" width="100%" style="font-size: 9pt; border-collapse: collapse; " cellpadding="8">
<thead>
<tr>
<td width="20%">Item</td>
<td width="25%">Description</td>
<td width="15%">Unit Cost</td>
<td width="10%">Quantity</td>
<td width="15%">Tax</td>
<td width="15%">Line Total</td>
<td width="28%">Product</td>
<td width="28%">Description</td>
<td width="10%">Qty</td>
<td width="10%">Price</td>
<td width="12%">Tax</td>
<td width="12%">Total</td>
</tr>
</thead>
<tbody>
@@ -1260,8 +1258,8 @@ if(isset($_GET['pdf_quote'])){
';
$mpdf = new \Mpdf\Mpdf([
'margin_left' => 20,
'margin_right' => 15,
'margin_left' => 5,
'margin_right' => 5,
'margin_top' => 48,
'margin_bottom' => 25,
'margin_header' => 10,
@@ -1328,8 +1326,8 @@ if(isset($_GET['email_quote'])){
<tr>
<td align='center'>$item_name</td>
<td>$item_description</td>
<td class='cost'>$$item_price</td>
<td align='center'>$item_quantity</td>
<td class='cost'>$$item_price</td>
<td class='cost'>$$item_tax</td>
<td class='cost'>$$item_total</td>
</tr>
@@ -1402,12 +1400,12 @@ if(isset($_GET['email_quote'])){
<table class="items" width="100%" style="font-size: 9pt; border-collapse: collapse; " cellpadding="8">
<thead>
<tr>
<td width="20%">Item</td>
<td width="25%">Description</td>
<td width="15%">Unit Cost</td>
<td width="10%">Quantity</td>
<td width="15%">Tax</td>
<td width="15%">Line Total</td>
<td width="28%">Product</td>
<td width="28%">Description</td>
<td width="10%">Qty</td>
<td width="10%">Price</td>
<td width="12%">Tax</td>
<td width="12%">Total</td>
</tr>
</thead>
<tbody>
@@ -1433,8 +1431,8 @@ if(isset($_GET['email_quote'])){
';
$mpdf = new \Mpdf\Mpdf([
'margin_left' => 20,
'margin_right' => 15,
'margin_left' => 5,
'margin_right' => 5,
'margin_top' => 48,
'margin_bottom' => 25,
'margin_header' => 10,
@@ -1548,19 +1546,6 @@ if(isset($_GET['delete_recurring'])){
}
if(isset($_POST['edit_recurring_note'])){
$recurring_id = intval($_POST['recurring_id']);
$recurring_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['recurring_note']));
mysqli_query($mysqli,"UPDATE recurring SET recurring_note = '$recurring_note' WHERE recurring_id = $recurring_id");
$_SESSION['alert_message'] = "Notes added";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_GET['recurring_activate'])){
$recurring_id = intval($_GET['recurring_activate']);
@@ -1585,9 +1570,11 @@ if(isset($_GET['recurring_deactivate'])){
}
if(isset($_POST['add_recurring_item'])){
if(isset($_POST['save_recurring'])){
$recurring_id = intval($_POST['recurring_id']);
if(isset($_POST['name'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
$qty = $_POST['qty'];
@@ -1611,6 +1598,18 @@ if(isset($_POST['add_recurring_item'])){
$_SESSION['alert_message'] = "Item added";
}
if(isset($_POST['recurring_note'])){
$recurring_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['recurring_note']));
mysqli_query($mysqli,"UPDATE recurring SET recurring_note = '$recurring_note' WHERE recurring_id = $recurring_id");
$_SESSION['alert_message'] = "Notes added";
}
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
@@ -1701,9 +1700,11 @@ if(isset($_GET['delete_invoice'])){
}
if(isset($_POST['add_invoice_item'])){
if(isset($_POST['save_invoice'])){
$invoice_id = intval($_POST['invoice_id']);
if(isset($_POST['name'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
$qty = $_POST['qty'];
@@ -1727,6 +1728,19 @@ if(isset($_POST['add_invoice_item'])){
$_SESSION['alert_message'] = "Item added";
}
if(isset($_POST['invoice_note'])){
$invoice_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['invoice_note']));
mysqli_query($mysqli,"UPDATE invoices SET invoice_note = '$invoice_note' WHERE invoice_id = $invoice_id");
$_SESSION['alert_message'] = "Notes added";
}
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
@@ -1985,8 +1999,8 @@ if(isset($_GET['email_invoice'])){
<tr>
<td align='center'>$item_name</td>
<td>$item_description</td>
<td class='cost'>$$item_price</td>
<td align='center'>$item_quantity</td>
<td class='cost'>$$item_price</td>
<td class='cost'>$$item_tax</td>
<td class='cost'>$$item_total</td>
</tr>
@@ -2060,12 +2074,12 @@ if(isset($_GET['email_invoice'])){
<table class="items" width="100%" style="font-size: 9pt; border-collapse: collapse; " cellpadding="8">
<thead>
<tr>
<td width="20%">Item</td>
<td width="25%">Description</td>
<td width="15%">Unit Cost</td>
<td width="10%">Quantity</td>
<td width="15%">Tax</td>
<td width="15%">Line Total</td>
<td width="28%">Product</td>
<td width="28%">Description</td>
<td width="10%">Qty</td>
<td width="10%">Price</td>
<td width="12%">Tax</td>
<td width="12%">Total</td>
</tr>
</thead>
<tbody>
@@ -2088,7 +2102,7 @@ if(isset($_GET['email_invoice'])){
<td class="totals cost">$ '.number_format($amount_paid,2).' </td>
</tr>
<tr>
<td class="totals"><b>Balance due:</b></td>
<td class="totals"><b>Balance:</b></td>
<td class="totals cost"><b>$ '.number_format($balance,2).' </b></td>
</tr>
</tbody>
@@ -2099,8 +2113,8 @@ if(isset($_GET['email_invoice'])){
';
$mpdf = new \Mpdf\Mpdf([
'margin_left' => 20,
'margin_right' => 15,
'margin_left' => 5,
'margin_right' => 5,
'margin_top' => 48,
'margin_bottom' => 25,
'margin_header' => 10,
@@ -2239,8 +2253,8 @@ if(isset($_GET['pdf_invoice'])){
<tr>
<td align='center'>$item_name</td>
<td>$item_description</td>
<td class='cost'>$$item_price</td>
<td align='center'>$item_quantity</td>
<td class='cost'>$$item_price</td>
<td class='cost'>$$item_tax</td>
<td class='cost'>$$item_total</td>
</tr>
@@ -2314,12 +2328,12 @@ if(isset($_GET['pdf_invoice'])){
<table class="items" width="100%" style="font-size: 9pt; border-collapse: collapse; " cellpadding="8">
<thead>
<tr>
<td width="20%">Item</td>
<td width="25%">Description</td>
<td width="15%">Unit Cost</td>
<td width="10%">Quantity</td>
<td width="15%">Tax</td>
<td width="15%">Line Total</td>
<td width="28%">Product</td>
<td width="28%">Description</td>
<td width="10%">Qty</td>
<td width="10%">Price</td>
<td width="12%">Tax</td>
<td width="12%">Total</td>
</tr>
</thead>
<tbody>
@@ -2342,7 +2356,7 @@ if(isset($_GET['pdf_invoice'])){
<td class="totals cost">$ '.number_format($amount_paid,2).' </td>
</tr>
<tr>
<td class="totals"><b>Balance due:</b></td>
<td class="totals"><b>Balance:</b></td>
<td class="totals cost"><b>$ '.number_format($balance,2).' </b></td>
</tr>
</tbody>
@@ -2353,8 +2367,8 @@ if(isset($_GET['pdf_invoice'])){
';
$mpdf = new \Mpdf\Mpdf([
'margin_left' => 20,
'margin_right' => 15,
'margin_left' => 5,
'margin_right' => 5,
'margin_top' => 48,
'margin_bottom' => 25,
'margin_header' => 10,
@@ -2376,19 +2390,6 @@ if(isset($_GET['pdf_invoice'])){
}
if(isset($_POST['edit_invoice_note'])){
$invoice_id = intval($_POST['invoice_id']);
$invoice_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['invoice_note']));
mysqli_query($mysqli,"UPDATE invoices SET invoice_note = '$invoice_note' WHERE invoice_id = $invoice_id");
$_SESSION['alert_message'] = "Notes added";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_POST['add_contact'])){
$client_id = intval($_POST['client_id']);
+15 -15
View File
@@ -61,8 +61,13 @@ if(isset($_GET['quote_id'])){
<span class="ml-3 p-2 badge badge-<?php echo $quote_badge_color; ?>"><?php echo $quote_status; ?></span>
</ol>
<form class="d-print-none" action="post.php" method="post">
<input type="hidden" name="quote_id" value="<?php echo $quote_id; ?>">
<div class="row mb-4 d-print-none">
<div class="col-md-12">
<div class="col-md-4">
<button class="btn btn-success btn-sm" type="submit" name="save_quote">Save</button>
</div>
<div class="col-md-8">
<div class="dropdown dropleft text-center">
<button class="btn btn-primary btn-sm float-right" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
@@ -72,7 +77,7 @@ if(isset($_GET['quote_id'])){
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addQuoteCopyModal<?php echo $quote_id; ?>">Copy</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addQuoteToInvoiceModal<?php echo $quote_id; ?>">Quote > Invoice</a>
<a class="dropdown-item" href="post.php?approve_quote=<?php echo $quote_id; ?>">Approve</a>
<a class="dropdown-item" href="post.php?cancel_quote=<?php echo $quote_id; ?>">Cancel</a>
<a class="dropdown-item" href="post.php?reject_quote=<?php echo $quote_id; ?>">Reject</a>
<a class="dropdown-item" href="post.php?email_quote=<?php echo $quote_id; ?>">Send Email</a>
<?php if($quote_status == "Draft"){ ?><a class="dropdown-item" href="post.php?mark_quote_sent=<?php echo $quote_id; ?>">Mark Sent</a><?php } ?>
<a class="dropdown-item" href="#" onclick="window.print();">Print</a>
@@ -144,12 +149,12 @@ if(isset($_GET['quote_id'])){
<thead>
<tr>
<th class="d-print-none"></th>
<th>Item</th>
<th>Product</th>
<th>Description</th>
<th class="text-right">Unit Cost</th>
<th class="text-center">Quantity</th>
<th class="text-center">Qty</th>
<th class="text-right">Price</th>
<th class="text-right">Tax</th>
<th class="text-right">Line Total</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
@@ -173,8 +178,8 @@ if(isset($_GET['quote_id'])){
<td class="text-center d-print-none"><a class="btn btn-danger btn-sm" href="post.php?delete_quote_item=<?php echo $item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-right">$<?php echo number_format($item_price,2); ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right">$<?php echo number_format($item_price,2); ?></td>
<td class="text-right">$<?php echo number_format($item_tax,2); ?></td>
<td class="text-right">$<?php echo number_format($item_total,2); ?></td>
</tr>
@@ -186,9 +191,8 @@ if(isset($_GET['quote_id'])){
?>
<tr class="d-print-none">
<form action="post.php" method="post">
<td class="text-center"><button type="submit" class="btn btn-primary btn-sm" name="add_quote_item"><i class="fa fa-check"></i></button></td>
<input type="hidden" name="quote_id" value="<?php echo $quote_id; ?>">
<td></td>
<td><input type="text" class="form-control" name="name"></td>
<td><textarea class="form-control" rows="1" name="description"></textarea></td>
<td><input type="text" class="form-control" style="text-align: right;" name="price"></td>
@@ -200,7 +204,6 @@ if(isset($_GET['quote_id'])){
</select>
</td>
<td></td>
</form>
</tr>
</tbody>
</table>
@@ -216,11 +219,7 @@ if(isset($_GET['quote_id'])){
</div>
<div class="card-body">
<div class="d-none d-print-block"><?php echo $quote_note; ?></div>
<form class="d-print-none" action="post.php" method="post">
<input type="hidden" name="quote_id" value="<?php echo $quote_id; ?>">
<textarea rows="6" class="form-control mb-2" name="quote_note"><?php echo $quote_note; ?></textarea>
<button class="btn btn-primary btn-sm float-right" type="submit" name="edit_quote_note"><i class="fa fa-fw fa-check"></i></button>
</form>
<textarea rows="6" class="form-control mb-2 d-print-none" name="quote_note"><?php echo $quote_note; ?></textarea>
</div>
</div>
</div>
@@ -252,6 +251,7 @@ if(isset($_GET['quote_id'])){
</table>
</div>
</div>
</form>
<div class="row mb-3">
<div class="col-sm d-print-none">
+2 -2
View File
@@ -51,7 +51,7 @@
$quote_badge_color = "primary";
}elseif($quote_status == "Approved"){
$quote_badge_color = "success";
}elseif($quote_status == "Cancelled"){
}elseif($quote_status == "Rejected"){
$quote_badge_color = "danger";
}else{
$quote_badge_color = "secondary";
@@ -89,7 +89,7 @@
<?php
//include("edit_quote_modal.php");
include("edit_quote_modal.php");
include("add_quote_copy_modal.php");
}
+16 -15
View File
@@ -58,8 +58,14 @@ if(isset($_GET['recurring_id'])){
<span class="ml-3 p-2 badge badge-<?php echo $status_badge_color; ?>"><?php echo $status; ?></span>
</ol>
<form class="d-print-none" action="post.php" method="post">
<input type="hidden" name="recurring_id" value="<?php echo $recurring_id; ?>">
<div class="row mb-4 d-print-none">
<div class="col-md-12">
<div class="col-md-4">
<button class="btn btn-success btn-sm" type="submit" name="save_recurring">Save</button>
</div>
<div class="col-md-8">
<div class="dropdown dropleft text-center">
<button class="btn btn-primary btn-sm float-right" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-h"></i>
@@ -141,12 +147,12 @@ if(isset($_GET['recurring_id'])){
<thead>
<tr>
<th class="d-print-none"></th>
<th>Item</th>
<th>Product</th>
<th>Description</th>
<th class="text-right">Unit Cost</th>
<th class="text-center">Quantity</th>
<th class="text-center">Qty</th>
<th class="text-right">Price</th>
<th class="text-right">Tax</th>
<th class="text-right">Line Total</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
@@ -170,8 +176,8 @@ if(isset($_GET['recurring_id'])){
<td class="text-center d-print-none"><a class="btn btn-danger btn-sm" href="post.php?delete_recurring_item=<?php echo $item_id; ?>"><i class="fa fa-trash"></i></a></td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-right">$<?php echo number_format($item_price,2); ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right">$<?php echo number_format($item_price,2); ?></td>
<td class="text-right">$<?php echo number_format($item_tax,2); ?></td>
<td class="text-right">$<?php echo number_format($item_total,2); ?></td>
</tr>
@@ -183,13 +189,12 @@ if(isset($_GET['recurring_id'])){
?>
<tr class="d-print-none">
<form action="post.php" method="post">
<td class="text-center"><button type="submit" class="btn btn-primary btn-sm" name="add_recurring_item"><i class="fa fa-check"></i></button></td>
<td></td>
<input type="hidden" name="recurring_id" value="<?php echo $recurring_id; ?>">
<td><input type="text" class="form-control" name="name"></td>
<td><textarea class="form-control" rows="1" name="description"></textarea></td>
<td><input type="text" class="form-control" style="text-align: right;" name="price"></td>
<td><input type="text" class="form-control" style="text-align: center;" name="qty"></td>
<td><input type="text" class="form-control" style="text-align: right;" name="price"></td>
<td>
<select dir="rtl" class="form-control" name="tax">
<option value="0.00">None</option>
@@ -197,7 +202,6 @@ if(isset($_GET['recurring_id'])){
</select>
</td>
<td></td>
</form>
</tr>
</tbody>
</table>
@@ -213,11 +217,7 @@ if(isset($_GET['recurring_id'])){
</div>
<div class="card-body">
<div class="d-none d-print-block"><?php echo $recurring_note; ?></div>
<form class="d-print-none" action="post.php" method="post">
<input type="hidden" name="recurring_id" value="<?php echo $recurring_id; ?>">
<textarea rows="6" class="form-control mb-2" name="recurring_note"><?php echo $recurring_note; ?></textarea>
<button class="btn btn-primary btn-sm float-right" type="submit" name="edit_recurring_note"><i class="fa fa-fw fa-check"></i></button>
</form>
<textarea rows="6" class="form-control mb-2 d-print-none" name="recurring_note"><?php echo $recurring_note; ?></textarea>
</div>
</div>
</div>
@@ -248,6 +248,7 @@ if(isset($_GET['recurring_id'])){
</table>
</div>
</div>
</form>
<div class="row mb-3">
<div class="col-sm d-print-none">
+58
View File
@@ -0,0 +1,58 @@
<?php include("header.php"); ?>
<?php include("settings-nav.php"); ?>
<div class="card mb-3">
<div class="card-header">
<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">
<form class="p-3" action="post.php" method="post" autocomplete="off">
<div class="form-group">
<label>Server</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
</div>
<input type="text" class="form-control" name="config_smtp_host" placeholder="CardDAV Server Address" value="<?php echo $config_carddav_server; ?>" required autofocus>
</div>
</div>
<div class="form-group">
<label>Addressbook</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-address-book"></i></span>
</div>
<input type="text" class="form-control" name="config_carddav_username" placeholder="Address book name" value="<?php echo $config_carddav_address_book; ?>" required>
</div>
</div>
<div class="form-group">
<label>Username</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="config_carddav_username" placeholder="Username" value="<?php echo $config_carddav_username; ?>" required>
</div>
</div>
<div class="form-group mb-5">
<label>Password</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="config_carddav_password" placeholder="Password" value="<?php echo $config_carddav_password; ?>" required>
</div>
</div>
<hr>
<button type="submit" name="edit_carddav_settings" class="btn btn-primary">Save</button>
</form>
</div>
</div>
<?php include("footer.php");
+8
View File
@@ -24,6 +24,14 @@
</a>
</li>
<li class="nav-item">
<a class="nav-link <?php if(basename($_SERVER["REQUEST_URI"]) == "settings-carddav.php") { echo "active"; } ?>"
href="settings-carddav.php">
<i class="fa fa-fw fa-2x fa-address-book"></i><br>
CardDAV
</a>
</li>
<li class="nav-item">
<a class="nav-link <?php if(basename($_SERVER["REQUEST_URI"]) == "settings-invoice.php") { echo "active"; } ?>"
href="settings-invoice.php">
+11 -1
View File
@@ -27,11 +27,21 @@
$email = $row['email'];
$password = $row['password'];
$avatar = $row['avatar'];
$initials = initials($name);
?>
<tr>
<td class="text-center">
<img height="48" width="48" class="img-fluid rounded-circle" src="<?php echo "$avatar"; ?>">
<?php if(!empty($avatar)){ ?>
<img height="48" width="48" class="img-fluid rounded-circle" src="<?php echo $avatar; ?>">
<?php }else{ ?>
<span class="fa-stack fa-2x">
<i class="fa fa-circle fa-stack-2x text-secondary"></i>
<span class="fa fa-stack-1x text-white"><?php echo $initials; ?></span>
</span>
<br>
<?php } ?>
<div class="text-secondary"><?php echo $name; ?></div>
</td>
<td><a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a></td>