mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
ALPHA 3.0.2
This commit is contained in:
@@ -4,12 +4,10 @@
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Activitées des utilisateurs <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
<strong class="card-title">Messages au staff<a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block">Afficher toutes les activitées</button>
|
||||
<hr>
|
||||
<table id="log-data" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -19,17 +17,25 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i = 0; ?>
|
||||
@while ($i < $messages->count())
|
||||
<tr>
|
||||
@for ($i = 0; $i < 3; $i++)
|
||||
<td>
|
||||
{{$messages[$i]->title}}
|
||||
<p>{{$messages[$i]->body}}</p>
|
||||
</td>
|
||||
@endfor
|
||||
</tr>
|
||||
@endwhile
|
||||
<?php
|
||||
$messages = $messages->sortByDesc('created_at');
|
||||
$messages = $messages->values();
|
||||
|
||||
$nbOfMsg = $messages->count();
|
||||
$nbOfRow = ceil($nbOfMsg/3);
|
||||
|
||||
for ($i=0; $i < $nbOfRow ; $i++) {
|
||||
echo '<tr>';
|
||||
for ($e=0; $e < 3 ; $e++) {
|
||||
if ($e+(3*$i) < $nbOfMsg) {
|
||||
echo '<td style="width:33%;"><a href="/admin/message/'.$messages[$e+(3*$i)]->id.'"><h3>'.$messages[$e+(3*$i)]->title.'</h3><br><h6>'.\App\User::find($messages[$e+(3*$i)]->user_id)->fullname().' - '.$messages[$e+(3*$i)]->created_at.'</h6><hr><div style="overflow:hidden;height:13.5rem;">'.$messages[$e+(3*$i)]->body.'</div></a><div class="float-right"><a href="/admin/message/edit/'.$messages[$e+(3*$i)]->id.'" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i> Modifier</a><a type="button" class="btn btn-danger" onclick="deleteEvent('.$messages[$e+(3*$i)]->id.');"><i class="fa fa-times-circle" style="color:white;"></i></a></div></td>';
|
||||
} else {
|
||||
echo '<td></td>';
|
||||
}
|
||||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -73,12 +79,47 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
$(document).ready(function() {
|
||||
$('#log-data').DataTable({
|
||||
"ordering": false,
|
||||
"lengthMenu": [[3, 4, -1], [9, 12, "All"]],
|
||||
});
|
||||
} );
|
||||
})(jQuery);
|
||||
$(document).ready(function() {
|
||||
$('#log-data').DataTable({
|
||||
"ordering": false,
|
||||
"order": [],
|
||||
"lengthMenu": [[3, 4, -1], [9, 12, "All"]],
|
||||
});
|
||||
} );
|
||||
})(jQuery);
|
||||
|
||||
function deleteEvent(pid){
|
||||
swal({
|
||||
title: 'Êtes vous certain ?',
|
||||
text: "Vous ne pourrez annuler cette action",
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
|
||||
(function($) {
|
||||
$.post('/api/message/delete?api_token='+api_token, { id: pid } , function(data) {
|
||||
console.log('Delete');
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
swal(
|
||||
'Supprimé!',
|
||||
"Le message a été supprimé",
|
||||
'success'
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user