mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Added Currency Selection to Add Currency and Edit
This commit is contained in:
@@ -22,6 +22,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md">
|
||||||
|
<label>Currency <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-money-bill"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="currency_code" required>
|
||||||
|
<option value="">- Currency -</option>
|
||||||
|
<?php foreach($currencies_array as $currency_code => $currency_name) { ?>
|
||||||
|
<option <?php if($config_default_currency == $currency_code){ echo "selected"; } ?> value="<?php echo $currency_code; ?>"><?php echo "$currency_code - $currency_name"; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md">
|
<div class="form-group col-md">
|
||||||
<label>Amount <strong class="text-danger">*</strong></label>
|
<label>Amount <strong class="text-danger">*</strong></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|||||||
@@ -23,6 +23,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md">
|
||||||
|
<label>Currency <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-money-bill"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control select2" name="currency_code" required>
|
||||||
|
<option value="">- Currency -</option>
|
||||||
|
<?php foreach($currencies_array as $currency_code => $currency_name) { ?>
|
||||||
|
<option <?php if($revenue_currency_code == $currency_code){ echo "selected"; } ?> value="<?php echo $currency_code; ?>"><?php echo "$currency_code - $currency_name"; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md">
|
<div class="form-group col-md">
|
||||||
<label>Amount <strong class="text-danger">*</strong></label>
|
<label>Amount <strong class="text-danger">*</strong></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|||||||
6
post.php
6
post.php
@@ -2960,13 +2960,14 @@ if(isset($_POST['add_revenue'])){
|
|||||||
|
|
||||||
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
||||||
$amount = floatval($_POST['amount']);
|
$amount = floatval($_POST['amount']);
|
||||||
|
$currency_code = strip_tags(mysqli_real_escape_string($mysqli,$_POST['currency_code']));
|
||||||
$account = intval($_POST['account']);
|
$account = intval($_POST['account']);
|
||||||
$category = intval($_POST['category']);
|
$category = intval($_POST['category']);
|
||||||
$payment_method = strip_tags(mysqli_real_escape_string($mysqli,$_POST['payment_method']));
|
$payment_method = strip_tags(mysqli_real_escape_string($mysqli,$_POST['payment_method']));
|
||||||
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
|
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
|
||||||
$reference = strip_tags(mysqli_real_escape_string($mysqli,$_POST['reference']));
|
$reference = strip_tags(mysqli_real_escape_string($mysqli,$_POST['reference']));
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO revenues SET revenue_date = '$date', revenue_amount = '$amount', revenue_currency_code = '$config_default_currency', revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_created_at = NOW(), category_id = $category, account_id = $account, company_id = $session_company_id");
|
mysqli_query($mysqli,"INSERT INTO revenues SET revenue_date = '$date', revenue_amount = '$amount', revenue_currency_code = '$currency_code', revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_created_at = NOW(), category_id = $category, account_id = $account, company_id = $session_company_id");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Revenue', log_action = 'Created', log_description = '$date - $amount', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Revenue', log_action = 'Created', log_description = '$date - $amount', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||||
@@ -2982,13 +2983,14 @@ if(isset($_POST['edit_revenue'])){
|
|||||||
$revenue_id = intval($_POST['revenue_id']);
|
$revenue_id = intval($_POST['revenue_id']);
|
||||||
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
||||||
$amount = floatval($_POST['amount']);
|
$amount = floatval($_POST['amount']);
|
||||||
|
$currency_code = strip_tags(mysqli_real_escape_string($mysqli,$_POST['currency_code']));
|
||||||
$account = intval($_POST['account']);
|
$account = intval($_POST['account']);
|
||||||
$category = intval($_POST['category']);
|
$category = intval($_POST['category']);
|
||||||
$payment_method = strip_tags(mysqli_real_escape_string($mysqli,$_POST['payment_method']));
|
$payment_method = strip_tags(mysqli_real_escape_string($mysqli,$_POST['payment_method']));
|
||||||
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
|
$description = strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']));
|
||||||
$reference = strip_tags(mysqli_real_escape_string($mysqli,$_POST['reference']));
|
$reference = strip_tags(mysqli_real_escape_string($mysqli,$_POST['reference']));
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE revenues SET revenue_date = '$date', revenue_amount = '$amount', revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_updated_at = NOW(), category_id = $category, account_id = $account WHERE revenue_id = $revenue_id AND company_id = $session_company_id");
|
mysqli_query($mysqli,"UPDATE revenues SET revenue_date = '$date', revenue_amount = '$amount', revenue_currency_code = '$currency_code', revenue_payment_method = '$payment_method', revenue_reference = '$reference', revenue_description = '$description', revenue_updated_at = NOW(), category_id = $category, account_id = $account WHERE revenue_id = $revenue_id AND company_id = $session_company_id");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Revenue', log_action = 'Modified', log_description = '$revenue_id', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Revenue', log_action = 'Modified', log_description = '$revenue_id', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
$revenue_date = $row['revenue_date'];
|
$revenue_date = $row['revenue_date'];
|
||||||
$revenue_payment_method = $row['revenue_payment_method'];
|
$revenue_payment_method = $row['revenue_payment_method'];
|
||||||
$revenue_amount = $row['revenue_amount'];
|
$revenue_amount = $row['revenue_amount'];
|
||||||
|
$revenue_currency_code = $row['revenue_currency_code'];
|
||||||
$revenue_created_at = $row['revenue_created_at'];
|
$revenue_created_at = $row['revenue_created_at'];
|
||||||
$account_id = $row['account_id'];
|
$account_id = $row['account_id'];
|
||||||
$account_name = $row['account_name'];
|
$account_name = $row['account_name'];
|
||||||
|
|||||||
Reference in New Issue
Block a user