after a series of bug fixes plus Non MNO logic for Sender IDs, unfinished leave management and holiday modules
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<link href="{!! url('public/assets/vendors/tabulator/css/bootstrap/tabulator_bootstrap.css') !!}" type="text/css" rel="stylesheet">
|
||||
@endsection
|
||||
@section('content')
|
||||
@include('client.partials.edit-shortcodes')
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
<div class="title_left">
|
||||
@@ -54,7 +55,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 form-group pull-left top_search" style="margin-top: -2px;">
|
||||
<div class="input-group bg-info">
|
||||
<div class="input-group bg-danger">
|
||||
<input type="text" name="keyword" class="form-control" id="keywordField" placeholder="Keyword here...">
|
||||
<span class="input-group-btn">
|
||||
<!-- <button type="submit" class="btn btn-primary" style="color: #fff;" type="button">Go!</button> -->
|
||||
@@ -89,16 +90,100 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
function link(cell, formatterParams){
|
||||
var url = cell.getValue();
|
||||
var rowID = cell.getData().id
|
||||
return "<a href='"+ base_url + "/smsshortcodes/"+rowID+"' class='btn btn-link'>"+url+"</a>";
|
||||
//return '<a href="'+ base_url + '"/clients/"'+rowID+'" class="btn btn-link">'+ url +'</a>';
|
||||
$('#shortCodeEditForm').submit(function(evt){
|
||||
evt.preventDefault();
|
||||
var formData = new FormData($(this)[0]);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: base_url + '/clients/shortcode_update',
|
||||
data : formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
async: false,
|
||||
success: function (data){
|
||||
if (data.code === 1) {
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: 'Short Code Details successfully updated',
|
||||
});
|
||||
setTimeout(function(){
|
||||
location.reload();
|
||||
}, 8000);
|
||||
}
|
||||
else if (data.code > 1) {
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: data.msg,
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: 'Your request could not be handled. Try again !',
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(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);
|
||||
}
|
||||
function link(cell, formatterParams){
|
||||
var url = cell.getValue();
|
||||
var rowID = cell.getData().id
|
||||
return "<a href='"+ base_url + "/smsshortcodes/"+rowID+"/edit' class='btn btn-link'>"+url+"</a>";
|
||||
//use rowID to fetch details from DB and populate form on the modal
|
||||
// return "<a href='"+ base_url + "/smsshortcodes/"+rowID+"/edit' class='btn btn-link' >"+url+"</a>";
|
||||
|
||||
|
||||
|
||||
//return "<input type='button' class='btn btn-link linkButton' value='" + url + "' name='" + url + "'/>";
|
||||
return "<input type='hidden' class='hiddenInput' value='" + rowID + "' name='" + url + "'/><button type='button' class='btn btn-link linkButton' >"+url+"</button>";
|
||||
// return "<a href='' class='btn btn-link'>"+url+"</a>";
|
||||
}
|
||||
function cellDesign (cell, formatterParams){
|
||||
var value = cell.getValue();
|
||||
@@ -122,12 +207,12 @@
|
||||
printAsHtml: true,
|
||||
ajaxLoaderLoading: $('#logo_spinner').html(),
|
||||
columns: [
|
||||
{
|
||||
title: "Friendly Name",
|
||||
field: "name",
|
||||
sorter: "string",
|
||||
formatter:link,
|
||||
},
|
||||
// {
|
||||
// title: "Friendly Name",
|
||||
// field: "name",
|
||||
// sorter: "string",
|
||||
// formatter:link,
|
||||
// },
|
||||
{
|
||||
title: "Short Code",
|
||||
field: "shortcode",
|
||||
@@ -141,6 +226,10 @@
|
||||
field:"clientName",
|
||||
sorter:"string",
|
||||
},
|
||||
{ title:"Monthly Fee",
|
||||
field:"monthly_fee",
|
||||
sorter:"string",
|
||||
},
|
||||
{
|
||||
title: "Status",
|
||||
field: "status",
|
||||
@@ -167,10 +256,21 @@
|
||||
// table.download("xlsx", "client-list.xlsx", {sheetName:"Sheet 1"});
|
||||
// });
|
||||
|
||||
rowClick:function(e, row){
|
||||
var userID = row.getData().id;
|
||||
//$('#userEditModal').modal('show');
|
||||
},
|
||||
//rowClick:function(e, row){
|
||||
//var shortCodeID = row.getData().id;
|
||||
//alert("heere at the wall, ID is " + shortCodeID );
|
||||
//getShortCodeDetails(shortCodeID);
|
||||
// $('#userEditModal').modal('show');
|
||||
//},
|
||||
// cellClick:function(e, cell){
|
||||
//e - the click event object
|
||||
//cell - cell component
|
||||
// var theHead = cell.getCell();
|
||||
// var shortCodeId = cell.getData();
|
||||
// console.log(cell);
|
||||
// console.log(shortCodeId.id);
|
||||
// console.log(theHead);
|
||||
// },
|
||||
});
|
||||
document.getElementById("smscodes-download-xlsx").addEventListener("click", function(){
|
||||
table.download("xlsx", "sms-shortcode-list.xlsx", {sheetName:"Sheet 1"});
|
||||
@@ -184,7 +284,6 @@
|
||||
});
|
||||
|
||||
$('#keywordField').on('keyup', function(){
|
||||
console.log('up');
|
||||
var keyword = $(this).val();
|
||||
table.setData("smsshortcodes/all?keyword=" + keyword + "&code_type=sms");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user