Files
lelong/resources/views/simulasi/senaraisimulasi.blade.php
T
2022-08-03 16:44:24 +08:00

142 lines
5.3 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportform" action="" method="POST">
<input type="hidden" name="type" value="User">
<table class="table table-striped table-xl text-center" id="simulasi" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
<th>ID Lelong</th>
<th>Tarikh Lelong</th>
<th>Fasa</th>
<th>Cawangan</th>
<th>Harga Asas (RM)</th>
<th class="text-center">Tindakan</th>
</tr>
</thead>
<tbody>
@foreach ($arrayinfo as $info)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$info['info']['simulasi_id']}}</td>
<td>
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $info['info']['tarikh_lelong'] );
$t_lelong = $myDateTime->format('d-m-Y');
echo($t_lelong);
@endphp
</td>
<td>{{$info['info']['fasa']}}</td>
<td align = 'left'>
@foreach($info['detailsinfo'] as $info2)
{{$info2['caw_name']}}<br>
@endforeach
</td>
<td>{{ $info['info']['harga_emas_asas'] }}</td>
<td class="text-center">
<a href="{{ route('analisa.kemaskinidata',$info['info']['simulasi_id']) }}" data-toggle="tooltip" data-placement="top" title="Kemaskini Data" style="margin-right:40px"><i class="fas fa-sync-alt"></i></a>
<a href="{{ route('analisa.show',$info['info']['simulasi_id']) }}" data-toggle="tooltip" data-placement="top" title="Butiran Simulasi" style="margin-right:30px"><i class="far fa-edit"></i></a>
<a class="confirmdel" href="{{ route('analisa.delete',$info['info']['simulasi_id']) }}" data-toggle="tooltip" data-placement="top" title="Hapus"><i class="far fa-trash-alt"></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 tablesimulasi = $('#simulasi').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 4,
"orderable": false
}
],
// "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 addsim',
// text: '<i class="fas fa-plus" id="test"></i>',
// titleAttr: 'Tambah Simulasi',
// action: function ( e, dt, node, config ) {
// alert( 'Button activated' );
// }
// },
// {
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
// titleAttr: 'Export to CSV',
// text: '<i class="fas fa-download"></i>',
// action: function ( e, dt, node, config ) {
// $("#exportform").submit();
// }
// }
// ]
});
$('.addsim').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.addsim').removeClass('dt-button');
$( '.export').removeClass('dt-button');
function selectall(cb) {
tablesimulasi.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
$(this).prop('checked', cb.checked);
})
}
</script>
@endsection