Commit 6b711e32 authored by thejoelinux's avatar thejoelinux

detail des emprunts pour les jeux en retard

parent fd175fdf
......@@ -38,6 +38,16 @@
<!-- end of panel -->
</div>
</div>
<!-- edit modal skel -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel">
<div class="modal-dialog">
<div class="modal-content">
</div>
</div>
</div>
<!-- end edit modal -->
<style>
.dataTables_length {
padding-top: 0.25em;
......@@ -45,6 +55,14 @@
</style>
<script>
$(document).ready(function() {
$("#editModal").on("show.bs.modal", function(e) {
var button = $(e.relatedTarget);
$(this).find(".modal-content").load('index.php?o=games&a=loans&i=' + button.data('id'));
}).on("hidden.bs.modal", function(e) {
$(this).find(".modal-content").empty();
});
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
var row = oSettings.aoData[iDataIndex].nTr;
......@@ -86,9 +104,11 @@ $(document).ready(function() {
"render": function(data, type, row) {
if(row.loan_status !== null) {
if(row.loan_status <= -1) {
return '<span style="margin:0.25em;" '
+ ' class="label label-danger">En retard de '
+ (0 - row.loan_status) + ' jour(s)</span>';
return '<button type="button" class="btn btn-danger btn-xs" '
+ ' data-toggle="modal" data-target="#editModal" data-id="' + row.id + '">'
+ '<i class="glyphicon glyphicon-eye-open"></i>'
+ ' <span>En retard de ' + (0 - row.loan_status) + ' jour(s)</span>'
+ '</button>';
}
return 'Emprunté';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment