1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
{% block basketadmin_body %}
<link rel="stylesheet" href="{{ asset('bundles/basketlibrairy/plugins/select2/select2.min.css') }}">
<script type="text/javascript" charset="utf8" src="{{ asset('bundles/basketlibrairy/plugins/jQuery/jQuery-2.1.4.min.js') }}"></script>
<script src="{{ asset('bundles/basketlibrairy/plugins/select2/select2.full.min.js') }}"></script>
<div id="test">
<table class="table table-bordered table-color">
<tr>
<th>Jour</th>
<th>Heure</th>
<th>Poste</th>
<th>Personne</th>
<th>Action</th>
</tr>
{% for game in listgamedays %}
{% for tableGame in game.tableGames %}
{% if tableGame.roleOTM.name == 'chronometreur' %}
<tr>
<td rowspan="2">{{ game.dateGame|date('d-m-Y') }}</td>
<td rowspan="2">{{ game.hourBegin|date('H:i:s') }}</td>
<td>{{ tableGame.roleOTM.name }}</td>
{% if tableGame.user %}
<td> {{ tableGame.user.username }} </td>
{% elseif tableGame.outsider %}
<td> {{ tableGame.outsider.name }} </td>
{% else %}
<td>Personne</td>
{% endif %}
{% if tableGame.user or tableGame.outsider %}
<td>
<a href="{{path('basket_admin_choose_user_table', { 'id_game': game.id, 'poste_name': tableGame.roleOTM.name, 'id_day': day.id }) }}" class="btn btn-info btn--sqxs btn-load-modal" title="Modifier">
<i class="fa fa-pencil"></i>
</a>
<a href="{{path('basket_table_remove_user_table', { 'id_game': game.id, 'poste_name': tableGame.roleOTM.name, 'id_day': day.id }) }}" class="btn btn-sq-xs btn-danger" data-toggle="tooltip" title="Supprimer">
<i class="fa fa-times"></i>
</a>
</td>
{% else %}
<td>
<a href="{{path('basket_admin_choose_user_table', { 'id_game': game.id, 'poste_name': tableGame.roleOTM.name, 'id_day': day.id }) }}" class="btn btn-info btn-sq-xs btn-load-modal" title="Ajouter">
<i class="fa fa-plus"></i>
</a>
</td>
{% endif %}
</tr>
{% else %}
<tr>
<td>{{ tableGame.roleOTM.name }}</td>
{% if tableGame.user %}
<td> {{ tableGame.user.username }} </td>
{% elseif tableGame.outsider %}
<td> {{ tableGame.outsider.name }} </td>
{% else %}
<td>Personne</td>
{% endif %}
{% if tableGame.user or tableGame.outsider %}
<td>
<a href="{{path('basket_admin_choose_user_table', { 'id_game': game.id, 'poste_name': tableGame.roleOTM.name, 'id_day': day.id }) }}" class="btn btn-info btn-sq-xs btn-load-modal" title="Modifier">
<i class="fa fa-pencil"></i>
</a>
<a href="{{path('basket_table_remove_user_table', { 'id_game': game.id, 'poste_name': tableGame.roleOTM.name, 'id_day': day.id }) }}" class="btn btn-sq-xs btn-danger" data-toggle="tooltip" title="Supprimer">
<i class="fa fa-times"></i>
</a>
</td>
{% else %}
<td>
<a href="{{path('basket_admin_choose_user_table', { 'id_game': game.id, 'poste_name': tableGame.roleOTM.name, 'id_day': day.id }) }}" class="btn btn-info btn-sq-xs btn-load-modal" title="Ajouter">
<i class="fa fa-plus"></i>
</a>
</td>
{% endif %}
</tr>
{% endif %}
{% endfor %}
{% endfor %}
</table>
</div>
<style>
.table-color {
border: 1px solid #000000;
}
</style>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
</div>
</div>
</div>
</div><br><br>
<script>
$("#test").on('click', '.btn-load-modal', function (e) {
$.ajax({
type: "POST",
url: $(this).attr("href"),
success: function (data) {
$('.modal-body').html(data);
},
complete: function () {
},
beforeSend: function () {
$('#myModal').modal('toggle');
$('.modal-body').html("<div class='progress' id='loadingDiv'><div class='progress-bar progress-bar-striped progress-bar-success active' role='progressbar' \n\
aria-valuenow='100' aria-valuemin='0' aria-valuemax='100' style='width: 100%'></div></div>");
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
return false;
});
</script>
{% endblock %} |
Partager