ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 18.117.100.157 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/storage/framework/views/ |
Upload File : |
<script> function addcomma(num){ return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")) num.replace(/[ ]*,[ ]*|[ ]+/g, ''); } // Get the modal var modal = document.getElementById('myModal'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal btn.onclick = function() { modal.style.display = "block"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } btnClose.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "block"; } } </script> <!--customized--> <script type="text/javascript"> //DATE $( function(){ $("#awardDate").datepicker({changeMonth: true,changeYear: true,dateFormat: 'yy-mm-dd'}); $(".awardDateEdit").datepicker({changeMonth: true,changeYear: true,dateFormat: 'yy-mm-dd'}); }); //end DATE //refreshPage $(document).ready(function() { $('#refreshPage').click(function() { location.reload(); }); }); </script> <script> //Read and print all contract description $(document).ready(function() { $('.getAllValue').click(function() { var getID = this.id; var allValue = $('#getAllValue' + getID).val(); alert(allValue); }); }); </script> <script> //Upload File with Ajax (errorCallBack) $(document).ready(function() { $('.showFileModal').click(function() { var contractID = this.id; $('#recordID').val(contractID); $('#showContractorName').html($('#getcontractorName' + contractID).val()); $('#myBtn').click(); // //--code.....------ // }); }); </script> <script> //View all uploaded file $(document).ready(function() { $('.myBtnView').click(function() { var contractID = this.id; $('#myBtnView' + contractID).css('display', 'block'); // }); $('.closeView').click(function() { var contractID = this.id; $('#myBtnView' + contractID).css('display', 'none'); }); }); //Show All Contract Comment $(document).ready(function() { $('.btnShowModalComment').click(function() { var contractID = this.id; $('#myModalCommentBtn' + contractID).css('display', 'block'); // }); $('.myModalCommentClose').click(function() { var contractID = this.id; $('#myModalCommentBtn' + contractID).css('display', 'none'); }); }); </script> <script> //Start Processing Contract $(document).ready(function() { $('.myBtnView').click(function() { var contractID = this.id; $('#myBtnView' + contractID).css('display', 'block'); // }); $('.closeView').click(function() { var contractID = this.id; $('#myBtnView' + contractID).css('display', 'none'); }); }); </script> <script> //Update/Edit Contract Information $(document).ready(function() { $('.editContract').click(function() { var contractID = this.id; $('#myModalEditContract' + contractID).css('display', 'block'); //Format Amount Entry $('#amountEdit' + + contractID).keyup(function(event) { // skip for arrow keys if(event.which >= 37 && event.which <= 40) return; // format number $(this).val(function(index, value) { return value .replace(/\D/g, "") .replace(/\B(?=(\d{3})+(?!\d))/g, ",") ; }); }); //End Amount text entry }); $('.myBtnEditClose').click(function() { var cID = this.id; $('#myModalEditContract' + cID).css('display', 'none'); }); }); </script> <script> //Start processing Contract Editing without reloading the entire page $(document).ready(function() { $('#btnProcessClose').click(function() { $('#myModalProcess').css('display', 'none'); }); $(".btnEdit").click(function () { var contractID = this.id; //get values var fileNo = $('#fileNoEdit' + contractID).val(); var name = $('#contractorNameEdit' + contractID).val(); var amount = $('#amountEdit' + contractID).val(); var awardDate = $('#awardDateEdit' + contractID).val(); var description = $('#contractDescriptionEdit' + contractID).val(); //validate if(fileNo === ''){ alert('File number cannot be empty!'); return false; } if(name === ''){ alert('Contractor name cannot be empty!'); return false; } if(amount === '' || amount < 1 || (!parseFloat(amount)) ){ alert('Contractor value cannot be empty/alphabet!'); return false; } if(awardDate === ''){ alert('Contractor award date cannot be empty!'); return false; } if(description === ''){ alert('Please enter contract description for this contract!'); return false; } $('#waitLogo' + contractID).fadeIn(500); // $.ajax({ url: murl + '/edit-contract-information-post-json', type: "post", data: { 'id': contractID, 'fileNo': fileNo, 'contractorID': name, 'amount': amount, 'awardDate': awardDate, 'description': description, '_token': $('input[name=_token]').val() }, success: function(data){ if(data.messageCode == 1) { $('#fileNoEdit' + contractID).val(data.getRecord.fileNo); $('#contractorNameEdit' + contractID).append('<option value=' + data.getRecord.id +'>' + data.getRecord.contractor + '</option>'); $('#amountEdit' + contractID).val(data.getRecord.amount); $('#awardDateEdit' + contractID).val(data.getRecord.award_date); $('#contractDescriptionEdit' + contractID).val(data.getRecord.description); $('#contractorNameTitle' + contractID).html(data.getRecord.contractor); // $('#waitthread' + contractID).html(data.message).css('color', 'green'); $('#waitLogo' + contractID).fadeOut(500); }else{ $('#waitthread' + contractID).html(data.message).css('color', 'red'); $('#waitLogo' + contractID).fadeOut(500); } }, error: function (jqXHR, status, err) { alert("The following error(s) occurred: " + err); } }) //} }); }); </script> <script> //Get economic Code $(document).ready(function() { $('#feedBack').html(''); $(".getEconomicCode").change(function () { $('#economicCode').empty().append('<option value="" selected>--Select--</option>'); var accountType = $('#accountType').val(); var allocationType = $('#allocationType').val(); var amount = $('#amount').val(); if (accountType === '' ) { $('#accountType').css('borderColor', 'red'); $('#feedBack').html('Please select Account Type!').css('color', 'red'); $('#accountType').focus(); return false; } if (allocationType === '') { $('#allocationType').css('borderColor', 'red'); $('#feedBack').html('Please select Allocation Type!').css('color', 'red'); $('#allocationType').focus(); return false; } $('#feedBack').html(''); $.ajax({ url: murl + '/get-all-economic-code', type: "post", data: { 'contractTypeID': accountType, 'allocationTypeID': allocationType, '_token': $('input[name=_token]').val() }, success: function (data) { var opt = ''; for(var i=0; i<data.length; i++) { opt += '<option value="' + data[i].economicID + '">' + data[i].description + ' - Bal.: ' +data[i].bal + '</option>'; } $('#economicCode').append(opt); }, error: function (jqXHR, status, err) { alert('Sorry, error occurred! Refresh this page. ' + err); } }) }); }); //Get economic Code Balance $(document).ready(function() { $("#economicCode").change(function () { var economicCode = $('#economicCode').val(); $.ajax({ url: murl + '/get-real-balance-json-economicCode', type: "post", data: { 'economicID': economicCode, '_token': $('input[name=_token]').val() }, success: function (data) { $('#getEconBal').html(' Bal.: ' + data.toFixed(2)); } }); }); }); //Remove/Delete Contract Attachment $(document).ready(function() { $(".removeFile").click(function () { var attachedFileID = this.id; if (confirm('Are you sure you want to remove this file?')) { if (attachedFileID <= 0) { alert("Error occurred , we cannot remove this file from our system! Refresh and try again."); return false; } $.ajax({ url: murl + '/remove-contract-attached-file', type: "post", data: { 'fileID': attachedFileID, '_token': $('input[name=_token]').val() }, success: function (data) { alert(data); //$(this).removeClass("removeFile"); $('#removeAllFile' + attachedFileID).hide(); }, error: function (jqXHR, status, err) { alert('Sorry, error occurred! Refresh this page. ' + err); } }); } }); }); //GET BALANCE LIABILITY //Get Liability Contract Details $(document).ready(function() { $(".getContractFileNo").change(function () { $('#refreshIfYouSeeNothing').html('Did you see nothing after selecting a file number? pls, select/refresh'); var fileNo = $('#fileNo').val(); if (fileNo == '') { alert("An error occurred! We cannot get the file number"); return false; } $.ajax({ url: murl + '/get-liability-contract-details', type: "post", data: { 'fileNo': fileNo, '_token': $('input[name=_token]').val() }, success: function (data) { $('#contractorName').val(data.id); $('#getContractorName').val(data.contractor); $('#newAmount').val(data.unpaidAmount); $('#totalLiability').val(data.totalLiability); $('#contractValue').val(data.amount); $('#contractDescription').val(data.description); $('#ContractAwardDate').val(data.award_date); $('#refreshIfYouSeeNothing').html(''); }, error: function (jqXHR, status, err) { $('#refreshIfYouSeeNothing').html('Pleas you can check your internet/login session expired!'); alert('Sorry, error occurred! Refresh this page. ' + err); } }); }); }); //END GET BALANCE LIABILITY //PROCESSING AND PUSHING //Start Pushing contract information procurement $(document).ready(function() { /// HECModule: check if the user is HEC var getUserType = ""; var userTakeLiability = 1; var unPaidAmount = 0.00; var unPaidBalEconomic_code = ''; var unPaidBalCountRecord = 0; var getAmount = 0.00; var amountToBePaid = 0.00; var getLiabilityAmount = 0.00; var totalLiability = 0.00 $('#feedBack').html(''); $('#HECModule').css('display', 'none'); $('#OtherUserModule').css('display', 'block'); $('#accountType').css('display','block'); $('#allocationType').css('display','block'); $('#economicCode').css('display','block'); // $.ajax({ url: murl + '/is-user-head-of-expenditure-control', type: "get", data: { '_token': $('input[name=_token]').val() }, success: function (data) { //HECModule ... getUserType = data; if (data == 'HEC'){ $('#HECModule').css('display', 'block'); $('#OtherUserModule').css('display', 'none'); userTakeLiability = 1; //take liability }else{ $('#HECModule').css('display', 'none'); $('#OtherUserModule').css('display', 'block'); userTakeLiability = 0; //Dont take liability } }, error: function (jqXHR, status, err) { alert("The following error(s) occurred: " + err); } }); //end get HEC //close modal btn $('#btnProcessCloseP').click(function() { $('#newComment').val(''); $('#myModalProcessP').css('display', 'none'); }); $(".btnShowModal").click(function () { ////////////////VARIABLES DECLARATIONS//////////////////// var contractID = this.id; getAmount = $.trim($('#getAmount' + contractID).val()); getLiabilityAmount = $.trim($('#getLiabilityAmount' + contractID).val()); //Hide if no liability taken if(getLiabilityAmount < 1){ $('#showAmountAndLiabilityForOther').css('display', 'none').hide(); }else{ $('#showAmountAndLiabilityForOther').css('display', 'block').show(); } $('#viewAllCommentP').empty(); ///////////////////////////////////////// //get amount $('#viewAmount').html(addcomma(getAmount)); $('#viewAmountLiability').html(addcomma(getLiabilityAmount)); $('#editAmount').val(addcomma(getAmount)); /// get all comments $.ajax({ url: murl + '/get-all-comment-for-all', type: "post", data: { 'contractID': contractID, '_token': $('input[name=_token]').val() }, success: function(data){ //comment ... var appendString=''; for(var i=0; i<data.length; i++) { appendString += '<div> <i class="fa fa-comment-o"></i> - ' + data[i].name + ': ' + data[i].comment + ' - <span class="text-danger"><small><i>'+ data[i].date + '</i></small></span></div>'; } //+ (i+1) +'. ' $('#viewAllCommentP').append(appendString); }, error: function (jqXHR, status, err) { alert("The following error(s) occurred: " + err); } }); ///end comment //Get Contract Economic details $.ajax({ url: murl + '/get-contract-economic-details', type: "post", data: { 'contractID': contractID, '_token': $('input[name=_token]').val() }, success: function(ecoDetails){ if((ecoDetails.economic_code != '') || (ecoDetails.economic_code > 0) ) { var econo = '<option selected value="' + ecoDetails.economic_code + '">' + ecoDetails.newDescription + '</option>'; var alloc = '<option selected value="' + ecoDetails.allocationID + '">' + ecoDetails.newAllocation + '</option>'; var accType = '<option selected value="' + ecoDetails.contractGroupID + '">' + ecoDetails.newContractType + '</option>'; //view by all $('#viewAccountType').val(ecoDetails.newContractType); $('#viewAllocationType').val(ecoDetails.newAllocation); $('#viewEconomicCode').val(ecoDetails.newDescription); } if((ecoDetails.economic_code == '') || (ecoDetails.economic_code < 1) ) { var econo = '<option selected value="' + '">' + '--Select--' + '</option>'; var alloc = '<option selected value="' + '">' + '--Select--' + '</option>'; var accType = '<option selected value="' + '">' + '--Select--' + '</option>'; //view by all $('#viewAccountType').val(''); $('#viewAllocationType').val(''); $('#viewEconomicCode').val(''); // } }, error: function (jqXHR, status, err) { alert("The following error(s) occurred: " + err); } });///end get economic details. //Get Unpaid Amount for a contract $.ajax({ url: murl + '/get-unpaid-amount-only', type: "post", data: { 'contractID': contractID, '_token': $('input[name=_token]').val() }, success: function(unPaidBal){ $('#unpaidBalanceLock').html(addcomma(unPaidBal.totalLiability)); //Unpaid Balance... unPaidAmount = unPaidBal.unPaidBalance; totalLiability = unPaidBal.totalLiability; unPaidBalEconomic_code = unPaidBal.economic_code; unPaidBalCountRecord = unPaidBal.countRecord; //$('#unpaidBalanceLock').html(unPaidAmount); if(unPaidAmount < 1) { $('#editAmountLiability').val(addcomma(getAmount)); }else{ $('#editAmountLiability').val(addcomma(unPaidAmount)); } if((unPaidBal.economic_code != '' && unPaidBal.countRecord > 1) || (unPaidBal.economic_code > 0 && unPaidBal.countRecord > 1) ) { $('#accountTypeRead').html(unPaidBal.newContractType).css('display','block'); $('#allocationTypeRead').html(unPaidBal.newAllocation).css('display','block'); $('#economicCodeRead').html(unPaidBal.newDescription).css('display','block'); $('#accountType').css('display','none'); $('#allocationType').css('display','none'); $('#economicCode').css('display','none'); // /*var econo = '<option selected value="' + unPaidBal.economic_code + '">' + unPaidBal.newDescription + '</option>'; var alloc = '<option selected value="' + unPaidBal.allocationID + '">' + unPaidBal.newAllocation + '</option>'; var accType = '<option selected value="' + unPaidBal.contractGroupID + '">' + unPaidBal.newContractType + '</option>'; $('#economicCode').append(econo).css('display','none'); $('#allocationType').append(alloc).css('display','none'); $('#accountType').append(accType).css('display','none');*/ }else{ // $('#accountTypeRead').css('display','none'); $('#allocationTypeRead').css('display','none'); $('#economicCodeRead').css('display','none'); $('#accountType').css('display','block'); $('#allocationType').css('display','block'); $('#economicCode').css('display','block'); // } }, error: function (jqXHR, status, err) { unPaidAmount = 0.00; alert("The following error(s) occurred: " + err); } });///end unpaid bal. $('#unpaidBalanceLock').html(addcomma(totalLiability)); if(unPaidAmount < 1) { $('#editAmountLiability').val(addcomma(getAmount)); }else{ $('#editAmountLiability').val(addcomma(unPaidAmount)); } //Check if user want to take liability or not $('#takeLiability').click(function(){ if($(this).is(":checked")){ $('#editAmountLiability').attr('readonly', true); $('#liabilityParameter').css('display', 'none'); userTakeLiability = 0; //Dont take liability } else if($(this).is(":not(:checked)")){ //$('#editAmountLiability').val($('#editAmount').val()); $('#editAmountLiability').attr('readonly', false); $('#liabilityParameter').css('display', 'block'); userTakeLiability = 1; //take liability } }); //end// $('#ShowNameHere').html($('#showContractorName' + contractID).val()); $('#viewFileNo').html($('#getFileNoModal' + contractID).val()); // if(confirm('Are you sure you want to continue with this operation?')) { if (contractID == '' || contractID < 0 ) { alert('Sorry, we cannot start the process of this contract now! Refresh and try again.!'); return false; } //show Modal $('#myModalProcessP').css('display', 'block'); //show Modal //set focus $('#getEconBal').html(''); $('#commentP').focus(); // //Return By Executive Secretary (ES) $("#btnReturnProcessES").click(function () { var newComment = $.trim($('#newComment').val()); var pushTo = $.trim($('#pushTo').val()); //end economic code if (newComment == '') { alert('Please, say something about this contract...'); $('#newComment').focus(); return false; } if (pushTo == '') { alert('Please, select who is taking the next action!'); $('#pushTo').focus(); return false; } if (confirm('Are you sure you want to continue?')) { //remind the user of the liability typed, if is sure of it... $.ajax({ url: murl + '/process-contract-post-json', type: "post", data: { 'id': contractID, 'pushTo': pushTo, 'comment': newComment, 'ESReturn': 1, '_token': $('input[name=_token]').val() }, success: function (data) { if(data.messageCode == 0) { alert(data.message); return false; } $('#commentP').val(''); $('#myModalProcessP').css('display', 'none'); location.reload(); }, error: function (jqXHR, status, err) { $('#commentP').val(''); alert("The following error(s) occurred: " + err); } }); }// end confirm }); //end Return By Executive Secretary (ES) // $("#btnSubmitProcessPush").click(function () { //Get all parameters $('#feedBack').html(''); var newComment = $.trim($('#newComment').val()); var pushTo = $.trim($('#pushTo').val()); var amount = $('#editAmount').val(); var liabilityAmount = $.trim($('#editAmountLiability').val()); var accountType = $('#accountType').val(); var economicCode = $('#economicCode').val(); var validateValue = /^[0-9.]+$/; //var validateLetter = /^[0-9a-zA-Z.<>/-=[]()!@#%^^&*?]+$/; //check if user takes liability amountToBePaid = ($.trim($('#editAmount').val()) - totalLiability); //alert( 'Amount: ' + $.trim($('#editAmount').val()) + ' T Liability: ' + totalLiability + ' Current Liability: ' + parseFloat($('#editAmountLiability').val()) ); if (userTakeLiability == 1) { //check if liability is not greater than total unpaid bal. if (parseFloat(liabilityAmount) > (amountToBePaid) ) { alert('Liability amount cannot be greater than unpaid balance!'); $('#feedBack').html('Liability amount cannot be greater than unpaid balance!').css('color', 'red'); $('#getLiabilityAmount').focus(); return false; } //get balance if (parseFloat(liabilityAmount) > parseFloat(amount)) { alert('Liability amount cannot be greater than contract value!'); $('#feedBack').html('Liability amount cannot be greater than contract value!').css('color', 'red'); $('#getLiabilityAmount').focus(); return false; } if ((parseFloat(liabilityAmount) <= 0) || !liabilityAmount.match(validateValue)) { alert('Please enter a valid amount!'); $('#feedBack').html('It seems you have not enter valid amount in the contract value field!').css('color', 'red'); $('#getLiabilityAmount').focus(); return false; } //check economic code (check if user taken liability more than 1.) if((unPaidBalEconomic_code == '' || (unPaidBalEconomic_code != '' && unPaidBalCountRecord < 2) )) { //check economic code if (getUserType == "HEC") { if (accountType == '') { alert('Please select account type from the list!'); $('#accountType').focus(); return false; } if (economicCode == '') { alert('Please select economic code from the list!'); $('#economicCode').focus(); return false; } } } // if ((economicCode < 1) ) { $('#feedBack').html('The economic code seems invalid. Please review').css('color', 'red'); $('#editAmountLiability').focus(); return false; } $.ajax({ url: murl + '/get-real-balance-json-economicCode', type: "post", data: { 'economicID': economicCode, '_token': $('input[name=_token]').val() }, success: function (data) { if (parseFloat(liabilityAmount) > data && economicCode > 0) { //alert('Liability taken is more than the available balance on this this economic code (' + data + ') !'); $('#feedBack').html('The balance on this economic code is not enough to fund this liability.').css('color', 'red'); $('#editAmountLiability').focus(); return false; } }, error: function (jqXHR, status, err) { alert("The following error(s) occurred: " + err); } }); }//end HEC module //end taken liability //end economic code if (newComment === '') { alert('Please, say something about this contract...'); $('#newComment').focus(); return false; } if (pushTo == '') { alert('Please, select who is taking the next action!'); $('#pushTo').focus(); return false; } // if (confirm('Are you sure you want to continue?')) { //remind the user of the liability typed, if is sure of it... $.ajax({ url: murl + '/process-contract-post-json', type: "post", data: { 'id': contractID, 'pushTo': pushTo, 'comment': newComment, 'accountType': accountType, 'economicCode': economicCode, 'liabilityAmount': liabilityAmount, 'amount': amount, 'ESReturn': 0, 'userTakeLiability': userTakeLiability, '_token': $('input[name=_token]').val() }, success: function (data) { if(data.messageCode === 0) { alert(data.message); $('#feedBack').html(data.message).css('color', 'red'); return false; } $('#commentP').val(''); $('#myModalProcessP').css('display', 'none'); location.reload(); }, error: function (jqXHR, status, err) { $('#commentP').val(''); alert("The following error(s) occurred: " + err); } }); }// end confirm }); //} }); }); //END PROCESS CODES </script><?php /**PATH /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/resources/views/njc/modalJs.blade.php ENDPATH**/ ?>