mirror of
https://github.com/itflow-org/itflow
synced 2026-03-03 04:14:54 +00:00
Merged Invoice and Quotes Settings into one
This commit is contained in:
22
post.php
22
post.php
@@ -298,35 +298,21 @@ if(isset($_POST['edit_mail_settings'])){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['edit_invoice_settings'])){
|
if(isset($_POST['edit_invoice_quote_settings'])){
|
||||||
|
|
||||||
$config_invoice_prefix = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_invoice_prefix']));
|
$config_invoice_prefix = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_invoice_prefix']));
|
||||||
$config_invoice_next_number = intval($_POST['config_invoice_next_number']);
|
$config_invoice_next_number = intval($_POST['config_invoice_next_number']);
|
||||||
$config_invoice_footer = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_invoice_footer']));
|
$config_invoice_footer = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_invoice_footer']));
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_invoice_prefix = '$config_invoice_prefix', config_invoice_next_number = $config_invoice_next_number, config_invoice_footer = '$config_invoice_footer' WHERE company_id = $session_company_id");
|
|
||||||
|
|
||||||
//Logging
|
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modified', log_description = 'Invoice', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
|
||||||
|
|
||||||
$_SESSION['alert_message'] = "Invoice Settings updated";
|
|
||||||
|
|
||||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_POST['edit_quote_settings'])){
|
|
||||||
|
|
||||||
$config_quote_prefix = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_quote_prefix']));
|
$config_quote_prefix = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_quote_prefix']));
|
||||||
$config_quote_next_number = intval($_POST['config_quote_next_number']);
|
$config_quote_next_number = intval($_POST['config_quote_next_number']);
|
||||||
$config_quote_footer = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_quote_footer']));
|
$config_quote_footer = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_quote_footer']));
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_quote_prefix = '$config_quote_prefix', config_quote_next_number = $config_quote_next_number, config_quote_footer = '$config_quote_footer' WHERE company_id = $session_company_id");
|
mysqli_query($mysqli,"UPDATE settings SET config_invoice_prefix = '$config_invoice_prefix', config_invoice_next_number = $config_invoice_next_number, config_invoice_footer = '$config_invoice_footer', config_quote_prefix = '$config_quote_prefix', config_quote_next_number = $config_quote_next_number, config_quote_footer = '$config_quote_footer' WHERE company_id = $session_company_id");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modified', log_description = 'Quote', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modified', log_description = 'Invoice', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||||
|
|
||||||
$_SESSION['alert_message'] = "Quote Settings updated";
|
$_SESSION['alert_message'] = "Invoice / Quote Settings updated";
|
||||||
|
|
||||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,13 @@
|
|||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header bg-dark text-white">
|
<div class="card-header bg-dark text-white">
|
||||||
<h6 class="float-left mt-1"><i class="fa fa-fw fa-file mr-2"></i>Invoice Settings</h6>
|
<h6 class="float-left mt-1"><i class="fa fa-fw fa-file mr-2"></i>Invoice/Quotes Settings</h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||||
|
|
||||||
|
<legend>Invoices</legend>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Invoice Prefix</label>
|
<label>Invoice Prefix</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -34,8 +36,35 @@
|
|||||||
<textarea class="form-control" rows="4" name="config_invoice_footer"><?php echo $config_invoice_footer; ?></textarea>
|
<textarea class="form-control" rows="4" name="config_invoice_footer"><?php echo $config_invoice_footer; ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<legend>Quotes</legend>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Quote Prefix</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="config_quote_prefix" placeholder="Quote Prefix" value="<?php echo $config_quote_prefix; ?>" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Next Number</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="number" min="0" class="form-control" name="config_quote_next_number" placeholder="Next Quote Number" value="<?php echo $config_quote_next_number; ?>" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Quote Footer</label>
|
||||||
|
<textarea class="form-control" rows="4" name="config_quote_footer"><?php echo $config_quote_footer; ?></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<button type="submit" name="edit_invoice_settings" class="btn btn-primary">Save</button>
|
<button type="submit" name="edit_invoice_quote_settings" class="btn btn-primary">Save</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -33,18 +33,10 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?php if(basename($_SERVER["REQUEST_URI"]) == "settings-invoice.php") { echo "active"; } ?>"
|
<a class="nav-link <?php if(basename($_SERVER["REQUEST_URI"]) == "settings-invoice-quotes.php") { echo "active"; } ?>"
|
||||||
href="settings-invoice.php">
|
href="settings-invoice-quotes.php">
|
||||||
<i class="fa fa-fw fa-2x fa-file"></i><br>
|
<i class="fa fa-fw fa-2x fa-file"></i><br>
|
||||||
Invoice
|
Invoices / Quotes
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link <?php if(basename($_SERVER["REQUEST_URI"]) == "settings-quote.php") { echo "active"; } ?>"
|
|
||||||
href="settings-quote.php">
|
|
||||||
<i class="fa fa-fw fa-2x fa-file"></i><br>
|
|
||||||
Quote
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
<?php include("header.php"); ?>
|
|
||||||
|
|
||||||
<?php include("settings-nav.php"); ?>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header bg-dark text-white">
|
|
||||||
<h6 class="float-left mt-1"><i class="fa fa-fw fa-file mr-2"></i>Quote Settings</h6>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Quote Prefix</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" name="config_quote_prefix" placeholder="Quote Prefix" value="<?php echo $config_quote_prefix; ?>" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Next Number</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-barcode"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="number" min="0" class="form-control" name="config_quote_next_number" placeholder="Next Quote Number" value="<?php echo $config_quote_next_number; ?>" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group mb-5">
|
|
||||||
<label>Quote Footer</label>
|
|
||||||
<textarea class="form-control" rows="4" name="config_quote_footer"><?php echo $config_quote_footer; ?></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<button type="submit" name="edit_quote_settings" class="btn btn-primary">Save</button>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php include("footer.php");
|
|
||||||
Reference in New Issue
Block a user