Skip to content

Instantly share code, notes, and snippets.

@rafgugi
Last active January 23, 2017 07:05
Show Gist options
  • Save rafgugi/4b436fbcfbda420fa5015873e11d4bba to your computer and use it in GitHub Desktop.
Save rafgugi/4b436fbcfbda420fa5015873e11d4bba to your computer and use it in GitHub Desktop.
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width:5%">No</th>
<th style="width:40%">Diet</th>
<th style="width:15%">Tgl AF</th>
<th style="width:20%">Perawat</th>
<th style="width:15%">Keterangan</th>
<th class="text-center" style="width:5%" title="Pengaturan"><i class="fa fa-cog"></i></th>
</tr>
</thead>
<tbody>
@foreach ($inap->catatan_order->where('jenis', ORDER_Diet) as $order)
<tr>
<td style="width:5%">{{$loop->iteration}}</td>
<td style="width:40%">{{$order->uraian}}</td>
<td style="width:15%">{{date_view($order->tanggal)}}</td>
<td style="width:20%">{{$order->perawat->nama}}</td>
<td style="width:15%">{{$order->keterangan}}</td>
<td style="width:5%">
<button type="button" class="btn btn-sm btn-danger hapus" title="Hapus" data-id="{{$order->id}}">
<i class="fa fa-close"></i>
</button>
</td>
</tr>
@endforeach
<tr>
<td>{{$inap->catatan_order->where('jenis', ORDER_Diet)->count() + 1}}</td>
<td><input type="text" name="uraian" class="form-control" placeholder=""></td>
<td>
<div class="input-group date">
<input type="text" name="tanggal" class="form-control pull-right datepicker">
</div>
</td>
<td><select type="text" name="perawat_id" class="selectize-perawat"></select></td>
<td><input type="text" name="keterangan" class="form-control" placeholder="3x Sehari"></td>
<td class="text-center">
<button class="btn btn-sm btn-primary" title="Tambahkan">
<i class="fa fa-plus"></i>
</button>
</td>
</tr>
</tbody>
</table>
<script>
$(".hapus").click(function(){
id = $(this).data('id');
$.ajax({
url: '/admin/inap/{{$inap->id}}/order/' + id,
method: 'post',
data: {
_token: '{{csrf_token()}}',
_method: 'delete',
},
success: function(data) {
location.reload();
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment