fixed shortcode edit issues plus refactoring
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
@endsection
|
||||
@section('content')
|
||||
@include('shortcodes.partials.create')
|
||||
@include('client.partials.edit-shortcodes')
|
||||
@include('shortcodes.partials.edit-short-code')
|
||||
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
@@ -93,6 +93,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#shortCodeEditForm').submit(function(evt){
|
||||
evt.preventDefault();
|
||||
var formData = new FormData($(this)[0]);
|
||||
@@ -130,49 +131,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.linkButton', function(){
|
||||
var theVal = $(this).siblings('.hiddenInput').val();
|
||||
console.log('heere at the wall' + theVal );
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: base_url + '/clients/get_shortcode/' + theVal,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
async: false,
|
||||
success: function (data){
|
||||
if (data.code === 1) {
|
||||
console.log(data);
|
||||
$('#shortCodeIDEdit').val(theVal);
|
||||
$('#nameEdit').val(data.result.name);
|
||||
$('#shortCodeClientIdEdit').val(data.result.client_id);
|
||||
$('#shortCodeTypeEdit').val(data.result.code_type);
|
||||
$('#shortCodeEdit').val(data.result.shortcode);
|
||||
$('#tollFreeEdit').val(data.result.toll_free).change();
|
||||
$('#monthlyFeeEdit').val(data.result.monthly_fee);
|
||||
$('#launchDateEdit').val(data.result.launch_date);
|
||||
$('#expiryDateEdit').val(data.result.expiry_date);
|
||||
$('#codeStatusEdit').val(data.result.status).change();
|
||||
$('#network').val(data.result.network).change();
|
||||
$('#remarksEdit').val(data.result.remarks);
|
||||
$('#shortCodeEditModal').modal('show');
|
||||
}
|
||||
else if (data.code > 1) {
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: data.msg,
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: 'Your request could not be handled. Try again !',
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function getShortCodeDetails(id){
|
||||
alert('heere at the wall from that side ' + id);
|
||||
}
|
||||
@@ -220,6 +179,7 @@
|
||||
title: "Short Code",
|
||||
field: "shortcode",
|
||||
sorter: "string",
|
||||
formatter:link,
|
||||
},
|
||||
{ title:"Network",
|
||||
field:"network",
|
||||
|
||||
Reference in New Issue
Block a user