change ui
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
<th>Karat</th>
|
||||
<th>Berat</th>
|
||||
<th>Nota</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
@@ -137,7 +138,7 @@
|
||||
<input type="text" name="kadarkeuntungan" id="kadarkeuntungan" value="" hidden>
|
||||
<input type="text" name="kuantiti_marhun" id="kuantiti_marhun" value="" hidden>
|
||||
<input type="text" name="total_nilai_marhun" id="total_nilai_marhun" value="" hidden>
|
||||
<a href="{{ url()->previous() }}" class="float-right btn btn-danger mr-2">Batal</a>
|
||||
<a href="{{ route('gadai.batal',['norujukan'=>$norujukan]) }}" class="float-right btn btn-danger mr-2">Batal</a>
|
||||
<input type="submit" name="terima_gadai" id="terima_gadai" class="float-right btn btn-primary mr-2" value="Terima">
|
||||
</div>
|
||||
</div>
|
||||
@@ -337,7 +338,8 @@
|
||||
'RM ' + formatter.format(marhun_detail['n_marhun']),
|
||||
marhun_detail['karat'],
|
||||
formatter.format(marhun_detail['berat']),
|
||||
marhun_detail['nota']
|
||||
marhun_detail['nota'],
|
||||
"<button onclick='deletemarhun(this)' class='btn btn-danger'><i class='fas fa-trash-alt'></i></button>"
|
||||
]).draw();
|
||||
counter = counter + 1;
|
||||
});
|
||||
@@ -379,6 +381,30 @@
|
||||
});
|
||||
}
|
||||
|
||||
function deletemarhun(e)
|
||||
{
|
||||
let marhun = $(e).closest('tr').children('td:eq(1)').text();
|
||||
let norujuk = $('#norujukan').val();
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: '{{ route("gadai.editmarhun") }}',
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujuk,
|
||||
"marhun" : marhun
|
||||
},
|
||||
success:function(data)
|
||||
{
|
||||
console.log(data);
|
||||
location.reload();
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#pinjaman').on('input',function(){
|
||||
var pinjaman = Number(this.value);
|
||||
var nilaimarhun = Number($('#jumlah_nilai_marhun').val());
|
||||
|
||||
Reference in New Issue
Block a user