1 line
29 KiB
JavaScript
1 line
29 KiB
JavaScript
var PERSONAL_INFO=[],SELECTED_ASSOC="",PRIVACY_GUARD_RESULTS=[];function replaceAll(e,t,a){return e.replace(new RegExp(t,"g"),a)}function getMatchIndex(r,e){var n=3;return $.each(e,function(e,t){r=$.trim(r);var a=$.trim(t.bank_name);if(r==a)return n=t.index,!1}),n}function count_array_values(e,a){var r=0;return $.each(e,function(e,t){t==a&&r++}),r}function getKeyIndex(e,t,a){var r=count_array_values(a,e);return""==t||""==a||r<2?"":"-"+count_array_values(t,e)}function getInquiriesAndPublicSelectedInfo(e,t){var a=$("select[name=client_id]").val();if(""==a||a<=0)return!1;setInquiriesDropDown(e,t),setPublicInfoDropDown(e,t)}function getHtmlInfo(e){var t=$("textarea[name=html_content]").val(),a=$("select[name=source_type]").val();if(""!=t)return!1;$("#client-loader").show();var r=$(e).val(),n=$("#token").val();$.ajax({type:"POST",data:{action:"htmlinfo",client_id:r,source_type:a,_token:n},url:saveIdentityID,success:function(e){var t=JSON.parse(e);$("textarea[name=html_content]").val(t),$("#client-loader").hide()},error:function(){$("#client-loader").hide()}})}function setSelectedBankDropDown(e){var t=$(".crPrint"),n=(getBankAdditionalInfo(),[]),i=[],l=[];t.find("tr").each(function(e,t){var a="";a=(a=(a=(a=(a=(a=(a=$(this).find("td").eq(0).children("ng-include").children(".sub_header").clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),""!=(a=$.trim(a))&&l.push(a)}),$(".sub_header").each(function(e,t){$(this).find("td");var a="";if(a=(a=(a=(a=(a=(a=(a=$(this).clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),""!=(a=$.trim(a))){i.push(a);var r={index:e,bank_name:a+getKeyIndex(a,i,l)};$(this).nextAll("table").first().find("th.headerTUC").children("select").attr("id","selectiq_tuc_"+e),$(this).nextAll("table").first().find("th.headerEXP").children("select").attr("id","selectiq_exp_"+e),$(this).nextAll("table").first().find("th.headerEQF").children("select").attr("id","selectiq_eqf_"+e),$(this).children("select").attr("class","banks review_type"),n.push(r)}}),console.log("data"),console.log(e.DI),$.each(e.DI,function(e,t){var a=getMatchIndex(t.data_key,n);console.log(a),$("#selectiq_tuc_"+a).val(t.type).trigger("change"),$("#selectiq_exp_"+a).val(t.type2).trigger("change"),$("#selectiq_eqf_"+a).val(t.type3).trigger("change")})}function pushPrivacyGuardValues(e,t){PRIVACY_GUARD_RESULTS.push({bank_name:t,bank_info:e})}function getPrivacyGuardBankTableInfo(){var e=$("#FtgCrTabContent5 .FtgCrContentRowTable"),x={},q=[];return e.find("tr").each(function(e,t){var a={},i=[],r=($(this).find("td"),$(this).find("th")),l="",c="",s="",n=r.eq(0).clone().children().remove().end().text(),o="";if(""!=n&&r.hasClass("FtgCrDarkTradeHead")){o=n;var p=r.parent(),d=r.parent().next("tr").children("th.FtgCrXPNHead"),u=r.parent().next("tr").children("th.FtgCrEFXHead"),h=r.parent().next("tr").children("th.FtgCrTUCHead"),v=3,f=3,m=3;d.children().has("select")&&(v=d.children("select").val()),u.children().has("select")&&(f=u.children("select").val()),h.children().has("select")&&(m=h.children("select").val());var g=r.parent().next("tr").children("th.FtgCrXPNHead"),_=r.parent().next("tr").children("th.FtgCrEFXHead"),y=r.parent().next("tr").children("th.FtgCrTUCHead");g.children().has("select")&&(v=g.children("select").val()),_.children().has("select")&&(f=_.children("select").val()),y.children().has("select")&&(m=y.children("select").val()),x={Experian:v,Equifax:f,TransUnion:m},p.next("tr").each(function(){var e=$(this),t=e.children("th").eq(0).text(),a=$.trim(e.children("td").eq(0).clone().children().remove().end().text()),r=$.trim(e.children("td").eq(1).clone().children().remove().end().text()),n=$.trim(e.children("td").eq(2).clone().children().remove().end().text());l=a,c=r,s=n,"Date:"!=t&&""!=t&&i.push({Experian:{account:l,key_name:t},Equifax:{account:c,key_name:t},TransUnion:{account:s,key_name:t}})}),""!=i&&(a={bank_name:$.trim(o),address:"",phone:"",bank_info:i,type:x},q.push(a))}}),q}function getStatusByDataKey1(a,e){var r="";return $.each(e.DB,function(e,t){if(t.data_key==a)return r=t,!1}),r}function setDropDownPrivacyGuardPersonalInfo(p,d){$(".FtgCrContentRowTable").first().find("tr").each(function(e,t){var a=$(this).find("th").eq(0),r=a.text(),n=a.parent().children("td");r=(r=(r=(r=(r=r.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace(":",""),r=$.trim(r);var i="";i=(i=(i=(i=(i=(i=(i=n.eq(0).text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace("updatenegativepositive","")).trim();var l=getStatusByDataKey1(r,d);if(""!=i){n.eq(0).append(p);var c=3;""!=l&&(c=l.status3),n.eq(0).children("select").val(c).trigger("change"),n.eq(0).children("select").attr("class","all-select review_type")}if(""!=(i=(i=(i=(i=(i=(i=(i=n.eq(1).text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace("updatenegativepositive","")).trim())){n.eq(1).append(p);var s=3;""!=l&&(s=l.status1),n.eq(1).children("select").val(s).trigger("change"),n.eq(1).children("select").attr("class","all-select review_type")}if(""!=(i=(i=(i=(i=(i=(i=(i=n.eq(2).text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace("updatenegativepositive","")).trim())){n.eq(2).append(p);var o=3;""!=l&&(o=l.status2),n.eq(2).children("select").val(o).trigger("change"),n.eq(2).children("select").attr("class","all-select review_type")}})}function getDropDownPrivacyGuardPersonalInfo(){var e=$(".FtgCrContentRowTable").first(),h=[];return e.find("tr").each(function(e,t){var a=$(this).find("th").eq(0),r=a.text(),n="",i=3,l="",c=3,s="",o=3,p={},d=a.parent().children("td");r=(r=(r=(r=(r=r.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).replace(":",""),r=$.trim(r);var u="";u=(u=(u=(u=(u=d.eq(0).clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," "),""!=(u=(u=$.trim(u)).replace("updatenegativepositive",""))&&(n=$.trim(u),i=d.eq(0).children("select").val()),""!=(u=(u=(u=(u=(u=(u=(u=d.eq(1).clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""))&&(l=$.trim(u),c=d.eq(1).children("select").val()),""!=(u=(u=(u=(u=(u=(u=(u=d.eq(2).clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""))&&(s=$.trim(u),o=d.eq(2).children("select").val()),""!=r&&(p={Experian:{data:n,key_name:r,type:i},Equifax:{data:l,key_name:r,type:c},TransUnion:{data:s,key_name:r,type:o}},h.push(p))}),h}function getBankTableInfo(){var e=$(".crPrint"),h=getBankAdditionalInfo(),v=[];e.find("tr").each(function(e,t){var a=$(this).find("td"),r="",n=a.eq(0).children("ng-include").children(".sub_header"),i=n.next("table").find("th.headerTUC").children("select").val(),l=n.next("table").find("th.headerEXP").children("select").val(),c=n.next("table").find("th.headerEQF").children("select").val();r=(r=(r=(r=(r=(r=(r=n.clone().children().remove().end().text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var s=a.eq(0).children("ng-include").children(".rpt_content_table");if(""!=r){var o=[];s.find("tr").each(function(e,t){var a={},r=$(this).find("td"),n=r.eq(0).text(),i=n.replace(/<(?:.|\n)*?>/gm,"");if(i=n.replace(/\r?\n|\r/g,""),i=n.replace(":"," "),i=n.replace(/\s+/g," "),i=n.replace(" ",""),""!=(i=n.trim())){var l=r.eq(1).text().replace(/<(?:.|\n)*?>/gm,"");l=(l=(l=(l=(l=(l=l.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var c=r.eq(2).text().replace(/<(?:.|\n)*?>/gm,"");c=(c=(c=(c=(c=(c=c.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var s=r.eq(3).text().replace(/<(?:.|\n)*?>/gm,"");s=(s=(s=(s=(s=(s=s.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),a={TransUnion:{account:l,key_name:$.trim(i.replace(":",""))},Experian:{account:c,key_name:$.trim(i.replace(":",""))},Equifax:{account:s,key_name:$.trim(i.replace(":",""))}},o.push(a)}});var p=getInfoByKey(r,h),d="",u="";null!=p.bank_name&&p.bank_name,null!=p.address&&(d=p.address),null!=p.phone&&(u=p.phone),v.push({bank_name:r,address:d,phone:u,type:{TransUnion:i,Experian:l,Equifax:c},bank_info:o})}});var s=[];return $.each(v,function(e,t){var a={},r=isInfoExist($.trim(t.bank_name),h,v),n=3,i="",l="",c="";""!=t.address&&(i=t.address),""!=t.phone&&(l=t.phone),isEmpty(t.type)||(n=t.type),null!=t.bank_info&&(c=t.bank_info),a={bank_name:t.bank_name,address:i,phone:l,bank_info:c,type:n},1==r.status&&(0<r.bankInfo.type&&(n=r.bankInfo.type),""!=r.bankInfo.address&&(i=r.bankInfo.address),""!=r.bankInfo.phone&&(l=r.bankInfo.phone),a={bank_name:r.bankInfo.bank_name,address:i,phone:l,bank_info:c,type:n}),s.push(a)}),s}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function getInfoByKey(e,t){var a={},r=$.trim(e);return null!=t&&$.each(t,function(e,t){if(-1!=r.indexOf($.trim(t.bank_name)))return a=t,!1}),a}function isInfoExist(e,t,r){var n=0,i={},l=$.trim(e);return null!=t&&$.each(t,function(e,t){var a=$.trim(t.bank_name);if(-1!=l.indexOf(a))return n=1,i=getBankArrayInfoBy(l,r),!1}),{status:n,bankInfo:i}}function getBankArrayInfoBy(a,e){var r={};return $.each(e,function(e,t){if($.trim(t.bank_name)==a)return r=t,!1}),r}function getBankAdditionalInfo(){var e=$("table.rpt_content_table:last"),c=[],s={};return e.find("tr").each(function(e,t){var a="";if(""!=(a=(a=(a=(a=(a=(a=(r=$(this).find("td")).eq(0).text().replace(/<(?:.|\n)*?>/gm,"")).replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim())){(r=$(this).find("td")).eq(0).text();var r,n=r.eq(1).text().replace(/<(?:.|\n)*?>/gm,"");n=(n=(n=(n=(n=(n=n.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var i=r.eq(2).text().replace(/<(?:.|\n)*?>/gm,"");i=(i=(i=(i=(i=(i=i.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var l=r.eq(3).text().replace(/<(?:.|\n)*?>/gm,"");l=(l=(l=(l=(l=(l=l.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),s={bank_name:a,address:n,phone:i},c.push(s)}}),c}function getTypeByDataKey(r,e){var n="";return $.each(e.DI,function(e,t){var a=getBankRealName(t.data_key);if(-1!=$.trim(r).indexOf(a))return n=t,!1}),n}function getBankRealName(r){var n="",e=r.split("-");return null==e&&(n=r),$.each(e,function(e,t){var a=t;if(null!=a&&1<=a&&a<=100)return n=r.replace("-"+a,""),!1}),n}function setInquiriesDropDown(l,c){$(".rpt_fullReport_header").each(function(){var e=$(this).text();"Inquiries"==(e=$.trim(e))&&($(this).children("select").remove(),$(this).append(allSelectDropDown("inquiries")),$(this).nextAll("table.rpt_content_table").first().find("tr").each(function(e,t){var a=$(this).find("td"),r=$.trim(a.eq(0).text()),n=$.trim(a.eq(2).text());if(""!=$.trim(a.eq(3).text())){var i=getInquiryTypeByDataKey(r+"_"+n,c);a.eq(3).append(l),0<i&&(a.eq(3).children("select").val(i).trigger("change"),a.eq(3).children("select").attr("class","inquiries review_type"))}}))})}function getInquiryTypeByDataKey(a,e){var r=3;return $.each(e.inquiry,function(e,t){if(t.inquiry_key==a)return r=t.inquiry_type,!1}),r}function getPublicTypeByDataKey(a,e){var r={status1:3,status2:3,status3:3};return $.each(e.publicrecords,function(e,t){if(t.public_key==a)return!(r={status1:t.public_status1,status2:t.public_status2,status3:t.public_status3})}),r}function setPublicInfoDropDown(s,o){$(".sub_header").each(function(){var e=$(this).text();(e=$.trim(e),console.log(e),"Bankruptcy"==e)&&$(this).nextAll("table.rpt_content_table").first().find("tr").each(function(e,t){var a=$(this).find("td"),r=$.trim(a.eq(0).text()).replace("-",""),n=$.trim(a.eq(1).text()).replace("-",""),i=$.trim(a.eq(2).text()).replace("-",""),l=$.trim(a.eq(3).text()).replace("-","");if(""!=(r=r.replace(":","")))var c=getPublicTypeByDataKey(r,o);""!=n&&(a.eq(1).append(s),a.eq(1).children("select").val(c.status3).trigger("change"),a.eq(1).children("select").attr("class","publicrecord review_type")),""!=i&&(a.eq(2).append(s),a.eq(2).children("select").val(c.status1).trigger("change"),a.eq(2).children("select").attr("class","publicrecord review_type")),""!=l&&(a.eq(3).append(s),a.eq(3).children("select").val(c.status2).trigger("change"),a.eq(3).children("select").attr("class","publicrecord review_type"))})})}function getSelectedPublicInfo(){var d=[];return $(".sub_header").each(function(){var e=$(this).text();if("Bankruptcy"==(e=$.trim(e)))return $(this).nextAll("table.rpt_content_table").first().find("tr").each(function(e,t){var a=$(this).find("td"),r=$.trim(a.eq(0).text()),n=$.trim(a.eq(1).text().replace("updatenegativepositive","")),i=($.trim(a.eq(1).text().replace("updatenegativepositive","")),n=$.trim(a.eq(1).text().replace("Please selectnegativepositive","")),$.trim(a.eq(2).text().replace("updatenegativepositive",""))),l=(i=$.trim(a.eq(2).text().replace("Please selectnegativepositive","")),$.trim(a.eq(3).text().replace("updatenegativepositive",""))),c=(l=$.trim(a.eq(3).text().replace("Please selectnegativepositive","")),""),s="",o="";if(null!=a.eq(1).children("select").val())c=a.eq(1).children("select").val();if(null!=a.eq(2).children("select").val())s=a.eq(2).children("select").val();if(null!=a.eq(3).children("select").val())o=a.eq(3).children("select").val();var p={TransUnion:{data:n,type:c,key_name:r.replace(":","")},Experian:{data:i,type:s,key_name:r.replace(":","")},Equifax:{data:l,type:o,key_name:r.replace(":","")}};d.push(p)}),!1}),d}function getSelectedInquiries(){var s=[];return $(".rpt_fullReport_header").each(function(){var e=$(this).clone().children().remove().end().text();if("Inquiries"==(e=$.trim(e)))return $(this).nextAll("table.rpt_content_table").first().find("tr").each(function(e,t){var a=$(this).find("td"),r=$.trim(a.eq(0).text()),n=$.trim(a.eq(2).text()),i=a.eq(3).text();if(i=i.replace("updatenegativepositive",""),i=$.trim(i),""!=r||""!=n||""!=i){var l=a.eq(3).children("select").val();""==l&&(l=3);var c={key_name:r+"_"+n,creditor_bereau:i,type:l};s.push(c)}}),!1}),s}function setDropDownPublicRecordPrivacyGuard(r,e){$("div:contains('Public Records')").nextAll("table.FtgCrContentRowTable").first().find("tr").each(function(e,t){var a=$(this).find("td");a.eq(0).children("table");a.each(function(e,t){$(this).children("select").remove(),$(this).is(":empty")||(console.log($(this)),$(this).append(r.replace("float: right;","")),$(this).children("select").attr("data-category",e),$(this).children("select").attr("class","public-records review_type"))})})}function getDropDownPublicRecordPrivacyGuard(){var u=[];return $("div:contains('Public Records')").nextAll("table.FtgCrContentRowTable").first().find("tr").each(function(e,t){if(2<e){var a=$(this).find("td"),r=$(this).find("th"),n=$.trim(r.text()),i="",l="",c="",s="",o="",p="";a.eq(0).is(":empty")||(i=a.eq(0).clone().children().remove().end().text(),s=a.eq(0).children("select").val()),a.eq(1).is(":empty")||(l=a.eq(1).clone().children().remove().end().text(),o=a.eq(1).children("select").val()),a.eq(2).is(":empty")||(c=a.eq(2).clone().children().remove().end().text(),p=a.eq(2).children("select").val());var d={Experian:{data:i,type:s,key_name:n.replace(":","")},Equifax:{data:l,type:o,key_name:n.replace(":","")},TransUnion:{data:c,type:p,key_name:n.replace(":","")}};u.push(d)}}),console.log(u),u}function setDropDownInquiryPrivacyGuard(r,e){$("div:contains('Credit Inquiries')").nextAll("table.FtgCrContentRowTable").first().find("tr").each(function(e,t){var a=$(this).find("td");a.eq(0).children("table");a.next("td.BlueLargeCheck").each(function(e,t){$(this).children("div").children("select").remove(),$(this).is(":empty")||($(this).children("div").append(r.replace("float: right;","")),$(this).children("div").children("select").attr("data-category",e),$(this).children("div").children("select").attr("class","inquries review_type"))})}),setDropDownPublicRecordPrivacyGuard(r,e)}function getDropDownInquiryPrivacyGuard(){var e=$("div:contains('Credit Inquiries')").nextAll("table.FtgCrContentRowTable").first(),s=[];return e.find("tr").each(function(e,t){$(this).find("td");if(0<e){var a=$(this).children("td").has("table"),c=$(this).children("td").children("table");a.find("tr").eq(0).children("th");a.find("tr").each(function(e,t){var a=$(this).find("th"),l=($(this).find("td"),$.trim(a.text()));a.parent().next("tr").next("tr").each(function(e,t){var a=$(this).children("td");if(""!=l){var r=c.parent("td").parent("tr"),n="",i="";r.find("td.BlueLargeCheck").each(function(){if($(this).children("div").has("select").length)return n=$(this).children("div").children("select").attr("id","pinq_"+e),!1}),0==n.data("category")?i="Experian":1==n.data("category")?i="Equifax":2==n.data("category")&&(i="TransUnion"),s.push({key_name:l+"_"+$.trim(a.eq(0).text()),creditor_bereau:i,type:n.val()})}})})}}),s}function selectAllPersonalinfoDropdown(e){var t=$(e).val(),a=$(e).data("key");confirm("Are you sure to change all items?")&&$("."+a).val(t).trigger("change")}function allSelectDropDown(e){return"<select data-key='"+e+'\' onchange="selectAllPersonalinfoDropdown(this)" style="width: auto;\n padding: 0px;color: black;\n height: 19px;\n margin: 0px;\n float: right;" name="source_type" class="review_type"><option value="3">Reset all items</option><option value="1">Set all items negative</option><option value="2">Set all items positive</option></select>'}function pinfoDropDown(e){return"<select data-key='"+e+'\' onchange="selectAllPersonalinfoDropdown(this)" style="width: auto;\n padding: 0px;color: black;\n height: 19px;\n margin: 0px;\n float: right;" name="source_type" class="review_type"><option value="3">Send Personal Information to Both EVcrm Attack and Audit Report</option><option value="1">Send Personal Information to Only EVcrm Attack Report</option><option value="2">Send Personal Information to Only EVcrm Audit Report</option></select>'}function setAllGlobalDropdown(){$(".rpt_fullReport_header").each(function(){var e=$(this).text();"Personal Information"==(e=$.trim(e))&&$(this).append(pinfoDropDown("all-select")),"Public Information"==e&&$(this).append(allSelectDropDown("publicrecord")),"Account History"==e&&$(this).append(allSelectDropDown("banks"))}),$(".FtgFullReportHeader").each(function(){var e=$.trim($(this).text());"Personal Profile"==e&&$(this).append(allSelectDropDown("all-select")),"Credit Inquiries"==e&&$(this).append(allSelectDropDown("inquries")),"Public Records"==e&&$(this).append(allSelectDropDown("public-records")),"Account History"==e&&$(this).append(allSelectDropDown("banks"))})}$(document).ready(function(){function s(f){$("table.rpt_content_table:eq(1)").find("tr").each(function(e,t){var a,r,n,i=$(this).find("td"),l=i.eq(0).text();if(""!=(l=i.eq(0).text())){var c=i.eq(1).text().replace(/<(?:.|\n)*?>/gm,"");c=(c=(c=(c=(c=(c=c.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var s=i.eq(2).text().replace(/<(?:.|\n)*?>/gm,"");s=(s=(s=(s=(s=(s=s.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var o=i.eq(3).text().replace(/<(?:.|\n)*?>/gm,"");o=(o=(o=(o=(o=(o=o.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","");var p=l.replace(/<(?:.|\n)*?>/gm,"");p=l.replace(/\r?\n|\r/g,""),p=l.replace(":"," "),p=l.replace(/\s+/g," "),p=l.trim();var d=(a=p.replace(":",""),r=f,n="",$.each(r.DB,function(e,t){if(t.data_key==a)return n=t,!1}),n);if(""!=c){i.eq(1).append(m());var u=3;""!=d&&(u=d.status3),i.eq(1).children("select").val(u).trigger("change"),i.eq(1).children("select").attr("class","all-select review_type")}if(""!=s){i.eq(2).append(m());var h=3;""!=d&&(h=d.status1),i.eq(2).children("select").val(h).trigger("change"),i.eq(2).children("select").attr("class","all-select review_type")}if(""!=o){i.eq(3).append(m());var v=3;""!=d&&(v=d.status2),i.eq(3).children("select").val(v).trigger("change"),i.eq(3).children("select").attr("class","all-select review_type")}}})}function m(){return'<select style="width: 120px;\n padding: 0px;color: black;\n height: 19px;\n margin: 0px;\n float: right;" name="source_type" class="review_type"><option value="3">Send To Both EVcrm for Attacks And Audit</option><option value="1">Send To Only EVcrm Attack</option><option value="2">Send To Only EVcrm Audit</option></select>'}$("button[name=checkConsole], button[name=credit_btn]").click(function(){var i=document.getElementById("client_id").value,l=$("select[name=source_type]").val(),c=$(this).attr("name");"credit_btn"==c?$("#credit-loader").show():$("#save-loader").show();var e={};if(""==i)alert("Please select Client"),$("select[name=client_id]").parent().addClass("has-error");else{var t="",a=(i=document.getElementById("client_id").value,document.getElementsByClassName("rpt_content_table"),0);if($("input[name=delete_all]").prop("checked")&&(a=1),t=(t=$("textarea[name=html_content]").val()).replace(/<script[^>]*>(?:(?!<\/script>)[^])*<\/script>/g,""),$.parseHTML(t),console.log("html"),console.log(t),1==l){var r=function(){PERSONAL_INFO=[];var o=[],e=$("table.rpt_content_table:eq(1)");return e.find("tr").each(function(e,t){var a=$(this).find("td"),r=a.eq(0).text(),n={};if(""!=r){var i=a.eq(1).text().replace(/<(?:.|\n)*?>/gm,"");i=(i=(i=(i=(i=(i=(i=(i=(i=i.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive","")).replace("Send To Both EVcrm for Attacks And Audit","")).replace("Send To Only EVcrm Attack","")).replace("Send To Only EVcrm Audit","");var l=a.eq(2).text().replace(/<(?:.|\n)*?>/gm,"");l=(l=(l=(l=(l=(l=l.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),l=i.replace("Send To Both EVcrm for Attacks And Audit",""),l=i.replace("Send To Only EVcrm Attack",""),l=i.replace("Send To Only EVcrm Audit","");var c=a.eq(3).text().replace(/<(?:.|\n)*?>/gm,"");c=(c=(c=(c=(c=(c=c.replace(/\r?\n|\r/g,"")).replace("_","")).replace("-","")).replace(/\s+/g," ")).trim()).replace("updatenegativepositive",""),c=i.replace("Send To Both EVcrm for Attacks And Audit",""),c=i.replace("Send To Only EVcrm Attack",""),c=i.replace("Send To Only EVcrm Audit","");var s=r.replace(/<(?:.|\n)*?>/gm,"");s=r.replace(/\r?\n|\r/g,""),s=r.replace(":"," "),s=r.replace(/\s+/g," "),s=r.trim(),n={TransUnion:{data:i,type:a.eq(1).children("select").val(),key_name:s.replace(":","")},Experian:{data:l,type:a.eq(2).children("select").val(),key_name:s.replace(":","")},Equifax:{data:c,type:a.eq(3).children("select").val(),key_name:s.replace(":","")}},PERSONAL_INFO.push(n),o.push(n)}}),o}(),n=getBankTableInfo(),s=getSelectedInquiries(),o=getSelectedPublicInfo();e={_token:$("#token").val(),client_id:i,delete_all:a,source_type:l,PERSONAL_INFO_DATA:r,inquiries:s,publicInfo:o,html_content:t,outputBankAcc:n,outputBankInfo:n}}else if(2==l){var p=getPrivacyGuardBankTableInfo(),d=getDropDownPrivacyGuardPersonalInfo();s=getDropDownInquiryPrivacyGuard(),o=getDropDownPublicRecordPrivacyGuard();e={_token:$("#token").val(),client_id:i,delete_all:a,source_type:l,inquiries:s,publicInfo:o,html_content:t,privacyGuardBank:p,PERSONAL_INFO_DATA:d}}}console.log(e),$.ajax({type:"POST",data:e,url:saveIdentityID,success:function(e){if($("#save-loader").hide(),$("#credit-loader").hide(),console.log(e),"success"==e)if("credit_btn"==c){var t=$("select[name=client_id]").children("option:selected").data("name");$("input[name=f_l_name]").val(t);var a=new Date,r=moment(a).format("YYYY-MM-DD");$("input[name=date_audit]").val(r),$("input[name=credit_client_id]").val(i),$("input[name=credit_source_type]").val(l);var n="";1==l?n="Identitiy IQ":2==l&&(n="Privacy Guard"),$("input[name=credit_report_and_date]").val(n+" report dated "+r+" per "+n),$("#credit-analaysis").css({display:"block",overflow:"auto"}).addClass("in")}else alert("Report has been processed successfully!");else alert("Failed. Try again later.")},error:function(){alert("Failed. Try again later.111")}})}),$("button[name=process_html]").click(function(){var e=$("textarea[name=html_content]").val(),t=document.getElementById("search").value,a=$("select[name=client_id]").val();if($("button[name=credit_btn]").hide(),""==t)$("select[name=source_type]").parent().addClass("has-error");else if(0==a)$("select[name=client_id]").parent().addClass("has-error"),alert("Please select client");else if(0<e.length){$("select[name=source_type]").val();$("select[name=client_id]").parent().removeClass("has-error"),$("select[name=source_type]").parent().removeClass("has-error"),$("textarea[name=html_content]").parent().removeClass("has-error"),$("textarea[name=html_content]").parent().hide(),$(this).hide(),$("button[name=checkConsole]").show(),$("button[name=generateReport]").show(),$("#velocity_link").show(),$("button[name=credit_btn]").show(),$("#goto-report").show(),""!=e&&(e=e.replace("document.write","wwwdocument.write"));try{2==$("select[name=source_type]").val()&&(e=replaceAll(e=e.replace('href="resources','href="https://www.privacyguard.com/BCA/Generic/ECD/resources/'),"ScoreAnalysis","ScoreAnalysis content-div-hide")),$(".view-html").html(e)}catch(e){}!function(){SELECTED_ASSOC="";var e=$("select[name=client_id]").val(),c=$("select[name=source_type]").val();!(""==e||e<=0)&&$.ajax({type:"GET",data:{client_id:e,source_type:c},url:select_url,async:!1,success:function(e){var t=e,a=t.datadocument;SELECTED_ASSOC=a;var r='<select style="width: 120px;\n padding: 0px;color: black;\n height: 19px;\n margin: 0px;\n float: right;" name="source_type" class="banks"><option value="3">Please select</option><option value="1">negative</option><option value="2">positive</option></select>';if(getInquiriesAndPublicSelectedInfo(r,t),1==c)s(a),$(".sub_header").next("table").find("th.headerTUC").append(r),$(".sub_header").next("table").find("th.headerEXP").append(r),$(".sub_header").next("table").find("th.headerEQF").append(r),$(".sub_header").each(function(){var e=$(this).text();e=(e=e.replace("updatenegativepositive","")).replace("Please selectnegativepositive",""),"Risk Factors"==(e=$.trim(e))&&$(this).next("table").find("th").children("select").remove(),"Bankruptcy"==e&&$(this).next("table").find("th").children("select").remove()}),setSelectedBankDropDown(a);else if(2==c){setDropDownInquiryPrivacyGuard(r,t);var n=[],i=[],l=[];setDropDownPrivacyGuardPersonalInfo(r,e),$(".FtgCrDarkTradeHead").each(function(e,t){var a=$(this).text();a=$.trim(a),n.push(a),$(this).parent().next("tr").children("th.FtgCrXPNHead").append(r),$(this).parent().next("tr").children("th.FtgCrEFXHead").append(r),$(this).parent().next("tr").children("th.FtgCrTUCHead").append(r),$(this).parent().next("tr").children("th.FtgCrXPNHead").children("select").attr("class","banks review_type").attr("id","select_pg_exp_"+e),$(this).parent().next("tr").children("th.FtgCrEFXHead").children("select").attr("class","banks review_type").attr("id","select_pg_eqf_"+e),$(this).parent().next("tr").children("th.FtgCrTUCHead").children("select").attr("class","banks review_type").attr("id","select_pg_tuc_"+e)}),$(".FtgCrDarkTradeHead").each(function(e,t){var a=$(this).text();a=$.trim(a),l.push(a);var r={index:e,bank_name:a+getKeyIndex(a,l,n)};i.push(r)}),console.log(t.datadocument.DI),$.each(t.datadocument.DI,function(e,t){var a=getMatchIndex(t.data_key,i);$("#select_pg_exp_"+a).val(t.type2).trigger("change"),$("#select_pg_eqf_"+a).val(t.type3).trigger("change"),$("#select_pg_tuc_"+a).val(t.type).trigger("change")})}setAllGlobalDropdown()},error:function(){alert("Failed. Try again later.")}})}(),$("select[name=client_id]").attr("disabled",!0)}else $("textarea[name=html_content]").parent().addClass("has-error")}),$("button[name=paste_html]").click(function(){$(".view-html").html(""),$("textarea[name=html_content]").val(""),$("textarea[name=html_content]").parent().show(),$("button[name=process_html]").show()}),$("button[name=import_html]").click(function(){$(".info")})}),$("button[name=credit_btn1]").click(function(){var a=$("select[name=client_id]").val(),r=$("select[name=source_type]").val();$("#credit-loader").show(),0<a&&$.ajax({type:"GET",data:{action:"clientInfo",client_id:a,source_type:r},url:credit_analysis_url,success:function(e){$("#credit-loader").hide();var t=JSON.parse(e);$("input[name=f_l_name]").val(t.clients.last_name+", "+t.clients.first_name),$("input[name=date_audit]").val(t.current_date),$("input[name=credit_client_id]").val(a),$("input[name=credit_source_type]").val(r)},error:function(){$("#credit-loader").hide()}})}),$(".modal-close-btn").click(function(){$("#credit-analaysis").css({display:"none"}).removeClass("in")}); |