shift open/close

This commit is contained in:
Nweni
2017-06-29 13:35:09 +06:30
parent 45961880c8
commit 618a89472a
20 changed files with 320 additions and 18 deletions

View File

@@ -0,0 +1,79 @@
<div class='row'>
<div class="col-lg-11 col-md-11 col-sm-11">
<h2> Payment Credit </h2>
<br>
<table class='table table-striped'>
<tr>
<td> Payment Reference
</td>
<td><input type='text' id='reference'/></td>
</tr>
<tr>
<td> Remark
</td>
<td><input type="text" id='remark'/></td>
</tr>
<tr>
<td> Payment Method
</td>
<td>
<button class='btn btn-primary payment-type' data-id='cash' id='cash'>CASH</button>
<button class='btn btn-primary payment-type' data-id='mpu' id='mpu'>MPU</button>
<button class='btn btn-primary payment-type' data-id='visa' id='visa'>VISA</button>
<button class='btn btn-primary payment-type' data-id='jcb' id='jcb'>JCB</button>
</td>
</tr>
</table>
<div class='row'>
<div class='col-md-2'></div>
<div class='col-md-2'>Reference Number </div>
<div class='col-md-4'><input type='text' id='payment_method_reference'/> </div>
</div>
<br>
<div class='row'>
<div class='col-md-2'></div>
<div class='col-md-2'>Amount</div>
<div class='col-md-4'><input type='text' id='amount'/></div>
</div>
<br><br>
<div class='row'>
<div class='col-md-3'></div>
<div class='col-md-4'><button class='btn btn-primary btn-lg' id='cash_in' style='width:200px;'> Cash In</button></div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button class='btn btn-primary ' id='cash_in' style='width:100px;'> Back </button>
</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';
}
});
})
</script>