0byt3m1n1
Path:
/
home
/
k74ns2xygros
/
www
/
globetech
/
cms
/
build
/
js
/
[
Home
]
File: ajax.js
//$(document).ready(function () { // $('.res_msg').hide(); // $('.res_err').hide(); // $('.msg_box').hide(); // $('#chkbx1').click(function () { // if ($('#chkbx1').is(':checked') == true) { // $('#exp_ovd').show(); // } else { // $('#exp_ovd').hide(); // } // }); //}); //function show_years() { // var year = (new Date()).getFullYear(); // var current = year; // year -= 4; // for (var i = 0; i < 5; i++) { // if ((year + i) == current) // $('#select_year').append('<option selected value="' + (year + i) + '">' + (year + i) + '</option>'); // else // $('#select_year').append('<option value="' + (year + i) + '">' + (year + i) + '</option>'); // } //} //function show_years_all() { // var year = (new Date()).getFullYear(); // var current = year; // year -= 4; // for (var i = 0; i < 5; i++) { // if ((year + i) == current) // $('#select_year').append('<option selected value="' + (year + i) + '">' + (year + i) + '</option>'); // else // $('#select_year').append('<option value="' + (year + i) + '">' + (year + i) + '</option>'); // } // $('#select_year').append('<option value="ALL">ALL</option>'); //} function show_years() { var current_year = (new Date()).getFullYear(); var start_year = '2018'; for (var i = start_year; i <= current_year; i++) { if (i == current_year) $('#select_year').append('<option selected value="' + i + '">' + i + '</option>'); else $('#select_year').append('<option value="' + i + '">' + i + '</option>'); } } function show_years_all() { var current_year = (new Date()).getFullYear(); var start_year = '2018'; for (var i = start_year; i <= current_year; i++) { if (i == current_year) $('#select_year').append('<option selected value="' + i + '">' + i + '</option>'); else $('#select_year').append('<option value="' + i + '">' + i + '</option>'); } $('#select_year').append('<option value="ALL">ALL</option>'); } // check only enabled checkboxes (true); function check(isChecked) { if (isChecked) { // $('input[type="checkbox"]').each(function () { $('input[type=checkbox]').not("[disabled]").each(function () { this.checked = true; // $('.mycheckboxes').val('yes'); $('#mycheckboxes' + $(this).val()).val('yes'); $(".bulk-actions").show(); }); } else { $('input[type="checkbox"]').each(function () { this.checked = false; // $('.mycheckboxes').val(''); $('#mycheckboxes' + $(this).val()).val(''); $(".bulk-actions").hide(); }); } } // check all checkboxes (true); function check_all(isChecked) { if (isChecked) { $('input[type="checkbox"]').each(function () { this.checked = true; $('.mycheckboxes').val('yes'); $(".bulk-actions").show(); }); } else { $('input[type="checkbox"]').each(function () { this.checked = false; $('.mycheckboxes').val(''); $(".bulk-actions").hide(); }); } } function bulk_user(x) { var n = []; $.each($("input[type='checkbox']:checked"), function () { n.push($(this).val()); }); if (n == 0) { $(".bulk-actions").hide(); } else { $(".bulk-actions").show(); } } function check_uncheck_account(myId, myId_value) { if ($('#' + myId).is(':checked')) { $('#mycheckboxes' + myId_value).val('yes'); } else if (!$('#' + myId).is(':checked')) { $('#mycheckboxes' + myId_value).val(''); } } function update_customer(s) { if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; $('#emailmsg').css("display", "none"); if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } reseller('showall'); setTimeout(function () { $('.msg_box').hide(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "updatestatus.php?id=" + n + "&s=" + s, true); xmlhttp.send(); } function reseller(x) { if (x == " " || x == "active" || x == "showall" || x == "suspended" || x == "terminated") { y = 'exist'; } else { y = 'search'; } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); // alert(xmlhttp.responseText); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "resellers.php?q=" + x + "&r=" + y, true); xmlhttp.send(); } // End List Reseller function provider(x) { if (x == " " || x == "active" || x == "showall" || x == "suspended" || x == "terminated") { y = 'exist'; } else { y = 'search'; } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); // alert(xmlhttp.responseText); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "providers.php?q=" + x + "&r=" + y, true); xmlhttp.send(); } function update_reseller(s) { update_provider(s); } // End List Provider function update_provider(s) { if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } provider('showall'); setTimeout(function () { $('.msg_box').hide(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } // xmlhttp.open("GET", "updatestatus.php?id=" + n + "&s=" + s, true); xmlhttp.send(); } function client(x) { // alert(x); if (x == " " || x == "accepted" || x == "pro_accepted" || x == "showall" || x == "unaccepted" || x == "waiting" || x == "rejected" || x == "deleted" || x == "byadmin" || x == "extra_emp" || x == "emergency" || x == "old_emergency" || x == "office" || x == "retired" || x == "discharge" || x == "notice" || x == "death" || x == "injury" || x == "bymobile" || x == "mobile") { var y = 'exist'; } else { var y = 'search'; } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); $("#emp_type").css("color", "blue"); var list_name = $("#emp_type").text(); if (x == "unaccepted") { $('#emp_type').html('New Applications'); } else if (x == "accepted") { $('#emp_type').html('Accepted List'); } else if (x == "deleted") { $('#emp_type').html('Deleted List'); } else if (x == "waiting") { $('#emp_type').html('Waiting List'); } else if (x == "rejected") { $('#emp_type').html('Hold List'); } else if (x == "showall") { $('#emp_type').html('All Employee'); } else if (x == "") { $('#emp_type').html('All Employee'); } else if (x == "pro_accepted") { $('#emp_type').html('Provisionally Accepted'); } else if (x == "byadmin") { $('#emp_type').html('ADDED BY MOBILE'); } else if (x == "extra_emp") { $('#emp_type').html('EXTRA EMPLOYEE'); } else if (x == "emergency") { $('#emp_type').html('EMERGENCY EMPLOYEE'); } else if (x == "old_emergency") { $('#emp_type').html('OLD EMERGENCY EMPLOYEE'); } else if (x == "office") { $('#emp_type').html('OFFICE EMPLOYEE LIST'); } else if (x == "retired") { $('#emp_type').html('RETIRED EMPLOYEE LIST'); } else if (x == "discharge") { $('#emp_type').html('TERMINATED EMPLOYEE LIST'); } else if (x == "notice") { $('#emp_type').html('NOTICE EMPLOYEE LIST'); } else if (x == "death") { $('#emp_type').html('DEATH EMPLOYEE LIST'); } else if (x == "injury") { $('#emp_type').html('INJURY EMPLOYEE LIST'); } else if (x == "transfer") { $('#emp_type').html('TRANSFERRED EMPLOYEE LIST'); } else if (x == "resign") { $('#emp_type').html('RESIGNED EMPLOYEE LIST'); } else if (x == "bymobile" || x == "mobile") { $('#emp_type').html('ADDED BY MOBILE NO'); } else { $('#emp_type').html(list_name); } document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); // $('#datatable-checkbox').DataTable({ // paging: true, searching: true, // dom: 'Bfrtip', // buttons: [ // 'copy', 'csv', 'excel', 'pdf', 'print' // ] // }); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); $('[data-toggle="tooltip"]').tooltip(); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "clients.php?q=" + x + "&r=" + y, true); xmlhttp.send(); } function client_substationwise(x) { // alert(x); var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); // $('#datatable-checkbox').DataTable({ // paging: true, searching: true, // dom: 'Bfrtip', // buttons: [ // 'copy', 'csv', 'excel', 'pdf', 'print' // ] // }); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "clients_substationwise.php?req=" + x, true); xmlhttp.send(); } // End List Clients function update_client(s) { if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } client('showall'); setTimeout(function () { $('.msg_box').hide(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "updateclient.php?id=" + n + "&s=" + s + "&msg=" + s, true); xmlhttp.send(); } // Client EDIT Page AJAX function edit_client() { $('.showedit').hide(); $('.edit').show(); $('.update').show(); $('.editclient').hide(); $('.editclientcancel').show(); } function cancel_editclient() { $('.showedit').show(); $('.edit').hide(); $('.update').hide(); $('.editclient').show(); $('.editclientcancel').hide(); } function updateclient() { var x = []; x.push($('#pname').val()); x.push($('#email').val()); x.push($('#phone').val()); x.push($('#add').val()); x.push($('#city').val()); x.push($('#state').val()); x.push($('#country').val()); x.push($('#c_cur').val()); x.push($('#id').val()); var n = $('#pname').val(); var e = $('#email').val(); var p = $('#phone').val(); var c = $('#city').val(); var s = $('#state').val(); var a = $('#add').val(); var cn = $('#country').val(); var cur = $('#c_cur').val(); var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { $('#ff').hide(); $('#imload1').show(); $('#admintask').show(); } else { $('imload1').hide(); } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('ff').innerHTML = xmlhttp.responseText; // alert(xmlhttp.responseText); $('#imload1').hide(); $('.showedit').toggle(); $('.edit').toggle(); $('.update').toggle(); $('.shown').text(n); $('.shown1').text(n); $('.showe').text(e); $('.showp').text(p); if (cur == '1') { $('.showc').text('INR'); } else { $('.showc').text('USD'); } $('.showa').text(a + ' ' + c + ' ' + s + ' ' + cn); $('.showedit').show(); $('.edit').hide(); $('.update').hide(); $('.editclient').show(); $('.editclientcancel').hide(); var res = xmlhttp.responseText; if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "edit_clientprofile.php?q=" + x, true); xmlhttp.send(); } function resetsent(id, cid, x) { $('#spn').show(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); $('#spn').hide(); var res = xmlhttp.responseText; if (res.match(/Mail Sent/g) == 'Mail Sent') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); }, 3000); if (xmlhttp.responseText == 'empty') { $('#ff').hide(); } } } xmlhttp.open("GET", "../mailer/reset_pass.php?q=" + id + "&r=" + cid + "&s=" + x, true); xmlhttp.send(); } function update_res() { var x = []; x.push($('#pname').val()); x.push($('#email').val()); x.push($('#phone').val()); x.push($('#add').val()); x.push($('#city').val()); x.push($('#state').val()); x.push($('#country').val()); x.push($('#id').val()); var n = $('#pname').val(); var e = $('#email').val(); var p = $('#phone').val(); var c = $('#city').val(); var s = $('#state').val(); var a = $('#add').val(); var cn = $('#country').val(); var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { $('#ff').hide(); $('#imload1').show(); $('#admintask').show(); } else { $('imload1').hide(); } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('ff').innerHTML = xmlhttp.responseText; // alert(xmlhttp.responseText); $('#imload1').hide(); $('.showedit').toggle(); $('.edit').toggle(); $('.update').toggle(); $('.shown').text(n); $('.shown1').text(n); $('.showe').text(e); $('.showp').text(p); $('.showa').text(a + ' ' + c + ' ' + s + ' ' + cn); $('.showedit').show(); $('.edit').hide(); $('.update').hide(); $('.editclient').show(); $('.editclientcancel').hide(); var res = xmlhttp.responseText; if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "comp_profile.php?q=" + x, true); xmlhttp.send(); } function client_status(s, id) { var msg = $('#msg' + s).val(); if (msg != '' && msg != null && msg != 'undefined') { $('#dropdown').removeClass('open1'); if (s == 0) { s = 'active'; } else if (s == 1) { s = 'suspended' } else if (s == 2) { s = 'terminated'; } $('#spn').show(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText;// alert(res); $('#spn').hide(); if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/updateclient.php?id=" + id + "&s=" + s + "&msg=" + msg, true); xmlhttp.send(); } else { $('#msg' + s).css('border', '1px solid red'); } } // Product and Services Status function client_ps_status(s, id) { var msg = $('#msg' + s + id).val(); if (msg != '' && msg != null && msg != 'undefined') { $('#dropdown' + id).removeClass('open1'); if (s == 0) { s = 'active'; } else if (s == 1) { s = 'suspended' } else if (s == 2) { s = 'terminated'; } $('#spn' + id).show(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; //alert(res); $('#spn' + id).hide(); if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/updateclient_ps.php?id=" + id + "&s=" + s + "&msg=" + msg, true); xmlhttp.send(); } else { $('#msg' + s).css('border', '1px solid red'); } } function client_ps_delete(x, id) { if (x == 1) { $('#create_customer').show(); } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { if (x == 1) { $('#create_customer').hide(); } var res = xmlhttp.responseText; //alert(res); $('#spn' + id).hide(); if (res.match(/Deleted Successfully/g) == 'Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } if (x == 1) { setTimeout(function () { $('.msg_box').hide(); window.location.href = "pending_orders.php"; }, 3000); } else { setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); } if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/deleteclient_ps.php?id=" + id, true); xmlhttp.send(); } function comp_status(s, id) { var msg = $('#msg' + s).val(); if (msg != '' && msg != null && msg != 'undefined') { $('#dropdown').removeClass('open1'); if (s == 0) { s = 'active'; } else if (s == 1) { s = 'suspended' } else if (s == 2) { s = 'terminated'; } $('#spn').show(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // document.getElementById('ff').innerHTML = xmlhttp.responseText; // alert(xmlhttp.responseText); var res = xmlhttp.responseText; $('#spn').hide(); if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/updatestatus.php?id=" + id + "&s=" + s + "&msg=" + msg, true); xmlhttp.send(); } else { $('#msg' + s).css('border', '1px solid red'); } } //function comp_status(s, id) { // // if (window.XMLHttpRequest) // {// code for IE7+, Firefox, Chrome, Opera, Safari // xmlhttp = new XMLHttpRequest(); // } else // {// code for IE6, IE5 // xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // } // xmlhttp.onreadystatechange = function () // { // if (xmlhttp.readyState == 4 && xmlhttp.status == 200) // // { //// document.getElementById('ff').innerHTML = xmlhttp.responseText; //// alert(xmlhttp.responseText); // // // var res = xmlhttp.responseText; // if (res.match(/Updated Successfully/g) == 'Updated Successfully') { // $('.res_msg').show(); // $('#bulk_res').html(xmlhttp.responseText); // } // else { // $('.res_err').show(); // $('#bulk_err').html(xmlhttp.responseText); // } // setTimeout(function () { // $('.msg_box').hide(); // }, 3000); // if (xmlhttp.responseText == 'empty') { // document.getElementById('ff').style.display = 'none'; // } // } // // // } // xmlhttp.open("GET", "../lists/updatestatus.php?id=" + id + "&s=" + s, true); // xmlhttp.send(); //} function addbalance() { if ($('#amt').val() == '') { $("#amt").css("border", "1px solid red"); return false; } else if ($('#tid').val() == '') { $("#tid").css("border", "1px solid red"); return false; } var a = $('#amt').val(); var tid = $('#tid').val(); var id = $('#id').val(); $('.close').click(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; if (res.match(/Balance Added Successfully/g) == 'Balance Added Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); }, 3000); window.setTimeout(function () { location.reload() }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "add_balance.php?a=" + a + "&id=" + id + "&tid=" + tid, true); xmlhttp.send(); } function tickets(x) { if (x == " " || x == "open" || x == "showall" || x == "answered" || x == "closed") { y = 'exist'; } else { y = 'search'; } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); // alert(xmlhttp.responseText); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "tickets.php?q=" + x + "&r=" + y, true); xmlhttp.send(); } // End List Tickets function showc(x) { if (x == '1') { $("#ctlist").show(); $("#ctlist1").show(); $("#ctlist2").hide(); $("#ctlist3").hide(); // $("#generate").attr( "disabled", "disabled" ); } else if (x == '2') { $("#ctlist").show(); $("#ctlist1").show(); $("#ctlist2").show(); $("#ctlist3").hide(); // $("#generate").attr( "disabled", "disabled" ); } else if (x == '3') { $("#ctlist").show(); $("#ctlist1").show(); $("#ctlist2").show(); $("#ctlist3").show(); // $("#generate").attr( "disabled", "disabled" ); } else { $("#ctlist").hide(); $("#ctlist1").hide(); $("#ctlist2").hide(); $("#ctlist3").hide(); } } function reslrclient(x) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // $("#generate").removeAttr("disabled"); $('#clientlist').hide(); document.getElementById("clientlist1").innerHTML = this.responseText; } } xmlhttp.open("GET", "ticket_getclient.php?q=" + x, true); xmlhttp.send(); } function pro_reslr(x) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // $("#generate").removeAttr("disabled"); $('#reslrlist').hide(); document.getElementById("reslrlist1").innerHTML = this.responseText; } } xmlhttp.open("GET", "ticket_getreslr.php?q=" + x, true); xmlhttp.send(); } function pro_rclient(x) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { $('#ctrlist').hide(); document.getElementById("ctrlist3").innerHTML = this.responseText; } } xmlhttp.open("GET", "ticket_getclient.php?q=" + x, true); xmlhttp.send(); } //function mail_reply(x){ // $('#spn').show(); // if (window.XMLHttpRequest) // {// code for IE7+, Firefox, Chrome, Opera, Safari // xmlhttp = new XMLHttpRequest(); // } // else // {// code for IE6, IE5 // xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // } // xmlhttp.onreadystatechange = function() // { // if (xmlhttp.readyState == 4 && xmlhttp.status == 200) // // { // //// alert(xmlhttp.responseText); // // $('#spn').hide(); //// var res=xmlhttp.responseText; //// if(res.match(/Mail Sent/g)=='Mail Sent'){ //// $('.res_msg').show();$('#bulk_res').html(xmlhttp.responseText); } //// else{ $('.res_err').show(); //// $('#bulk_err').html(xmlhttp.responseText);} //// setTimeout(function(){$('.msg_box').hide(); }, 3000); // // // } // // } // xmlhttp.open("GET", "../mailer/mailer1.php?q=" + x, true); // xmlhttp.send(); //} function close_ticket(x) { $('.wizard1').hide(); $('.spn').show(); $('.closeticket').attr('disabled', 'disabled'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { $('.spn').hide(); $('.wizard').show(); var res = xmlhttp.responseText; if (res.match(/Updating Ticket Status/g) == 'Updating Ticket Status') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); }, 3000); window.setTimeout(function () { location.reload() }, 3000); } } xmlhttp.open("GET", "closeticket.php?x=" + x, true); xmlhttp.send(); } function escalate(x, y) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; if (res.match(/Ticket forwarded/g) == 'Ticket forwarded') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); }, 3000); setTimeout(function () { window.location.href = "list_tickets.php"; }, 3000); } } xmlhttp.open("GET", "ticket_forward.php?q=" + x + "&t=" + y, true); xmlhttp.send(); } function mytickets(x) { if (x == " " || x == "open" || x == "showall" || x == "answered" || x == "closed") { y = 'exist'; } else { y = 'search'; } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); // alert(xmlhttp.responseText); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "mytickets.php?q=" + x + "&r=" + y, true); xmlhttp.send(); } // End My Tickets function con_del_img() { var x = $('#imgname').val(); $('#myModal').hide(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; if (res.match(/Image Deleted Successfully/g) == 'Image Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); }, 3000); window.setTimeout(function () { location.reload() }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "delete_kb_image.php?q=" + x, true); xmlhttp.send(); } function delete_client(id) { $('#create_customer').show(); $('#myModal').modal('hide'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { $('#create_customer').hide(); var res = xmlhttp.responseText; //alert(res); if (res.match(/Deleted Successfully/g) == 'Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/deleteclient.php?id=" + id, true); xmlhttp.send(); } function calculate_amount(tax) { var amount = $('#grandTotal').val(); // var tax_amount=((amount*tax)/100); var sub_total = parseFloat(amount); var dis_amt = $('#dis_amount').val(); if (dis_amt == '') { var dis_amt = 0; } var discounted_subtotal = parseFloat(sub_total) - parseFloat(dis_amt); taxp = (discounted_subtotal * tax) / 100; taxp = parseFloat(taxp); tt = taxp + parseFloat(discounted_subtotal); if (!isNaN(tt)) { $('.tax').text(parseFloat(Math.round(taxp * 100) / 100).toFixed(2)); $('.stotal1').text(parseFloat(Math.round(discounted_subtotal * 100) / 100).toFixed(2)); $('.tcost').text(parseFloat(Math.round(tt * 100) / 100).toFixed(2)); $('#taxamount').val(parseFloat(Math.round(taxp * 100) / 100).toFixed(2)); $('#subtotal').val(parseFloat(Math.round(discounted_subtotal * 100) / 100).toFixed(2)); $('#totalcost').val(parseFloat(Math.round(tt * 100) / 100).toFixed(2)); //$('#add_bank_info').click(); // $('#add_item').append(" <tr><td style='padding:15px'>1</td><td><input type='text' name='product_name[]' style='width:140;margin:15px;' placeholder='' required></td><td><input type='text' name='description[]' style='width:160;margin:15px;' placeholder='' required></td><td><input type='text' name='amount[]' id='amount' style='width:80;margin:15px;' placeholder='' required></td></tr>"); // $('#balance').val(bal); // $('#taxamt').val(taxp); // $('#stotal').val(taxp1); // $('#gtotal').val(tt); } } function delete_invoice(invoice_no, customer_id) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; //alert(res); if (res.match(/Invoice Deleted Successfully/g) == 'Invoice Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); window.history.back(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/delete_invoice.php?invoice=" + invoice_no + "&customer_id=" + customer_id, true); xmlhttp.send(); } function delete_order(order_id) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Order Deleted Successfully/g) == 'Order Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); window.history.back(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/delete_order.php?order_id=" + order_id, true); xmlhttp.send(); } function view_addon(ps_id) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; $('#addon-data').html(res); $('#addon-modal').modal('show'); } } xmlhttp.open("GET", "view-addon.php?q=" + ps_id, true); xmlhttp.send(); } function view_payment(ino) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; $('#payment-data').html(res); $('#payment-modal').modal('show'); } } xmlhttp.open("GET", "add-invoice-payment.php?q=" + ino, true); xmlhttp.send(); } function addinvoicepayment(ino) { var amount = $('#amt').val(); var tid = $('#tid').val(); var ptype = $('#ptype').val(); if (amount != '' && tid != '') { $('#payment-modal').modal('hide'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; if (res.match(/Invoice Payment Added Successfully/g) == 'Invoice Payment Added Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else if ((res.match(/Something Went Wrong/g) == 'Something Went Wrong') || (res.match(/Balance is low/g) == 'Balance is low')) { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); } } xmlhttp.open("GET", "invoicepayment.php?q=" + ino + "&amt=" + amount + "&tid=" + tid + "&ptype=" + ptype, true); xmlhttp.send(); } else { $('#fld_res').show(); $('#fld_res').html("*Enter both fields."); } } function check_amt(amt) { if (amt == '') { amt = $('#amt').val(); } var due_amt = $('#total_due').val(); if (parseFloat(amt) < parseFloat(due_amt) || parseFloat(amt) == parseFloat(due_amt)) { $('#amt_res').hide(); $("#addb").removeAttr("disabled"); } else if (parseFloat(amt) > parseFloat(due_amt)) { $("#addb").attr("disabled", "disabled"); $('#amt_res').show(); $('#amt_res').html("*You have entered greater amount than due amount."); } } function delete_addon(aid) { $('#spn' + aid).show(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; $('#spn' + aid).hide(); if (res.match(/Deleted Successfully/g) == 'Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); } } xmlhttp.open("GET", "delete_addon.php?q=" + aid, true); xmlhttp.send(); } function edit_date() { $('.showedit').hide(); $('.edit').show(); $('.updatedate').show(); $('.editdate').hide(); $('.editdatecancel').show(); } function cancel_editdate() { $('.showedit').show(); $('.edit').hide(); $('.updatedate').hide(); $('.editdate').show(); $('.editdatecancel').hide(); } function updatedate() { var x = []; x.push($('#startdate').val()); x.push($('#expirydate').val()); x.push($('#ps_id').val()); var n = $('#startdate').val(); var e = $('#expirydate').val(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); $('#imload1').hide(); $('.showedit').toggle(); $('.edit').toggle(); $('.updatedate').toggle(); $('.shown').text(n); $('.shown1').text(e); $('.showedit').show(); $('.edit').hide(); $('.updatedate').hide(); $('.editdate').show(); $('.editdatecancel').hide(); var res = xmlhttp.responseText; if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "edit_psdates.php?q=" + x, true); xmlhttp.send(); } function generate_invioce(customer_id, ps_id) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Due Inovice Generated Successfully/g) == 'Due Inovice Generated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); } } xmlhttp.open("GET", "generate_invoice.php?customer_id=" + customer_id + "&ps_id=" + ps_id, true); xmlhttp.send(); } //function editinvoiceprice1(x) { // $('.editinvoiceprice1' + x).hide(); // $('.showinvoiceprice' + x).show(); //// $('.savechanges').show(); //} //function editinvoiceprice_cancel(x) { // $('.editinvoiceprice1' + x).show(); // $('.showinvoiceprice' + x).hide(); //// $('.savechanges' ).hide(); //} // recalculate invoice amount function recalculate_invoice() { var array_des_id = $('#description_id').val(); // alert(array_des_id); var grandtotal = 0; var array_des_id = array_des_id.split(','); for (i = 0; i < array_des_id.length; i++) { // alert(array_des_id[i]); var des_id = array_des_id[i]; if ($('#price' + des_id).val() == '') { alert('Please Enter Amount in Amount Field'); document.getElementById('imbutton').style.display = 'none'; } else { grandtotal += parseFloat($('#price' + des_id).val()); document.getElementById('imbutton').style.display = 'block'; } } var amount = grandtotal; //$('#grandTotal').val(); // alert(amount); var tax = $('#tax').val(); // var tax_amount=((amount*tax)/100); var sub_total = parseFloat(amount); var dis_amt = $('#dis_amount').val(); // alert(dis_amt); if (dis_amt == '') { var dis_amt = 0; } var discounted_subtotal = parseFloat(sub_total) - parseFloat(dis_amt); taxp = (discounted_subtotal * tax) / 100; taxp = parseFloat(taxp); tt = taxp + parseFloat(discounted_subtotal); if (!isNaN(tt)) { $('.tax').text(parseFloat(Math.round(taxp * 100) / 100).toFixed(2)); $('.stotal1').text(parseFloat(Math.round(discounted_subtotal * 100) / 100).toFixed(2)); $('.tcost').text(parseFloat(Math.round(tt * 100) / 100).toFixed(2)); $('#taxamount').val(parseFloat(Math.round(taxp * 100) / 100).toFixed(2)); $('#subtotal').val(parseFloat(Math.round(discounted_subtotal * 100) / 100).toFixed(2)); $('#totalcost').val(parseFloat(Math.round(tt * 100) / 100).toFixed(2)); } } function update_expovd() { var d = $('#ovd_date').val(); var ps_id = $('#ps_id').val(); if (d != '') { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').show(); }, 5000); location.reload(); } } xmlhttp.open("GET", "add_expiry_override.php?q=" + d + "&r=" + ps_id, true); xmlhttp.send(); } } function addon_status(id) { var msg = $('#msg' + id).val(); if (msg != '' && msg != null && msg != 'undefined') { $('#dropdown' + id).removeClass('open1'); // $('#spn' + id).show(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; //alert(res); $('#spn' + id).hide(); if (res.match(/Updated Successfully/g) == 'Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/addon_status.php?id=" + id + "&msg=" + msg, true); xmlhttp.send(); } else { $('#msg' + id).css('border', '1px solid red'); } } function change_application_status(status, customer_id) { if (status == 'waiting') { var reason = $('#waiting_reason').val(); var remark = $('#waiting_remark').val(); } else if (status == 'rejected') { var reason = $('#rejected_reason').val(); var remark = $('#rejected_remark').val(); } else if (status == 'pro_accepted') { var reason = $('#pro_accepted_reason').val(); var remark = $('#pro_accepted_remark').val(); } else if (status == 'extra_emp') { var reason = $('#extra_emp_reason').val(); var remark = $('#extra_emp_remark').val(); } else if (status == 'rejoin') { var reason = $('#rejoin_emp_reason').val(); var remark = $('#rejoin_emp_remark').val(); } else if (status == 'restore') { var reason = $('#restored_reason').val(); var remark = $('#restored_remark').val(); } else if (status == 'accepted') { var reason = 'No Reason'; var remark = 'No Remark'; } // alert(reason); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Application Status Changed Successfully/g) == 'Application Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.history.back(); if (status == 'accepted') { window.location.href = "print_call_letter.php?emp_cid=" + customer_id; } else if (status == 'rejected' || status == 'waiting' || status == 'pro_accepted' || status == 'extra_emp') { location.reload(); } }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/change_application_status.php?status=" + status + "&customer_id=" + customer_id + "&reason=" + reason + "&remark=" + remark, true); xmlhttp.send(); } function change_application_status_req_doc(status, customer_id) { if (status == 'waiting') { var reason = $('#waiting_reason').val(); var remark = $('#waiting_remark').val(); } else if (status == 'rejected') { var reason = $('#rejected_reason').val(); var remark = $('#rejected_remark').val(); } else if (status == 'pro_accepted') { var reason = $('#pro_accepted_reason').val(); var remark = $('#pro_accepted_remark').val(); } else if (status == 'extra_emp') { var reason = $('#extra_emp_reason').val(); var remark = $('#extra_emp_remark').val(); } // alert(reason); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Application Status Changed Successfully/g) == 'Application Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.history.back(); if (status == 'accepted') { // window.location.href = "print_call_letter.php?emp_cid=" + customer_id; window.location.href = "view_employee_status.php?q=" + customer_id; // location.reload(); } else if (status == 'rejected' || status == 'waiting' || status == 'pro_accepted' || status == 'extra_emp') { location.reload(); } }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/change_application_status.php?status=" + status + "&customer_id=" + customer_id + "&reason=" + reason + "&remark=" + remark, true); xmlhttp.send(); } function change_application_status_prevfuntion(status, customer_id) { // alert(status); alert(customer_id); if (status == 'waiting') { var reason = $('#waiting_reason').val(); } else if ((status == 'rejected')) { var reason = $('#rejected_reason').val(); } // alert(reason); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { // alert('yes'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Application Status Changed Successfully/g) == 'Application Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); window.history.back(); }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/change_application_status.php?status=" + status + "&customer_id=" + customer_id + "&reason=" + reason, true); xmlhttp.send(); } function update_insurance(status) { var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (status == 'insurance') { window.location.href = '../lists/update_insurance_details.php?emp_id=' + n; } else if (status == 'epf') { window.location.href = '../lists/update_epf_details.php?emp_id=' + n; } } } // End List Clients function print_employee111(s) { if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Something Went Wrong!/g) == 'Something Went Wrong!') { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } else { $('#list_page').hide(); $('#print_page').html(xmlhttp.responseText); } client('showall'); setTimeout(function () { $('.msg_box').hide(); // window.location.href='newtest.php?html='+res; }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "bulk_identity_card.php?emp_id=" + n + "&s=" + s + "&msg=" + s, true); xmlhttp.send(); } function print_employee(status) { var area_name = $('#area_name').val(); // alert(area_name); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (status == 'essential_service') { // window.location.href = '../lists/bulk_identity_card.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/bulk_identity_card_essential_service.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'back_side') { // window.location.href = '../lists/bulk_identity_card_back.php'; window.open("../lists/bulk_identity_card_back.php", "_blank"); } else if (status == 'front_back_side') { // window.location.href = '../lists/bulk_identity_card.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/bulk_identity_card_front_back.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else { // window.location.href = '../lists/bulk_identity_card.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/bulk_identity_card.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } } } function print_employees(status) { var area_name = $('#area_name').val(); var ajency_name = $('#ajency_name').val(); var edd_name = $('#edd_name').val(); // alert(area_name); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (status == 'pdf') { // window.location.href = '../lists/print_employee_details.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_employee_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'survey') { window.open("../lists/print_employee_survey_list.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'emp_detail' || status == 'emp_detail_address' || status == 'emp_detail_absenty') { // window.location.href = '../lists/print_employee_list.php?emp_id=' + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name; window.open("../lists/print_employee_list.php?emp_id=" + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name + "&type=" + status + "&edd_name=" + edd_name, "_blank"); } else if (status == 'emp_detail_all') { // window.location.href = '../lists/print_employee_all_list.php?emp_id=' + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name; window.open("../lists/print_employee_all_list.php?emp_id=" + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name, "_blank"); } else if (status == 'employee_address') { // window.open("../lists/print_employee_address.php?emp_id=" + n + "&area_name=" + area_name + "&edd_name=" + edd_name + "&select_month=" + select_month + "&select_year=" + select_year + "&type=" + status + "&print_type=approved", "_blank"); window.open("../lists/print_employee_address.php?emp_id=" + n + "&area_name=" + area_name + "&type=" + status + "&print_type=approved", "_blank"); } else if (status == 'emp_bank_detail') { window.open("../lists/print_employee_list_bank_details.php?emp_id=" + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name, "_blank"); } else if (status == 'emp_detail_details') { window.open("../lists/searched_result_list.php?emp_id=" + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name, "_blank"); } else if (status == 'emp_detail_interview') { window.open("../lists/print_interview_list.php?emp_id=" + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name, "_blank"); } else if (status == 'emp_detail_interview_accepted') { window.open("../lists/print_interview_accepted_list.php?emp_id=" + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name, "_blank"); } else if (status == 'emp_detail_interview_absent') { window.open("../lists/print_interview_absent_list.php?emp_id=" + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name, "_blank"); } else if (status == 'pro_accepted') { // window.location.href = '../lists/print_employee_list_provisional.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_employee_list_provisional.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'wages') { // window.location.href = '../lists/print_employee_list_provisional.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_employee_details_monthwise.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'wages_no_photo') { // window.location.href = '../lists/print_employee_list_provisional.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_employee_details_monthwise_list.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } } } function print_newemployee_detail(status) { var area_name = $('.input-sm').val(); // alert(area_name); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { // window.location.href = '../lists/print_newemployee_details.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_newemployee_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } } function print_bill_detail(status, list_type) { var area_name = $('.input-sm').val(); // alert(area_name); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { // window.location.href = '../lists/print_newemployee_details.php?emp_id=' + n + "&area_name=" + area_name; // window.open("../lists/print_newemployee_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); window.open("../lists/print_bill_details.php?bill_id=" + n + "&area_name=" + area_name + "&status=" + status + "&list_type=" + list_type, "_blank"); } } function delete_employee(status) { var msg2 = $('#msg2').val();//reason var remark = $('#remark').val(); // alert(remark); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); // if (n == 0) { // $('.res_err').show(); // $('#bulk_err').html('No Record Selected!'); // } else { // window.location.href='../lists/print_employee_details.php?emp_id='+n+"&area_name="+area_name; // } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Employee Deleted Successfully/g) == 'Employee Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); } } xmlhttp.open("GET", "../include/delete_bulk_employee.php?employee_id=" + n + "&msg2=" + msg2 + "&remark=" + remark, true); xmlhttp.send(); } //delete single employee function delete_employee_single(status, customer_id) { //alert(customer_id); var message = $('#reason').val(); var remark = $('#remark').val(); // alert(message); alert(remark); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Employee Deleted Successfully/g) == 'Employee Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.location.href = "print_call_letter.php?emp_cid=" + customer_id; // window.history.back(); location.reload(); }, 4000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/delete_employee.php?customer_id=" + customer_id + "&message=" + message + "&remark=" + remark, true); xmlhttp.send(); } function move_to_extra(status) { var reason = $('#extra_reason').val();//reason var remark = $('#extra_remark').val(); // alert(remark); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Employee Moved to Extra Successfully/g) == 'Employee Moved to Extra Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 4000); } } xmlhttp.open("GET", "../include/move_to_extra.php?employee_id=" + n + "&reason=" + reason + "&remark=" + remark, true); xmlhttp.send(); } } function move_to_emergency_old(status) { var reason = $('#emergency_reason').val();//reason var remark = $('#emergency_remark').val(); // alert(remark); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Employee Moved Successfully/g) == 'Employee Moved Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 4000); } } xmlhttp.open("GET", "../include/move_to_emergency_old.php?employee_id=" + n + "&reason=" + reason + "&remark=" + remark + "&status=" + status, true); xmlhttp.send(); } } function restored_deleted_employee(d_id) { // alert(d_id); // deleted id // var message = $('#reason').val(); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Employee Restored Successfully/g) == 'Employee Restored Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.location.href = "print_call_letter.php?emp_cid=" + customer_id; location.reload(); self.close(); window.history.back(); }, 5000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/restore_deleted_employee.php?d_id=" + d_id, true); xmlhttp.send(); } function delete_deleted_employee(customer_id) { //alert(customer_id); // var message = $('#reason').val(); if (confirm('Are you sure want to delete selected Employee?')) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Employee Deleted Successfully/g) == 'Employee Deleted Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.location.href = "print_call_letter.php?emp_cid=" + customer_id; window.history.back(); //location.reload(); }, 5000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/delete_deleted_employee.php?customer_id=" + customer_id, true); xmlhttp.send(); } } function print_bulk_detail(status) { // alert(status); var area_name = $('#area_name').val(); var select_month = $('#select_month').val(); var select_year = $('#select_year').val(); var insurance_amount_2 = $('#insurance_amount_2').val(); var insurance_amount_3 = $('#insurance_amount_3').val(); var insurance_amount_4 = $('#insurance_amount_4').val(); var insurance_amount_6 = $('#insurance_amount_6').val(); // alert(area_name); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (status == 'employment') { window.location.href = '../lists/bulk_niyojan_letter.php?emp_id=' + n + "&area_name=" + area_name; } else if (status == 'appointment') { window.location.href = '../lists/bulk_appointment_letter.php?emp_id=' + n + "&area_name=" + area_name; } else if (status == 'application') { window.location.href = '../lists/bulk_application_letter.php?emp_id=' + n + "&area_name=" + area_name; } else if (status == 'epf') { // window.location.href = '../lists/print_employee_epf_details.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_employee_epf_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'esic') { // window.location.href = '../lists/print_employee_esic_details.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_employee_esic_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'insurance' || status == 'insurance_new' || status == 'insurance_new_2') { // window.location.href = '../lists/print_employee_insurance_details.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_employee_insurance_details.php?emp_id=" + n + "&area_name=" + area_name + "&status=" + status + "&select_month=" + select_month + "&select_year=" + select_year + "&insurance_amount_2=" + insurance_amount_2 + "&insurance_amount_3=" + insurance_amount_3 + "&insurance_amount_4=" + insurance_amount_4 + "&insurance_amount_6=" + insurance_amount_6, "_blank"); } else if (status == 'crystal') { var zone = $('#zone').val(); var s_engineer = $('#s_engineer').val(); var ex_engineer = $('#ex_engineer').val(); var electry_city = $('#electry_city').val(); var selected_edc_id = $('#selected_edc_id').val(); var selected_edd_id = $('#selected_edd_id').val(); var work_type = $('#work_type').val(); var date_to = $('#date_to').val(); var select_year = $('#select_year').val(); var select_month = $('#select_month').val(); var total_monthly_wages = $('#total_monthly_wages').val(); var total_ip_contribution = $('#total_ip_contribution').val(); // window.location.href = '../admin/print_esic_cristal.php?emp_id=' + n + "&area_name=" + area_name; window.open("../admin/print_esic_cristal.php?emp_id=" + n + "&area_name=" + area_name + "&zone=" + zone + "&s_engineer=" + s_engineer + "&ex_engineer=" + ex_engineer + "&electry_city=" + electry_city + "&selected_edc_id=" + selected_edc_id + "&selected_edd_id=" + selected_edd_id + "&zone=" + zone + "&work_type=" + work_type + "&date_to=" + date_to + "&select_year=" + select_year + "&select_month=" + select_month + "&total_monthly_wages=" + total_monthly_wages + "&total_ip_contribution=" + total_ip_contribution, "_blank"); } else if (status == 'bank') { // window.location.href = '../lists/print_employee_bank_details.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/print_employee_bank_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'salary') { var basic_sal_skilled = $('#basic_sal_skilled').val() != "" ? $('#basic_sal_skilled').val() : ""; var basic_sal_semiskilled = $('#basic_sal_semiskilled').val() != "" ? $('#basic_sal_semiskilled').val() : ""; var basic_sal_unskilled = $('#basic_sal_unskilled').val() != "" ? $('#basic_sal_unskilled').val() : ""; var date_to = $('#date_to').val() != "" ? $('#date_to').val() : ""; window.location.href = '../lists/print_employee_salary.php?emp_id=' + n + "&area_name=" + area_name + "&basic_sal_skilled=" + basic_sal_skilled + "&basic_sal_semiskilled=" + basic_sal_semiskilled + "&basic_sal_unskilled=" + basic_sal_unskilled + "&date_to=" + date_to; } } } function export_emp_details(status) { var area_name = $('#area_name').val(); var ajency_name = $('#ajency_name').val(); // alert(area_name); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (status == 'export_emp_detail') { // window.location.href = '../lists/print_employee_details.php?emp_id=' + n + "&area_name=" + area_name; window.open("../lists/export_websofy_emp_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_address_detail') { window.open("../lists/export_websofy_emp_address_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_bank_detail') { window.open("../lists/export_websofy_emp_bank_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_father_detail') { window.open("../lists/export_websofy_emp_father_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_mother_detail') { window.open("../lists/export_websofy_emp_mother_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_wife_detail') { window.open("../lists/export_websofy_emp_wife_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_nominee_detail') { window.open("../lists/export_websofy_emp_nominee_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_child_detail') { window.open("../lists/export_websofy_emp_child_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_txn_detail') { window.open("../lists/export_websofy_emp_txn_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'export_emp_process_detail') { window.open("../lists/export_websofy_emp_process_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); } else if (status == 'emp_bank_detail') { // window.location.href = '../lists/print_employee_list.php?emp_id=' + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name; window.open("../lists/print_employee_list_bank_details.php?emp_id=" + n + "&area_name=" + area_name + "&ajency_name=" + ajency_name, "_blank"); } } } function send_message(status) { // alert(status); var area_name = $('#area_name').val(); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (status == 'message') { window.location.href = '../forms/send_message.php?emp_id=' + n; } else if (status == '123') { window.location.href = '../lists/bulk_appointment_letter.php?emp_id=' + n + "&area_name=" + area_name; } } } function approve_edited_details(status) { // alert(status); var area_name = $('#area_name').val(); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { // alert('yes'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Application Status Changed Successfully/g) == 'Application Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.history.back(); //location.reload(); window.location.href = "update_details.php"; }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/change_application_status_afteredit_bulk.php?status=" + status + "&customer_id=" + n, true); xmlhttp.send(); } } function change_application_status_afteredit(status, customer_id) { // alert(status); alert(customer_id); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { // alert('yes'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Application Status Changed Successfully/g) == 'Application Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.history.back(); //location.reload(); window.location.href = "update_details.php"; }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/change_application_status_afteredit.php?status=" + status + "&customer_id=" + customer_id, true); xmlhttp.send(); } function change_ajency_details_afteredit(status, ep_id) { // alert(status); // alert(customer_id); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { // alert('yes'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Party Details Updated Successfully/g) == 'Party Details Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.history.back(); // location.reload(); window.location.href = "list_updated_ajency.php"; }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/change_ajency_details_afteredit.php?status=" + status + "&ep_id=" + ep_id, true); xmlhttp.send(); } function change_company_details_afteredit(status, ep_id) { // alert(status); // alert(customer_id); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { // alert('yes'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Company Details Updated Successfully/g) == 'Company Details Updated Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.history.back(); // location.reload(); window.location.href = "list_updated_company.php"; }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/change_company_details_afteredit.php?status=" + status + "&ep_id=" + ep_id, true); xmlhttp.send(); } function change_application_status_afteredit_nominee_child(status, nid, change_table_name_to, change_table_name_from) { // alert(status+ nid + change_table_name_to + change_table_name_from); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { // alert('yes'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Application Status Changed Successfully/g) == 'Application Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(res); } else { $('.res_err').show(); $('#bulk_err').html(res); } setTimeout(function () { $('.msg_box').hide(); // window.history.back(); //location.reload(); window.location.href = "../lists/update_details_nominee.php"; }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/change_application_status_afteredit_nominee_child.php?status=" + status + "&nid=" + nid + "&change_table_name_to=" + change_table_name_to + "&change_table_name_from=" + change_table_name_from, true); xmlhttp.send(); } function same_status(status, customer_id) { // alert(status + customer_id); if (status == 'approved') { var reason = "All Document Approved";//$('#waiting_reason').val(); var remark = $('#waiting_remark').val(); } // alert(reason);alert(remark); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Application Status Changed Successfully/g) == 'Application Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); if (status == 'approved') { location.reload(); } }, 6000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/same_status.php?status=" + status + "&customer_id=" + customer_id + "&reason=" + reason + "&remark=" + remark, true); xmlhttp.send(); } function allowNumbersOnly(e) { var code = (e.which) ? e.which : e.keyCode; if (code > 31 && (code < 48 || code > 57)) { e.preventDefault(); } } function bills(x) { // alert(x); if (x == " " || x == "approved" || x == "pending" || x == "checked" || x == "rejected" || x == "deleted") { var y = 'exist'; } else { y = 'search'; } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); // $("#emp_type").css("color", "blue"); if (x == "approved") { $('#emp_type').html('List of Approved Bill'); } else if (x == "pending") { $('#emp_type').html('List of Pending Bill'); } else if (x == "checked") { $('#emp_type').html('List of Checked Bill'); } else if (x == "rejected") { $('#emp_type').html('List of Rejected Bill'); } else if (x == "deleted") { $('#emp_type').html('List of Deleted Bill'); } document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); // $('#datatable-checkbox').DataTable({ // paging: true, searching: true, // dom: 'Bfrtip', // buttons: [ // 'copy', 'csv', 'excel', 'pdf', 'print' // ] // }); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "billing.php?q=" + x + "&r=" + y, true); xmlhttp.send(); } function agreements(x) { // alert(x); if (x == " " || x == "approved" || x == "pending" || x == "checked" || x == "rejected") { y = 'exist'; } else { y = 'search'; } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); // $("#emp_type").css("color", "blue"); if (x == "approved") { $('#emp_type').html('List of Approved Agreements'); } else if (x == "pending") { $('#emp_type').html('List of Pending Agreements'); } else if (x == "checked") { $('#emp_type').html('List of Checked Agreements'); } else if (x == "rejected") { $('#emp_type').html('List of Rejected Agreements'); } document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); // $('#datatable-checkbox').DataTable({ // paging: true, searching: true, // dom: 'Bfrtip', // buttons: [ // 'copy', 'csv', 'excel', 'pdf', 'print' // ] // }); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "agreements.php?q=" + x + "&r=" + y, true); xmlhttp.send(); } function agreements_da(x) { // alert(x); var y; if (x == " " || x == "showall") { y = 'exist'; } else { y = 'search'; } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); // $("#emp_type").css("color", "blue"); if (x == "showall") { $('#emp_type').html('List of Agreements DA'); } document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); // $('#datatable-checkbox').DataTable({ // paging: true, searching: true, // dom: 'Bfrtip', // buttons: [ // 'copy', 'csv', 'excel', 'pdf', 'print' // ] // }); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../lists/agreements_da.php?q=" + x + "&r=" + y, true); xmlhttp.send(); } function number2text(value) { // alert(value); var fraction = Math.round(frac(value) * 100); var f_text = ""; if (fraction > 0) { f_text = "AND " + convert_number(fraction) + " PAISE"; } return convert_number(value) + " RUPEE " + f_text + " ONLY"; } function frac(f) { return f % 1; } function convert_number(number) { if ((number < 0) || (number > 999999999)) { return "NUMBER OUT OF RANGE!"; } var Gn = Math.floor(number / 10000000); /* Crore */ number -= Gn * 10000000; var kn = Math.floor(number / 100000); /* lakhs */ number -= kn * 100000; var Hn = Math.floor(number / 1000); /* thousand */ number -= Hn * 1000; var Dn = Math.floor(number / 100); /* Tens (deca) */ number = number % 100; /* Ones */ var tn = Math.floor(number / 10); var one = Math.floor(number % 10); var res = ""; if (Gn > 0) { res += (convert_number(Gn) + " CRORE"); } if (kn > 0) { res += (((res == "") ? "" : " ") + convert_number(kn) + " LAKH"); } if (Hn > 0) { res += (((res == "") ? "" : " ") + convert_number(Hn) + " THOUSAND"); } if (Dn) { res += (((res == "") ? "" : " ") + convert_number(Dn) + " HUNDRED"); } var ones = Array("", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "ELEVEN", "TWELVE", "THIRTEEN", "FOURTEEN", "FIFTEEN", "SIXTEEN", "SEVENTEEN", "EIGHTEEN", "NINETEEN"); var tens = Array("", "", "TWENTY", "THIRTY", "FOURTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY"); if (tn > 0 || one > 0) { if (!(res == "")) { res += " AND "; } if (tn < 2) { res += ones[tn * 10 + one]; } else { res += tens[tn]; if (one > 0) { res += ("-" + ones[one]); } } } if (res == "") { res = "zero"; } return res; } function NumInWords(number) { const first = ['', 'one ', 'two ', 'three ', 'four ', 'five ', 'six ', 'seven ', 'eight ', 'nine ', 'ten ', 'eleven ', 'twelve ', 'thirteen ', 'fourteen ', 'fifteen ', 'sixteen ', 'seventeen ', 'eighteen ', 'nineteen ']; const tens = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']; const mad = ['', 'thousand', 'million', 'billion', 'trillion']; let word = ''; for (let i = 0; i < mad.length; i++) { let tempNumber = number % (100 * Math.pow(1000, i)); if (Math.floor(tempNumber / Math.pow(1000, i)) !== 0) { if (Math.floor(tempNumber / Math.pow(1000, i)) < 20) { word = first[Math.floor(tempNumber / Math.pow(1000, i))] + mad[i] + ' ' + word; } else { word = tens[Math.floor(tempNumber / (10 * Math.pow(1000, i)))] + '-' + first[Math.floor(tempNumber / Math.pow(1000, i)) % 10] + mad[i] + ' ' + word; } } tempNumber = number % (Math.pow(1000, i + 1)); if (Math.floor(tempNumber / (100 * Math.pow(1000, i))) !== 0) word = first[Math.floor(tempNumber / (100 * Math.pow(1000, i)))] + 'hunderd ' + word; } return word; } function change_monthwise_employee_status(status, month, year) { if (confirm('Are you sure you want to ' + status + ' this list?')) { // return true; var area_name = $('#area_name').val(); var ajency_name = $('#ajency_name').val(); var ex_engineer = $('#ex_engineer').val(); var selected_edd_id = $('#selected_edd_id').val(); var electry_city = $('#electry_city').val(); var ag_id = $('#ag_id').val(); // alert(area_name); var n = []; var wages_id = []; $.each($("input[name='checkboxes']:checked"), function () { var cid = $(this).val(); n.push(cid); wages_id.push($('#wages_id_' + cid).val()); }); // alert(n); // alert(wages_id); if (n == 0) { $('#bulk_err').text('No Record Selected!'); } else { $('button').attr('disabled', true); $('.btn').attr('disabled', true); $('#bulk_res').text('Please wait...'); $('#res_msg').css('display', 'block'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { // alert('yes'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Employee Exited From Month List Successfully/g) == 'Employee Exited From Month List Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else if (res.match(/Employee Back to Attendance List Successfully/g) == 'Employee Back to Attendance List Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else if (res.match(/Employee Deleted From Attendance List Successfully/g) == 'Employee Deleted From Attendance List Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); // window.history.back(); // window.location.href = "update_details.php"; }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/change_monthwise_employee_status.php?status=" + status + "&ids=" + n + "&month=" + month + "&year=" + year + "&wages_id=" + wages_id + "&ex_engineer=" + ex_engineer + "&selected_edd_id=" + selected_edd_id + "&electry_city=" + electry_city + "&ag_id=" + ag_id, true); xmlhttp.send(); } } } function exit_from_list(cid, wages_id, status, month, year) { var selected_edd_id = $('#selected_edd_id').val(); var area_name = $('#area_name').val(); var ajency_name = $('#ajency_name').val(); var ex_engineer = $('#ex_engineer').val(); var selected_edd_id = $('#selected_edd_id').val(); var electry_city = $('#electry_city').val(); // alert(id); var n = cid; // var n = []; // var wages_id = []; // $.each($("input[name='checkboxes']:not(:checked)"), function () { // var cid = $(this).val(); // n.push(cid); // wages_id.push($('#wages_id_' + cid).val()); // }); // alert(n); // alert(wages_id); if (n == 0) { // alert('no record sel'); $('#bulk_err').text('No Record Selected!'); $('#res_err').css('display', 'block'); } else { $('#modal_for_check_unckeck_' + n).modal('toggle'); $('#bulk_res').text('Please wait...'); $('#res_msg').css('display', 'block'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Employee Exited From Month List Successfully/g) == 'Employee Exited From Month List Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else if (res.match(/Employee Back to Attendance List Successfully/g) == 'Employee Back to Attendance List Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else if (res.match(/Employee Deleted From Attendance List Successfully/g) == 'Employee Deleted From Attendance List Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); location.reload(); // window.history.back(); // window.location.href = "update_details.php"; }, 3000); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "../include/change_monthwise_employee_status.php?status=" + status + "&ids=" + n + "&month=" + month + "&year=" + year + "&wages_id=" + wages_id + "&ex_engineer=" + ex_engineer + "&selected_edd_id=" + selected_edd_id + "&electry_city=" + electry_city, true); xmlhttp.send(); } } function print_lockbooks(list_status, list_type) { // var area_name = $('.input-sm').val(); var book_type = $('#book_type').val(); var view_type = $('#view_type').val(); var select_month = $('#select_month').val(); var select_year = $('#select_year').val(); var date_from = $("#date_from").val(); var company_id = $("#company_id").val(); var company_name = $("#company_name").val(); var unit_id = $("#unit_id").val(); var unit_name = $("#unit_name").val(); var unit_code = $("#unit_code").val(); if (!unit_id) { alert('Select Unit!'); } else if (!book_type) { alert('Select Transaction Book Type!'); } else if (!view_type) { alert('Select Book View Type!'); } else { // alert(area_name); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { // window.location.href = '../lists/print_newemployee_details.php?emp_id=' + n + "&area_name=" + area_name; // window.open("../lists/print_newemployee_details.php?emp_id=" + n + "&area_name=" + area_name, "_blank"); window.open("../ledger/print_lockbook_details.php?id=" + n + "&list_status=" + list_status + "&list_type=" + list_type + "&book_type=" + book_type + "&view_type=" + view_type + "&select_month=" + select_month + "&select_year=" + select_year + "&date_from=" + date_from + "&company_id=" + company_id + "&company_name=" + company_name + "&unit_id=" + unit_id + "&unit_name=" + unit_name + "&unit_code=" + unit_code, "_blank"); } } } function open_view_agreement_modal(row_id, agreement_number, t_name, am_id) { // alert(row_id + agreement_number + t_name); $('#myModal_view').modal('show'); $('#agreement_number_text').text(agreement_number); $('#agreement_number').val(agreement_number); $('#am_id').val(am_id); if (t_name == 'tbl_agmt') { $('#agree_form').attr('action', '../forms/view_agreement_details_new.php'); } else { $('#agree_form').attr('action', '../forms/view_agreement_details.php'); } } function employee_relatives_detail(x, list_of) { // alert(x+list_of); if (x == " " || x == "accepted" || x == "unaccepted") { } else { } var status = document.getElementById('ff').style.display = 'block'; if (status == 'block') { document.getElementById('ff').style.display = 'none'; document.getElementById('imload').style.display = 'block'; } else { document.getElementById('imload').style.display = 'none'; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); $("#emp_type").css("color", "blue"); if (x == "unaccepted") { $('#emp_type').html(list_of + ' Pending List'); } else if (x == "accepted") { $('#emp_type').html(list_of + ' Accepted List'); } document.getElementById('ff').innerHTML = xmlhttp.responseText; document.getElementById('ff').style.display = 'block'; document.getElementById('imload').style.display = 'none'; // $('.result_table').DataTable(); $('#datatable-checkbox').dataTable({ "columnDefs": [{"orderable": false, "targets": 'no-sort'}], "scrollY": "50vh", "scrollCollapse": true, "scrollX": true, "autoWidth": false }); // $('#datatable-checkbox').DataTable({ // paging: true, searching: true, // dom: 'Bfrtip', // buttons: [ // 'copy', 'csv', 'excel', 'pdf', 'print' // ] // }); if (xmlhttp.responseText == 'empty') { document.getElementById('ff').style.display = 'none'; } } } xmlhttp.open("GET", "relatives.php?q=" + x + "&list_of=" + list_of, true); xmlhttp.send(); } function open_whatsapp_modal(cid) { // alert(cid); $('#msg_send_btn').val(cid); $('#myModal_whatsapp').modal('show'); } function send_whatsapp_msg(message_type) { if (message_type == 1) { var whatsapp_msg = $('#whatsapp_msg_bulk').val(); var n = []; $.each($("input[name='checkboxes']:checked"), function () { n.push($(this).val()); }); } else { var whatsapp_msg = $('#whatsapp_msg').val(); var n = $('#msg_send_btn').val(); } // alert(whatsapp_msg); // alert(n); if (n == 0) { $('.res_err').show(); $('#bulk_err').html('No Record Selected!'); } else { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { $('#myModal_whatsapp').modal('hide'); if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Message Sent Successfully/g) == 'Message Sent Successfully') { $('.res_msg').show(); $('#bulk_res').html(xmlhttp.responseText); } else { $('.res_err').show(); $('#bulk_err').html(xmlhttp.responseText); } setTimeout(function () { $('.msg_box').hide(); // window.history.back(); location.reload(); // window.location.href = "update_details.php"; }, 3000); } } xmlhttp.open("GET", "../assets/whatsapp_api.php?whatsapp_msg=" + whatsapp_msg + "&ids=" + n, true); xmlhttp.send(); } } function change_party_status_all(status, n) { var reason = $('#reason_' + status).val(); var date = $('#date_' + status).val(); // alert(status + n); // alert(date); // alert(reason); if (!date) { $('.res_err').show(); $('#bulk_err').html('Date is not Selected!'); } else if (!reason) { $('.res_err').show(); $('#bulk_err').html('Enter Reason!'); } else { if (status == 'ACTIVE') { var amount = $('#amount_' + status).val(); var amount_type = $('#amount_type_' + status + ' option:selected').val(); // alert(amount + amount_type); if (!amount) { $('.res_err').show(); $('#bulk_err').html('Enter Opening Amount !'); } else if (!amount_type) { $('.res_err').show(); $('#bulk_err').html('Select Amount Type!'); } else { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Party Status Changed Successfully/g) == 'Party Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(res); } else { $('.res_err').show(); $('#bulk_err').html(res); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); } } xmlhttp.open("GET", "../include/change_party_status.php?ep_id=" + n + "&reason=" + reason + "&date=" + date + "&amount=" + amount + "&amount_type=" + amount_type + "&status=" + status, true); xmlhttp.send(); } } else { var amount = '0.00'; var amount_type = ''; // alert(amount + amount_type); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var res = xmlhttp.responseText; // alert(res); if (res.match(/Party Status Changed Successfully/g) == 'Party Status Changed Successfully') { $('.res_msg').show(); $('#bulk_res').html(res); } else { $('.res_err').show(); $('#bulk_err').html(res); } setTimeout(function () { $('.msg_box').hide(); location.reload(); }, 3000); } } xmlhttp.open("GET", "../include/change_party_status.php?ep_id=" + n + "&reason=" + reason + "&date=" + date + "&amount=" + amount + "&amount_type=" + amount_type + "&status=" + status, true); xmlhttp.send(); } } } function check_agreement_loy(number, name) { //alert(number); //alert(name); // loy or agreement if (number.length != 0 && number != '') { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var r = xmlhttp.responseText; // alert(r); var res = r.match(/matched/g); if (res == 'matched') { // $('#zone').css("border", "1px solid red"); $('#modify_agree_no').css("display", "block"); $('#add_agree_no').css("display", "none"); // $('#add_agreement').attr("disabled", true); $('#error_msg').css("display", "block"); } else { // $('#zone').css("border", "1px solid #dedede"); $('#add_agree_no').css("display", "block"); $('#modify_agree_no').css("display", "none"); // $('#add_agreement').attr("disabled", false); $('#error_msg').css("display", "none"); } $("#spin").hide(); } } xmlhttp.open("GET", "../include/check_agreement_loy.php?name=" + name + "&number=" + number, true); xmlhttp.send(); } else { // $('#zone').css("border", "1px solid #dedede"); $('#add_agree_no').css("display", "block"); $('#modify_agree_no').css("display", "none"); // $('#add_agreement').attr("disabled", false); $('#error_msg').css("display", "none"); } }