+ Update historiques des transactions

This commit is contained in:
Djery-Tom 2020-07-17 14:46:50 +01:00
parent 89e9f5d503
commit eae6ee845a
3 changed files with 63 additions and 22 deletions

View File

@ -2020,5 +2020,44 @@ class Gestion extends CI_Controller
}
}
public function cancelIlinkTransation()
{
if ($this->isLogged()) {
if (isset($_POST)) {
$id_transacton = $_POST['id_transaction'];
/* API URL */
$url = $this->db->wallet_service_url . '/transactions/ilink/' . $id_transacton;
/* Init cURL resource */
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
/* set the content type json */
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type:application/json',
'Authorization: yhSTSSqIO1uSE1icu09edPOeSFGxIDjo'
));
/* set return type json */
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
/* execute request */
$result = curl_exec($ch);
/* close cURL resource */
curl_close($ch);
if ($result) {
echo json_encode("200");
} else {
echo json_encode("500");
}
}
}
}
}

View File

@ -519,7 +519,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
class="col-form-label"><?php echo $this->lang->line('rate_com_agent_depot_autre_wallet_national'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new10"><i
<button type="button" class="btn btn-info add-new new99"><i
class="fa fa-plus"></i> <?php echo $this->lang->line('new_level'); ?>
</button>
</div>
@ -543,9 +543,9 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>" . '
<td>
<a class="add add10" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit10" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete10" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
<a class="add add99" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit99" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete99" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
@ -1229,14 +1229,14 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(".new9").removeAttr("disabled");
});
// Table 10
var actions10 = $("#agent_depot_autre_wallet_national td:last-child").html();
// Table 99
var actions99 = $("#agent_depot_autre_wallet_national td:last-child").html();
// Append table with add row form on add new button click
$(".new10").click(function () {
if (!actions10) {
actions10 = '<a class="add add10" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE010B;</i></a>\n' +
' <a class="edit edit10" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete10" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE10102;</i></a>';
$(".new99").click(function () {
if (!actions99) {
actions99 = '<a class="add add99" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE099B;</i></a>\n' +
' <a class="edit edit99" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete99" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE99992;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#agent_depot_autre_wallet_national tbody tr:last-child").index();
@ -1244,14 +1244,14 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required class="form-control" name="taux" id="taux"></td>' +
'<td> ' + actions10 + '</td>' +
'<td> ' + actions99 + '</td>' +
'</tr>';
$("#agent_depot_autre_wallet_national").append(row);
$("#agent_depot_autre_wallet_national tbody tr").eq(index + 1).find(".add, .edit").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add10", function () {
$(document).on("click", ".add99", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
@ -1290,11 +1290,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new10").removeAttr("disabled");
$(".new99").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit10", function () {
$(document).on("click", ".edit99", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
@ -1304,14 +1304,15 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new10").attr("disabled", "disabled");
$(".new99").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete10", function () {
$(document).on("click", ".delete99", function () {
$(this).parents("tr").remove();
$(".new10").removeAttr("disabled");
$(".new99").removeAttr("disabled");
});
// Table 11
var actions11 = $("#agent_cash_cash_national td:last-child").html();
// Append table with add row form on add new button click

View File

@ -195,8 +195,9 @@ use Brick\Money\Money;
?>
<?php if ($this->session->userdata('category') != 'super') { ?>
<td>
<button data-id-transaction="<?= $row->id ?>" id="cancel" class="btn btn-danger btn-block" <?php if($row->canceled) echo "disabled"?> >
<b><?php echo $this->lang->line('cancel')?></b>
<button data-id-transaction="<?= $row->id_transaction ?>" id="cancel"
class="btn btn-danger btn-block" <?php if ($row->canceled) echo "disabled" ?> >
<b><?php echo $this->lang->line('cancel') ?></b>
</button>
</td>
<?php } ?>