90 lines
2.8 KiB
Plaintext
Executable File
90 lines
2.8 KiB
Plaintext
Executable File
<div class="container-fluid">
|
|
<div class='row'>
|
|
<div class="col-lg-10 col-md-10 col-sm-10">
|
|
<h2> Cash In </h2>
|
|
<br>
|
|
<table class='table table-striped'>
|
|
<tr>
|
|
<td> Payment Reference
|
|
</td>
|
|
<td>
|
|
<input type="text" class="form-control" placeholder="Reference" id="reference">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Remark
|
|
</td>
|
|
<td>
|
|
<input type="text" class="form-control" placeholder="Remark" id="remark">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Payment Method
|
|
</td>
|
|
<td>
|
|
<button class='btn bg-blue waves-effect payment-type' data-id='cash' id='cash'>CASH</button>
|
|
<button class='btn bg-blue waves-effect payment-type' data-id='mpu' id='mpu'>MPU</button>
|
|
<button class='btn bg-blue waves-effect payment-type' data-id='visa' id='visa'>VISA</button>
|
|
<button class='btn bg-blue waves-effect payment-type' data-id='jcb' id='jcb'>JCB</button>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Reference Number
|
|
</td>
|
|
<td>
|
|
<input type="text" class="form-control" id="payment_method_reference">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td> Amount
|
|
</td>
|
|
<td>
|
|
<input type="text" class="form-control" placeholder="Amount" id="amount">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="col-lg-2 col-md-2 col-sm-2 ">
|
|
<div class="button-demo">
|
|
<button type="button" class="btn bg-default waves-effect btn-" id='back'> Back </button>
|
|
<button type="button" class="btn bg-blue waves-effect btn-" id='cash_in'> Cash In </button>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
var payment_method = "";
|
|
$('.payment-type').on('click',function(){
|
|
$('.payment-type').css("background-color","#7a62d3")
|
|
$(this).css("background-color","green");
|
|
var type = $(this).attr('data-id')
|
|
if(type == 'cash'){
|
|
payment_method = 'cash';
|
|
}else if(type == 'mpu'){
|
|
payment_method = "mpu";
|
|
}else if(type == 'visa'){
|
|
payment_method = "visa";
|
|
}else if(type == 'jcb'){
|
|
payment_method = "jcb";
|
|
}
|
|
})
|
|
$('#cash_in').on('click',function(){
|
|
var reference = $('#reference').val();
|
|
var remark = $('#remark').val();
|
|
var amount = $('#amount').val();
|
|
var payment_method_reference = $('#payment_method_reference').val();
|
|
$.ajax({type: "POST",
|
|
url: "<%= origami_cash_ins_path %>",
|
|
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount + "&payment_method="+payment_method + "&payment_method_reference="+ payment_method_reference,
|
|
success:function(result){
|
|
window.location.href = '/origami';
|
|
}
|
|
});
|
|
})
|
|
$('#back').on('click',function(){
|
|
window.location.href = '/origami';
|
|
})
|
|
</script>
|