after a series of bug fixes plus Non MNO logic for Sender IDs, unfinished leave management and holiday modules

This commit is contained in:
Kwesi Banson Jnr
2025-03-19 10:33:04 +00:00
parent 6cede6d980
commit cf39ff2682
112 changed files with 26812 additions and 496 deletions

View File

@@ -14,6 +14,34 @@
$('#textbox1').val(this.checked);
});
*/
function matchCustom(params, data) {
// If there are no search terms, return all of the data
if ($.trim(params.term) === '') {
return data;
}
// Do not display the item if there is no 'text' property
if (typeof data.text === 'undefined') {
return null;
}
// `params.term` should be the term that is used for searching
// `data.text` is the text that is displayed for the data object
if (data.text.indexOf(params.term) > -1) {
var modifiedData = $.extend({}, data, true);
modifiedData.text += ' (matched)';
// You can return modified objects from here
// This includes matching the `children` how you want in nested data sets
return modifiedData;
}
// Return `null` if the term should not be displayed
return null;
}
$('#shortCodeCountry').select2({
matcher: matchCustom
});
$('.progressIndicatorCheckbox').on('change', function() {
// From the other examples
// console.log('finker');
@@ -23,8 +51,45 @@
$('#textbox1').val(sure.toString());
}
});
$("select#shortCodeCountry").change(function(){
var shortCodeCountry = $(this).val();
var theToken = "{{ csrf_token }}";
$.ajax({
type: "POST",
url: base_url + '/mnos/getCountryNetworks',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {"country" : shortCodeCountry },
cache: false,
beforeSend: function () {
console.log('loader here');
//show a loader here
//$('#district').html('<img src="../../img/loading.gif" alt="" width="24" height="24">');
},
success: function(data) {
console.log(data.mnos);
// var jason = JSON.parse(data);
if (data.code === 1) {
var actionPoint = $('#networks').empty();
console.log(actionPoint);
$.each(data.mnos, function(key, value) {
console.log(id);
console.log(row);
//$('#networks').append($("<option />").val(row.id).text(row.name));
});
}
else {
console.log(data);
$.alert(data.msg);
}
},
fail : function(errordata){
console.log(errordata);å
}
});
});
$('select').select2();
$('#myDatepicker2').datetimepicker({
format: 'YYYY-MM-DD',
@@ -68,7 +133,6 @@
});
$('#createSenderIdBtn').click(function(evt){
evt.preventDefault();
console.log('Heere at the wall');
$('#newSenderIdFormModal').modal('show');
});
@@ -92,6 +156,7 @@
contentType: false,
async: false,
success: function (data){
console.log(data);
if (data.code === 1) {
// console.log(theIDD);
$('#paymentIdEdit').val(theIDD);
@@ -99,6 +164,7 @@
$('#invoiceNumberEdit').val(data.result.invoice_number);
$('#invoiceAmountEdit').val(data.result.invoice_amount);
$('#invoiceDateEdit').val(data.result.invoice_date);
$('#financeShortCodeEdit').val(data.result.short_code);
$('#invoiceStatusEdit').val(data.result.invoice_status).change();
$('#remarksEdit').val(data.result.remarks);
$('#financePaymentsEditForm').modal('show');
@@ -141,6 +207,7 @@
$('#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();

36
public/assets/js/senderid.js vendored Normal file
View File

@@ -0,0 +1,36 @@
$(document).ready(function(){
$('#directMno').change(function(tve){
tve.preventDefault();
// var theIDD = $(this).siblings('.shortCodeEntryRowId').val();
var directMnoSelection = $(this).val();
$.ajax({
type: "GET",
url: base_url + '/senderids/get-mno-list/' + directMnoSelection,
processData: false,
contentType: false,
async: false,
success: function (data){
if (data.code === 1) {
$('#networkName').empty();
$.each(data.result, function(id, row) {
// console.log(row);
$('#networkName').append($("<option />").val(row.id).text(row.name));
});
}
else if (data.code > 1) {
$.alert({
title: 'Alert!',
content: data.msg,
});
}
else {
$.alert({
title: 'Alert!',
content: 'Your request could not be handled. Try again !',
});
}
}
});
});
});

44
public/assets/js/vpn_configs.js vendored Normal file
View File

@@ -0,0 +1,44 @@
$(document).ready(function(){
$('#dateReceived').datetimepicker({
format: 'YYYY-MM-DD'
});
$('#partnerType').change(function(tve){
tve.preventDefault();
// var theIDD = $(this).siblings('.shortCodeEntryRowId').val();
var selectedPartnerType = $(this).val();
$.ajax({
type: "GET",
url: base_url + '/infrastructure/get-vpn-partner-list/' + selectedPartnerType,
processData: false,
contentType: false,
async: false,
success: function (data){
if (data.code === 1) {
$('#partnerTypeID').empty();
$.each(data.result, function(id, row) {
// console.log(row);
$('#partnerTypeID').append($("<option />").val(row.id).text(row.partner));
});
// $('#partnerTypeIDd').val(data.result).change();
// $('#codeStatusEdit').val(data.result.status).change();
// $('#network').val(data.result.network).change();
}
else if (data.code > 1) {
$.alert({
title: 'Alert!',
content: data.msg,
});
}
else {
$.alert({
title: 'Alert!',
content: 'Your request could not be handled. Try again !',
});
}
}
});
});
});