var simhoursforbid = false; var mytime = parseInt(Date.now()/1000); var howmanyrowsoninvoicetable = 0; var availableTags = ['2 WEEK CALLBACKS','3 DAY CALLBACKS','4 DAY CALLBACKS','4 WEEK CALLBACKS','AUDIT HOURS','AUGMENT CALLBACK 1','BRIEFING HOURS','CANCELLATION FEES','CLIENT VISIT','COMPLETED 1ST CALLBACK','COMPLETED 2ND CALLBACK','COMPLETED 3RD CALLBACK','COMPLETED AA INTERVIEWS','COMPLETED AUGMENTS','COMPLETED CALLBACKS','COMPLETED GENERAL','COMPLETED HISP INTERVIEWS','COMPLETED INTERVIEWS','COMPLETED MALL INTERVIEWS','COMPLETED NON-USERS','COMPLETED PAIRED INTERVIEWS','COMPLETED PAR/KIDS','COMPLETED PLACEMENTS','COMPLETED PRR INTERVIEWS','COMPLETED RANDOM','COMPLETED TASTE TESTS','CONCEPT ONLY','CONTROL INTERVIEWS','COPIES MADE','DATA ENTRY','DIARY RETURNS','DRIVE TIME','EXPENSES','FACILITY RENTAL','FOCUS GROUP','FRIDGE FEES','GIFT CARDS','INCENTIVES PAID','INTERVIEWING HOURS','KITCHEN HELP','LABELING TIME','MAIL FEES','MILES DRIVEN','MISCELLANEOUS EXP','PHONE CALLS','PIZZA PARTY','POSTAGE / SHIPPING COSTS','PROJECT MANAGEMENT FEE','RANDOM CALLBACK 1','REMINDER CALLS','RESCHEDULE FEES','SET UP AND PREP','SHELF RENTAL','SHELF SET UP PER HOUR','SHOPPING TIME','TABLET FEES','TEST INTERVIEWS','TT SUPPLIES','VIDEO RECORDINGS' ]; var globallastjobdone = ""; var mylevel = ""; var mylastarcspersonid = 0; String.prototype.replaceAll = function(search, replacement) { var target = this; return target.replace(new RegExp(search, 'g'), replacement); }; function urldecode(str) { console.log(str) // return decodeURIComponent(str.replace(/\+/g, ' ')); var mystring = str; try { mystring = decodeURIComponent((str+'').replace(/\+/g, '%20')); } catch(err) { } return mystring; } function urlencode(text) { return encodeURIComponent(text).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+'); } function setCookie(cname, cvalue) { document.cookie = cname + "=" + cvalue + "; "; } function delete_cookie( name ) { document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } function getCookie(name) { var r = document.cookie.match("\\b" + name + "=([^;]*)\\b"); return r ? r[1] : undefined; } function timeStamp(d) { var now = new Date(d*1000); var date = [ now.getMonth() + 1, now.getDate(), now.getFullYear() ]; var time = [ now.getHours(), now.getMinutes(), now.getSeconds() ]; var suffix = ( time[0] < 12 ) ? "AM" : "PM"; time[0] = ( time[0] < 12 ) ? time[0] : time[0] - 12; time[0] = time[0] || 12; for ( var i = 1; i < 3; i++ ) if ( time[i] < 10 ) time[i] = "0" + time[i]; return date.join("/") + " " + time.join(":") + " " + suffix; } function timeStamp24hour(d) { var now = new Date(d*1000); var date = [ now.getMonth() + 1, now.getDate(), now.getFullYear() ]; var time = [ now.getHours(), now.getMinutes(), now.getSeconds() ]; // var suffix = ( time[0] < 12 ) ? "AM" : "PM"; time[0] = ( time[0] < 12 ) ? time[0] : time[0] - 12; time[0] = time[0] || 12; for ( var i = 1; i < 3; i++ ) if ( time[i] < 10 ) time[i] = "0" + time[i]; return date.join("/") + " " + time.join(":"); } var arrayUnique = function(a) { return a.reduce(function(p, c) { if (p.indexOf(c) < 0) p.push(c); return p; }, []); }; function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } function simulatehoursonbids(that) { $("#simulatesectiontotals").css("display", "block"); $(that).css("background-color", "lightgreen"); $(that).html("simulating"); simhoursforbid=true; var mydate; $(".hoursclasstoreplace").each(function() { var mynp = $("").attr({"type":"number","id":"manualhourtextbox_" + $(this).attr("empid")}).css({"width":"50px"}); mydate = $(this).attr("thedate"); mynp.on("focus", function() { var mytempdata = $(this).val(); $(this).one("blur", function() { if ($(this).val() != mytempdata) { $.getJSON("/json/updatemanualhours.php?date=" + $(this).parent().attr("thedate") + "&emp=" + $(this).parent().attr("empid") + "&hour=" + $(this).val(), function(data) { }); console.log("send new"); } }); }); $(this).empty(); $(this).append( mynp); }); $(".percenttoclearforman").empty(); $(".totalfordaytoclearforman").empty(); $(".totaltoclearforman").empty(); $.getJSON("/json/getmanhoursfor.php?number=&date=" + mydate, function(data) { $.each(data, function(key, val) { console.log(val); if( $("#" + key ).is('input') ) { $("#" + key ).val(val); } else { $("#" + key ).html(val); } }); console.log(data); }); } function logoutfrommanagertools() { delete_cookie("managerpass"); // $("#managerstoolsdropdown").css("display","none"); // $("#enablemanagerstoolsul").css("display","block"); window.location.assign("/"); } function enablemanagertools() { var person = prompt("Please input the managers password", ""); $.getJSON("/inputs/confirmmanagerpass.php?pass=" + urlencode(person), function (data) { if (data.result == "ok") { setCookie("managerpass", data.manmd5); window.location.assign("/"); // $("#managerstoolsdropdown").css("display","block"); // $("#enablemanagerstoolsul").css("display","none"); } }); } function billjobnowforwips(theid, billstatus, thisa) { var that = thisa; $.getJSON("/inputs/wipsmanagement.php?get=wips&status=" + billstatus + "&number=&do=bill&id=" + theid, function(data) { $(that).parent().html('' + data.change + ''); console.log(data); }); } function shipjobnowforwips(theid, billstatus, thisa) { var that = thisa; $.getJSON("/inputs/wipsmanagement.php?get=wips&status=" + billstatus + "&number=&do=ship&id=" + theid, function(data) { $(that).parent().html('' + data.change + ''); console.log(data); }); } function givestriketoemp(name, number) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getstrikeinfo.php?temptime=" + mytime + "&number=&num=" + number, function( data ) { $("#givestriketoempfield").html(urldecode(name)); $("#strikeempnumber").val(urldecode(number)); $("#previousstrikeul").html(""); $.each(data, function(key, value) { var d = new Date(value.tima*1000); var li = $("
  • ") .addClass("ui-menu-item") .attr("role", "menuitem") .html(urldecode(value.reason) + " - " + timeStamp(value.tima) + "") .appendTo($("#previousstrikeul")); }); $("#givestrikeprompt").modal(); }); } function validateinvoiceform() { console.log(howmanyrowsoninvoicetable); for(tempx=0;tempx 0 && $("#invoiceexpensesdesc").val().trim().length <= 0) { $("#invoicejobmessage").html("Please put in a description for the expenses");} if ($("#invoicejobname").val().trim().length <= 0) { $("#invoicejobmessage").html("Job name not entered");} if ($("#invoicejobnum").val().trim().length <= 0) { $("#invoicejobmessage").html("Job number not entered");} if ($("#invoicecode").val().trim().length <= 0) { $("#invoicejobmessage").html("Company Code not entered");} setTimeout('$("#invoicejobmessage").html("");', 5000); return false; } function showeditjobwindow(theccnum, number) { mytime = parseInt(Date.now()/1000); globallastjobdone=theccnum; $.getJSON( "/json/getwipinfo.php?temptime=" + mytime + "&number=" + number + "&num=" + theccnum, function( data ) { $("#editjobname").val(urldecode(data.jobname)); $("#editjobnum").val(urldecode(data.jobnumber)); $("#editnumber").val(number); $("#editjobstart").val(urldecode(data.startdate)); $("#editjobtype").val(urldecode(data.format)); $("#editjobend").val(urldecode(data.enddate)); $("#editjobcpi").val(urldecode(data.cpi)); $("#editjobcoop").val(urldecode(data.coop)); $("#editjobquota").val(urldecode(data.totq)); $("#editjobdesc").val(urldecode(data.desc)); $("#editjobprcells").val(urldecode(data.prcells)); $("#editjobeditnum").val(urldecode(data.ccnum)); $("#editjobcredits").val(urldecode(data.credits)); $("#ccnumdisplayfield").html("" + urldecode(data.ccnum.substring(0, data.ccnum.indexOf("_"))) + ""); if (data.userlevel >= 8) { $("#editwipsdeletebutton").css("display","block"); $("#editjobsubmit").css("display","inline"); } else { $("#editwipsdeletebutton").css("display","none"); $("#editjobsubmit").css("display","none"); } console.log(data.files); $('#filelistforeditingthestudy').html(""); if (data.files.length > 0) { var textforfilelist = ""; textforfilelist+=""; textforfilelist+=""; textforfilelist+=""; textforfilelist+=""; textforfilelist+=""; $.each(data.files, function( index, value ) { textforfilelist+=""; textforfilelist+=""; textforfilelist+=""; textforfilelist+=""; textforfilelist+=""; console.log(index); console.log(value); textforfilelist+=""; }); textforfilelist+="
    filedescuploaderdate
    " + urldecode(value.origname) + "" + urldecode(value.description) + "" + value.username + "" + value.uploaddate + "
    "; console.log(textforfilelist); $('#filelistforeditingthestudy').html(textforfilelist); $("#filelistforeditingthestudytable").tablesorter({theme : "blue",widgets: ["zebra"],widgetOptions : {zebra : [ "normal-row", "alt-row" ]},sortList: [[0,0]]}); } if (data.startdate == "0000-00-00") { var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); if(dd<10) {dd = '0'+dd} if(mm<10) {mm = '0'+mm} data.startdate = yyyy+"-"+mm+"-"+dd; } if (data.enddate == "0000-00-00") { var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); if(dd<10) {dd = '0'+dd} if(mm<10) {mm = '0'+mm} data.enddate = yyyy+"-"+mm+"-"+dd; } $('#editjobstart').datetimepicker({defaultDate: urldecode(data.startdate)}); $('#editjobend').datetimepicker({defaultDate: urldecode(data.enddate)}); $("#editjobprompt").modal(); }); } function deletecheck() { mytime = parseInt(Date.now()/1000); console.log($("#editcheckofficenumber").val()); console.log($("#editcheckid").val()); var myresult = confirm("Are you sure you want to delete this check?"); if (myresult) { window.location = "/inputs/deletecheckid.php?get=index&number=" + $("#editcheckofficenumber").val() + "&do=delete&checkid=" + $("#editcheckid").val(); } } function voidcheck() { mytime = parseInt(Date.now()/1000); console.log($("#editcheckofficenumber").val()); console.log($("#editcheckid").val()); var myresult = confirm("Are you sure you want to " + $("#editcheckvoidbutton").html() + " this check?"); if (myresult) { window.location = "/inputs/voidcheckid.php?get=index&number=" + $("#editcheckofficenumber").val() + "&do=void&checkid=" + $("#editcheckid").val(); } } function deletevoucher() { mytime = parseInt(Date.now()/1000); console.log($("#editvoucherofficenumber").val()); console.log($("#editvoucherid").val()); var myresult = confirm("Are you sure you want to delete this voucher?"); if (myresult) { window.location = "/inputs/deletevoucherid.php?get=index&number=" + $("#editvoucherofficenumber").val() + "&do=delete&voucherid=" + $("#editvoucherid").val(); } } function voidvoucher() { mytime = parseInt(Date.now()/1000); console.log($("#editvoucherofficenumber").val()); console.log($("#editvoucherid").val()); var myresult = confirm("Are you sure you want to " + $("#editvouchervoidbutton").html() + " this voucher?"); if (myresult) { window.location = "/inputs/voidvoucherid.php?get=index&number=" + $("#editvoucherofficenumber").val() + "&do=void&voucherid=" + $("#editvoucherid").val(); } } function checkdatetotimestamp(strDate){ var datum = Date.parse(strDate); return datum/1000; } function editcheckid(number, checkid) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getcheckinfo.php?temptime=" + mytime + "&number=" + number + "&checkid=" + checkid, function( data ) { console.log(data); $("#editcheckid").val(urldecode(data.id)); $("#editcheckchecknumber").val(urldecode(data.checknum)); $("#editcheckpayeename").val(urldecode(data.payeename)); $("#editcheckdate").val(urldecode(data.checkdate)); $("#editcheckamount").val(urldecode(data.amount)); $("#editcheckglaccount").val(urldecode(data.glaccount)); $("#editcheckrespondentname").val(urldecode(data.respondentname)); $("#editcheckjobid").val(urldecode(data.jobid)); console.log("test") var twoweeksago = new Date(new Date() - (86400*14*1000)); twoweeksago = (twoweeksago.getMonth()+1) + "/" + twoweeksago.getDate() + "/" + twoweeksago.getFullYear(); var thecheckdate = moment(urldecode(data.checkdate)); var thecheckmindatetwoweeks = moment(twoweeksago); $('#editcheckdate').datetimepicker({defaultDate: urldecode(data.checkdate)}); console.log("1") if (data.void == "yes") { $("#editcheckvoidbutton").html("UnVoid"); } else { $("#editcheckvoidbutton").html("Void"); } console.log("2") $("#editcheckdeletebutton").css("display", "none"); if ((Math.floor(Date.now() / 1000))-data.inputtime > (86400/2)) {$("#editcheckbutton").css("display", "none"); } else { $("#editcheckbutton").css("display", "block"); } if ((Math.floor(Date.now() / 1000))-data.inputtime > (86400/2)) {$("#editcheckvoidbutton").css("display", "none"); } else { $("#editcheckvoidbutton").css("display", "block"); } $("#editcheckform").bind("keypress", function (e) { if (e.keyCode == 13) { return false; } }); $("#editcheckprompt").modal(); }); } function editvoucherid(number, voucherid) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getvoucherinfo.php?temptime=" + mytime + "&number=" + number + "&voucherid=" + voucherid, function( data ) { $("#editvoucherid").val(urldecode(data.id)); $("#editvouchervouchernumberspan").html(urldecode(data.checknum)); $("#editvoucherdate").val(urldecode(data.checkdate)); $("#editvoucheramount").val(urldecode(data.amount)); $("#editvoucherglaccount").val(urldecode(data.glaccount)); $("#editvouchernumberofrespondents").val(urldecode(data.numresp)); $("#editvoucherjobid").val(urldecode(data.jobid)); $("#editvoucherdescription").val(urldecode(data.description)); var twoweeksago = new Date(new Date() - (86400*14*1000)); twoweeksago = (twoweeksago.getMonth()+1) + "/" + twoweeksago.getDate() + "/" + twoweeksago.getFullYear(); $('#editvoucherdate').datetimepicker({defaultDate: urldecode(data.checkdate)}); if (data.void == "yes") { $("#editvouchervoidbutton").html("UnVoid"); } else { $("#editvouchervoidbutton").html("Void"); } $("#editvoucherdeletebutton").css("display", "none"); if ((Math.floor(Date.now() / 1000))-data.inputtime > (86400/2)) {$("#editvoucherbutton").css("display", "none"); } else {$("#editvoucherbutton").css("display", "block"); } if ((Math.floor(Date.now() / 1000))-data.inputtime > (86400/2)) {$("#editvouchervoidbutton").css("display", "none"); } else {$("#editvouchervoidbutton").css("display", "block");} $("#editvoucherform").bind("keypress", function (e) { if (e.keyCode == 13) { return false; } }); $("#editvoucherprompt").modal(); }); } function deletethisjob() { var myccnum = $("#editjobeditnum").val(); var mynumber = $("#editnumber").val(); var myresult = confirm("Are you sure you want to delete this from wips?"); if (myresult) { window.location = "/inputs/deletejobfromwips.php?get=index&ccnum=" + myccnum + "&do=delete&number=" + mynumber; } // alert(myccnum); } function deletethisjoboverall() { var myccnum = $("#editfieldwipnum").val(); var myresult = confirm("Are you sure you want to delete this from wips from all offices?"); if (myresult) { console.log("/inputs/deletejobfromwipsoverall.php?get=index&ccnum=" + myccnum + "&do=delete"); window.location = "/inputs/deletejobfromwipsoverall.php?get=index&ccnum=" + myccnum + "&do=delete"; } // alert(myccnum); } function showfilemakerjob(theccnum) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getfilemakerjobinfo.php?temptime=" + mytime + "&num=" + theccnum, function( data ) { $("#filemakerinfoshowdiv").html(urldecode(data.data)); console.log(data.data); }); } function showeditfieldwipwindow(theccnum) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getfieldwipinfo.php?temptime=" + mytime + "&num=" + theccnum, function( data ) { console.log(data); $("#editfieldwipnum").val(urldecode(data.ccnum)); $("#editfieldwipname").val(urldecode(data.jobname)); $("#editfieldwipnumber").val(urldecode(data.jobnumber)); $("#editfieldwippm").val(urldecode(data.pmname)); $("#editfieldwipstatus").val(urldecode(data.fieldwipstatus)); $("#editfieldwipcomment").html(urldecode(data.fieldwipinfo)); if (data.userlevel >= 8) { // $("#editwipsdeletebuttonoverall").css("display","block"); } else { $("#editwipsdeletebuttonoverall").css("display","none"); } $("#editfieldwipprompt").modal(); }); } function removerow() { console.log($(this)); $(this).parent().remove(); } function updateinvoicetotaldue() { var totaldue = 0; for(tempx=0;tempx$$X"); $( '#invoicejobquota' + howmanyrowsoninvoicetable ).val(0); $( '#invoicejobcoop' + howmanyrowsoninvoicetable ).val(0); $( '#invoicejobcpi' + howmanyrowsoninvoicetable ).val(0); $('#clicktoremoverow' + howmanyrowsoninvoicetable).on('click', function() { console.log(this.id); if (this.id != 'clicktoremoverow0') { $(this).parent().parent().remove(); howmanyrowsoninvoicetable--; } }); $( '#invoicejobdesc' + howmanyrowsoninvoicetable ).autocomplete({ source: availableTags }); $( '#invoicejobquota' + howmanyrowsoninvoicetable ).on('keypress', function(e) { if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) { return false; } }); $( '#invoicejobquota' + howmanyrowsoninvoicetable ).on('keyup', function() { updateinvoicetotaldue(); }); $( '#invoicejobcoop' + howmanyrowsoninvoicetable ).on('keypress', function(e) { if (e.which != 8 && e.which != 0 && e.which != 46 && (e.which < 48 || e.which > 57)) { return false; } }); $( '#invoicejobcoop' + howmanyrowsoninvoicetable ).on('keyup', function() { updateinvoicetotaldue(); }); $( '#invoicejobcpi' + howmanyrowsoninvoicetable ).on('keypress', function(e) { if (e.which != 8 && e.which != 0 && e.which != 46 && (e.which < 48 || e.which > 57)) { return false; } }); $( '#invoicejobcpi' + howmanyrowsoninvoicetable ).on('keyup', function() { updateinvoicetotaldue(); }); $( '#invoiceexpenses' ).on('click', function() { updateinvoicetotaldue(); }); howmanyrowsoninvoicetable++; } function showinvoicewindow(theccnum) { mytime = parseInt(Date.now()/1000); $.getJSON( '/json/getwipinfoforinvoice.php?temptime=' + mytime + '&number=&num=' + theccnum, function( data ) { howmanyrowsoninvoicetable=0; console.log(data); $('#invoicedetailtable').html("QDescriptionCoopCpi") .html("" + value.text + "") .addClass("table-bordered") .css("text-align", "center") .appendTo($("#weekhistoryfortimesheettablehead")); var li2 = $("") .html("" + value.value.toFixed(2) + "") .addClass("table-bordered") .css("text-align", "center") .appendTo($("#weekhistoryfortimesheettablebody")); if (value.color) { li2.css("color", value.color); } }); } if (data.history) { $.each(data.history, function(key, value) { var d = new Date(value.tima*1000); var li = $("
  • ") .addClass("ui-menu-item") .attr("role", "menuitem"); li.html(buildstringfortimesheethistory(value,0,"history", passhash2, date, empid, name, timezonedifference)); li.appendTo($("#timesheethistory")); }); } if (data.deleted) { $.each(data.deleted, function(key, value) { var d = new Date(value.tima*1000); var li = $("
  • ") .addClass("ui-menu-item") .attr("role", "menuitem"); li.html(buildstringfortimesheethistory(value,0,"deleted", passhash2, date, empid, name, timezonedifference)); li.appendTo($("#timesheethistorydeleted")); }); } if (mylevel < 8) { $("#addnewtimesheetentry").css("display", "none"); } else { if (getCookie("nameforcc") == "nancy" || getCookie("nameforcc") == "nkhodayari" || getCookie("nameforcc") == "charity" || getCookie("nameforcc") == "alex" || getCookie("nameforcc") == "staci" || getCookie("nameforcc") == "karthic") { $("#addnewtimesheetentry").css("display", "block"); } else { $("#addnewtimesheetentry").css("display", "none"); } } $("#employeetimesheetprompt").modal(); } function buildstringfortimesheethistory(data, valx, type, passhash2, date, empid, name, timezonedifference) { var mystring = ""; valx++; if (type == "history") { if (valx==1) { if (mylevel == 8) { if (getCookie("nameforcc") == "nancy" || getCookie("nameforcc") == "nkhodayari" || getCookie("nameforcc") == "charity" || getCookie("nameforcc") == "alex" || getCookie("nameforcc") == "staci" || getCookie("nameforcc") == "karthic") { mystring += "delete "; mystring += "modify "; } } } } else if (type == "deleted") { if (valx==1) { if (mylevel == 8) { if (getCookie("nameforcc") == "nancy" || getCookie("nameforcc") == "nkhodayari" || getCookie("nameforcc") == "nancy" || getCookie("nameforcc") == "karthic") { mystring += "restore "; } } } } timezonedifference = parseInt(timezonedifference); mystring += "" + data.method + " - " + timeStamp(parseInt(urldecode(data.servertima))) + " - " + data.action; if (typeof data.override === 'object') { mystring += " - " + buildstringfortimesheethistory(data.override, valx, type, passhash2, date, empid, name, timezonedifference); } return mystring; } function getcameralist(number) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getcamerainfo.php?temptime=" + mytime + "&number=" + number, function( data ) { $.each(data, function(key, value) { var tr = $("") .appendTo($("#bodyofcameralisttable")); var td1 = $("") .html("" + value.url + "") .appendTo(tr); var td2 = $("") .html(value.status) .appendTo(tr); if (value.status == "offline") { td2.css("color","red"); } else if (value.status == "online") { td2.css("color","green"); } }); $("#getcameralistlink").css("display", "none"); }); } function approveemployee(number, officenumber) { mytime = parseInt(Date.now()/1000); $.getJSON( "/inputs/approveemployee.php?temptime=" + mytime + "&number=" + officenumber + "&num=" + number, function( data ) { }); } function editempinfo(name, number, officenumber) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getemployeeinfo.php?temptime=" + mytime + "&number=" + officenumber + "&num=" + number, function( data ) { $("#employeenamespan").html(urldecode(name)); $("#editemployeeempnum").val(number); $("#editemployeeofficenumber").val(officenumber); $("#editemployeephone").val(urldecode(data.phone)); $("#editemployeename").val(urldecode(data.name)); $("#editemployeepay").val(urldecode(data.payrate)); $("#editemployeemanager").val(urldecode(data.manager)); $("#editemployeecanuseid").val(urldecode(data.usesidtoclock)); $("#editemployeessn").val(urldecode(data.ssn)); $("#editemployeeaddress").val(urldecode(data.address)); $("#editemployeecity").val(urldecode(data.city2)); $("#editemployeebirthdate").val(urldecode(data.birthdate)); $("#editemployeehiredate").val(urldecode(data.hiredate)); $("#editemployeefilings").val(urldecode(data.filings)); $("#editemployeeallowences").val(urldecode(data.allowences)); $("#editemployeepayrollid").val(urldecode(data.payrollid)); $("#editemployeeroutingnumber").val(urldecode(data.routingnumber)); $("#editemployeeaccountnumber").val(urldecode(data.accountnumber)); if (data.globalusersql.level < 8) { $("#showmanagerfieldeditemployeesbutton").css("display","block"); //$("#addempbutton").css("display","none"); } else { $("#showmanagerfieldeditemployeesbutton").css("display","none"); } console.log(data); $("#editemployeeprompt").modal(); $("#editemployeebirthdate").datetimepicker({defaultDate: urldecode(data.birthdate)}); $("#editemployeehiredate").datetimepicker({defaultDate: urldecode(data.hiredate)}); }); } function addofficetofieldwips(theccnum, thesubccnum, number) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getfieldwipinfo.php?temptime=" + mytime + "&num=" + theccnum + "&subnum=" + thesubccnum + "&number=" + number, function( data ) { console.log(data); $("#addofficetofieldwipnum").val(urldecode(data.ccnum)); $("#addofficetofieldwipsjobnumber").val(urldecode(data.jobnumber)); $("#addofficetofieldwipsjobname").val(urldecode(data.jobname)); $("#addofficetofieldwipsjobcode").val(urldecode(data.cocode)); $("#addofficetofieldwipspmname").val(urldecode(data.pmname)); $("#addofficetofieldwipname").val(urldecode(data.desc)); $("#addofficetofieldwipsquota").val(urldecode(data.totq)); $("#addofficetofieldwipsstartdate").val(urldecode(data.startdate)); $("#addofficetofieldwipsenddate").val(urldecode(data.enddate)); $("#addofficetofieldwipscpi").val(urldecode(data.cpi)); $("#addofficetofieldwipscoop").val(urldecode(data.coop)); $("#addofficetofieldwipsformat").val(urldecode(data.format)); $( '#addofficetofieldwipsstartdate' ).datetimepicker({ defaultDate: urldecode(data.startdate) }); $( '#addofficetofieldwipsenddate' ).datetimepicker({ defaultDate: urldecode(data.enddate) }); $("#addofficetofieldwips").modal(); }); } function getuserinfo(theusernum) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getuserinfo.php?temptime=" + mytime + "&num=" + theusernum, function( data ) { console.log(data); $("#edituserprevurl").val(window.location.href); $("#editusernum").val(urldecode(data.number)); $("#editusername").val(urldecode(data.name)); $("#edituseremail").val(urldecode(data.email)); $("#editusercellphone").val(urldecode(data.cellphone)); $("#editusermainphone").val(urldecode(data.mainnumber)); $("#edituserprimaryfunction").val(urldecode(data.primaryfunction)); $("#edituserofficesortorder").val(urldecode(data.officesortorder)); $("#edituseremail").attr("disabled", "disabled"); $("#editusermainphone").attr("disabled", "disabled"); $("#edituserprompt").modal(); }); } function getuseraccountinfo(theusernum) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getuseraccountinfo.php?temptime=" + mytime + "&num=" + theusernum, function( data ) { console.log(data); $("#edituseraccountprevurl").val(window.location.href); $("#edituseraccountnum").val(urldecode(data.number)); $("#edituseraccountusername").val(urldecode(data.username)); $("#edituseraccountactive").val(urldecode(data.active)); $("#edituseraccountprompt").modal(); }); } function logintoacomputerloadfuncs(number, comphash) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/logintoacomputerloadfuncs.php?temptime=" + mytime + "&number=" + number + "&comphash=" + comphash, function( data ) { console.log(data); $("#logintocomputernamefield").html(data.name + " " + data.mallinfo + ""); $("#logintocomputerlastcheckinfield").html(data.phone + " - Last checkin " + data.timestring + ""); $("#logmeinnumber").val(number); $("#logmeincomphash").val(comphash); $("#loginto-iframe").removeAttr("src"); $("#loginto-iframe").html(""); $("#logmeinloginprompt").find("button").each(function() { $(this).removeAttr("disabled"); $(this).css("background-color", "white"); }); $("#recentloginsul").html(""); $.each(data.recent, function(key, value) { var d = new Date(value.tima*1000); var li = $("
  • ") .addClass("ui-menu-item") .attr("role", "menuitem") .html(urldecode(value.loginuser) + " - " + timeStamp(value.tima) + "") .appendTo($("#recentloginsul")); }); $("#logmeinloginprompt").modal(); }); } function logintothiscompas(name) { mytime = parseInt(Date.now()/1000); var tempstring = "http://firewall.ccmar.com/logmeinwindow.php?number=" + $("#logmeinnumber").val() + "&time=" + mytime + "&comphash=" + $("#logmeincomphash").val() + "&loginto=" + name; console.log(tempstring); $("#loginto-iframe").attr("src", tempstring); } function infologintothiscompas(name) { mytime = parseInt(Date.now()/1000); var tempstring = "http://firewall.ccmar.com/logmeinwindow.php?number=" + $("#logmeininfonumber").val() + "&time=" + mytime + "&comphash=" + $("#logmeininfocomphash").val() + "&loginto=" + name; console.log(tempstring); $("#info-loginto-iframe").attr("src", tempstring); } function getcompinfo(number, comphash) { mytime = parseInt(Date.now()/1000); $.getJSON( "/json/getcompinfo.php?temptime=" + mytime + "&number=" + number + "&comphash=" + comphash, function( data ) { console.log(data); $("#infologintocomputernamefield").html(data.name + " " + data.mallinfo + ""); $("#infologintocomputerlastcheckinfield").html(data.phone + " - Last checkin " + data.timestring + ""); $("#logmeininfonumber").val(number); $("#logmeininfocomphash").val(comphash); $("#info-loginto-iframe").removeAttr("src"); $("#info-loginto-iframe").html(""); $("#logmeininfoprompt").find("button").each(function() { $(this).removeAttr("disabled"); $(this).css("background-color", "white"); }); $("#inforecentloginsul").html(""); $("#infoprocessul").html(""); $("#infoprocessul2").html(""); $("#logininfoprompttablebody").html(""); if ("process" in data.checkindata) { var processstring = urldecode(data.checkindata.process).split("|"); processstring = arrayUnique(processstring); var myx = 0; $.each(processstring, function(key, value) { if (value.indexOf(".") && value.length > 5) { var li = $("
  • ") .addClass("ui-menu-item") .attr("role", "menuitem") .css("padding", "0") .css("margin", "0") .css("line-height", "14px") .css("word-wrap", "break-word") .html("" + value + ""); if (myx==0) {li.appendTo($("#infoprocessul"));} if (myx==1) {li.appendTo($("#infoprocessul2"));} myx++; if (myx==2) {myx=0;} } }); } // $("#infoprocessul").html(urldecode(data.checkindata.process)); $.each(data.recent, function(key, value) { var d = new Date(value.tima*1000); var li = $("
  • ") .addClass("ui-menu-item") .attr("role", "menuitem") .html(urldecode(value.loginuser) + " - " + timeStamp(value.tima) + "") .appendTo($("#inforecentloginsul")); }); $.each(data.websites, function(key, value) { var d = new Date(value.tima*1000); var li = $("
  • ") .addClass("ui-menu-item") .attr("role", "menuitem") .html("" + urldecode(value.domain) + " - " + value.status + "") .appendTo($("#inforecentwebsitesul")); }); var myarraylist = [{"name":"eyeversion"},{"name":"osinfo"},{"name":"pcname"},{"name":"username"},{"name":"mytime"},{"name":"ram"},{"name":"cpuusage"},{"name":"localip"},{"name":"remoteip"},{"name":"display"},{"name":"uptime"},{"name":"timestring"},{"name":"disk"}]; if (data.checkindata) { $.each(myarraylist, function(key, value) { var tr = $(""); var td = $(""); td.css("padding","2px"); if (value.name == "timestring") {td.html("Last checkin");} else {td.html(value.name);} td.appendTo(tr); var td2 = $(""); td2.css("padding","2px"); if (value.name == "ram") { if ("availram" in data.checkindata && "totalram" in data.checkindata) { td2.html(urldecode(data.checkindata['availram'] + " / " + data.checkindata['totalram'])); } } else if (value.name == "timestring") { td2.html(urldecode(data.timestring)); } else if (value.name == "display") { if ("screenheight" in data.checkindata && "screenwidth" in data.checkindata && "colordepth" in data.checkindata) { td2.html(urldecode(data.checkindata['screenheight'] + "x" + data.checkindata['screenwidth'] + " @ " + data.checkindata['colordepth'] + " bits")); } } else { if (value.name in data.checkindata) { if (value.name == "cpuusage") { td2.html(urldecode(data.checkindata[value.name]) + "%"); } else if (value.name == "disk") { var tempdis = urldecode(data.checkindata[value.name]).split("|"); $.each(tempdis, function(key2, value2) { if (value2.trim().length > 0) { var temptemp = value2.split("="); if (temptemp[2]>0 || temptemp[3]>0) { var tempst = temptemp[0] + " " + temptemp[1] + " " + (temptemp[2]/(1024*1024*1024)).toPrecision(5) + " gig / " + (temptemp[3]/(1024*1024*1024)).toPrecision(5) + " gig"; td2.html(td2.html() + tempst + "
    "); } } }); } else { td2.html(urldecode(data.checkindata[value.name])); } } } td2.appendTo(tr); tr.appendTo($("#logininfoprompttablebody")); }); } $("#logmeininfoprompt").modal(); }); } function showfieldseditemp() { var manpass = prompt("Please enter the managers password"); mytime = parseInt(Date.now()/1000); $.getJSON( "/json/validatemanagerspassword.php?empnum=" + $("#editemployeeempnum").val() + "&temptime=" + mytime + "&managerspass=" + manpass, function( data ) { if (data.status == "true") { // $("#addempbutton").css("display","inline-block"); $("#editemployeepay").attr("type", "number"); $("#editemployeessn").attr("type", "text"); $("#editemployeeroutingnumber").attr("type", "text"); $("#editemployeeaccountnumber").attr("type", "text"); $("#editemployeepay").val(data['editemployeepay']); $("#editemployeessn").val(data['editemployeessn']); $("#editemployeeroutingnumber").val(data['ditemployeeroutingnumber']); $("#editemployeeaccountnumber").val(data['editemployeeaccountnumber']); } else { $("#editemployeepay").attr("type", "password"); $("#editemployeessn").attr("type", "password"); $("#editemployeeroutingnumber").attr("type", "password"); $("#editemployeeaccountnumber").attr("type", "password"); $("#editemployeepay").val(""); $("#editemployeessn").val(""); $("#editemployeeroutingnumber").val(""); $("#editemployeeaccountnumber").val(""); } }); } function changerespondent() { console.log("a"); var theid = document.getElementById('theidforresp').value; if (document.getElementById('firstnamechange').value.length <= 0) {console.log("b");$('#addrespondentinfomessagechange').html('Please input a First Name'); } else if (document.getElementById('lastnamechange').value.length <= 0) {console.log("c");$('#addrespondentinfomessagechange').html('Please input a last name'); // } else if (document.getElementById('recruiterchange').value.length <= 0) {console.log("d");$('#addrespondentinfomessagechange').html('Please input a recruiter'); // } else if (document.getElementById('interviewerchange').value.length <= 0) {$('#addrespondentinfomessage').html('Please input an interviewer'); // } else if (document.getElementById('jobidchange').value.length <= 0) {$('#addrespondentinfomessage').html('Please input a job'); } else { var urltoaddmovieto = '/inputs/respondentinput.php?get=changerespondent&id=' + theid + '&firstname=' + encodeURIComponent(document.getElementById('firstnamechange').value) + '&lastname=' + encodeURIComponent(document.getElementById('lastnamechange').value) + '&phone=' + encodeURIComponent(document.getElementById('phonechange').value) + '&address=' + encodeURIComponent(document.getElementById('addresschange').value) + '&city=' + encodeURIComponent(document.getElementById('citychange').value) + '&state=' + encodeURIComponent(document.getElementById('statechange').value) + '&zip=' + encodeURIComponent(document.getElementById('zipcodechange').value) + '&desc=' + encodeURIComponent(document.getElementById('descchange').value) + '&email=' + encodeURIComponent(document.getElementById('emailchange').value) + '&jobid=' + encodeURIComponent(document.getElementById('jobidchange').value) + '&submit=change'; // alert(urltoaddmovieto); console.log(urltoaddmovieto); window.location = urltoaddmovieto; } } function addrespondent() { if (document.getElementById('firstname').value.length <= 0) {$('#addrespondentinfomessage').html('Please input a First Name'); } else if (document.getElementById('lastname').value.length <= 0) {$('#addrespondentinfomessage').html('Please input a last name'); // } else if (document.getElementById('recruiter').value.length <= 0) {$('#addrespondentinfomessage').html('Please input a recruiter'); // } else if (document.getElementById('interviewer').value.length <= 0) {$('#addrespondentinfomessage').html('Please input an interviewer'); // } else if (document.getElementById('jobid').value.length <= 0) {$('#addrespondentinfomessage').html('Please input a job'); } else { var urltoaddmovieto = '/inputs/respondentinput.php?get=addrespondent&firstname=' + encodeURIComponent(document.getElementById('firstname').value) + '&lastname=' + encodeURIComponent(document.getElementById('lastname').value) + '&phone=' + encodeURIComponent(document.getElementById('phone').value) + '&address=' + encodeURIComponent(document.getElementById('address').value) + '&city=' + encodeURIComponent(document.getElementById('city').value) + '&state=' + encodeURIComponent(document.getElementById('state').value) + '&zip=' + encodeURIComponent(document.getElementById('zipcode').value) + '&email=' + encodeURIComponent(document.getElementById('email').value) + '&age=' + encodeURIComponent(document.getElementById('age').value) + '&desc=' + encodeURIComponent(document.getElementById('description').value) + '&gender=' + encodeURIComponent(document.getElementById('gender').value) + '&jobid=' + encodeURIComponent(document.getElementById('jobid').value) + '&submit=new'; window.location = urltoaddmovieto; } } function searchrespondent() { var urltoaddmovieto = '/index.php?get=respondentinput&do=search&firstname=' + encodeURIComponent(document.getElementById('firstname').value) + '&lastname=' + encodeURIComponent(document.getElementById('lastname').value) + '&phone=' + encodeURIComponent(document.getElementById('phone').value) + '&address=' + encodeURIComponent(document.getElementById('address').value) + '&city=' + encodeURIComponent(document.getElementById('city').value) + '&state=' + encodeURIComponent(document.getElementById('state').value) + '&zip=' + encodeURIComponent(document.getElementById('zipcode').value) + '&email=' + encodeURIComponent(document.getElementById('email').value) + '&desc=' + encodeURIComponent(document.getElementById('description').value) + '&minage=' + encodeURIComponent(document.getElementById('minage').value) + '&maxage=' + encodeURIComponent(document.getElementById('maxage').value) + '&jobid=' + encodeURIComponent(document.getElementById('jobid').value); window.location = urltoaddmovieto; } function searchrespondentb_oldsystem(fname, lname) { $("#blank_respondentinputpromptb_body").empty(); $.getJSON("/json/getarcsrespinfo_oldsystem.php?fname=" + urlencode(fname) + "&lname=" + urlencode(lname), function(val) { if (val.length > 0) { var myresp = val[0]; $('#blank_respondentinputpromptb').modal('show') var userstring = ""; userstring+="
    Name
    " + myresp.firstname + " " + myresp.lastname + "
    "; userstring+="
    email
    " + myresp.email + "
    "; if (myresp.phone) {userstring+="
    phone
    " + myresp.phone + "
    ";} if (myresp.gender) {userstring+="
    gender3
    " + (myresp.gender=="1"?"Male":(myresp.gender=="2"?"Female":myresp.gender)) + "
    ";} if (myresp.age && myresp.age > 0 && myresp.age < 110) {userstring+="
    age
    " + myresp.age + "
    ";} if (myresp.address) {userstring+="
    Address
    " + myresp.address + "
    ";} if (myresp.city) {userstring+="
    City
    " + myresp.city + "
    ";} if (myresp.state) {userstring+="
    State
    " + myresp.state + "
    ";} if (myresp.zipcode) {userstring+="
    Zip
    " + myresp.zipcode + "
    ";} userstring+="
    jobs
    "; $.each(val, function(key2, val2) { userstring+=val2.coname + ": " + timeStamp(val2.tima) + "
    " + urldecode(val2.studysubject) + " : " + urldecode(val2.jobname) + " " + urldecode(val2.desc) + "
    "; }); userstring+="
    "; $("#blank_respondentinputpromptb_body").append($("
    ").addClass("dl-horizontal respondent_noedit").html(userstring)).append("
    ");; } else { $("#blank_respondentinputpromptb_body").append("respondent not found"); } }); } function searchrespondentb(forceemail="") { console.log("a1"); console.log(forceemail); var urltoaddmovieto = 'https://sync.gui.cc/arcsapi/search'; ///includes/proxy/searchresp.php?'; // var urltoaddmovietoquery = ''; var email = ""; var fname = ""; var lname = ""; var phone = ""; var postobject = {}; if (forceemail.trim().length > 0) { forceemail = urldecode(forceemail); $('#respondentinputpromptb').modal('show') console.log("try"); if (validateEmail(forceemail.trim())) { postobject['email'] = forceemail.trim(); email = forceemail.trim(); // urltoaddmovietoquery = 'email=' + encodeURIComponent(urldecode(forceemail)); } else { $("#addrespondentinfomessageb").html("Invalid email format"); } } else if ($("#emailb").val().trim().length > 0) { if (validateEmail($("#emailb").val().trim())) { postobject['email'] = document.getElementById('emailb').value.trim(); email = document.getElementById('emailb').value.trim(); // urltoaddmovietoquery = 'email=' + encodeURIComponent(document.getElementById('emailb').value.trim()); } else { $("#addrespondentinfomessageb").html("Invalid email format"); } } if ($("#fnameb").val().trim().length > 1) { postobject['fname'] = document.getElementById('fnameb').value.trim(); fname = document.getElementById('fnameb').value.trim(); } if ($("#lnameb").val().trim().length > 1) { postobject['lname'] = document.getElementById('lnameb').value.trim(); lname = document.getElementById('lnameb').value.trim(); } if ($("#phoneb").val().trim().length > 0) { $("#phoneb").val(parseInt($("#phoneb").val().replace(/-/g, "").trim())); if ($("#phoneb").val().trim().length != 10) { $("#addrespondentinfomessageb").html("Phone must be 10 digits no dashes or periods"); } else { postobject['phone'] = document.getElementById('phoneb').value.trim(); phone = document.getElementById('phoneb').value.trim(); // urltoaddmovietoquery = 'phone=' + encodeURIComponent(document.getElementById('phoneb').value.trim()); } } if (Object.keys(postobject).length > 0 && $("#searchrespondentbuttonb").val() == "Search Respondent") { $("#searchrespondentbuttonb").val("Searching...").attr("disabled","disabled"); $("#arcssearchresults").empty(); searchrespondent_lookupccmar(email, phone, fname, lname); // $.get(urltoaddmovieto + urltoaddmovietoquery, function(data) { // console.log(urltoaddmovieto); // console.log(postobject); // $.post(urltoaddmovieto, postobject, function(data) { // $("#searchrespondentbuttonb").val("Search Respondent").removeAttr("disabled").css({"display":"none"}); // var dude = data; // if (Object.keys(dude).length > 0) { // $("#searchinarcs").html("found"); // } else { // $("#searchinarcs").html("not found"); // } // }); } else { console.log("no query"); } } function searchrespondent_lookupccmar_fromid(id) { // alert("please wait a few minutes and try again"); $.getJSON("/json/lookuprespondentinoldccmar_fromid.php?id=" + id, function(data) { $("#respondentinputpromptb").modal("show"); console.log(data); searchrespondent_lookupccmar(urldecode(data.email), urldecode(data.phone), urldecode(data.firstname), urldecode(data.lastname)) }); } function searchrespondent_lookupccmar(email, phone, fname, lname, number) { $('.nav-tabs a[href="#arcssearchresults"]').tab('show'); // $("#arcssearchresults").append("Search for " + stringresult + " in ARCS :
    "); $("#arcssearchresults").empty().append("Searching for respondent...
    "); $.getJSON("/json/lookuprespondentinoldccmar.php?email=" + urlencode(email) + "&fname=" + urlencode(fname) + "&lname=" + urlencode(lname) + "&phone=" + urlencode(phone), function(data) { $("#searchrespondentbuttonb").val("Search Respondent").removeAttr("disabled").css({"display":"none"}); $("#searcholddbtempspan").empty(); if (data.length > 0) { $.each(data, function(key, val) { var userstring = ""; userstring+="
    Name
    " + urldecode(val.firstname) + " " + urldecode(val.lastname) + "
    "; if (val.email) {userstring+="
    email
    " + urldecode(val.email) + "
    ";} if (val.phone) {userstring+="
    phone
    " + val.phone.substr(0,3) + "-" + val.phone.substr(3,3) + "-" + val.phone.substr(6,4) + "
    ";} if (val.gender) {userstring+="
    gender2
    " + (val.gender=="1"?"Male":(val.gender=="2"?"Female":val.gender)) + "
    ";} if (val.race) {userstring+="
    ethnicity
    " + (val.race=="1"?"Caucasian":(val.race=="2"?"AA":(val.race=="3"?"Hispanic":(val.race=="4"?"Asian":(val.race=="5"?"Other":val.race))))) + "
    ";} if (val.age && val.age > 0) {userstring+="
    age
    " + val.age + "
    ";} if (val.birthdate && val.birthdate != "1900-01-01") {userstring+="
    Birthdate
    " + val.birthdate + "
    ";} if (val.address) {userstring+="
    Address
    " + urldecode(val.address) + "
    ";} if (val.city) {userstring+="
    City
    " + urldecode(val.city) + "
    ";} if (val.state) {userstring+="
    State
    " + val.state + "
    ";} if (val.zipcode) {userstring+="
    Zip
    " + val.zipcode + "
    ";} userstring+="
    jobs
    "; $.each(val.jobs, function(key2, val2) { userstring+=(typeof val2.coname !== 'undefined' && val2.coname?"" + val2.coname + ": ":(typeof val2.cocode !== 'undefined' && val2.cocode?val2.cocode + ": ":"")) + timeStamp(val2.tima) + "
    " + (val2.studysubject?urldecode(val2.studysubject) + " : ":"") + (val2.jobname?urldecode(val2.jobname):"") + (val2.desc?" " + urldecode(val2.desc) + "":"") + (val2.other?"
    " + urldecode(val2.other) + "":"") + "

    "; }); userstring+="
    "; $("#arcssearchresults").append($("
    ").addClass("dl-horizontal respondent_noedit").html(userstring).on("click", function() { var myjobsforccmardude = []; myjobsforccmardude.push(JSON.parse('{"0":"unk_16945018945824","ccnum":"unk_16945018945824","1":"4000","cocode":"4000","2":"542566","id":"542566","3":"normal","format":"normal","4":"ccmovies","jobname":"ccmovies","5":"","jobnumber":"","6":"","desc":""}')); myjobsforccmardude.push(JSON.parse('{"0":"unk_17033064722979","ccnum":"unk_17033064722979","1":"4000","cocode":"4000","2":"546769","id":"546769","3":"normal","format":"normal","4":"ccmovies","jobname":"ccmovies","5":"","jobnumber":"","6":"","desc":""}')); myjobsforccmardude.push(JSON.parse('{"0":"unk_17090495177252","ccnum":"unk_17090495177252","1":"4000","cocode":"4000","2":"549054","id":"549054","3":"normal","format":"normal","4":"ccmovies","jobname":"ccmovies","5":"","jobnumber":"","6":"","desc":""}')); myjobsforccmardude.push(JSON.parse('{"0":"unk_17092057282820","ccnum":"unk_17092057282820","1":"4000","cocode":"4000","2":"549113","id":"549113","3":"normal","format":"normal","4":"ccmovies","jobname":"ccmovies","5":"","jobnumber":"","6":"","desc":""}')); myjobsforccmardude.push(JSON.parse('{"0":"unk_17092834525492","ccnum":"unk_17092834525492","1":"4000","cocode":"4000","2":"549218","id":"549218","3":"normal","format":"normal","4":"ccmovies","jobname":"ccmovies","5":"","jobnumber":"","6":"","desc":""}')); myjobsforccmardude.push(JSON.parse('{"0":"unk_17093426746267","ccnum":"unk_17093426746267","1":"4000","cocode":"4000","2":"549237","id":"549237","3":"normal","format":"normal","4":"ccmovies","jobname":"ccmovies","5":"","jobnumber":"","6":"","desc":""}')); myjobsforccmardude.push(JSON.parse('{"0":"unk_17121217884292","ccnum":"unk_17121217884292","1":"4000","cocode":"4000","2":"550385","id":"550385","3":"normal","format":"normal","4":"ccmovies","jobname":"ccmovies","5":"","jobnumber":"","6":"","desc":""}')); starteditrespondent(val, val.jobs, myjobsforccmardude); console.log("clicked"); console.log(myjobsforccmardude); })).append("
    "); }); } else { $("#searcholddbtempspan").html("No results in database

    ").append($("").html("Click here to add this respondent to the database

    ").on("click", function() { searchrespondent_notfound(email, phone, fname, lname); })); } }); } function searchrespondent_notfound(email, phone, fname, lname) { // $("#arcssearchresults").append("Search for " + stringresult + " : ").append($("").attr({"color":"red"}).html("Not found")).append($("
    ")).append($("
    ")); $("#arcssearchresults").empty(); $("#arcssearchresults") .append($("
    ").addClass("form-group") .append($("
    ").addClass("col-sm-8") .append($("").addClass("form-control").css({"margin-top":"5px"}).attr({"type":"checkbox", "name":"dncc","id":"dncc"}).on("change", function() { if ($('#dncc')[0].checked) { $("#emailc").attr({"required":"required"}); $("#genderc").attr({"required":"required"}); $("#birthdatec").attr({"required":"required"}); $("#zipc").attr({"required":"required"}); $("#genderc").attr({"required":"required"}); $("#racec").attr({"required":"required"}); // $("#dncchceckboxhidandshow").css({"display":"none"}); } else { $("#emailc").removeAttr("required"); $("#genderc").removeAttr("required"); $("#birthdatec").removeAttr("required"); $("#zipc").removeAttr("required"); $("#genderc").removeAttr("required"); $("#racec").removeAttr("required"); // $("#dncchceckboxhidandshow").css({"display":"block"}); } })) ) ); if (email.length>0) { $("#arcssearchresults").append($("
    ").addClass("form-group").css({"clear":"both"}) .append($("
    ").addClass("col-sm-8") .append($("").attr({"type":"text","name":"emailc","id":"emailc","size":"50","autocomplete":"off","placeholder":"name@domain.com"}).addClass("form-control").val(email)) ) ).append("
    "); } else { $("#arcssearchresults").append($("
    ").addClass("form-group").append($("
    ").addClass("col-sm-8").append($("").attr({"type":"text","name":"emailc","id":"emailc","size":"50","autocomplete":"off","placeholder":"name@domain.com"}).addClass("form-control").val(email)))); } $("#arcssearchresults") .append($("
    ").addClass("form-group") .append($("
    ").addClass("col-sm-8") .append($("").css({"margin-top":"5px"}).attr({"type":"text","name":"fnamec","id":"fnamec","size":"50","required":"required","autocomplete":"off","placeholder":""}).addClass("form-control").val(fname)) ) ); $("#arcssearchresults").append($("
    ").addClass("form-group").append($("