Files
lelong/resources/views/pembida/senaraipembidakeseluruhan.blade.php
T
2023-01-15 12:40:32 +08:00

153 lines
5.8 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col mx-auto p-4">
<div class="card">
<div class="card-header header-style">
<div class="header-style-title">
Senarai pembida
</div>
</div>
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<?php
// $totaluser = count($alluser);
?>
<form id="exportform" action="{{route('pengguna.export')}}" method="POST">
@csrf
<input type="hidden" name="type" value="User">
<table class="table text-center table-bordered" id="pengguna" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<!-- <th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th> -->
<th>Bil</th>
<th>Nama</th>
<th>Nama Pengguna</th>
<th>No Telefon</th>
<th>Emel</th>
<th>Status</th>
<th class="text-center">Tindakan</th>
</tr>
</thead>
<tbody>
@foreach ($alluser as $user)
<tr>
<!-- <td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $user->id }}"></td> -->
<td>{{ $loop->iteration }}</td>
<td align = 'left'>{{ $user->name }}</td>
<td>{{ $user->username }}</td>
<td>{{ $user->notelbimbit }}</td>
<td>{{ $user->email }}</td>
<td>
@if ($user->status =='active')
<button class="btn btn-success btn-sm hovernone-success" disabled>{{$user->status}}</button>
@elseif ($user->status =='banned')
<button class="btn btn-danger btn-sm hovernone-danger" disabled>{{$user->status}}</button>
@elseif ($user->status == 'inactive')
<button class="btn btn-danger btn-sm hovernone-danger" disabled>{{$user->status}}</button>
@else ($user->status == null)
Menunggu Pengesahan Operasi
@endif
</td>
<td class="text-center">
<a class="btn btn-info" href="{{ route('pembida.kemaskini',$user->id) }}" data-toggle="tooltip" data-placement="top" title="Kemaskini Pembida"><i class="fas fa-edit"></i></a>
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
$('a.confirmdel').confirm({
title: 'Confirmation',
content: 'Anda pasti?',
type: 'orange',
typeAnimated: true,
buttons: {
Delete: {
btnClass: 'btn-warning',
action: function () {
location.href = this.$target.attr('href');
}
},
Batal: {
btnClass: 'btn-default',
action: function () {}
}
}
});
var tablepengguna = $('#pengguna').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 5,
"orderable": false
}
],
order: [[0, 'asc']],
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
// 'copy', 'excel', 'pdf'
// { text: 'copy', className: 'btn btn-primary' },
// {
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm adduser',
// text: '<i class="fas fa-plus" id="test"></i>',
// titleAttr: 'Tambah Pembida',
// action: function ( e, dt, node, config ) {
// alert( 'Button activated' );
// }
// },
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Export to PDF',
text: '<i class="fas fa-download"></i>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
}
}
]
});
$('.adduser').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.adduser').removeClass('dt-button');
$( '.export').removeClass('dt-button');
function selectall(cb) {
tablepengguna.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
$(this).prop('checked', cb.checked);
})
}
</script>
@endsection