﻿@model FingerprintsModel.Nurse @{ @section Title { Dashboard } ViewBag.Title = "ChildDetails"; Layout = "~/Views/Shared/AgencyStaffLayout.cshtml"; } @section Script{ @*<script type="text/javascript"> $(document).ready(function () { $('#ImmunizationService').val(''); $('#BMIStatus').val(''); }); </script>*@ <script type="text/javascript"> var round = 1; var rounds = 1; var round1 = 1; var isValid = true; var isValiddob = true; var ssnoriginalvalue = null; var ssnothervalue = null; var Parent1ssn = null; var Parent2ssn = null; var popupid = null; var popupname = null; var cloneimmunizationtable = null; var Refrenceid = []; function removeclasss() { $('#HouseholdRecord').removeClass("active"); $('#HouseholdRecord').removeClass("in"); $('#FamilyHouseholdRecord').removeClass("active"); $('#FamilyHouseholdRecord').removeClass("in"); $('#FamilyRecord').removeClass("active"); $('#FamilyRecord').removeClass("in"); $('#ChildRecord').removeClass("active"); $('#ChildRecord').removeClass("in"); $('#EmergencyContacts').removeClass("active"); $('#EmergencyContacts').removeClass("in"); $('#RestrictedList').removeClass("active"); $('#RestrictedList').removeClass("in"); $('#OtherinHousehold').removeClass("active"); $('#OtherinHousehold').removeClass("in"); $('#FamilyFileCabinet').removeClass("active"); $('#FamilyFileCabinet').removeClass("in"); $('#Qualifier').removeClass("active"); $('#Qualifier').removeClass("in"); } $(document).ready(function () { $('input').keypress(function () { if ($(this).val() == 'MM/DD/YYYY') { $(this).val(''); // $(this).mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); } }); $('#AssessmentDate').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); $('#RecentDentalExam').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); $('#HSProfessionalDentalExam').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); if ('@Model.HealthReview' == 1) { $('.ChangeToHealth').text('Health Review'); $('#Acceptclient').hide(); $('#HealthReview').show(); } else { $('#Acceptclient').show(); $('#HealthReview').hide(); } try { $("#CDoctor").autocomplete({ minLength: 1, source: function (request, response) { $.ajax({ url: HostedDir + "/AgencyUser/AutoCompleteDoctor", type: "POST", dataType: "json", data: { term: request.term, IsDeleted: "0" }, success: function (data) { response($.map(data, function (item) { return { label: item.MedicalCenter, id: item.CommunityID //Changes by Akansha on 15Dec2016 }; })) } }) }, select: function (event, ui) { $('#Doctor').val(ui.item.id); }, messages: { noResults: "", results: "" } }) } catch (err) { } //end of auto suggest doctor try { $("#CDoctorP1").autocomplete({ minLength: 1, source: function (request, response) { $.ajax({ url: HostedDir + "/AgencyUser/AutoCompleteDoctor", type: "POST", dataType: "json", data: { term: request.term, IsDeleted: "0" }, success: function (data) { response($.map(data, function (item) { return { label: item.MedicalCenter, id: item.CommunityID //Changes by Akansha on 15Dec2016 }; })) } }) }, select: function (event, ui) { $('#P1Doctor').val(ui.item.id); }, messages: { noResults: "", results: "" } }) } catch (err) { } //////////////// try { $("#CDoctorP2").autocomplete({ minLength: 1, source: function (request, response) { $.ajax({ url: HostedDir + "/AgencyUser/AutoCompleteDoctor", type: "POST", dataType: "json", data: { term: request.term, IsDeleted: "0" }, success: function (data) { response($.map(data, function (item) { return { //label: item.Fname, id: item.CommunityID label: item.MedicalCenter, id: item.CommunityID //Changes by Akansha on 15Dec2016 }; })) } }) }, select: function (event, ui) { $('#P2Doctor').val(ui.item.id); }, messages: { noResults: "", results: "" } }) } catch (err) { } //auto suggest for dentist try { $("#CDentist").autocomplete({ minLength: 1, source: function (request, response) { $.ajax({ url: HostedDir + "/AgencyUser/AutoCompleteDentist", type: "POST", dataType: "json", data: { term: request.term, IsDeleted: "0" }, success: function (data) { response($.map(data, function (item) { return { label: item.DentalCenter, id: item.CommunityID//Changes by Akansha on 15Dec2016 }; })) } }) }, select: function (event, ui) { $('#Dentist').val(ui.item.id); }, messages: { noResults: "", results: "" } }) } catch (err) { } @*$("#searchurl").load('@Url.Action("FamilyHouseHold", "AgencyUser")', { tabName: 'Household', houseHoldId: $('#HouseholdId').val() }); $('#familydetailsId li a').click(function () { $("#searchurl").load('@Url.Action("FamilyHouseHold", "AgencyUser")', { tabName: $(this).text(), houseHoldId: $('#HouseholdId').val() }); });*@ if ($('#ChildId').val() != "0") { $('#Pquestionyes').attr("disabled", "disabled"); $('#Pregnantmotherprogram').attr("disabled", "disabled"); $('#Pquestionyes1').attr("disabled", "disabled"); $('#PregnantmotherprogramP1').attr("disabled", "disabled"); $('#Div3').hide(); $('#Divp3').hide(); $('#customChecklist input:checked').each(function () { if ($(this).prop("checked")) { if ($(this).attr("accesskey") == 1) { $('#EHSHealth').show(); //Changes on 21Dec2016 // $('#Nutrition').show(); $('#Nutrition').hide(); $('#EhsNutrition1').show(); //End $('#HSHealth').hide(); } if ($(this).attr("accesskey") == 2) { $('#HSHealth').show(); //Changes on 21Dec2016 $('#Nutrition').show(); $('#EhsNutrition1').hide(); //End $('#EHSHealth').hide(); } } }); if($('#ParetZipCode').val()=="") { $('#Parentcity').val('');//Changes on 6Feb2017 } } if ('@Model.FoodPantory' == "") { $('#FoodPantory').val(""); } if ('@Model.ChildHungry' == "") { $('#DdlChildhungry').val(""); } if ('@Model.ChildFeed' == "") { $('#DdlChildFeed').val(""); } if ('@Model.ChildFormula' == "") { $('#DdlChildFormula').val(""); } else $('#DdlChildFormula').val('@Model.ChildFormula'); if ('@Model.ChildFeedCereal' == "") { $('#ChildFeedCereal').val(""); } if ('@Model.ChildFeedMarshfood' == "") { $('#ChildFeedMarshfood').val(""); } if ('@Model.ChildFeedChopedfood' == "") { $('#ChildFeedChopedfood').val(""); } if ('@Model.ChildFingerFood' == "") { $('#ChildFingerFood').val(""); } if ('@Model.ChildFruitJuice' == "") { $('#ChildFruitJuice').val(""); } if ('@Model.ChildReferalCriteria' == "") { $('#ChildReferalCriteria').val(""); } if ('@Model.DOBverifiedBy' != "") { $('#DOBverifiedBy').val('@Model.DOBverifiedBy'); } $("#searchurl").load('@Url.Action("FamilyHouseHold", "AgencyUser")', { tabName: 'Household', houseHoldId: $('#HouseholdId').val() }); $('#familydetailsId li a').click(function () { $("#searchurl").load('@Url.Action("FamilyHouseHold", "AgencyUser")', { tabName: $(this).text(), houseHoldId: $('#HouseholdId').val() }); }); if (($('#Pquestionyes').prop("checked")) && ($('#ChildId').val() == "0")) { $('#ChildRecord').hide(); $('#Childtab').hide(); } else { // $('#ChildRecord').show(); $('#ChildRecord').addClass("active"); $('#ChildRecord').addClass("in"); $('#myTab li:eq(3) a').tab('show'); } if (($('#Pquestionyes1').prop("checked")) && ($('#ChildId').val() == "0")) { $('#ChildRecord').hide(); $('#Childtab').hide(); } else { $('#ChildRecord').addClass("active"); $('#ChildRecord').addClass("in"); $('#myTab li:eq(3) a').tab('show'); }$('#form1').on('keyup keypress', function (e) { var keyCode = e.keyCode || e.which; if (keyCode === 13) { e.preventDefault(); return false; } }); //end of auto suggest if ('@ViewBag.tabpage' != '') { if ('@ViewBag.tabpage' == '1') { //removeclasss(); $('#HouseholdRecord').removeClass("in"); $('#HouseholdRecord').removeClass("active"); $('#HouseholdRecord').addClass("active"); $('#HouseholdRecord').addClass("in"); $('#myTab li:eq(0) a').tab('show'); } if ('@ViewBag.tabpage' == '2') { removeclasss(); $('#HouseholdRecord').removeClass("in"); $('#HouseholdRecord').removeClass("active"); $('#FamilyHouseholdRecord').addClass("active"); $('#FamilyHouseholdRecord').addClass("in"); $('#myTab li:eq(1) a').tab('show'); } if ('@ViewBag.tabpage' == '3') { removeclasss(); $('#HouseholdRecord').removeClass("in"); $('#HouseholdRecord').removeClass("active"); $('#ChildRecord').hide(); $('#Childtab').hide(); $('#FamilyRecord').addClass("active"); $('#FamilyRecord').addClass("in"); $('#myTab li:eq(2) a').tab('show'); if ($('#Pregnantmotherenrolled').prop("checked")) { $("#Div3").show(); } if ($('#PregnantmotherenrolledP1').prop("checked")) { $("#Divp3").show(); } } if ('@ViewBag.tabpage' == '4') { removeclasss(); $('#HouseholdRecord').removeClass("in"); $('#HouseholdRecord').removeClass("active"); $('#ChildRecord').addClass("active"); $('#ChildRecord').addClass("in"); $('#myTab li:eq(3) a').tab('show'); } if ('@ViewBag.tabpage' == '5') { removeclasss(); $('#HouseholdRecord').removeClass("in"); $('#HouseholdRecord').removeClass("active"); $('#OtherinHousehold').addClass("active"); $('#OtherinHousehold').addClass("in"); $('#myTab li:eq(4) a').tab('show'); } if ('@ViewBag.tabpage' == '6') { removeclasss(); $('#HouseholdRecord').removeClass("in"); $('#HouseholdRecord').removeClass("active"); $('#EmergencyContacts').addClass("active"); $('#EmergencyContacts').addClass("in"); $('#myTab li:eq(6) a').tab('show'); } if ('@ViewBag.tabpage' == '7') { removeclasss(); $('#HouseholdRecord').removeClass("in"); $('#HouseholdRecord').removeClass("active"); $('#RestrictedList').addClass("active"); $('#RestrictedList').addClass("in"); $('#myTab li:eq(7) a').tab('show'); } if ('@ViewBag.tabpage' == '8') { removeclasss(); $('#HouseholdRecord').removeClass("in"); $('#HouseholdRecord').removeClass("active"); $('#FamilyFileCabinet').addClass("active"); $('#FamilyFileCabinet').addClass("in"); $('#myTab li:eq(8) a').tab('show'); } } else { $('#myTab a:first').tab('show'); } if ('@ViewBag.result' == 'Sucessbtn') { //$('#btnSubmitAccept').attr("disabled", "disabled"); $('#btnSubmitAccept').hide(); } if ('@ViewBag.result' == 'Sucess') { emptychild(); } if ('@ViewBag.result' == 'Sucessemergency') { emptyemergencytab(); } if ('@ViewBag.result' == 'SucessOther') { emptyOther(); } if ('@ViewBag.result' == 'SucessRestricted') { emptyrestricted(); } $(document).on('click', '.panel-heading2 span.clickable', function (e) { $('.panel - body1').show(); var $this = $(this); if (!$this.hasClass('panel-collapsed')) { $this.parents('.panel2').find('.panel-body2').slideUp(); $this.addClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); } else { $this.parents('.panel2').find('.panel-body').slideDown(); $this.removeClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); } }); $(document).on('click', '.panel-heading1 span.clickable1', function (e) { $('.panel - body2').show(); var $this = $(this); if (!$this.hasClass('panel-collapsed')) { $this.parents('.panel1').find('.panel-body1').slideUp(); $this.addClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); } else { $this.parents('.panel1').find('.panel-body1').slideDown(); $this.removeClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); } }); $(document).on('click', '.panel-heading3 span.clickable3', function (e) { $('.panel - body3').show(); var $this = $(this); if (!$this.hasClass('panel-collapsed')) { $this.parents('.panel3').find('.panel-body3').slideUp(); $this.addClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); } else { $this.parents('.panel3').find('.panel-body3').slideDown(); $this.removeClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); } }); $('#myTab li:eq(0) a').on('click', function (e) { $('#BtnMsave').show(); }); $('#myTab li:eq(1) a').on('click', function (e) { $('#BtnMsave').show(); }); $('#myTab li:eq(2) a').on('click', function (e) { $('#BtnMsave').show(); }); $('#myTab li:eq(3) a').on('click', function (e) { $('#BtnMsave').show(); }); $('#myTab li:eq(4) a').on('click', function (e) { $('#BtnMsave').hide(); }); $('#myTab li:eq(5) a').on('click', function (e) { $('#BtnMsave').hide(); }); $('#myTab li:eq(6) a').on('click', function (e) { $('#BtnMsave').hide(); }); $('#myTab li:eq(7) a').on('click', function (e) { $('#BtnMsave').hide(); }); $('#myTab li:eq(8) a').on('click', function (e) { $('#BtnMsave').hide(); }); $('#PMDentalExamDate1').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); $('#PMDentalExamDate').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); $("#mobileno").mask("(999) 999-9999"); $("#P1phoneno").mask("(999) 999-9999"); $("#Pphoneno").mask("(999) 999-9999"); $("#CSSN").mask("999-99-9999"); $("#ParentSSN1").mask("999-99-9999"); $("#ParentSSN2").mask("999-99-9999"); $("#ParentSSN3").mask("999-99-9999"); $('#gridphone > tbody tr').each(function () { $(this).find('td:eq(1) :input[type="text"]').mask("(999) 999-9999"); $(this).find('td:eq(0) :input').val(""); }); $('#gridphone1 > tbody tr').each(function () { $(this).find('td:eq(1) :input[type="text"]').mask("(999) 999-9999"); $(this).find('td:eq(0) :input').val(""); }); $('#gridphoneE1 > tbody tr').each(function () { $(this).find('td:eq(1) :input[type="text"]').mask("(999) 999-9999"); $(this).find('td:eq(0) :input').val(""); }); //rohit if (($('.Pfemale').prop("checked"))) { $("#addquestion").show(); if ($('#Pquestionyes').prop("checked")) { if ('@Model.ExistPmprogram' > 0) { $('#Pregnantmotherprogram').show(); if (($('#Pregnantmotherenrolled').prop("checked")) && ($('#ChildId').val() == "0")) { if ($('#MedicalhomePreg1').val() == 3 || $('#MedicalhomePreg1').val() == 4 || $('#MedicalhomePreg1').val() == 2) { $('#addp1').show(); } $("#Div3").show(); } else { $("#Div3").hide(); } } } } if ($('.P1female').prop("checked")) { $("#addquestion1").show(); if ($('#Pquestionyes1').prop("checked")) { if ('@Model.ExistPmprogram' > 0) { $('#Pregnantmotherprogram1').show(); if (($('#PregnantmotherenrolledP1').prop("checked")) && ($('#ChildId').val() == "0")) { $("#Divp3").show(); if ($('#MedicalhomePreg2').val() == 3 || $('#MedicalhomePreg2').val() == 4 || $('#MedicalhomePreg2').val() == 2) { $('#addp2').show(); } } else { $("#Divp3").hide(); } } } } if ($('#FamilyType').prop('checked')) { $('#Pparentid1').removeClass("panel-collapsed"); $(".panel1").hide(); $('.panel-body2').attr('style', 'display: block;'); $('#Pparentid1').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); $(".panel2").show(); } if ($('#FamilyType1').prop('checked')) { $('#Pparentid1').removeClass("panel-collapsed"); $('#pparentid2').removeClass("panel-collapsed"); $('#Pparentid1').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); $('#pparentid2').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); $('.panel-body2').attr('style', 'display: block;'); $('.panel-body1').attr('style', 'display: block;'); $(".panel1").show(); $(".panel2").show(); $('#ParentRelatioship').find('option').remove().end().append('<option value="1">Parents (biological, adoptive, stepparents, etc.)</option>' + '<option value="2">Grandparents</option><option value="3">Relatives other than grandparents</option><option value="4">Foster parents not including relatives</option>' + '<option value="6">Other</option> '); $('#ParentRelatioship').val(''); $('#divParentrelatioship').hide(); $('#divrelationshipparent').show(); if ('@Model.ParentRelatioship' != '0') { $('#ParentRelatioship').val('@Model.ParentRelatioship'); } if ('@Model.ParentRelatioship' == '6') { $('#divParentrelatioship').show(); } } $('#CDOB').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); $('#PDOB').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); $('#P1DOB').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); $('#ODOB').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); $('#EDOB').mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); if ('@ViewBag.mode' == 0) { $('#DdlPRole').val(''); $('#DdlP1Role').val(''); $('#ERelationwithchild').val(''); $('#DdlPDegreeEarned').val(''); $('#DdlP1DegreeEarned').val(''); $('#CProgramType').val(''); $('#Pregnantmotherprimaryinsurance').val(''); $('#Pregnantmotherprimaryinsurance1').val(''); } @*if ('@ViewBag.mode' == 1) { if ('@Model.PrimaryLanguauge' == '') { $('#PrimaryLanguauge').val(''); } if ('@Model.PRole' == '') { $('#DdlPRole').val(''); } if ('@Model.PDegreeEarned' == '') { $('#DdlPDegreeEarned').val(''); } if ('@Model.P1Role' == '') { $('#DdlP1Role').val(''); } if ('@Model.P1DegreeEarned' == '') { $('#DdlP1DegreeEarned').val(''); } if ('@Model.Pregnantmotherprimaryinsurance' == '0') { $('#Pregnantmotherprimaryinsurance').val(''); } if ('@Model.TrimesterEnrolled' == '0') { $('#TrimesterEnrolled').val(''); } if ('@Model.MedicalhomePreg1' == '0') { $('#MedicalhomePreg1').val(''); } if ('@Model.Pregnantmotherprimaryinsurance1' == '0') { $('#Pregnantmotherprimaryinsurance1').val(''); } if ('@Model.TrimesterEnrolled1' == '0') { $('#TrimesterEnrolled1').val(''); } if ('@Model.MedicalhomePreg2' == '0') { $('#MedicalhomePreg2').val(''); } $('#ERelationwithchild').val(''); if ($('#ChildId').val() == "0") { $('#CRace').val(''); $('#CRaceSubCategory').val(''); $('#CEthnicity').val(''); $('#Medicalhome').val(''); $('#CDentalhome').val(''); $('#ImmunizationService').val(''); $('#BMIStatus').val(''); $('#CProgramType').val(''); $('#DOBverifiedBy').val(''); $('#SchoolDistrict').val(''); $('#InsuranceOption').val(''); } if ($('#ParentID').val() == "0") { $('#DdlPRole').val(''); $('#DdlPDegreeEarned').val(''); } if ($('#ParentID1').val() == "0") { $('#DdlP1Role').val(''); $('#DdlP1DegreeEarned').val(''); } }*@ if ($('#ParentID').val() != "0" && $('#ParentID1').val() != "0") { $('#btnremoveParent1').show(); $('#btnremoveParent2').show(); } if ($('#DdlPRole').val() == 6) { $('#addrow').show(); } if ($('#DdlP1Role').val() == 6) { $('#addrow1').show(); } if ('@Model.PrimaryLanguauge' == '12') $('#div2').show(); else $('#div2').hide(); //rohit $('#customChecklist input[type=checkbox]').change(function () { var exist1 = false; var exist2 = false; $('#customChecklist input:checked').each(function () { if ($(this).prop("checked")) { if ($(this).attr("accesskey") == 1) exist1 = true; if ($(this).attr("accesskey") == 2) exist2 = true; } }); if (exist1 == true || exist2 == true) $('#Screening1').show(); else $('#Screening1').hide(); if (exist1 == true && exist2 == true) { customAlert('Cannot select Head Start or Early Head Start program together.'); $(this).prop("checked", false); exist1 = false; exist2 = false; return false; } }); //get all in one request $("#ParentSSN1").blur(function () { if (Parent1ssn != null) { if ($('#ParentSSN1').val() == "") { var res = Parent1ssn; len = res.length; max = 11; stars = len > 0 ? len > 1 ? len > 2 ? len > 3 ? len > 4 ? '***-**-' : '***-*' : '***-' : '**' : '*' : ''; result = stars + res.substring(7); $('#ParentSSN1').val(result); } } }); $("#ParentSSN2").blur(function () { if (Parent2ssn != null) { if ($('#ParentSSN2').val() == "") { var res = Parent2ssn; len = res.length; max = 11; stars = len > 0 ? len > 1 ? len > 2 ? len > 3 ? len > 4 ? '***-**-' : '***-*' : '***-' : '**' : '*' : ''; result = stars + res.substring(7); $('#ParentSSN2').val(result); } } }); if ($('#ParentID').val() != "0") { if ('@Model.ParentSSN1' != "") { var res = '@Model.ParentSSN1'; len = res.length; max = 11; stars = len > 0 ? len > 1 ? len > 2 ? len > 3 ? len > 4 ? '***-**-' : '***-*' : '***-' : '**' : '*' : ''; result = stars + res.substring(7); $('#ParentSSN1').val(result); Parent1ssn = '@Model.ParentSSN1'; } drawParent1phonelist(); } if ($('#ParentID1').val() != "0") { if ('@Model.ParentSSN2' != "") { var res = '@Model.ParentSSN2'; len = res.length; max = 11; stars = len > 0 ? len > 1 ? len > 2 ? len > 3 ? len > 4 ? '***-**-' : '***-*' : '***-' : '**' : '*' : ''; result = stars + res.substring(7); $('#ParentSSN2').val(result); Parent2ssn = '@Model.ParentSSN2'; } drawParent2phonelist(); } //drawEmergencygrid(); //drawRestrictedgrid(); //drawOthergrid(); //drawgrid(); getNotes(); cloneimmunizationtable = $('#Imminizationclone').html(); if ('@ViewBag.message' != '') { customAlert('@ViewBag.message'); } if ('@TempData["message"]' != null && '@TempData["message"]' != '') { customAlert('@TempData["message"]'); } $('#form1').submit(function () { //$('#BtnMsave').attr('disabled', 'disabled'); //$('#btnother').attr('disabled', 'disabled'); btnRestricted //$('#btnEmergency').attr('disabled', 'disabled'); //$('#btnRestricted').attr('disabled', 'disabled'); }); $('#btnExit').click(function () { window.location.href = HostedDir + "/Home/AgencystaffDashboard"; }); $('#btnFamilyDetailExit').click(function () { removeclasss(); $('#HouseholdRecord').addClass("active"); $('#HouseholdRecord').addClass("in"); $('#myTab li:eq(0) a').tab('show'); //window.location.href = HostedDir + "/Home/AgencystaffDashboard"; }); $('#btnExitchild').click(function () { removeclasss(); $('#FamilyRecord').addClass("active"); $('#FamilyRecord').addClass("in"); $('#myTab li:eq(2) a').tab('show'); }); $('#btnParentExit').click(function () { removeclasss(); $('#FamilyHouseholdRecord').addClass("active"); $('#FamilyHouseholdRecord').addClass("in"); $('#myTab li:eq(1) a').tab('show'); //window.location.href = HostedDir + "/Home/AgencystaffDashboard"; }); var dateToday = new Date(); var yrRange = "1950:" - (dateToday.getFullYear() - 20); $(".datecss").datetimepicker({ changeMonth: true, changeYear: true, yearRange: '1964:1991', timepicker: false, format: 'm/d/Y' }); //$("#CDOB").keypress(function (event) { event.preventDefault(); }); //$("#PDOB").keypress(function (event) { event.preventDefault(); }); //var end = new Date(); //$("#PDOB").datetimepicker({ // timepicker: false, // format: 'm/d/Y', // changeMonth: true, // changeYear: true, // maxDate: end, //}); $('.time').datetimepicker({ datepicker: false, format: 'H:i', step: 15 }); //$("#P1DOB").keypress(function (event) { event.preventDefault(); }); //var end = new Date(); //$("#P1DOB").datetimepicker({ // timepicker: false, // format: 'm/d/Y', // changeMonth: true, // changeYear: true, // maxDate: end, //}); $('.time').datetimepicker({ datepicker: false, format: 'H:i', step: 15 }); //var end = new Date(); //$("#CDOB").datetimepicker({ // timepicker: false, onChangeDateTime: function (dp, $input) { // // checkdate(); // }, // format: 'm/d/Y', // changeMonth: true, // changeYear: true, // maxDate: end, //}); //var end = new Date(); //$("#ODOB").datetimepicker({ // timepicker: false, // format: 'm/d/Y', // changeMonth: true, // changeYear: true, // maxDate: end, //}); $('.time').datetimepicker({ datepicker: false, format: 'H:i', step: 15 }); //$("#EDOB").keypress(function (event) { event.preventDefault(); }); //var end = new Date(); //$("#EDOB").datetimepicker({ // timepicker: false, // format: 'm/d/Y', // changeMonth: true, // changeYear: true, // maxDate: end, //}); $('.time').datetimepicker({ datepicker: false, format: 'H:i', step: 15 }); $("#CSSN").blur(function () { if (ssnoriginalvalue != null) { if ($('#CSSN').val() == "") { var res = ssnoriginalvalue; len = res.length; max = 11; stars = len > 0 ? len > 1 ? len > 2 ? len > 3 ? len > 4 ? '***-**-' : '***-*' : '***-' : '***' : '*' : ''; result = stars + res.substring(7); $('#CSSN').val(result); } } }); $("#ParentSSN3").blur(function () { if (ssnothervalue != null) { if ($('#ParentSSN3').val() == "") { var res = ssnothervalue; len = res.length; max = 11; stars = len > 0 ? len > 1 ? len > 2 ? len > 3 ? len > 4 ? '***-**-' : '***-*' : '***-' : '***' : '*' : ''; result = stars + res.substring(7); $('#ParentSSN3').val(result); } } }); //30082016 if('@Model.HealthReview'==1) { $('.ChangeToHealth').text('Health Review'); $('#Acceptclient').hide(); $('#HealthReview').show(); } //addded on 12-26-2016 var programtype = null; $('#customChecklist input:checked').each(function () { if ($(this).prop("checked")) { programtype = $(this).attr("accesskey"); } }); $('.customallowscreening').each(function () { if ($(this).attr("accesskey") == programtype) { $(this).show(); } else { $(this).hide(); } }); }); //End of document.ready function function CheckHealthchk() { isValid = true; if (!$('#Healthreviewnurse').prop("checked")) { isValid = false; customAlert("Reviewed is required "); plainValidation('#Healthreviewnurse'); return isValid; } } function ucfirst(str, force) { str = force ? str.toLowerCase() : str; return str.replace(/(\b)([a-zA-Z])/, function (firstLetter) { return firstLetter.toUpperCase(); }); } function Changefirstchar(value) { var cp_value = ucfirst($(value).val(), true); $(value).val(cp_value); } //Changes on 7Feb2017 function checkParentZipCode(inputTextObject) { if ($(inputTextObject).val() != "") { var ret = true; var Zipcode = $(inputTextObject).val(); var len = Zipcode.length; if ((isNaN(inputTextObject.value)) && (len < 2)) { $(inputTextObject).val(''); customAlert("Zip code must be numeric. "); var ret = false; } else if (len < 2) { $(inputTextObject).val(''); customAlert("Zip code length must be 2 digit. "); var ret = false; } else if (isNaN(inputTextObject.value)) { $(inputTextObject).val(''); customAlert("Zip code must be numeric. "); var ret = false; } if (ret) CheckParentAddress(1); return ret; } else { $('#Parentcity').find('option').remove(); $('#Parentstate').val(''); // $('#County').val(''); } } function CheckParentAddress(value) { //debugger; var Zipcode = 0; if (value == 0) Zipcode = 0; else Zipcode = $('#Parentzipcode').val(); if ($('#Parentzipcode').val().trim() != "") { $.ajax({ url: HostedDir + "/AgencyAdmin/Checkaddress", type: "POST", data: { Address: $('#Parentzipcode').val(), //HouseHoldId: $('#HouseholdId').val(), Zipcode: Zipcode }, dataType: "json", secureuri: false, async: false, success: function (response) { //debugger; if (value == 1) { if (response.Zipcodelist != null && response.Zipcodelist.length > 0) { var option = ""; for (var i = 0; i < response.Zipcodelist.length; i++) { option = option + '<option value="' + response.Zipcodelist[i].City + '">' + response.Zipcodelist[i].City + '</option>'; } $('#Parentcity').find('option').remove().end().append(option); $('#Parentcity').val(''); $('#Parentstate').val(response.Zipcodelist[0].State); // $('#CountyD').val(response.Zipcodelist[0].County); $('#Parentzipcode').val(response.Zipcodelist[0].Zipcode); } else { $('#Parentcity').find('option').remove().end(); $('#Parentcity').val(''); $('#Parentstate').val(''); $('#Parentzipcode').val(''); // $('#CountyD').val(''); customAlert("Could not find zipcode details."); } } } , error: function (response) { customAlert("Session Ended Log Onto The System Again."); setTimeout(function () { window.location.href = HostedDir + '/login/Loginagency'; }, 2000); } }); } } //End function isValidParentInfo() { cleanValidation(); isValid = true; //if ($('#Pfirstname')[0].value.trim() == "") { // isValid = false; // customAlert("First name is required. "); // plainValidation('#Pfirstname'); // return isValid; //} //if ($('#Plastname')[0].value.trim() == "") { // isValid = false; // customAlert("Last name is required. "); // plainValidation('#Plastname'); // return isValid; //} //if ($('#PDOB')[0].value.trim() == "") { // isValid = false; // customAlert("Date of birth is required. "); // plainValidation('#PDOB'); // return isValid; //} //if ($('#PDOB')[0].value.trim() != "") { // var today = new Date(); // if (Date.parse($("#PDOB").val()) > today) { // isValid = false; // customAlert("Date of birth Can't be greater than current date. "); // plainValidation('#PDOB'); // return isValid; // } //} //if ($('#Pemailid')[0].value.trim() == "") { // isValid = false; // customAlert("Email id is required. "); // plainValidation('#Pemailid'); // return isValid; //} //if ($('#Pemailid')[0].value.trim() != "" && !validateEmail($('#Pemailid')[0].value.trim())) { // isValid = false; // customAlert("Please enter valid email id. "); // plainValidation('#Pemailid'); // return isValid; //} //if ($("#DdlPRole").val() == null) { // isValid = false; // customAlert("Parent/Guardian is required. "); // plainValidation('#DdlPRole'); // return isValid; //} //if (!$("input:radio[name='PGender']").is(":checked")) { // isValid = false; // customAlert("Gender is required. "); // return isValid; //} //if ($('#DdlPRole').val() == 6) { // if ($('#Pnotesother')[0].value.trim() == "") { // isValid = false; // customAlert("Notes is required. "); // plainValidation('#Pnotesother'); // return isValid; // } //} //if (!$("input:radio[name='PMilitaryStatus']").is(":checked")) { // isValid = false; // customAlert("Military Status is required. "); // return isValid; //} //if ($(".Pfemale").prop("checked")) { // if (!$("input:radio[name='PQuestion']").is(":checked")) { // isValid = false; // customAlert("Currently pregnant is required. "); // return isValid; // } //} //if ($('#Pregnantmotherenrolled').prop("checked")) { // if ($("#Pregnantmotherprimaryinsurance").val() == null) { // isValid = false; // customAlert("Primary Insurance is required. "); // plainValidation('#Pregnantmotherprimaryinsurance'); // return isValid; // } // if ($("#TrimesterEnrolled").val() == null) { // isValid = false; // customAlert("Trimester Enrolled is required. "); // plainValidation('#TrimesterEnrolled'); // return isValid; // } //} //if (!$("input:radio[name='PCurrentlyWorking']").is(":checked")) { // isValid = false; // customAlert("Currently working is required. "); // return isValid; //} //if (!$("input:radio[name='PEnrollment']").is(":checked")) { // isValid = false; // customAlert("Currently enrolled in job training/school is required. "); // return isValid; //} //if ($("#DdlPDegreeEarned").val() == null) { // isValid = false; // customAlert("Highest degree earned is required. "); // plainValidation('#DdlPDegreeEarned'); // return isValid; //} //if ($('#Span1').text() == "") { // isValid = false; // customAlert("Parent Income is required. "); // $('#Myincomecalculator').modal('show'); // return isValid; //} ////if ($('#Parentincome1')[0].value.trim() == "") { // isValid = false; // customAlert("Total income is required."); // plainValidation('#Parentincome1'); // return isValid; //} //if ($('#gridphone > tbody tr').length == 0) { // isValid = false; // customAlert("Please add contact no. "); // return isValid; //} //if ($('#gridphone > tbody tr').length > 0) { // var Phonetype = $("#gridphone > tbody tr:first").find('td:eq(0) :input'); // var PrimaryPhone = $("#gridphone > tbody tr:first").find('td:eq(1) :input[type="text"]'); // if ($(Phonetype).val() == null) { // isValid = false; // customAlert("Phone type is required. "); // plainValidation(Phonetype); // return isValid; // } // if ($(PrimaryPhone).val().trim() == "") { // isValid = false; // customAlert("Phone no is required. "); // plainValidation(PrimaryPhone); // return isValid; // } // var length = 0; // $('#gridphone > tbody tr').each(function () { // if (length == 0) { // length = $(this).find('td:eq(2) :checkbox:checked').length; // if ($(this).find('td:eq(0) :input').val() == null) // length = 0; // if ($(this).find('td:eq(1) :input[type="text"]').val() == null) // length = 0; // } // }); // if (length == 0) { // var checkbox = $("#gridphone > tbody tr:first").find('td:eq(2) :checkbox'); // isValid = false; // customAlert("Please check one primary no. "); // plainValidation(checkbox); // return isValid; // } //} //if ($('.Pmale').prop("checked")) { // if ($('#DdlPRole').val() == 2) { // customAlert("Please select valid parent/guardian role. "); // plainValidation('#DdlPRole'); // $('#addrow').html(''); // isValid = false; // return isValid; // } //} //if ($('.Pfemale').prop("checked")) { // if ($('#DdlPRole').val() == 1) { // customAlert("Please select valid parent/guardian role. "); // plainValidation('#DdlPRole'); // $('#addrow').html(''); // isValid = false; // return isValid; // } //} //if ($('.Pother').prop("checked")) { // if ($('#DdlPRole').val() == 1 || $('#DdlPRole').val() == 2) { // customAlert("Please select valid parent/guardian."); // plainValidation('#DdlPRole'); // $('#addrow').html(''); // isValid = false; // return isValid; // } //} //if ($('#DdlPRole').val() == 6 && $('#Pnotesother').val().trim() == "") { // isValid = false; // customAlert("Notes is required. "); // plainValidation('#Pnotesother'); // return isValid; //} //if ($('#FamilyType1').prop("checked")) { // if ($('#P1firstname')[0].value.trim() == "") { // isValid = false; // customAlert("First name is required. "); // plainValidation('#P1firstname'); // return isValid; // } // if ($('#P1lastname')[0].value.trim() == "") { // isValid = false; // customAlert("Last name is required. "); // plainValidation('#P1lastname'); // return isValid; // } // if ($('#P1DOB')[0].value.trim() == "") { // isValid = false; // customAlert("Date of birth is required. "); // plainValidation('#P1DOB'); // return isValid; // } // if ($('#P1DOB')[0].value.trim() != "") { // var today = new Date(); // if (Date.parse($("#P1DOB").val()) > today) { // isValid = false; // customAlert("Date of birth Can't be greater than current date. "); // plainValidation('#P1DOB'); // return isValid; // } // } // if ($('#P1emailid')[0].value.trim() == "") { // isValid = false; // customAlert("Email id is required. "); // plainValidation('#P1emailid'); // return isValid; // } // if ($('#P1emailid')[0].value.trim() != "" && !validateEmail($('#Pemailid')[0].value.trim())) { // isValid = false; // customAlert("Please enter valid email id. "); // plainValidation('#P1emailid'); // return isValid; // } // if ($("#DdlP1Role").val() == null) { // isValid = false; // customAlert("Parent/Guardian is required. "); // plainValidation('#DdlP1Role'); // return isValid; // } // if (!$("input:radio[name='P1Gender']").is(":checked")) { // isValid = false; // customAlert("Gender is required. "); // return isValid; // } // if ($('#DdlP1Role').val() == 6) { // if ($('#P1notesother')[0].value.trim() == "") { // isValid = false; // customAlert("Notes is required. "); // plainValidation('#P1notesother'); // return isValid; // } // } // if (!$("input:radio[name='P1MilitaryStatus']").is(":checked")) { // isValid = false; // customAlert("Military Status is required. "); // return isValid; // } // if ($(".P1female").prop("checked")) { // if (!$("input:radio[name='P1Question']").is(":checked")) { // isValid = false; // customAlert("Currently pregnant is required. "); // return isValid; // } // } // if ($('#PregnantmotherenrolledP1').prop("checked")) { // if ($("#Pregnantmotherprimaryinsurance1").val() == null) { // isValid = false; // customAlert("Primary Insurance is required. "); // plainValidation('#Pregnantmotherprimaryinsurance1'); // return isValid; // } // if ($("#TrimesterEnrolled1").val() == null) { // isValid = false; // customAlert("Trimester Enrolled is required. "); // plainValidation('#TrimesterEnrolled1'); // return isValid; // } // } // if (!$("input:radio[name='P1CurrentlyWorking']").is(":checked")) { // isValid = false; // customAlert("Currently working is required. "); // return isValid; // } // if (!$("input:radio[name='P1Enrollment']").is(":checked")) { // isValid = false; // customAlert("Currently enrolled in job training/school is required. "); // return isValid; // } // if ($("#DdlP1DegreeEarned").val() == null) { // isValid = false; // customAlert("Highest degree earned is required. "); // plainValidation('#DdlP1DegreeEarned'); // return isValid; // } // if ($('#Span1P2').text() == "") { // isValid = false; // customAlert("Parent Income is required. "); // $('#Myincomecalculator1').modal('show'); // return isValid; // } // if ($('#gridphone1 > tbody tr').length == 0) { // isValid = false; // customAlert("Please add contact no. "); // return isValid; // } // if ($('#gridphone1 > tbody tr').length > 0) { // var Phonetype = $("#gridphone1 > tbody tr:first").find('td:eq(0) :input'); // var PrimaryPhone = $("#gridphone1 > tbody tr:first").find('td:eq(1) :input[type="text"]'); // if ($(Phonetype).val() == null) { // isValid = false; // customAlert("Phone type is required. "); // plainValidation(Phonetype); // return isValid; // } // if ($(PrimaryPhone).val().trim() == "") { // isValid = false; // customAlert("Phone no is required. "); // plainValidation(PrimaryPhone); // return isValid; // } // var length = 0; // $('#gridphone1 > tbody tr').each(function () { // if (length == 0) { // length = $(this).find('td:eq(2) :checkbox:checked').length; // if ($(this).find('td:eq(0) :input').val() == null) // length = 0; // if ($(this).find('td:eq(1) :input[type="text"]').val() == null) // length = 0; // } // }); // if (length == 0) { // isValid = false; // var checkbox = $("#gridphone1 > tbody tr:first").find('td:eq(2) :checkbox'); // customAlert("Please check one primary no ."); // plainValidation(checkbox); // return isValid; // } // } // if ($('.P1male').prop("checked")) { // if ($('#DdlP1Role').val() == 2) { // customAlert("Please select valid parent/guardian role. "); // plainValidation('#DdlP1Role'); // $('#addrow1').html(''); // isValid = false; // return isValid; // } // } // if ($('.P1female').prop("checked")) { // if ($('#DdlP1Role').val() == 1) { // customAlert("Please select valid parent/guardian role. "); // plainValidation('#DdlP1Role'); // $('#addrow1').html(''); // isValid = false; // return isValid; // } // } // if ($('.P1other').prop("checked")) { // if ($('#DdlP1Role').val() == 1 || $('#DdlPRole').val() == 2) { // customAlert("Please select valid parent/guardian."); // plainValidation('#DdlP1Role'); // $('#addrow1').html(''); // isValid = false; // return isValid; // } // } // if ($('#DdlP1Role').val() == 6 && $('#P1notesother').val().trim() == "") { // isValid = false; // customAlert("Notes is required. "); // plainValidation('#P1notesother'); // return isValid; // } //} //if ($('#ParentID').val() != "0" && $('#ParentID1').val() != "0") { // if ($('#FamilyType').prop('checked')) { // customAlert("Please select two parent family. "); // removeclasss(); // $('#FamilyHouseholdRecord').addClass("active"); // $('#FamilyHouseholdRecord').addClass("in"); // $('#myTab li:eq(1) a').tab('show'); // isValid = false; // return isValid; // } //} removeclasss(); $('#ChildRecord').addClass("active"); $('#ChildRecord').addClass("in"); $('#myTab li:eq(3) a').tab('show'); return isValid; } function GetHschild() { $.ajax({ url: HostedDir + "/Nurse/GetHschild", type: "POST", data: { Childid: $('#ChildId').val(), }, dataType: "json", secureuri: false, async: false, success: function (data) { EditChild(data); SetCustomData(data); } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } function EditChild(data) { //if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { // $('#ChildVitaminSupplementlist input:checked').each(function () { // $(this).prop("checked", false); // }); // for (var i = 0; i < data._Childhealthnutrition.length; i++) { // if (data._Childhealthnutrition[i].Questionid == "7") { // if (data._Childhealthnutrition[i].MasterId == "") { // $('#ChildVitaminSupplementlist').append('<br><input name="PostedPostedChildVitamin.CDietInfoID"' + // 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); // } // else { // $('#ChildVitaminSupplementlist input[type=checkbox]').each(function () { // if ($(this).val() == data._Childhealthnutrition[i].MasterId) // $(this).prop("checked", true); // }); // } // } // } // $('#ChildVitaminSupplementlist input:checked').each(function () { // if ($(this).prop("checked")) { // var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; // $('#Cvstext').append(div); // } // }); // //Child Diet Pop // $('#ChildDietlist input:checked').each(function () { // $(this).prop("checked", false); // }); // for (var i = 0; i < data._Childhealthnutrition.length; i++) { // if (data._Childhealthnutrition[i].Questionid == "8") { // if (data._Childhealthnutrition[i].MasterId == "") { // $('#ChildDietlist').append('<br><input name="PostedPostedChildDietFull.CDietInfoID"' + // 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); // } // else { // $('#ChildDietlist input[type=checkbox]').each(function () { // if ($(this).val() == data._Childhealthnutrition[i].MasterId) // $(this).prop("checked", true); // }); // } // } // } // $('#ChildDietlist input:checked').each(function () { // if ($(this).prop("checked")) { // var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; // $('#CDText').append(div); // } // }); // //Child Drink Pop // $('#ChildDrinklist input:checked').each(function () { // $(this).prop("checked", false); // }); // for (var i = 0; i < data._Childhealthnutrition.length; i++) { // if (data._Childhealthnutrition[i].Questionid == "9") { // if (data._Childhealthnutrition[i].MasterId == "") { // $('#ChildDrinklist').append('<br><input name="PostedPostedChildDrink.CDrinkID"' + // 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); // } // else { // $('#ChildDrinklist input[type=checkbox]').each(function () { // if ($(this).val() == data._Childhealthnutrition[i].MasterId) // $(this).prop("checked", true); // }); // } // } // } // $('#ChildDrinklist input:checked').each(function () { // if ($(this).prop("checked")) { // var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; // $('#CDRinkText').append(div); // } // }); //} if ('@Model.ChildReferenceProgramID' == "2") {//Hs //debugger; $('#CDBRText').html(''); $('#CDCText').html(''); $('#CCHText').html(''); $('#CTCHText').html(''); $('#CDBRlist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#DiagnoseChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#MedicalChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#ChronicChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#EHSCDBRText').html(''); $('#EHSCDCText').html(''); $('#EHSCHCText').html(''); $('#EHDCDCText').html(''); $('#EHSCCHText').html(''); $('#EHSCTCHText').html(''); $('#CDBRlist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#DiagnoseChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#EHSChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#EHSCHCChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#MedicalChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#ChronicChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { $('#CDBRlist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "1") { if (data._Childhealthnutrition[i].MasterId == "") { $('#CDBRlist').append('<br><input name="PostedPostedDisease.DiseaseID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#CDBRlist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#CDBRlist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#CDBRText').append(div); } }); $('#DiagnoseChildChecklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "2") { if (data._Childhealthnutrition[i].MasterId == "") { $('#DiagnoseChildChecklist').append('<br><input name="PostedPostedDiagnosedDisease.DiagnoseDiseaseID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#DiagnoseChildChecklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#DiagnoseChildChecklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#CDCText').append(div); } }); $('#MedicalChildChecklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "4") { if (data._Childhealthnutrition[i].MasterId == "") { $('#MedicalChildChecklist').append('<br><input name="PostedPostedDiagnosedDisease.MedicalDiagnoseDiseaseID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#MedicalChildChecklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#MedicalChildChecklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#CCHText').append(div); } }); $('#ChronicChildChecklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "5") { if (data._Childhealthnutrition[i].MasterId == "") { $('#ChronicChildChecklist').append('<br><input name="PostedPostedDiagnosedDisease.ChronicHealthConditionsID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#ChronicChildChecklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#ChronicChildChecklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#CTCHText').append(div); } }); } //Nutrition Hs Questions $('#Cvstext').html(''); $('#ChildVitaminSupplementlist input:checked').each(function () { $(this).prop("checked", false); }); $('#CDText').html(''); $('#ChildDietlist input:checked').each(function () { $(this).prop("checked", false); }); $('#CDRinkText').html(''); $('#ChildDrinklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); if ('@Model.PersistentNausea' == "1") { $('#PersistentNausea1').prop("checked", true); $('#NauseaorVomitingcomment').val('@Model.NauseaorVomitingcomment'); $('#divNauseaorVomitingcomment').show(); } else if ('@Model.PersistentNausea' == 2) { $('#PersistentNausea2').prop("checked", true); $('#divNauseaorVomitingcomment').hide(); $('#NauseaorVomitingcomment').val(''); } else { $('#PersistentNausea1').prop("checked", false); $('#PersistentNausea2').prop("checked", false); $('#NauseaorVomitingcomment').val(''); $('#divNauseaorVomitingcomment').hide(); } if ('@Model.PersistentDiarrhea' == 1) { $('#PersistentDiarrhea1').prop("checked", true); $('#divdiarrheacomment').show(); $('#DiarrheaComment').val('@Model.DiarrheaComment'); } else if ('@Model.PersistentDiarrhea' == 2) { $('#PersistentDiarrhea2').prop("checked", true); $('#DiarrheaComment').val(''); $('#divdiarrheacomment').hide(); } else { $('#PersistentDiarrhea1').prop("checked", false); $('#PersistentDiarrhea2').prop("checked", false); $('#DiarrheaComment').val(''); $('#divdiarrheacomment').hide(); } if ('@Model.PersistentConstipation' == 1) { $('#PersistentConstipation1').prop("checked", true); $('#divPersistentConstipation').show(); $('#Constipationcomment').val('@Model.Constipationcomment'); } else if ('@Model.PersistentConstipation' == 2) { $('#PersistentConstipation2').prop("checked", true); $('#Constipationcomment').val(''); $('#divPersistentConstipation').hide(); } else { $('#PersistentConstipation1').prop("checked", false); $('#PersistentConstipation2').prop("checked", false); $('#Constipationcomment').val(''); $('#divPersistentConstipation').hide(); } if ('@Model.DramaticWeight' == 1) { $('#DramaticWeight1').prop("checked", true); $('#divDramaticWeightchange').show(); $('#DramaticWeightchangecomment').val('@Model.DramaticWeightchangecomment'); } else if ('@Model.DramaticWeight' == 2) { $('#DramaticWeight2').prop("checked", true); $('#DramaticWeightchangecomment').val(''); $('#divDramaticWeightchange').hide(); } else { $('#DramaticWeight1').prop("checked", false); $('#DramaticWeight2').prop("checked", false); $('#DramaticWeightchangecomment').val(''); $('#divDramaticWeightchange').hide(); } if ('@Model.RecentSurgery' == 1) { $('#RecentSurgery1').prop("checked", true); $('#divRecentSurgery').show(); $('#RecentSurgerycomment').val('@Model.RecentSurgerycomment'); } else if ('@Model.RecentSurgery' == 2) { $('#RecentSurgery2').prop("checked", true); $('#RecentSurgerycomment').val(''); $('#divRecentSurgery').hide(); } else { $('#RecentSurgery1').prop("checked", false); $('#RecentSurgery2').prop("checked", false); $('#RecentSurgerycomment').val(''); $('#divRecentSurgery').hide(); } if ('@Model.RecentHospitalization' == 1) { $('#RecentHospitalization1').prop("checked", true); $('#RecentHospitalizationComment').val('@Model.RecentHospitalizationComment'); $('#divRecentHospitalization').show(); } else if ('@Model.RecentHospitalization' == 2) { $('#RecentHospitalization2').prop("checked", true); $('#divRecentHospitalization').hide(); $('#RecentHospitalizationComment').val(''); } else { $('#RecentHospitalization1').prop("checked", false); $('#RecentHospitalization2').prop("checked", false); $('#RecentHospitalizationComment').val(''); $('#divRecentHospitalization').hide(); } if ('@Model.ChildSpecialDiet' == 1) { $('#ChildSpecialDiet1').prop("checked", true); $('#divChildSpecialDiet').show(); $('#SpecialDietComment').val('@Model.SpecialDietComment'); } else if ('@Model.ChildSpecialDiet' == 2) { $('#ChildSpecialDiet2').prop("checked", true); $('#SpecialDietComment').val(''); $('#divChildSpecialDiet').hide(); } else { $('#ChildSpecialDiet1').prop("checked", false); $('#ChildSpecialDiet2').prop("checked", false); $('#SpecialDietComment').val(''); $('#divChildSpecialDiet').hide(); } if ('@Model.FoodAllergies' == 1) { $('#FoodAllergies1').prop("checked", true); $('#divFoodAllergies').show(); $('#FoodAllergiesComment').val('@Model.FoodAllergiesComment'); } else if ('@Model.FoodAllergies' == 2) { $('#FoodAllergies2').prop("checked", true); $('#FoodAllergiesComment').val(''); $('#divFoodAllergies').hide(); } else { $('#FoodAllergies1').prop("checked", false); $('#FoodAllergies2').prop("checked", false); $('#FoodAllergiesComment').val(''); $('#divFoodAllergies').hide(); } if ('@Model.NutritionalConcern' == 1) { $('#NutritionalConcern1').prop("checked", true); $('#divNutritionalConcern').show(); $('#NutritionAlconcernsComment').val('@Model.NutritionAlconcernsComment'); } else if ('@Model.NutritionalConcern' == 2) { $('#NutritionalConcern2').prop("checked", true); $('#NutritionAlconcernsComment').val(''); $('#divNutritionalConcern').hide(); } else { $('#NutritionalConcern1').prop("checked", false); $('#NutritionalConcern2').prop("checked", false); $('#NutritionAlconcernsComment').val(''); $('#divNutritionalConcern').hide(); } //if (data.WICNutrition) // $('#WICNutrition').prop("checked", true); //else // $('#WICNutrition').prop("checked", false); //if (data.FoodStamps) // $('#FoodStamps').prop("checked", true); //else // $('#FoodStamps').prop("checked", false); //if (data.NoNutritionProg) // $('#NoNutritionProg').prop("checked", true); //else // $('#NoNutritionProg').prop("checked", false); //$('#FoodPantory').val(data.FoodPantory); if ('@Model.childTrouble' == 1) { $('#childTrouble1').prop("checked", true); $('#divchildTrouble').show(); $('#ChewingorSwallowingcomment').val('@Model.ChewingorSwallowingcomment'); } else if ('@Model.childTrouble' == 2) { $('#childTrouble2').prop("checked", true); $('#ChewingorSwallowingcomment').val(''); $('#divchildTrouble').hide(); } else { $('#childTrouble1').prop("checked", false); $('#childTrouble2').prop("checked", false); $('#ChewingorSwallowingcomment').val(''); $('#divchildTrouble').hide(); } if ('@Model.spoon' == 1) { $('#spoon1').prop("checked", true); $('#divSpoonorForkComment').hide(); $('#SpoonorForkComment').val(''); } else if ('@Model.spoon' == 2) { $('#spoon2').prop("checked", true); $('#SpoonorForkComment').val('@Model.SpoonorForkComment'); $('#divSpoonorForkComment').show(); } else { $('#spoon1').prop("checked", false); $('#spoon2').prop("checked", false); $('#SpoonorForkComment').val(''); $('#divSpoonorForkComment').hide(); } if ('@Model.feedingtube' == 1) { $('#feedingtube1').prop("checked", true); $('#divSpecialFeedingComment').show(); $('#SpecialFeedingComment').val('@Model.SpecialFeedingComment'); } else if ('@Model.feedingtube' == 2) { $('#feedingtube2').prop("checked", true); $('#SpecialFeedingComment').val(''); $('#divSpecialFeedingComment').hide(); } else { $('#feedingtube1').prop("checked", false); $('#feedingtube2').prop("checked", false); $('#SpecialFeedingComment').val(''); $('#divSpecialFeedingComment').hide(); } //if (data.childThin == 1) // $('#childThin1').prop("checked", true); //else if (data.childThin == 2) // $('#childThin2').prop("checked", true); //else if (data.childThin == 3) // $('#childThin3').prop("checked", true); //else if (data.childThin == 4) // $('#childThin4').prop("checked", true); //else if (data.childThin == 5) // $('#childThin5').prop("checked", true); //else { // $('#childThin1').prop("checked", false); // $('#childThin2').prop("checked", false); // $('#childThin3').prop("checked", false); // $('#childThin4').prop("checked", false); // $('#childThin5').prop("checked", false); //} if ('@Model.Takebottle' == 1) { $('#Takebottle1').prop("checked", true); $('#divBottleComment').show(); $('#BottleComment').val('@Model.BottleComment'); } else if ('@Model.Takebottle' == 2) { $('#Takebottle2').prop("checked", true); $('#BottleComment').val(''); $('#divBottleComment').hide(); } else { $('#Takebottle1').prop("checked", false); $('#Takebottle2').prop("checked", false); $('#BottleComment').val(''); $('#divBottleComment').hide(); } if ('@Model.chewanything' == 1) { $('#chewanything1').prop("checked", true); $('#divchewanything').show(); $('#EatOrChewComment').val('@Model.EatOrChewComment'); } else if ('@Model.chewanything' == 2) { $('#chewanything2').prop("checked", true); $('#EatOrChewComment').val('@Model.EatOrChewComment'); $('#divchewanything').hide(); } else { $('#chewanything1').prop("checked", false); $('#chewanything2').prop("checked", false); $('#EatOrChewComment').val(""); $('#divchewanything').hide(); } if ('@Model.ChildVitaminSupplment' == 1) { $('#divVitaminPopup').show(); } else { $('#divVitaminPopup').hide(); } //questions if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { $('#divEhsVitaminPopup').show(); $('#ChildVitaminSupplementlist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "7") { if (data._Childhealthnutrition[i].MasterId == "") { $('#ChildVitaminSupplementlist').append('<br><input name="PostedPostedChildVitamin.CDietInfoID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#ChildVitaminSupplementlist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#ChildVitaminSupplementlist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#Cvstext').append(div); } }); //Child Diet Pop $('#ChildDietlist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "8") { if (data._Childhealthnutrition[i].MasterId == "") { $('#ChildDietlist').append('<br><input name="PostedPostedChildDietFull.CDietInfoID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#ChildDietlist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#ChildDietlist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#CDText').append(div); } }); //Child Drink Pop $('#ChildDrinklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "9") { if (data._Childhealthnutrition[i].MasterId == "") { $('#ChildDrinklist').append('<br><input name="PostedPostedChildDrink.CDrinkID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#ChildDrinklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#ChildDrinklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#CDRinkText').append(div); } }); } //End //End } if ('@Model.ChildReferenceProgramID' == "1") {//Ehs //debugger; $('#EHSCDBRText').html(''); $('#EHSCDCText').html(''); $('#EHSCHCText').html(''); $('#EHDCDCText').html(''); $('#EHSCCHText').html(''); $('#EHSCTCHText').html(''); $('#CDBRlist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#DiagnoseChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#EHSChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#EHSCHCChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#MedicalChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#ChronicChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#CDBRText').html(''); $('#CDCText').html(''); $('#CCHText').html(''); $('#CTCHText').html(''); $('#CDBRlist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#DiagnoseChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#MedicalChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); $('#ChronicChildChecklist input:checked').each(function () { var value = $(this).val(); if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { $(this).next('label').remove(); $(this).remove(); } else $(this).prop("checked", false); }); ///ChildDirectBloodRelative Popup if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { $('#CDBRlist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "1") { if (data._Childhealthnutrition[i].MasterId == "") { $('#CDBRlist').append('<br><input name="PostedPostedDisease.DiseaseID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#CDBRlist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } } $('#CDBRlist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EHSCDBRText').append(div); } }); //Diagnosed Conditions pop if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { var count = 0; $('#DiagnoseChildChecklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "2") { if (data._Childhealthnutrition[i].MasterId == "") { $('#DiagnoseChildChecklist').append('<br><input name="PostedPostedDiagnosedDisease.DiagnoseDiseaseID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#DiagnoseChildChecklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); if (data._Childhealthnutrition[i].MasterId == 1) count = 1; }); } } } if (count == 1) { $('#DivEHSAllergy').show(); $('#DivEHSEpiPen').show(); } } $('#DiagnoseChildChecklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EHSCDCText').append(div); } }); // received medical treatment pop if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { $('#EHSChildChecklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "6") { if (data._Childhealthnutrition[i].MasterId == "") { $('#EHSChildChecklist').append('<br><input name="PostedPostedMedicalEHS.ChildEHSID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#EHSChildChecklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } } $('#EHSChildChecklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EHSCHCText').append(div); } }); // receiving treatment pop if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { $('#EHSCHCChildChecklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "5") { if (data._Childhealthnutrition[i].MasterId == "") { $('#EHSCHCChildChecklist').append('<br><input name="PostedPostedEHS.ChildEHSID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#EHSCHCChildChecklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } } $('#EHSCHCChildChecklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EHDCDCText').append(div); } }); //Medical Treatment pop if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { $('#MedicalChildChecklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "4") { if (data._Childhealthnutrition[i].MasterId == "") { $('#MedicalChildChecklist').append('<br><input name="PostedPostedDiagnosedDisease.MedicalDiagnoseDiseaseID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#MedicalChildChecklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } } $('#MedicalChildChecklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EHSCCHText').append(div); } }); //receive treatment pop if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { $('#ChronicChildChecklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "3") { if (data._Childhealthnutrition[i].MasterId == "") { $('#ChronicChildChecklist').append('<br><input name="PostedPostedDiagnosedDisease.ChronicHealthConditionsID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#ChronicChildChecklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } } $('#ChronicChildChecklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EHSCTCHText').append(div); } }); //Ehs Nutrition Questions //debugger; //$('#EhsCvstext').html(''); //$('#ChildVitaminSupplementlist input:checked').each(function () { // $(this).prop("checked", false); //}); //$('#EhsCDText').html(''); //$('#ChildDietlist input:checked').each(function () { // $(this).prop("checked", false); //}); //$('#EhsCDRinkText').html(''); //$('#ChildDrinklist input:checked').each(function () { // var value = $(this).val(); // if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { // $(this).next('label').remove(); // $(this).remove(); // } // else // $(this).prop("checked", false); //}); if ('@Model.EhsPersistentNausea' == "1") { $('#EhsPersistentNausea1').prop("checked", true); $('#EhsNauseaorVomitingcomment').val('@Model.EhsNauseaorVomitingcomment'); $('#divEhsNauseaorVomitingcomment').show(); } else if ('@Model.EhsPersistentNausea' == 2) { $('#EhsPersistentNausea2').prop("checked", true); $('#divEhsNauseaorVomitingcomment').hide(); $('#EhsNauseaorVomitingcomment').val(''); } else { $('#EhsPersistentNausea1').prop("checked", false); $('#EhsPersistentNausea2').prop("checked", false); $('#EhsNauseaorVomitingcomment').val(''); $('#divEhsNauseaorVomitingcomment').hide(); } if ('@Model.EhsPersistentDiarrhea' == 1) { $('#EhsPersistentDiarrhea1').prop("checked", true); $('#divEhsdiarrheacomment').show(); $('#EhsDiarrheaComment').val('@Model.EhsDiarrheaComment'); } else if ('@Model.EhsPersistentDiarrhea' == 2) { $('#EhsPersistentDiarrhea2').prop("checked", true); $('#EhsDiarrheaComment').val(''); $('#divEhsdiarrheacomment').hide(); } else { $('#EhsPersistentDiarrhea1').prop("checked", false); $('#EhsPersistentDiarrhea2').prop("checked", false); $('#EhsDiarrheaComment').val(''); $('#divEhsdiarrheacomment').hide(); } if ('@Model.EhsPersistentConstipation' == 1) { $('#EhsPersistentConstipation1').prop("checked", true); $('#divEhsPersistentConstipation').show(); $('#EhsConstipationcomment').val('@Model.EhsConstipationcomment'); } else if ('@Model.EhsPersistentConstipation' == 2) { $('#EhsPersistentConstipation2').prop("checked", true); $('#EhsConstipationcomment').val(''); $('#divEhsPersistentConstipation').hide(); } else { $('#EhsPersistentConstipation1').prop("checked", false); $('#EhsPersistentConstipation2').prop("checked", false); $('#EhsConstipationcomment').val(''); $('#divEhsPersistentConstipation').hide(); } if ('@Model.EhsDramaticWeight' == 1) { $('#EhsDramaticWeight1').prop("checked", true); $('#divEhsDramaticWeightchange').show(); $('#EhsDramaticWeightchangecomment').val('@Model.EhsDramaticWeightchangecomment'); } else if ('@Model.EhsDramaticWeight' == 2) { $('#EhsDramaticWeight2').prop("checked", true); $('#EhsDramaticWeightchangecomment').val(''); $('#divEhsDramaticWeightchange').hide(); } else { $('#EhsDramaticWeight1').prop("checked", false); $('#EhsDramaticWeight2').prop("checked", false); $('#EhsDramaticWeightchangecomment').val(''); $('#divEhsDramaticWeightchange').hide(); } if ('@Model.EhsRecentSurgery' == 1) { $('#EhsRecentSurgery1').prop("checked", true); $('#divEhsRecentSurgery').show(); $('#EhsRecentSurgerycomment').val('@Model.EhsRecentSurgerycomment'); } else if ('@Model.EhsRecentSurgery' == 2) { $('#EhsRecentSurgery2').prop("checked", true); $('#EhsRecentSurgerycomment').val(''); $('#divEhsRecentSurgery').hide(); } else { $('#EhsRecentSurgery1').prop("checked", false); $('#EhsRecentSurgery2').prop("checked", false); $('#EhsRecentSurgerycomment').val(''); $('#divEhsRecentSurgery').hide(); } if ('@Model.EhsRecentHospitalization' == 1) { $('#EhsRecentHospitalization1').prop("checked", true); $('#EhsRecentHospitalizationComment').val('@Model.EhsRecentHospitalizationComment'); $('#divEhsRecentHospitalization').show(); } else if ('@Model.EhsRecentHospitalization' == 2) { $('#EhsRecentHospitalization2').prop("checked", true); $('#divEhsRecentHospitalization').hide(); $('#EhsRecentHospitalizationComment').val(''); } else { $('#EhsRecentHospitalization1').prop("checked", false); $('#EhsRecentHospitalization2').prop("checked", false); $('#EhsRecentHospitalizationComment').val(''); $('#divEhsRecentHospitalization').hide(); } if ('@Model.EhsChildSpecialDiet' == 1) { $('#EhsChildSpecialDiet1').prop("checked", true); $('#divEhsChildSpecialDiet').show(); $('#EhsSpecialDietComment').val('@Model.EhsSpecialDietComment'); } else if ('@Model.EhsChildSpecialDiet' == 2) { $('#EhsChildSpecialDiet2').prop("checked", true); $('#EhsSpecialDietComment').val(''); $('#divEhsChildSpecialDiet').hide(); } else { $('#EhsChildSpecialDiet1').prop("checked", false); $('#EhsChildSpecialDiet2').prop("checked", false); $('#EhsSpecialDietComment').val(''); $('#divEhsChildSpecialDiet').hide(); } if ('@Model.EhsFoodAllergies' == 1) { $('#EhsFoodAllergies1').prop("checked", true); $('#divEhsFoodAllergies').show(); $('#EhsFoodAllergiesComment').val('@Model.EhsFoodAllergiesComment'); } else if ('@Model.EhsFoodAllergies' == 2) { $('#EhsFoodAllergies2').prop("checked", true); $('#EhsFoodAllergiesComment').val(''); $('#divEhsFoodAllergies').hide(); } else { $('#EhsFoodAllergies1').prop("checked", false); $('#EhsFoodAllergies2').prop("checked", false); $('#EhsFoodAllergiesComment').val(''); $('#divEhsFoodAllergies').hide(); } if ('@Model.EhsNutritionalConcern' == 1) { $('#EhsNutritionalConcern1').prop("checked", true); $('#divEhsNutritionalConcern').show(); $('#EhsNutritionAlconcernsComment').val('@Model.EhsNutritionAlconcernsComment'); } else if ('@Model.EhsNutritionalConcern' == 2) { $('#EhsNutritionalConcern2').prop("checked", true); $('#EhsNutritionAlconcernsComment').val(''); $('#divEhsNutritionalConcern').hide(); } else { $('#EhsNutritionalConcern1').prop("checked", false); $('#EhsNutritionalConcern2').prop("checked", false); $('#EhsNutritionAlconcernsComment').val(''); $('#divEhsNutritionalConcern').hide(); } //if (data.WICNutrition) // $('#WICNutrition').prop("checked", true); //else // $('#WICNutrition').prop("checked", false); //if (data.FoodStamps) // $('#FoodStamps').prop("checked", true); //else // $('#FoodStamps').prop("checked", false); //if (data.NoNutritionProg) // $('#NoNutritionProg').prop("checked", true); //else // $('#NoNutritionProg').prop("checked", false); //$('#EhsFoodPantory').val(data.EhsFoodPantory); if ('@Model.EhschildTrouble' == 1) { $('#EhschildTrouble1').prop("checked", true); $('#divEhschildTrouble').show(); $('#EhsChewingorSwallowingcomment').val('@Model.EhsChewingorSwallowingcomment'); } else if ('@Model.EhschildTrouble' == 2) { $('#EhschildTrouble2').prop("checked", true); $('#EhsChewingorSwallowingcomment').val(''); $('#divEhschildTrouble').hide(); } else { $('#EhschildTrouble1').prop("checked", false); $('#EhschildTrouble2').prop("checked", false); $('#EhsChewingorSwallowingcomment').val(''); $('#divEhschildTrouble').hide(); } if ('@Model.Ehsspoon' == 1) { $('#Ehsspoon1').prop("checked", true); $('#divEhsSpoonorForkComment').hide(); $('#EhsSpoonorForkComment').val(''); } else if ('@Model.Ehsspoon' == 2) { $('#Ehsspoon2').prop("checked", true); $('#EhsSpoonorForkComment').val('@Model.EhsSpoonorForkComment'); $('#divEhsSpoonorForkComment').show(); } else { $('#Ehsspoon1').prop("checked", false); $('#Ehsspoon2').prop("checked", false); $('#EhsSpoonorForkComment').val(''); $('#divEhsSpoonorForkComment').hide(); } if ('@Model.Ehsfeedingtube' == 1) { $('#Ehsfeedingtube1').prop("checked", true); $('#divEhsSpecialFeedingComment').show(); $('#EhsSpecialFeedingComment').val('@Model.EhsSpecialFeedingComment'); } else if ('@Model.Ehsfeedingtube' == 2) { $('#Ehsfeedingtube2').prop("checked", true); $('#EhsSpecialFeedingComment').val(''); $('#divEhsSpecialFeedingComment').hide(); } else { $('#Ehsfeedingtube1').prop("checked", false); $('#Ehsfeedingtube2').prop("checked", false); $('#EhsSpecialFeedingComment').val(''); $('#divEhsSpecialFeedingComment').hide(); } //if (data.EhschildThin == 1) // $('#EhschildThin1').prop("checked", true); //else if (data.EhschildThin == 2) // $('#EhschildThin2').prop("checked", true); //else if (data.EhschildThin == 3) // $('#EhschildThin3').prop("checked", true); //else if (data.EhschildThin == 4) // $('#EhschildThin4').prop("checked", true); //else if (data.EhschildThin == 5) // $('#EhschildThin5').prop("checked", true); //else { // $('#EhschildThin1').prop("checked", false); // $('#EhschildThin2').prop("checked", false); // $('#EhschildThin3').prop("checked", false); // $('#EhschildThin4').prop("checked", false); // $('#EhschildThin5').prop("checked", false); //} if ('@Model.EhsTakebottle' == 1) { $('#EhsTakebottle1').prop("checked", true); $('#divEhsBottleComment').show(); $('#EhsBottleComment').val('@Model.EhsBottleComment'); } else if ('@Model.EhsTakebottle' == 2) { $('#EhsTakebottle2').prop("checked", true); $('#EhsBottleComment').val(''); $('#divEhsBottleComment').hide(); } else { $('#EhsTakebottle1').prop("checked", false); $('#EhsTakebottle2').prop("checked", false); $('#EhsBottleComment').val(''); $('#divEhsBottleComment').hide(); } if ('@Model.Ehschewanything' == 1) { $('#Ehschewanything1').prop("checked", true); $('#divEhschewanything').show(); $('#EhsEatOrChewComment').val('@Model.EhsEatOrChewComment'); } else if ('@Model.Ehschewanything' == 2) { $('#Ehschewanything2').prop("checked", true); $('#EhsEatOrChewComment').val('@Model.EhsEatOrChewComment'); $('#divEhschewanything').hide(); } else { $('#Ehschewanything1').prop("checked", false); $('#Ehschewanything2').prop("checked", false); $('#EhsEatOrChewComment').val(""); $('#divEhschewanything').hide(); } //if (data.EhsChildFruitJuicevitaminc == "1") { // $('#EhsChildFruitJuicevitaminc1').prop("checked", true); // $('#EhsChildFruitJuicevitaminc2').prop("checked", false); // $('#EhsChildFruitJuicevitaminc3').prop("checked", false); //} //else if (data.EhsChildFruitJuicevitaminc == "2") { // $('#EhsChildFruitJuicevitaminc1').prop("checked", false); // $('#EhsChildFruitJuicevitaminc2').prop("checked", true); // $('#EhsChildFruitJuicevitaminc3').prop("checked", false); //} //else { // $('#EhsChildFruitJuicevitaminc1').prop("checked", false); // $('#EhsChildFruitJuicevitaminc2').prop("checked", false); // $('#EhsChildFruitJuicevitaminc3').prop("checked", true); //} //if (data.EhsChildWater == "1") { // $('#EhsChildWater1').prop("checked", true); // $('#EhsChildWater2').prop("checked", false); // $('#EhsChildWater3').prop("checked", false); //} //else if (data.EhsChildWater == "2") { // $('#EhsChildWater1').prop("checked", false); // $('#EhsChildWater2').prop("checked", true); // $('#EhsChildWater3').prop("checked", false); //} //else { // $('#EhsChildWater1').prop("checked", false); // $('#EhsChildWater2').prop("checked", false); // $('#EhsChildWater3').prop("checked", true); //} //if (data.EhsNA) // $('#EhsNA').prop("checked", true); //else // $('#EhsNA').prop("checked", false); //if (data.EhsBreakfast) // $('#EhsBreakfast').prop("checked", true); //else // $('#EhsBreakfast').prop("checked", false); //if (data.EhsDinner) // $('#EhsDinner').prop("checked", true); //else // $('#EhsDinner').prop("checked", false); //if (data.EhsLunch) // $('#EhsLunch').prop("checked", true); //else // $('#EhsLunch').prop("checked", false); //if (data.EhsSnack) // $('#EhsSnack').prop("checked", true); //else // $('#EhsSnack').prop("checked", false); //if (data.EhsRestrictFood == "1") { // $('#EhsRestrictFood1').prop("checked", true); // $('#EhsRestrictFood2').prop("checked", false); //} //else if (data.EhsRestrictFood == "2") { // $('#EhsRestrictFood1').prop("checked", false); // $('#EhsRestrictFood2').prop("checked", true); //} //else { // $('#EhsRestrictFood1').prop("checked", false); // $('#EhsRestrictFood2').prop("checked", false); //} //if (data.EhsChildVitaminSupplment == "1") { // $('#EhsChildVitaminSupplment1').prop("checked", true); // $('#EhsChildVitaminSupplment2').prop("checked", false); //} //else if (data.EhsChildVitaminSupplment == "2") { // $('#EhsChildVitaminSupplment1').prop("checked", false); // $('#EhsChildVitaminSupplment2').prop("checked", true); //} //else { // $('#EhsChildVitaminSupplment1').prop("checked", false); // $('#EhsChildVitaminSupplment2').prop("checked", false); //} //if (data.NotHealthStaff) { // $('#NotHealthStaff').prop("checked", true); // $('#ChildReferalCriteria').attr("disabled", true); //} //else { // $('#NotHealthStaff').prop("checked", false); // $('#ChildReferalCriteria').attr("disabled", false); //} //Questions //questions if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { $('#divEhsVitaminPopup').show(); $('#ChildVitaminSupplementlist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "7") { if (data._Childhealthnutrition[i].MasterId == "") { $('#ChildVitaminSupplementlist').append('<br><input name="PostedPostedChildVitamin.CDietInfoID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#ChildVitaminSupplementlist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#ChildVitaminSupplementlist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EhsCvstext').append(div); } }); //Child Diet Pop $('#ChildDietlist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "8") { if (data._Childhealthnutrition[i].MasterId == "") { $('#ChildDietlist').append('<br><input name="PostedPostedChildDietFull.CDietInfoID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#ChildDietlist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#ChildDietlist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EhsCDText').append(div); } }); //Child Drink Pop $('#ChildDrinklist input:checked').each(function () { $(this).prop("checked", false); }); for (var i = 0; i < data._Childhealthnutrition.length; i++) { if (data._Childhealthnutrition[i].Questionid == "9") { if (data._Childhealthnutrition[i].MasterId == "") { $('#ChildDrinklist').append('<br><input name="PostedPostedChildDrink.CDrinkID"' + 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); } else { $('#ChildDrinklist input[type=checkbox]').each(function () { if ($(this).val() == data._Childhealthnutrition[i].MasterId) $(this).prop("checked", true); }); } } } $('#ChildDrinklist input:checked').each(function () { if ($(this).prop("checked")) { var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; $('#EhsCDRinkText').append(div); } }); } //End } //else if ($('#_childprogrefid').val() == "2") { // $('#Cvstext').html(''); // $('#ChildVitaminSupplementlist input:checked').each(function () { // $(this).prop("checked", false); // }); // $('#CDText').html(''); // $('#ChildDietlist input:checked').each(function () { // $(this).prop("checked", false); // }); // $('#CDRinkText').html(''); // $('#ChildDrinklist input:checked').each(function () { // var value = $(this).val(); // if (value != null && value.slice(0, 1) == "$" && value.slice(-1) == "?") { // $(this).next('label').remove(); // $(this).remove(); // } // else // $(this).prop("checked", false); // }); // if (data.PersistentNausea == 1) { // $('#PersistentNausea1').prop("checked", true); // $('#NauseaorVomitingcomment').val(data.NauseaorVomitingcomment); // $('#divNauseaorVomitingcomment').show(); // } // else if (data.PersistentNausea == 2) { // $('#PersistentNausea2').prop("checked", true); // $('#divNauseaorVomitingcomment').hide(); // $('#NauseaorVomitingcomment').val(''); // } // else { // $('#PersistentNausea1').prop("checked", false); // $('#PersistentNausea2').prop("checked", false); // $('#NauseaorVomitingcomment').val(''); // $('#divNauseaorVomitingcomment').hide(); // } // if (data.PersistentDiarrhea == 1) { // $('#PersistentDiarrhea1').prop("checked", true); // $('#divdiarrheacomment').show(); // $('#DiarrheaComment').val(data.DiarrheaComment); // } // else if (data.PersistentDiarrhea == 2) { // $('#PersistentDiarrhea2').prop("checked", true); // $('#DiarrheaComment').val(''); // $('#divdiarrheacomment').hide(); // } // else { // $('#PersistentDiarrhea1').prop("checked", false); // $('#PersistentDiarrhea2').prop("checked", false); // $('#DiarrheaComment').val(''); // $('#divdiarrheacomment').hide(); // } // if (data.PersistentConstipation == 1) { // $('#PersistentConstipation1').prop("checked", true); // $('#divPersistentConstipation').show(); // $('#Constipationcomment').val(data.Constipationcomment); // } // else if (data.PersistentConstipation == 2) { // $('#PersistentConstipation2').prop("checked", true); // $('#Constipationcomment').val(''); // $('#divPersistentConstipation').hide(); // } // else { // $('#PersistentConstipation1').prop("checked", false); // $('#PersistentConstipation2').prop("checked", false); // $('#Constipationcomment').val(''); // $('#divPersistentConstipation').hide(); // } // if (data.DramaticWeight == 1) { // $('#DramaticWeight1').prop("checked", true); // $('#divDramaticWeightchange').show(); // $('#DramaticWeightchangecomment').val(data.DramaticWeightchangecomment); // } // else if (data.DramaticWeight == 2) { // $('#DramaticWeight2').prop("checked", true); // $('#DramaticWeightchangecomment').val(''); // $('#divDramaticWeightchange').hide(); // } // else { // $('#DramaticWeight1').prop("checked", false); // $('#DramaticWeight2').prop("checked", false); // $('#DramaticWeightchangecomment').val(''); // $('#divDramaticWeightchange').hide(); // } // if (data.RecentSurgery == 1) { // $('#RecentSurgery1').prop("checked", true); // $('#divRecentSurgery').show(); // $('#RecentSurgerycomment').val(data.RecentSurgerycomment); // } // else if (data.RecentSurgery == 2) { // $('#RecentSurgery2').prop("checked", true); // $('#RecentSurgerycomment').val(''); // $('#divRecentSurgery').hide(); // } // else { // $('#RecentSurgery1').prop("checked", false); // $('#RecentSurgery2').prop("checked", false); // $('#RecentSurgerycomment').val(''); // $('#divRecentSurgery').hide(); // } // if (data.RecentHospitalization == 1) { // $('#RecentHospitalization1').prop("checked", true); // $('#RecentHospitalizationComment').val(data.RecentHospitalizationComment); // $('#divRecentHospitalization').show(); // } // else if (data.RecentHospitalization == 2) { // $('#RecentHospitalization2').prop("checked", true); // $('#divRecentHospitalization').hide(); // $('#RecentHospitalizationComment').val(''); // } // else { // $('#RecentHospitalization1').prop("checked", false); // $('#RecentHospitalization2').prop("checked", false); // $('#RecentHospitalizationComment').val(''); // $('#divRecentHospitalization').hide(); // } // if (data.ChildSpecialDiet == 1) { // $('#ChildSpecialDiet1').prop("checked", true); // $('#divChildSpecialDiet').show(); // $('#SpecialDietComment').val(data.SpecialDietComment); // } // else if (data.ChildSpecialDiet == 2) { // $('#ChildSpecialDiet2').prop("checked", true); // $('#SpecialDietComment').val(''); // $('#divChildSpecialDiet').hide(); // } // else { // $('#ChildSpecialDiet1').prop("checked", false); // $('#ChildSpecialDiet2').prop("checked", false); // $('#SpecialDietComment').val(''); // $('#divChildSpecialDiet').hide(); // } // if (data.FoodAllergies == 1) { // $('#FoodAllergies1').prop("checked", true); // $('#divFoodAllergies').show(); // $('#FoodAllergiesComment').val(data.FoodAllergiesComment); // } // else if (data.FoodAllergies == 2) { // $('#FoodAllergies2').prop("checked", true); // $('#FoodAllergiesComment').val(''); // $('#divFoodAllergies').hide(); // } // else { // $('#FoodAllergies1').prop("checked", false); // $('#FoodAllergies2').prop("checked", false); // $('#FoodAllergiesComment').val(''); // $('#divFoodAllergies').hide(); // } // if (data.NutritionalConcern == 1) { // $('#NutritionalConcern1').prop("checked", true); // $('#divNutritionalConcern').show(); // $('#NutritionAlconcernsComment').val(data.NutritionAlconcernsComment); // } // else if (data.NutritionalConcern == 2) { // $('#NutritionalConcern2').prop("checked", true); // $('#NutritionAlconcernsComment').val(''); // $('#divNutritionalConcern').hide(); // } // else { // $('#NutritionalConcern1').prop("checked", false); // $('#NutritionalConcern2').prop("checked", false); // $('#NutritionAlconcernsComment').val(''); // $('#divNutritionalConcern').hide(); // } // if (data.WICNutrition) // $('#WICNutrition').prop("checked", true); // else // $('#WICNutrition').prop("checked", false); // if (data.FoodStamps) // $('#FoodStamps').prop("checked", true); // else // $('#FoodStamps').prop("checked", false); // if (data.NoNutritionProg) // $('#NoNutritionProg').prop("checked", true); // else // $('#NoNutritionProg').prop("checked", false); // $('#FoodPantory').val(data.FoodPantory); // if (data.childTrouble == 1) { // $('#childTrouble1').prop("checked", true); // $('#divchildTrouble').show(); // $('#ChewingorSwallowingcomment').val(data.ChewingorSwallowingcomment); // } // else if (data.childTrouble == 2) { // $('#childTrouble2').prop("checked", true); // $('#ChewingorSwallowingcomment').val(''); // $('#divchildTrouble').hide(); // } // else { // $('#childTrouble1').prop("checked", false); // $('#childTrouble2').prop("checked", false); // $('#ChewingorSwallowingcomment').val(''); // $('#divchildTrouble').hide(); // } // if (data.spoon == 1) { // $('#spoon1').prop("checked", true); // $('#divSpoonorForkComment').hide(); // $('#SpoonorForkComment').val(''); // } // else if (data.spoon == 2) { // $('#spoon2').prop("checked", true); // $('#SpoonorForkComment').val(data.SpoonorForkComment); // $('#divSpoonorForkComment').show(); // } // else { // $('#spoon1').prop("checked", false); // $('#spoon2').prop("checked", false); // $('#SpoonorForkComment').val(''); // $('#divSpoonorForkComment').hide(); // } // if (data.feedingtube == 1) { // $('#feedingtube1').prop("checked", true); // $('#divSpecialFeedingComment').show(); // $('#SpecialFeedingComment').val(data.SpecialFeedingComment); // } // else if (data.feedingtube == 2) { // $('#feedingtube2').prop("checked", true); // $('#SpecialFeedingComment').val(''); // $('#divSpecialFeedingComment').hide(); // } // else { // $('#feedingtube1').prop("checked", false); // $('#feedingtube2').prop("checked", false); // $('#SpecialFeedingComment').val(''); // $('#divSpecialFeedingComment').hide(); // } // if (data.childThin == 1) // $('#childThin1').prop("checked", true); // else if (data.childThin == 2) // $('#childThin2').prop("checked", true); // else if (data.childThin == 3) // $('#childThin3').prop("checked", true); // else if (data.childThin == 4) // $('#childThin4').prop("checked", true); // else if (data.childThin == 5) // $('#childThin5').prop("checked", true); // else { // $('#childThin1').prop("checked", false); // $('#childThin2').prop("checked", false); // $('#childThin3').prop("checked", false); // $('#childThin4').prop("checked", false); // $('#childThin5').prop("checked", false); // } // if (data.Takebottle == 1) { // $('#Takebottle1').prop("checked", true); // $('#divBottleComment').show(); // $('#BottleComment').val(data.BottleComment); // } // else if (data.Takebottle == 2) { // $('#Takebottle2').prop("checked", true); // $('#BottleComment').val(''); // $('#divBottleComment').hide(); // } // else { // $('#Takebottle1').prop("checked", false); // $('#Takebottle2').prop("checked", false); // $('#BottleComment').val(''); // $('#divBottleComment').hide(); // } // if (data.chewanything == 1) { // $('#chewanything1').prop("checked", true); // $('#divchewanything').show(); // $('#EatOrChewComment').val(data.EatOrChewComment); // } // else if (data.chewanything == 2) { // $('#chewanything2').prop("checked", true); // $('#EatOrChewComment').val(data.EatOrChewComment); // $('#divchewanything').hide(); // } // else { // $('#chewanything1').prop("checked", false); // $('#chewanything2').prop("checked", false); // $('#EatOrChewComment').val(""); // $('#divchewanything').hide(); // } // if (data.ChildFruitJuicevitaminc == "1") { // $('#ChildFruitJuicevitaminc1').prop("checked", true); // $('#ChildFruitJuicevitaminc2').prop("checked", false); // $('#ChildFruitJuicevitaminc3').prop("checked", false); // } // else if (data.ChildFruitJuicevitaminc == "2") { // $('#ChildFruitJuicevitaminc1').prop("checked", false); // $('#ChildFruitJuicevitaminc2').prop("checked", true); // $('#ChildFruitJuicevitaminc3').prop("checked", false); // } // else { // $('#ChildFruitJuicevitaminc1').prop("checked", false); // $('#ChildFruitJuicevitaminc2').prop("checked", false); // $('#ChildFruitJuicevitaminc3').prop("checked", true); // } // if (data.ChildWater == "1") { // $('#ChildWater1').prop("checked", true); // $('#ChildWater2').prop("checked", false); // $('#ChildWater3').prop("checked", false); // } // else if (data.ChildWater == "2") { // $('#ChildWater1').prop("checked", false); // $('#ChildWater2').prop("checked", true); // $('#ChildWater3').prop("checked", false); // } // else { // $('#ChildWater1').prop("checked", false); // $('#ChildWater2').prop("checked", false); // $('#ChildWater3').prop("checked", true); // } // if (data.NA) // $('#NA').prop("checked", true); // else // $('#NA').prop("checked", false); // if (data.Breakfast) // $('#Breakfast').prop("checked", true); // else // $('#Breakfast').prop("checked", false); // if (data.Dinner) // $('#Dinner').prop("checked", true); // else // $('#Dinner').prop("checked", false); // if (data.Lunch) // $('#Lunch').prop("checked", true); // else // $('#Lunch').prop("checked", false); // if (data.Snack) // $('#Snack').prop("checked", true); // else // $('#Snack').prop("checked", false); // if (data.RestrictFood == "1") { // $('#RestrictFood1').prop("checked", true); // $('#RestrictFood2').prop("checked", false); // } // else if (data.RestrictFood == "2") { // $('#RestrictFood1').prop("checked", false); // $('#RestrictFood2').prop("checked", true); // } // else { // $('#RestrictFood1').prop("checked", false); // $('#RestrictFood2').prop("checked", false); // } // if (data.ChildVitaminSupplment == "1") { // $('#ChildVitaminSupplment1').prop("checked", true); // $('#ChildVitaminSupplment2').prop("checked", false); // } // else if (data.ChildVitaminSupplment == "2") { // $('#ChildVitaminSupplment1').prop("checked", false); // $('#ChildVitaminSupplment2').prop("checked", true); // } // else { // $('#ChildVitaminSupplment1').prop("checked", false); // $('#ChildVitaminSupplment2').prop("checked", false); // } // if (data.NotHealthStaff) { // $('#NotHealthStaff').prop("checked", true); // $('#ChildReferalCriteria').attr("disabled", true); // } // else { // $('#NotHealthStaff').prop("checked", false); // $('#ChildReferalCriteria').attr("disabled", false); // } //questions // if (data._Childhealthnutrition != null && data._Childhealthnutrition.length > 0) { // $('#divEhsVitaminPopup').show(); // $('#ChildVitaminSupplementlist input:checked').each(function () { // $(this).prop("checked", false); // }); // for (var i = 0; i < data._Childhealthnutrition.length; i++) { // if (data._Childhealthnutrition[i].Questionid == "7") { // if (data._Childhealthnutrition[i].MasterId == "") { // $('#ChildVitaminSupplementlist').append('<br><input name="PostedPostedChildVitamin.CDietInfoID"' + // 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); // } // else { // $('#ChildVitaminSupplementlist input[type=checkbox]').each(function () { // if ($(this).val() == data._Childhealthnutrition[i].MasterId) // $(this).prop("checked", true); // }); // } // } // } // $('#ChildVitaminSupplementlist input:checked').each(function () { // if ($(this).prop("checked")) { // var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; // $('#Cvstext').append(div); // } // }); // //Child Diet Pop // $('#ChildDietlist input:checked').each(function () { // $(this).prop("checked", false); // }); // for (var i = 0; i < data._Childhealthnutrition.length; i++) { // if (data._Childhealthnutrition[i].Questionid == "8") { // if (data._Childhealthnutrition[i].MasterId == "") { // $('#ChildDietlist').append('<br><input name="PostedPostedChildDietFull.CDietInfoID"' + // 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); // } // else { // $('#ChildDietlist input[type=checkbox]').each(function () { // if ($(this).val() == data._Childhealthnutrition[i].MasterId) // $(this).prop("checked", true); // }); // } // } // } // $('#ChildDietlist input:checked').each(function () { // if ($(this).prop("checked")) { // var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; // $('#CDText').append(div); // } // }); // //Child Drink Pop // $('#ChildDrinklist input:checked').each(function () { // $(this).prop("checked", false); // }); // for (var i = 0; i < data._Childhealthnutrition.length; i++) { // if (data._Childhealthnutrition[i].Questionid == "9") { // if (data._Childhealthnutrition[i].MasterId == "") { // $('#ChildDrinklist').append('<br><input name="PostedPostedChildDrink.CDrinkID"' + // 'type="checkbox" checked value="$' + data._Childhealthnutrition[i].Description + '?"><label>' + data._Childhealthnutrition[i].Description + '</label>'); // } // else { // $('#ChildDrinklist input[type=checkbox]').each(function () { // if ($(this).val() == data._Childhealthnutrition[i].MasterId) // $(this).prop("checked", true); // }); // } // } // } // $('#ChildDrinklist input:checked').each(function () { // if ($(this).prop("checked")) { // var div = '<div style="padding-left:24px; line-height:normal;color:#295b8f;">' + $(this).next('label').text() + '</div>'; // $('#CDRinkText').append(div); // } // }); // // } // //End // //End //} if (data.ImmunizationRecords != null && data.ImmunizationRecords.length > 0) { $('#Immunization > tbody > tr').remove(); var tr = ""; var immunizatiocount = 0; for (var i = 0; i < data.ImmunizationRecords.length; i++) { tr = ""; tr = tr + '<tr><td width="200px">' + data.ImmunizationRecords[i].Dose + '<input type="hidden" value="' + data.ImmunizationRecords[i].Dose + '" name="imminization[' + immunizatiocount + '].dose" />' + '<input type="hidden" value="' + data.ImmunizationRecords[i].ImmunizationId + '" name="Imminization[' + immunizatiocount + '].ImmunizationId" /><input type="hidden" value="' + data.ImmunizationRecords[i].ImmunizationmasterId + '" name="Imminization[' + immunizatiocount + '].ImmunizationmasterId" /></td>'; tr = tr + '<td><input type="text" onblur="return validatedateChilddateofbirth(this);" placeholder="MM/DD/YYYY" value="' + data.ImmunizationRecords[i].Dose1 + '" name="Imminization[' + immunizatiocount + '].Dose1" /></td>'; if (data.ImmunizationRecords[i].Preempt1) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Preempt1" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Preempt1" /></td>'; if (data.ImmunizationRecords[i].Exempt1) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Exempt1" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Exempt1" /></td>'; tr = tr + '<td><input type="text" onblur="return validatedateChilddateofbirth(this);" placeholder="MM/DD/YYYY" value="' + data.ImmunizationRecords[i].Dose2 + '" name="Imminization[' + immunizatiocount + '].Dose2" /></td>'; if (data.ImmunizationRecords[i].Preempt2) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Preempt2" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Preempt2" /></td>'; if (data.ImmunizationRecords[i].Exempt2) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Exempt2" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Exempt2" /></td>'; tr = tr + '<td><input type="text" onblur="return validatedateChilddateofbirth(this);" placeholder="MM/DD/YYYY" value="' + data.ImmunizationRecords[i].Dose3 + '" name="Imminization[' + immunizatiocount + '].Dose3" /></td>'; if (data.ImmunizationRecords[i].Preempt3) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Preempt3" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Preempt3" /></td>'; if (data.ImmunizationRecords[i].Exempt3) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Exempt3" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Exempt3" /></td>'; tr = tr + '<td><input type="text" onblur="return validatedateChilddateofbirth(this);" placeholder="MM/DD/YYYY" value="' + data.ImmunizationRecords[i].Dose4 + '" name="Imminization[' + immunizatiocount + '].Dose4" /></td>'; if (data.ImmunizationRecords[i].Preempt4) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Preempt4" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Preempt4" /></td>'; if (data.ImmunizationRecords[i].Exempt4) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Exempt4" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Exempt4" /></td>'; tr = tr + '<td><input type="text" onblur="return validatedateChilddateofbirth(this);" placeholder="MM/DD/YYYY" value="' + data.ImmunizationRecords[i].Dose5 + '" name="Imminization[' + immunizatiocount + '].Dose5" /></td>'; if (data.ImmunizationRecords[i].Preempt5) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Preempt5" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Preempt5" /></td>'; if (data.ImmunizationRecords[i].Exempt5) tr = tr + '<td align="center"><input type="checkbox" value="true" checked="checked" name="Imminization[' + immunizatiocount + '].Exempt5" /></td>'; else tr = tr + '<td align="center"><input type="checkbox" value="true" name="Imminization[' + immunizatiocount + '].Exempt5" /></td>'; $('#Immunization > tbody').append(tr); immunizatiocount = immunizatiocount + 1; } $('#Immunization > tbody tr').each(function () { var end = new Date(); $(this).find(':input[type="text"]').each(function () { $(this).mask("99/99/9999", { placeholder: 'MM/DD/YYYY' }); }); }); } if (data._Screening != null) { $('#F001physicalDate').val(data._Screening.F001physicalDate) $('#F002physicalResults').val(data._Screening.F002physicalResults) $('#F003physicallFOReason').val(data._Screening.F003physicallFOReason) $('#F004medFollowup').val(data._Screening.F004medFollowup) $('#F005MedFOComments').val(data._Screening.F005MedFOComments) $('#F006bpResults').val(data._Screening.F006bpResults) $('#F007hgDate').val(data._Screening.F007hgDate) $('#FhgStatus').val(data._Screening.F008hgStatus) $('#F009hgResults').val(data._Screening.F009hgResults) $('#F010hgReferralDate').val(data._Screening.F010hgReferralDate) $('#F011hgComments').val(data._Screening.F011hgComments) $('#F012hgDate2').val(data._Screening.F012hgDate2) $('#F013hgResults2').val(data._Screening.F013hgResults2) $('#F014hgFOStatus').val(data._Screening.F014hgFOStatus) $('#F015leadDate').val(data._Screening.F015leadDate) $('#F016leadResults').val(data._Screening.F016leadResults) $('#F017leadReferDate').val(data._Screening.F017leadReferDate) $('#F018leadComments').val(data._Screening.F018leadComments) $('#F019leadDate2').val(data._Screening.F019leadDate2) $('#F020leadResults2').val(data._Screening.F020leadResults2) $('#F021leadFOStatus').val(data._Screening.F021leadFOStatus) $('#v022date').val(data._Screening.v022date) $('#v023results').val(data._Screening.v023results) $('#v024comments').val(data._Screening.v024comments) $('#v025dateR1').val(data._Screening.v025dateR1) $('#v026resultsR1').val(data._Screening.v026resultsR1) $('#v027commentsR1').val(data._Screening.v027commentsR1) $('#v028dateR2').val(data._Screening.v028dateR2) $('#v029resultsR2').val(data._Screening.v029resultsR2) $('#v030commentsR2').val(data._Screening.v030commentsR2) $('#v031ReferralDate').val(data._Screening.v031ReferralDate) $('#v032Treatment').val(data._Screening.v032Treatment) $('#v033TreatmentComments').val(data._Screening.v033TreatmentComments) $('#v034Completedate').val(data._Screening.v034Completedate) $('#v035ExamStatus').val(data._Screening.v035ExamStatus) $('#h036Date').val(data._Screening.h036Date) $('#h037Results').val(data._Screening.h037Results) $('#h038Comments').val(data._Screening.h038Comments) $('#h039DateR1').val(data._Screening.h039DateR1) $('#h040ResultsR1').val(data._Screening.h040ResultsR1) $('#h041CommentsR1').val(data._Screening.h041CommentsR1) $('#h042DateR2').val(data._Screening.h042DateR2) $('#h043ResultsR2').val(data._Screening.h043ResultsR2) $('#h044CommentsR2').val(data._Screening.h044CommentsR2) $('#h045ReferralDate').val(data._Screening.h045ReferralDate) $('#h046Treatment').val(data._Screening.h046Treatment) $('#h047TreatmentComments').val(data._Screening.h047TreatmentComments) $('#h048CompleteDate').val(data._Screening.h048CompleteDate) $('#h049ExamStatus').val(data._Screening.h049ExamStatus) $('#d050evDate').val(data._Screening.d050evDate) $('#d051NameDEV').val(data._Screening.d051NameDEV) $('#d052evResults').val(data._Screening.d052evResults) $('#d053evResultsDetails').val(data._Screening.d053evResultsDetails) $('#d054evDate2').val(data._Screening.d054evDate2) $('#d055evResults2').val(data._Screening.d055evResults2) $('#d056evReferral').val(data._Screening.d056evReferral) $('#d057evFOStatus').val(data._Screening.d057evFOStatus) $('#d058evComments').val(data._Screening.d058evComments) $('#d059evTool').val(data._Screening.d059evTool) $('#E060denDate').val(data._Screening.E060denDate) $('#E061denResults').val(data._Screening.E061denResults) $('#E062denPrevent').val(data._Screening.E062denPrevent) $('#E063denReferralDate').val(data._Screening.E063denReferralDate) $('#E064denTreatment').val(data._Screening.E064denTreatment) $('#E065denTreatmentComments').val(data._Screening.E065denTreatmentComments) $('#E066denTreatmentReceive').val(data._Screening.E066denTreatmentReceive) $('#s067Date').val(data._Screening.s067Date) $('#s068NameTCR').val(data._Screening.s068NameTCR) $('#s069Details').val(data._Screening.s069Details) $('#s070Results').val(data._Screening.s070Results) $('#s071RescreenTCR').val(data._Screening.s071RescreenTCR) $('#s072RescreenTCRDate').val(data._Screening.s072RescreenTCRDate) $('#s073RescreenTCRResults').val(data._Screening.s073RescreenTCRResults) $('#s074ReferralDC').val(data._Screening.s074ReferralDC) $('#s075ReferDate').val(data._Screening.s075ReferDate) $('#s076DCDate').val(data._Screening.s076DCDate) $('#s077NameDC').val(data._Screening.s077NameDC) $('#s078DetailDC').val(data._Screening.s078DetailDC) $('#s079DCDate2').val(data._Screening.s079DCDate2) $('#s080DetailDC2').val(data._Screening.s080DetailDC2) $('#s081FOStatus').val(data._Screening.s081FOStatus) if (data._Screening.Parentname != null) $('#Parentscreening').val(data._Screening.Parentname); else $('#Parentscreening').val($('#Pfirstname').val() + ' ' + $('#Plastname').val()) if (data._Screening.AddPhysical == "1") { $('#AddPhysical').prop("checked", true); $('#Physical').show(); } else if (data._Screening.AddPhysical == "2") { $('#AddPhysical1').prop("checked", true); $('#Physical').hide(); } else { $('#AddPhysical').prop("checked", false); $('#AddPhysical1').prop("checked", false); $('#Physical').hide(); } if (data._Screening.AddVision == "1") { $('#AddVision').prop("checked", true); $('#Vision').show(); } else if (data._Screening.AddVision == "2") { $('#AddVision1').prop("checked", true); $('#Vision').hide(); } else { $('#AddVision').prop("checked", false); $('#AddVision1').prop("checked", false); $('#Vision').hide(); } if (data._Screening.AddHearing == "1") { $('#AddHearing').prop("checked", true); $('#Hearing').show(); } else if (data._Screening.AddHearing == "2") { $('#AddHearing1').prop("checked", true); $('#Hearing').hide(); } else { $('#AddHearing').prop("checked", false); $('#AddHearing1').prop("checked", false); $('#Hearing').hide(); } if (data._Screening.AddDental == "1") { $('#AddDental').prop("checked", true); $('#Dental').show(); } else if (data._Screening.AddDental == "2") { $('#AddDental1').prop("checked", true); $('#Dental').hide(); } else { $('#AddDental').prop("checked", false); $('#AddDental1').prop("checked", false); $('#Dental').hide(); } if (data._Screening.AddDevelop == "1") { $('#AddDevelop').prop("checked", true); $('#Develop').show(); } else if (data._Screening.AddDevelop == "2") { $('#AddDevelop1').prop("checked", true); $('#Develop').hide(); } else { $('#AddDevelop').prop("checked", false); $('#AddDevelop1').prop("checked", false); $('#Develop').hide(); } if (data._Screening.AddSpeech == "1") { $('#AddSpeech').prop("checked", true); $('#Speech').show(); } else if (data._Screening.AddSpeech == "2") { $('#AddSpeech1').prop("checked", true); $('#Speech').hide(); } else { $('#AddSpeech').prop("checked", false); $('#AddSpeech1').prop("checked", false); $('#Speech').hide(); } //18-11-2016 if (data._Screening.PhysicalFileName != "" && data._Screening.PhysicalFileName != null ) { $('#Allow30DayPhysical').attr("href", HostedDir + "/Agencyuser/getpdfimageScreening/1," + data._Screening.ParentAppID); $('#Allow30DayPhysical').show(); if (data._Screening.PhysicalFileExtension == ".pdf") { $('#Phyimagedocument').hide(); $('#Phypdfdocument').show(); $('#Phypdfdocument').attr("src", HostedDir + data._Screening.PhysicalImagejson); } else { $('#Phyimagedocument').show(); $('#Phypdfdocument').show(); $('#Phyimagedocument').ZoomCrop( { image: "data:image/png;base64," + data._Screening.PhysicalImagejson, updated: function (size, crop, position) { console.log(size, crop, position); } }); } } else { $('#Allow30DayPhysical').hide(); $('#Phyimagedocument').show(); $('#Phypdfdocument').hide(); $('#Phyimagedocument').ZoomCrop( { image: HostedDir + "/Content/img/NoImageAvailable.jpg", updated: function (size, crop, position) { console.log(size, crop, position); } }); } if (data._Screening.VisionFileName != "" && data._Screening.VisionFileName != null) { $('#Allow45DayVisionScreening').attr("href", HostedDir + "/Agencyuser/getpdfimageScreening/2," + data._Screening.ParentAppID); $('#Allow45DayVisionScreening').show(); if (data._Screening.VisionFileExtension == ".pdf") { $('#Visimagedocument').hide(); $('#Vispdfdocument').show(); $('#Vispdfdocument').attr("src", HostedDir + data._Screening.VisionImagejson); } else { $('#Visimagedocument').show(); $('#Vispdfdocument').hide(); $('#Visimagedocument').ZoomCrop( { image: "data:image/png;base64," + data._Screening.VisionImagejson, updated: function (size, crop, position) { console.log(size, crop, position); } }); } } else { $('#Visimagedocument').show(); $('#Vispdfdocument').hide(); $('#Visimagedocument').ZoomCrop( { image: HostedDir + "/Content/img/NoImageAvailable.jpg", updated: function (size, crop, position) { console.log(size, crop, position); } }); $('#Allow45DayVisionScreening').hide(); } if (data._Screening.HearingFileName != "" && data._Screening.HearingFileName != null) { $('#Allow45DayHearingScreening').attr("href", HostedDir + "/Agencyuser/getpdfimageScreening/3," + data._Screening.ParentAppID); $('#Allow45DayHearingScreening').show(); if (data._Screening.HearingFileExtension == ".pdf") { $('#Hearimagedocument').hide(); $('#Hearpdfdocument').show(); $('#Hearpdfdocument').attr("src", HostedDir + data._Screening.HearingImagejson); } else { $('#Hearimagedocument').show(); $('#Hearpdfdocument').hide(); $('#Hearimagedocument').ZoomCrop( { image: "data:image/png;base64," + data._Screening.HearingImagejson, updated: function (size, crop, position) { console.log(size, crop, position); } }); } } else { $('#Hearimagedocument').show(); $('#Hearpdfdocument').hide(); $('#Hearimagedocument').ZoomCrop( { image: HostedDir + "/Content/img/NoImageAvailable.jpg", updated: function (size, crop, position) { console.log(size, crop, position); } }); $('#Allow45DayHearingScreening').hide(); } if (data._Screening.DevelopFileName != "" && data._Screening.DevelopFileName != null) { $('#Allow45DayDevelopmentalScreening').attr("href", HostedDir + "/Agencyuser/getpdfimageScreening/4," + data._Screening.ParentAppID); $('#Allow45DayDevelopmentalScreening').show(); if (data._Screening.DevelopFileExtension == ".pdf") { $('#Devimagedocument').hide(); $('#Devpdfdocument').show(); $('#Devpdfdocument').attr("src", HostedDir + data._Screening.DevelopImagejson); } else { $('#Devimagedocument').show(); $('#Devpdfdocument').hide(); $('#Devimagedocument').ZoomCrop( { image: "data:image/png;base64," + data._Screening.DevelopImagejson, updated: function (size, crop, position) { console.log(size, crop, position); } }); } } else { $('#Devimagedocument').show(); $('#Devpdfdocument').hide(); $('#Devimagedocument').ZoomCrop( { image: HostedDir + "/Content/img/NoImageAvailable.jpg", updated: function (size, crop, position) { console.log(size, crop, position); } }); $('#Allow45DayDevelopmentalScreening').hide(); } if (data._Screening.DentalFileName != "" && data._Screening.DentalFileName != null) { $('#Allow90DayDentalScreening').attr("href", HostedDir + "/Agencyuser/getpdfimageScreening/5," + data._Screening.ParentAppID); $('#Allow90DayDentalScreening').show(); if (data._Screening.DentalFileExtension == ".pdf") { $('#Dentimagedocument').hide(); $('#Dentpdfdocument').show(); $('#Dentpdfdocument').attr("src", HostedDir + data._Screening.DentalImagejson); } else { $('#Dentimagedocument').show(); $('#Dentpdfdocument').hide(); $('#Dentimagedocument').ZoomCrop( { image: "data:image/png;base64," + data._Screening.DentalImagejson, updated: function (size, crop, position) { console.log(size, crop, position); } }); } } else { $('#Dentimagedocument').show(); $('#Dentpdfdocument').hide(); $('#Dentimagedocument').ZoomCrop( { image: HostedDir + "/Content/img/NoImageAvailable.jpg", updated: function (size, crop, position) { console.log(size, crop, position); } }); $('#Allow90DayDentalScreening').hide(); } if (data._Screening.SpeechFileName != "" && data._Screening.SpeechFileName != null) { $('#AllowSpeechScreening').attr("href", HostedDir + "/Agencyuser/getpdfimageScreening/6," + data._Screening.ParentAppID); $('#AllowSpeechScreening').show(); if (data._Screening.SpeechFileExtension == ".pdf") { $('#Speechimagedocument').hide(); $('#Speechpdfdocument').show(); $('#Speechpdfdocument').attr("src", HostedDir + data._Screening.SpeechImagejson); } else { $('#Speechimagedocument').show(); $('#Speechpdfdocument').hide(); $('#Speechimagedocument').ZoomCrop( { image: "data:image/png;base64," + data._Screening.SpeechImagejson, updated: function (size, crop, position) { console.log(size, crop, position); } }); } } else { $('#Speechimagedocument').show(); $('#Speechpdfdocument').hide(); $('#Speechimagedocument').ZoomCrop( { image: HostedDir + "/Content/img/NoImageAvailable.jpg", updated: function (size, crop, position) { console.log(size, crop, position); } }); $('#AllowSpeechScreening').hide(); } if (data._Screening.ScreeningAcceptFileName != "" && data._Screening.ScreeningAcceptFileName != null) { $('#ScreeningAcceptance').attr("href", HostedDir + "/Agencyuser/getpdfimageScreening/7," + data._Screening.ParentAppID); $('#ScreeningAcceptance').show(); } else { $('#ScreeningAcceptance').hide(); } $('#PhysicalFileName').val(data._Screening.PhysicalFileName); $('#VisionFileName').val(data._Screening.VisionFileName); $('#HearingFileName').val(data._Screening.HearingFileName); $('#DevelopFileName').val(data._Screening.DevelopFileName); $('#DentalFileName').val(data._Screening.DentalFileName); $('#SpeechFileName').val(data._Screening.SpeechFileName); $('#ScreeningAcceptFileName').val(data._Screening.ScreeningAcceptFileName); $('#ParentAppID').val(data._Screening.ParentAppID); } else { $('#Allow30DayPhysical').hide(); $('#Allow45DayVisionScreening').hide(); $('#Allow45DayHearingScreening').hide(); $('#Allow45DayDevelopmentalScreening').hide(); $('#Allow90DayDentalScreening').hide(); $('#ScreeningAcceptance').hide(); $('#AllowSpeechScreening').hide(); $('#Parentscreening').val($('#Pfirstname').val() + ' ' + $('#Plastname').val()); } } function isValidPMQuesParentInfo() { isValid = true; cleanValidation(); if (!$('#PMChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one PM service. "); return isValid; } if (($('#Pquestionyes').prop("checked"))) { //if (!$("input:radio[name='PMProblem']").is(":checked")) { // isValid = false; // customAlert("PM problems is required. "); // return isValid; //} if ($("#TrimesterEnrolled").val() == "") { isValid = false; customAlert("Trimester Enrolled is required. "); plainValidation('#TrimesterEnrolled'); return isValid; } //TrimesterEnrolled } if (($('#Pquestionyes1').prop("checked"))) { //if (!$("input:radio[name='PMProblem1']").is(":checked")) { // isValid = false; // customAlert("PM problems is required. "); // return isValid; //} if ($("#TrimesterEnrolled1").val() == "") { isValid = false; customAlert("Trimester Enrolled is required. "); plainValidation('#TrimesterEnrolled1'); return isValid; } } return isValid; // } function isValidHealthQuesInfo() { isValid = true; cleanValidation(); var exist1 = false; var exist2 = false; $('#customChecklist input:checked').each(function () { if ($(this).prop("checked")) { if ($(this).attr("accesskey") == 2) { // var HS = 2; exist1 = true; } if ($(this).attr("accesskey") == 1) { exist2 = true; } } }); if (exist1) { if (!$("input:radio[name='HsChildBorn']").is(":checked")) { isValid = false; customAlert("Child born is required. "); return isValid; } if (!$('#ChildChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's direct blood relative. "); return isValid; } if (!$('#diagnosedChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's diagnosed health conditions. "); return isValid; } if (!$('#medicalChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's medical treatment conditions. "); return isValid; } if (!$('#healthChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's chronic health conditions. "); return isValid; } if (!$("input:radio[name='HsChildDentalCare']").is(":checked")) { isValid = false; customAlert("Child preventative dental care is required. "); return isValid; } if (!$("input:radio[name='HsDentalExam']").is(":checked")) { isValid = false; customAlert("Child current professional dental exam is required. "); return isValid; } if (!$("input:radio[name='HsChildNeedDentalTreatment']").is(":checked")) { isValid = false; customAlert("Child diagnosed dental treatment is required. "); return isValid; } if (!$("input:radio[name='HsChildRecievedDentalTreatment']").is(":checked")) { isValid = false; customAlert("Child diagnosed dental treatment is required. "); return isValid; } if (!$('#ChildVitaminlist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's vitamin supplement. "); return isValid; } if (!$("input:radio[name='PersistentNausea']").is(":checked")) { isValid = false; customAlert(" Please select persistent/current nausea health condition. "); return isValid; } if (!$("input:radio[name='PersistentDiarrhea']").is(":checked")) { isValid = false; customAlert("Please select persistent/current diarrhea health condition. "); return isValid; } if (!$("input:radio[name='PersistentConstipation']").is(":checked")) { isValid = false; customAlert("Please select persistent/current constipation health condition. "); return isValid; } if (!$("input:radio[name='DramaticWeight']").is(":checked")) { isValid = false; customAlert("Please select dramatic weight change. "); return isValid; } if (!$("input:radio[name='RecentSurgery']").is(":checked")) { isValid = false; customAlert("Please select recent surgery. "); return isValid; } if (!$("input:radio[name='RecentHospitalization']").is(":checked")) { isValid = false; customAlert("Please select recent hospitalization. "); return isValid; } if (!$("input:radio[name='FoodAllergies']").is(":checked")) { isValid = false; customAlert("Please select food allergies. "); return isValid; } if (!$("input:radio[name='NutritionalConcern']").is(":checked")) { isValid = false; customAlert("Please select nutritional concern. "); return isValid; } if (!$("input:radio[name='spoon']").is(":checked")) { isValid = false; customAlert("Please select child use a spoon or fork. "); return isValid; } if (!$("input:radio[name='feedingtube']").is(":checked")) { isValid = false; customAlert("Please select child use a feeding tube or other special feeding method. "); return isValid; } if (!$("input:radio[name='chewanything']").is(":checked")) { isValid = false; customAlert("Please select child eat or chew anything that is not food. "); return isValid; } if (!$("input:radio[name='ChangeinAppetite']").is(":checked")) { isValid = false; customAlert("Please describe child's appetite. "); return isValid; } if (!$("input:radio[name='ChangeinAppetite']").is(":checked")) { isValid = false; customAlert("Please describe child's appetite. "); return isValid; } if (!$('#ChildDietlist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one condition when your child is full. "); return isValid; } if (!$('#ChildDrinkChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select how much water does your child drink. "); return isValid; } } if (exist2) { if (!$("input:radio[name='EhsChildBorn']").is(":checked")) { isValid = false; customAlert("Child born is required. "); return isValid; } if (!$('#ChildChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's direct blood relative. "); return isValid; } if (!$('#diagnosedChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's diagnosed health conditions. "); return isValid; } if (!$('#EHSChildChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's received medical treatment. "); return isValid; } if (!$('#EHSCHCChildChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's receiving treatment. "); return isValid; } if (!$('#medicalChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's medical treatment conditions. "); return isValid; } if (!$('#healthChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's chronic health conditions. "); return isValid; } //if (!$("input:radio[name='EhsChildDentalCare']").is(":checked")) { // isValid = false; // customAlert("Child preventative dental care is required. "); // return isValid; //} //if (!$("input:radio[name='EhsDentalExam']").is(":checked")) { // isValid = false; // customAlert("Child current professional dental exam is required. "); // return isValid; //} //if (!$("input:radio[name='EhsChildNeedDentalTreatment']").is(":checked")) { // isValid = false; // customAlert("Child diagnosed dental treatment is required. "); // return isValid; //} //if (!$("input:radio[name='EhsChildRecievedDentalTreatment']").is(":checked")) { // isValid = false; // customAlert("Child diagnosed dental treatment is required. "); // return isValid; //} if (!$('#ChildVitaminlist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one child's vitamin supplement. "); return isValid; } if (!$("input:radio[name='PersistentNausea']").is(":checked")) { isValid = false; customAlert(" Please select persistent/current nausea health condition. "); return isValid; } if (!$("input:radio[name='PersistentDiarrhea']").is(":checked")) { isValid = false; customAlert("Please select persistent/current diarrhea health condition. "); return isValid; } if (!$("input:radio[name='PersistentConstipation']").is(":checked")) { isValid = false; customAlert("Please select persistent/current constipation health condition. "); return isValid; } if (!$("input:radio[name='DramaticWeight']").is(":checked")) { isValid = false; customAlert("Please select dramatic weight change. "); return isValid; } if (!$("input:radio[name='RecentSurgery']").is(":checked")) { isValid = false; customAlert("Please select recent surgery. "); return isValid; } if (!$("input:radio[name='RecentHospitalization']").is(":checked")) { isValid = false; customAlert("Please select recent hospitalization. "); return isValid; } if (!$("input:radio[name='FoodAllergies']").is(":checked")) { isValid = false; customAlert("Please select food allergies. "); return isValid; } if (!$("input:radio[name='NutritionalConcern']").is(":checked")) { isValid = false; customAlert("Please select nutritional concern. "); return isValid; } if (!$("input:radio[name='spoon']").is(":checked")) { isValid = false; customAlert("Please select child use a spoon or fork. "); return isValid; } if (!$("input:radio[name='feedingtube']").is(":checked")) { isValid = false; customAlert("Please select child use a feeding tube or other special feeding method. "); return isValid; } if (!$("input:radio[name='chewanything']").is(":checked")) { isValid = false; customAlert("Please select child eat or chew anything that is not food. "); return isValid; } if (!$("input:radio[name='ChangeinAppetite']").is(":checked")) { isValid = false; customAlert("Please describe child's appetite. "); return isValid; } if (!$("input:radio[name='ChangeinAppetite']").is(":checked")) { isValid = false; customAlert("Please describe child's appetite. "); return isValid; } if (!$('#ChildDietlist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one condition when your child is full. "); return isValid; } if (!$('#ChildDrinkChecklist input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select how much water does your child drink. "); return isValid; } } //if (HS) { // if (!$("input:radio[name='HsChildBorn']").is(":checked")) { // isValid = false; // customAlert("Child born is required. "); // return isValid; // } // if (!$('#ChildChecklist input[type="checkbox"]').is(':checked')) { // isValid = false; // customAlert("Please select atleast one child's direct blood relative. "); // return isValid; // } // if (!$('#diagnosedChecklist input[type="checkbox"]').is(':checked')) { // isValid = false; // customAlert("Please select atleast one child's medical treatment conditions. "); // return isValid; // } // if (!$('#healthChecklist input[type="checkbox"]').is(':checked')) { // isValid = false; // customAlert("Please select atleast one child's chronic health conditions. "); // return isValid; // } // if (!$("input:radio[name='HsChildDentalCare']").is(":checked")) { // isValid = false; // customAlert("Child preventative dental care is required. "); // return isValid; // } // if (!$("input:radio[name='HsDentalExam']").is(":checked")) { // isValid = false; // customAlert("Child current professional dental exam is required. "); // return isValid; // } // if (!$("input:radio[name='HsChildNeedDentalTreatment']").is(":checked")) { // isValid = false; // customAlert("Child diagnosed dental treatment is required. "); // return isValid; // } // if (!$("input:radio[name='HsChildRecievedDentalTreatment']").is(":checked")) { // isValid = false; // customAlert("Child diagnosed dental treatment is required. "); // return isValid; // } //} //if (EHS) //{ //if (!$("input:radio[name='EhsChildBorn']").is(":checked")) { // isValid = false; // customAlert("Child born is required. "); // return isValid; //} //if (!$('#ChildChecklist input[type="checkbox"]').is(':checked')) { // isValid = false; // customAlert("Please select atleast one child's direct blood relative. "); // return isValid; //} // if (!$('#diagnosedChecklist input[type="checkbox"]').is(':checked')) { // isValid = false; // customAlert("Please select atleast one child's medical treatment conditions. "); // return isValid; // } // if (!$('#healthChecklist input[type="checkbox"]').is(':checked')) { // isValid = false; // customAlert("Please select atleast one child's chronic health conditions. "); // return isValid; // } // if (!$("input:radio[name='EhsChildDentalCare']").is(":checked")) { // isValid = false; // customAlert("Child preventative dental care is required. "); // return isValid; // } // if (!$("input:radio[name='EhsDentalExam']").is(":checked")) { // isValid = false; // customAlert("Child current professional dental exam is required. "); // return isValid; // } // if (!$("input:radio[name='EhsChildNeedDentalTreatment']").is(":checked")) { // isValid = false; // customAlert("Child diagnosed dental treatment is required. "); // return isValid; // } // if (!$("input:radio[name='EhsChildRecievedDentalTreatment']").is(":checked")) { // isValid = false; // customAlert("Child diagnosed dental treatment is required. "); // return isValid; // } //} return isValid; // } function isValidagencyInfo() { isValid = true; cleanValidation(); //if ($('#Street')[0].value.trim() == "") { // isValid = false; // customAlert("Address is required. "); // plainValidation('#Street'); // return isValid; //} //if ($('#ZipCode')[0].value.trim() == "") { // isValid = false; // customAlert("Zip Code is required. "); // plainValidation('#ZipCode'); // return isValid; //} //if ($('#City')[0].value.trim() == "") { // isValid = false; // customAlert("City is required. "); // plainValidation('#City'); // return isValid; //} //if ($('#State')[0].value.trim() == "") { // isValid = false; // customAlert("State is required. "); // plainValidation('#State'); // return isValid; //} //if ($('#County')[0].value.trim() == "") { // isValid = false; // customAlert("County is required. "); // plainValidation('#County'); // return isValid; //} //if (!$('#AdresssverificationinPaper').prop("checked") && $('#HouseholdId').val() == '0') { // if ($('#FileaddressAvatar')[0].value.trim() == "") { // isValid = false; // customAlert("Please upload address verification form. "); // plainValidation('#FileaddressAvatar'); // return isValid; // } //} //else { // if ($('#HouseholdId').val() != '0' && $('#HFileName').val() == "" && !$('#AdresssverificationinPaper').prop("checked")) { // isValid = false; // customAlert("Please upload address verification form. "); // plainValidation('#FileaddressAvatar'); // return isValid; // } //} //removeclasss(); $('#FamilyHouseholdRecord').addClass("active"); $('#FamilyHouseholdRecord').addClass("in"); $('#myTab li:eq(1) a').tab('show'); return isValid; } function checkdate(input) { isValiddob = true; var age = null; var now = null; var past = null; var nowYear = null; var pastYear = null; if ($('#CDOB')[0].value.trim() != "") { if ($('#CProgramType').val() == "1") { now = new Date(); past = new Date($("#CDOB").val()); nowYear = now.getFullYear(); pastYear = past.getFullYear(); age = nowYear - pastYear; if (age < 0 || age > 3) { isValiddob = false; customAlert("If program type is early head start. Date of birth should be between 0 to 3 years. "); } } else { now = new Date(); past = new Date($("#CDOB").val()); nowYear = now.getFullYear(); pastYear = past.getFullYear(); age = nowYear - pastYear; if (age < 0 || age > 5) { isValiddob = false; customAlert("If program type is head start. Date of birth should be between 0 to 5 years. "); } } } return isValiddob; } function validatedate(inputTextObject) { if ($(inputTextObject).val().trim() != "MM/DD/YYYY" && $(inputTextObject).val().trim() != "") { var dateformat = /^(0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])[\/\-]\d{4}$/; var regex = new RegExp(dateformat); if (regex.test($(inputTextObject).val())) { var dob = new Date(); if (Date.parse($(inputTextObject).val()) >= dob) { customAlert("Invalid Date of birth .Date of birth must be less than today's date. "); $(inputTextObject).val(''); return false; } else { var age = null; var now = null; var past = null; var nowYear = null; var pastYear = null; now = new Date(); past = new Date($(inputTextObject).val()); nowYear = now.getFullYear(); pastYear = past.getFullYear(); age = nowYear - pastYear; if (age > 90) { BootstrapDialog.confirm('Date of birth is greater than 90 years!! Do you want to continue?', function (result) { if (result) { return true; } else { $(inputTextObject).val(''); $('#Oemergencycontact').hide(); $('#lblOemergencycontact').hide(); } }); } return true; } } else { customAlert("Invalid date of birth. "); $(inputTextObject).val(''); return false; } } } function validatedatenew(inputTextObject) { if ($(inputTextObject).val().trim() != "MM/DD/YYYY" && $(inputTextObject).val().trim() != "") { var dateformat = /^(0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])[\/\-]\d{4}$/; var regex = new RegExp(dateformat); if (!regex.test($(inputTextObject).val())) { customAlert("Invalid date format. "); $(inputTextObject).val(''); return false; } } } function IsValidRejectInfo() { isValid = true; cleanValidation(); if (!$("input:radio[name='AcceptApplicant']").is(":checked")) { isValid = false; customAlert("Acceptance is required. "); return isValid; } else if ($("input:radio[name='AcceptApplicant']:checked").val()==="1") { if (!$("input:radio[name='AcceptReason']").is(":checked")) { isValid = false; customAlert("Acceptance Reason is required. "); return isValid; } } //if (!$("input:radio[name='AcceptApplicant']").is(":checked")) { // isValid = false; // customAlert("Acceptance is required. "); // return isValid; //} return isValid; } function isValidfamilyInfo() { isValid = true; cleanValidation(); //if (!$("input:radio[name='FamilyType']").is(":checked")) { // isValid = false; // customAlert("Family type is required. "); // return isValid; //} //if (!$("input:radio[name='HomeType']").is(":checked")) { // isValid = false; // customAlert("Is family Homeless at this time is required. "); // return isValid; //} //if ($('#FamilyType1').prop("checked")) { // if ($("#ParentRelatioship").val() == null) { // isValid = false; // customAlert("Parent relatioship is required. "); // plainValidation('#ParentRelatioship'); // return isValid; // } // if ($("#ParentRelatioship").val() == "6") { // if ($("#ParentRelatioshipOther").val().trim() == "") { // isValid = false; // customAlert("Other relatioship is required. "); // plainValidation('#ParentRelatioshipOther'); // return isValid; // } // } //} //if (!$('#chk input[type="checkbox"]').is(':checked')) { // isValid = false; // customAlert("Please select atleast one federal or other Assistance. "); // return isValid; //} //if ($("#PrimaryLanguauge").val() == null) { // isValid = false; // customAlert("Primarylanguauge is required. "); // plainValidation('#PrimaryLanguauge'); // return isValid; //} //if ($("#PrimaryLanguauge").val() == 12) { // if ($("#OtherLanguageDetail").val().trim() == "") { // isValid = false; // customAlert("Other Language Detail is required. "); // plainValidation('#OtherLanguageDetail'); // return isValid; // } //} //if (!$("input:radio[name='Interpretor']").is(":checked")) { // isValid = false; // customAlert("Interpretor is required. "); // return isValid; //} //if ($("#InsuranceOption").val() == null) { // isValid = false; // customAlert("Primary insurance is required. "); // plainValidation('#InsuranceOption'); // return isValid; //} //if ($("#MedicalNote").val() == "") { // isValid = false; // customAlert("Insurance notes is required ."); // plainValidation('#MedicalNote'); // return isValid; //} removeclasss(); $('#FamilyRecord').addClass("active"); $('#FamilyRecord').addClass("in"); $('#myTab li:eq(2) a').tab('show'); //if ($('#ParentID').val() != "0" && $('#ParentID1').val() != "0") { // if ($('#FamilyType').prop('checked')) { // $('#Pparentid1').removeClass("panel-collapsed"); // $('#pparentid2').removeClass("panel-collapsed"); // $('#Pparentid1').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); // $('#pparentid2').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); // $('.panel-body2').attr('style', 'display: block;'); // $('.panel-body1').attr('style', 'display: block;'); // $(".panel1").show(); // $(".panel2").show(); // isValid = false; // customAlert("Single parent family selected. Please delete one parent from family."); // removeclasss(); // $('#FamilyRecord').addClass("active"); // $('#FamilyRecord').addClass("in"); // $('#myTab li:eq(2) a').tab('show'); // return isValid; // } //} return isValid; } function isValidnotall() { isValid = true; cleanValidation(); if ($('#Street')[0].value.trim() == "") { isValid = false; customAlert("Address is required. "); activehouseholdtab(); plainValidation('#Street'); return isValid; } if ($('#ZipCode')[0].value.trim() == "") { isValid = false; customAlert("Zip Code is required. "); plainValidation('#ZipCode'); activehouseholdtab(); return isValid; } if ($('#City')[0].value.trim() == "") { isValid = false; customAlert("City is required. "); plainValidation('#City'); activehouseholdtab(); return isValid; } if ($('#State')[0].value.trim() == "") { isValid = false; customAlert("State is required. "); plainValidation('#State'); activehouseholdtab(); return isValid; } if ($('#County')[0].value.trim() == "") { isValid = false; customAlert("County is required. "); plainValidation('#County'); activehouseholdtab(); return isValid; } if ($('#Pfirstname')[0].value.trim() == "") { isValid = false; activefamilytab(); customAlert("First name is required. "); plainValidation('#Pfirstname'); return isValid; } if ($('#Plastname')[0].value.trim() == "") { isValid = false; activefamilytab(); customAlert("Last name is required. "); plainValidation('#Plastname'); return isValid; } if ($('#FamilyType1').prop("checked")) { if ($('#Span1P2').text() != "") { if ($('#P1firstname')[0].value.trim() == "") { isValid = false; activefamilytab(); customAlert("First name is required. "); plainValidation('#P1firstname'); return isValid; } if ($('#P1lastname')[0].value.trim() == "") { isValid = false; activefamilytab(); customAlert("Last name is required. "); plainValidation('#P1lastname'); return isValid; } } } if ($('#Cfirstname')[0].value.trim() != "") { if ($('#Cfirstname')[0].value.trim() == "") { isValid = false; customAlert("First name is required. "); plainValidation('#Cfirstname'); return isValid; } if ($('#Clastname')[0].value.trim() == "") { isValid = false; customAlert("Last name is required. "); plainValidation('#Clastname'); return isValid; } if ($('#CDOB')[0].value.trim() == "") { isValid = false; customAlert("Date of birth is required. "); plainValidation('#CDOB'); return isValid; } if ($('#CDOB')[0].value.trim() != "") { var today = new Date(); if (Date.parse($("#CDOB").val()) > today) { isValid = false; customAlert("Date of birth Can't be greater than current date. "); plainValidation('#CDOB'); return isValid; } } if (!$("input:radio[name='CGender']").is(":checked")) { isValid = false; customAlert("Gender is required. "); return isValid; } } if (ssnoriginalvalue != null) { if (ssnoriginalvalue != $('#CSSN').val()) { if ($('#CSSN').val() == "") { $('#CSSN').val(ssnoriginalvalue); } else if ($('#CSSN').val().indexOf("*") > 0) { $('#CSSN').val(ssnoriginalvalue); } } } if (Parent1ssn != null) { if (Parent1ssn != $('#ParentSSN1').val()) { if ($('#ParentSSN1').val() == "") { $('#ParentSSN1').val(Parent1ssn); } else if ($('#ParentSSN1').val().indexOf("*") > 0) { $('#ParentSSN1').val(Parent1ssn); } } } if (Parent2ssn != null) { if (Parent2ssn != $('#ParentSSN2').val()) { if ($('#ParentSSN2').val() == "") { $('#ParentSSN2').val(Parent1ssn); } else if ($('#ParentSSN2').val().indexOf("8") > 0) { $('#ParentSSN2').val(Parent1ssn); } } } } function isValidChildInfo() { isValid = true; cleanValidation(); //if (!isValidagencyInfo()) { // isValid = false; // activehouseholdtab(); // return isValid; //} //household check if ($('#Street')[0].value.trim() == "") { isValid = false; customAlert("Address is required. "); activehouseholdtab(); plainValidation('#Street'); return isValid; } if ($('#ZipCode')[0].value.trim() == "") { isValid = false; customAlert("Zip Code is required. "); plainValidation('#ZipCode'); activehouseholdtab(); return isValid; } if ($('#City')[0].value.trim() == "") { isValid = false; customAlert("City is required. "); plainValidation('#City'); activehouseholdtab(); return isValid; } if ($('#State')[0].value.trim() == "") { isValid = false; customAlert("State is required. "); plainValidation('#State'); activehouseholdtab(); return isValid; } if ($('#County')[0].value.trim() == "") { isValid = false; customAlert("County is required. "); plainValidation('#County'); activehouseholdtab(); return isValid; } if (!$('#AdresssverificationinPaper').prop("checked") && $('#HouseholdId').val() == '0') { if ($('#FileaddressAvatar')[0].value.trim() == "") { isValid = false; customAlert("Please upload address verification form. "); plainValidation('#FileaddressAvatar'); activehouseholdtab(); return isValid; } } else { if ($('#HouseholdId').val() != '0' && $('#HFileName').val() == "" && !$('#AdresssverificationinPaper').prop("checked")) { isValid = false; customAlert("Please upload address verification form. "); plainValidation('#FileaddressAvatar'); activehouseholdtab(); return isValid; } } ///family house hold check if (!$("input:radio[name='FamilyType']").is(":checked")) { isValid = false; customAlert("Family type is required. "); activefamilyhouseholdtab(); return isValid; } if (!$("input:radio[name='HomeType']").is(":checked")) { isValid = false; customAlert("Is family Homeless at this time is required. "); activefamilyhouseholdtab(); return isValid; } //if (!$("input:radio[name='RentType']").is(":checked")) { // isValid = false; // customAlert("Rent type is required."); // activefamilyhouseholdtab(); // return isValid; //} if (!$('#chk input[type="checkbox"]').is(':checked')) { isValid = false; customAlert("Please select atleast one federal or other Assistance. "); activefamilyhouseholdtab(); return isValid; } if ($("#PrimaryLanguauge").val() == null) { isValid = false; customAlert("Primarylanguauge is required. "); plainValidation('#PrimaryLanguauge'); activefamilyhouseholdtab(); return isValid; } if (!$("input:radio[name='Interpretor']").is(":checked")) { isValid = false; customAlert("Interpretor is required. "); activefamilyhouseholdtab(); return isValid; } //if ($("#InsuranceOption").val() == null) { // isValid = false; // customAlert("Primary insurance is required. "); // plainValidation('#InsuranceOption'); // activefamilyhouseholdtab(); // return isValid; //} //if ($("#MedicalNote").val() == "") { // isValid = false; // customAlert("Insurance notes is required ."); // plainValidation('#MedicalNote'); // activefamilyhouseholdtab(); // return isValid; //} //////////////////////////////// //Parent check if (!isValidParentInfo()) { isValid = false; activefamilytab(); return isValid; } ///////// if ($('#HouseholdId').val() != '0' && $('#Cfirstname').val() == "") { isValid = true; return isValid; } if ($('#Cfirstname')[0].value.trim() == "") { isValid = false; customAlert("First name is required. "); plainValidation('#Cfirstname'); return isValid; } if ($('#Clastname')[0].value.trim() == "") { isValid = false; customAlert("Last name is required. "); plainValidation('#Clastname'); return isValid; } //if ($('#CProgramType')[0].value.trim() == "") { // isValid = false; // customAlert("Program type is required. "); // plainValidation('#CProgramType'); // return isValid; //} //if (!$("input:radio[name='FamilyType']").is(":checked")) { // isValid = false; // customAlert("Family type is required."); // return isValid; //} if ($('#CDOB')[0].value.trim() == "") { isValid = false; customAlert("Date of birth is required. "); plainValidation('#CDOB'); return isValid; } if ($('#CDOB')[0].value.trim() != "") { var today = new Date(); if (Date.parse($("#CDOB").val()) > today) { isValid = false; customAlert("Date of birth Can't be greater than current date. "); plainValidation('#CDOB'); return isValid; } } if ($('#DOBverifiedBy')[0].value.trim() == "") { isValid = false; customAlert("DOB verified by is required. "); plainValidation('#DOBverifiedBy'); return isValid; } //if ($('#CSSN').val().trim() != "" && $('#CSSN').val().length != 9) { // isValid = false; // customAlert("SSN must be at least 9 characters."); // plainValidation('#CSSN'); // return isValid; //} if (!$("input:radio[name='CGender']").is(":checked")) { isValid = false; customAlert("Gender is required. "); return isValid; } if ($('#CRace')[0].value.trim() == "") { isValid = false; customAlert("Race is required. "); plainValidation('#CRace'); return isValid; } if ($('#CEthnicity')[0].value.trim() == "") { isValid = false; customAlert("Ethnicity is required. "); plainValidation('#CEthnicity'); return isValid; } if ($('#SchoolDistrict')[0].value.trim() == "") { isValid = false; customAlert("School District is required. "); plainValidation('#SchoolDistrict'); return isValid; } if ($('#Medicalhome')[0].value.trim() == "") { isValid = false; customAlert("Medical home is required. "); plainValidation('#Medicalhome'); return isValid; } if ($('#Medicalhome').val() == 3 || $('#Medicalhome').val() == 4) { if ($('#Doctor').val() == 0) { isValid = false; customAlert("Doctor name is required. "); plainValidation('#CDoctor'); return isValid; } } if ($('#CDentalhome')[0].value.trim() == "") { isValid = false; customAlert("Dental home is required ."); plainValidation('#CDentalhome'); return isValid; } if ($('#CDentalhome').val() == 3 || $('#CDentalhome').val() == 4) { if ($('#Dentist').val() == 0) { isValid = false; customAlert("Dentist name is required. "); plainValidation('#CDentist'); return isValid; } } if ($('#ImmunizationService')[0].value.trim() == "") { isValid = false; customAlert("Immunization service is required. "); plainValidation('#ImmunizationService'); return isValid; } if ($('#BMIStatus')[0].value.trim() == "") { isValid = false; customAlert("BMI status is required. "); plainValidation('#BMIStatus'); return isValid; } if (!$("input:radio[name='MedicalService']").is(":checked")) { isValid = false; customAlert("Is this child up-to-date on a schedule of age-appropriate health care is required. "); return isValid; } if (!$("input:radio[name='CParentdisable']").is(":checked")) { isValid = false; customAlert("Suspected or document of disabilty is required. "); return isValid; } if (!$("input:radio[name='IsFoster']").is(":checked")) { isValid = false; customAlert("Is foster child is required. "); return isValid; } if (!$("input:radio[name='Inwalfareagency']").is(":checked")) { isValid = false; customAlert("Is child referred by a child welfare agency is required. "); return isValid; } if (!$("input:radio[name='InDualcustody']").is(":checked")) { isValid = false; customAlert("Is child a dual custody child is required. "); return isValid; } if (!$('#DobverificationinPaper').prop("checked") && $('#ChildId').val() == '0') { if ($('#FiledobRAvatar')[0].value.trim() == "") { isValid = false; customAlert("Please upload DOB verification form. "); plainValidation('#FiledobRAvatar'); return isValid; } } else { if ($('#ChildId').val() != '0' && $('#DobFileName').val() == "" && !$('#DobverificationinPaper').prop("checked")) { isValid = false; customAlert("Please upload DOB verification form. "); plainValidation('#FiledobRAvatar'); return isValid; } } return isValid; } function activehouseholdtab() { removeclasss(); $('#HouseholdRecord').addClass("active"); $('#HouseholdRecord').addClass("in"); $('#myTab li:eq(0) a').tab('show'); } function activefamilyhouseholdtab() { removeclasss(); $('#FamilyHouseholdRecord').addClass("active"); $('#FamilyHouseholdRecord').addClass("in"); $('#myTab li:eq(1) a').tab('show'); } function activefamilytab() { removeclasss(); $('#FamilyRecord').addClass("active"); $('#FamilyRecord').addClass("in"); $('#myTab li:eq(2) a').tab('show'); } function ShowHideDivParentTwo1() { if ($('#ParentID1').val() != "0") { customAlert("Single parent family selected. Please delete one parent from family. "); $('#FamilyType').prop('checked', false); $('#FamilyType1').prop('checked', true); return; } $('#Pparentid1').removeClass("panel-collapsed"); $(".panel1").hide(); $('.panel-body2').attr('style', 'display: block;'); $('#Pparentid1').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); $(".panel2").show(); //$('#ParentRelatioship').find('option').remove().end().append('<option value="2">Mother (biological, adoptive, stepmother, etc.)</option>' + // '<option value="1">Father (biological, adoptive, stepfather, etc.)</option><option value="3">Grandparent</option><option value="4">Relative other than grandparent</option>' + // '<option value="6">Other</option> '); //$('#ParentRelatioship').val(''); //$('#divParentrelatioship').hide(); $('#divParentrelatioship').hide(); $('#divrelationshipparent').hide(); } function ShowHideDivParentTwo2() { $('#Pparentid1').removeClass("panel-collapsed"); $('#pparentid2').removeClass("panel-collapsed"); $('#Pparentid1').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); $('#pparentid2').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); $('.panel-body2').attr('style', 'display: block;'); $('.panel-body1').attr('style', 'display: block;'); $(".panel1").show(); $(".panel2").show(); $('#P1firstname').val(''); $('#P1lastname').val(''); $('#P1midddlename').val(''); $('#P1DOB').val(''); $('#P1emailid').val(''); $('#DdlP1Role').val(''); $('#DdlP1DegreeEarned').val(''); $("input:radio[name='P1Gender']").prop("checked", false); $("input:radio[name='P1MilitaryStatus']").prop("checked", false); $("input:radio[name='P1CurrentlyWorking']").prop("checked", false); $("input:radio[name='P1Enrollment']").prop("checked", false); $('#gridphone1 > tbody tr').each(function () { $(this).find('td:eq(0) :input').val(""); $(this).find('td:eq(1) :input[type="text"]').val(""); $(this).find('td:eq(2) :checkbox').prop("checked", false); $(this).find('td:eq(3) :input[type="text"]').val(""); $(this).find('td:eq(4) :checkbox').prop("checked", false); } ); $('#ParentRelatioship').find('option').remove().end().append('<option value="1">Parents (biological, adoptive, stepparents, etc.)</option>' + '<option value="2">Grandparents</option><option value="3">Relatives other than grandparents</option><option value="4">Foster parents not including relatives</option>' + '<option value="6">Other</option> '); $('#ParentRelatioship').val(''); $('#divParentrelatioship').hide(); $('#divrelationshipparent').show(); } //function showdropdown() { // $("#Dropdown").addClass("visible"); // $("#DdlBMIStatus").hide() //} function showlist() { $("#Dropdown").addClass("visible"); $("#DdlBMIStatus").show() } var _validFileExtensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png"]; function ValidateSingleInput(oInput) { if (oInput.type == "file") { var sFileName = oInput.value; if (sFileName.length > 0) { var blnValid = false; // alert(oInput.files[0].size / 1024 / 1024); var v = oInput.files[0].size / 1024 / 1024; if (v <= 1) { for (var j = 0; j < _validFileExtensions.length; j++) { var sCurExtension = _validFileExtensions[j]; if (sFileName.substr(sFileName.length - sCurExtension.length, sCurExtension.length).toLowerCase() == sCurExtension.toLowerCase()) { blnValid = true; break; } } if (!blnValid) { oInput.value = ""; return false; } } else { oInput.value = ""; customAlertforlongtime("File size should not be greater than 1 MB. "); return false; } } } return true; } var _validFileExtensions1 = [".pdf", ".jpg", ".jpeg", ".bmp", ".gif", ".png"]; function ValidateSingleInputpdf(oInput) { if (oInput.type == "file") { var sFileName = oInput.value; if (sFileName.length > 0) { var blnValid = false; // alert(oInput.files[0].size / 1024 / 1024); var v = oInput.files[0].size / 1024 / 1024; if (v <= 1) { for (var j = 0; j < _validFileExtensions1.length; j++) { var sCurExtension = _validFileExtensions1[j]; if (sFileName.substr(sFileName.length - sCurExtension.length, sCurExtension.length).toLowerCase() == sCurExtension.toLowerCase()) { $('#AdresssverificationinPaper').prop("checked", false); blnValid = true; break; } } if (!blnValid) { oInput.value = ""; return false; } } else { oInput.value = ""; customAlertforlongtime("File size should not be greater than 1 MB. "); return false; } } } return true; } var _validFileExtensions1 = [".pdf", ".jpg", ".jpeg", ".bmp", ".gif", ".png"]; function ValidateSingleInputpdf2(oInput) { //Changes by Akansha on 12Dec2016 //Changes by Akansha on 12Dec2016 if (oInput.id == "Physical") { $('#AddPhysical').prop("checked", true); $('#Physical').show(); } if (oInput.id == "Vision") { $('#AddVision').prop("checked", true); $('#Vision').show(); } if (oInput.id == "Hearing") { $('#AddHearing').prop("checked", true); $('#Hearing').show(); } if (oInput.id == "Develop") { $('#AddDevelop').prop("checked", true); $('#Develop').show(); } if (oInput.id == "Dental") { $('#AddDental').prop("checked", true); $('#Dental').show(); } if (oInput.id == "Speech") { $('#AddSpeech').prop("checked", true); $('#Speech').show(); } //End //End if (oInput.type == "file") { var sFileName = oInput.value; if (sFileName.length > 0) { var blnValid = false; // alert(oInput.files[0].size / 1024 / 1024); var v = oInput.files[0].size / 1024 / 1024; if (v <= 1) { for (var j = 0; j < _validFileExtensions1.length; j++) { var sCurExtension = _validFileExtensions1[j]; if (sFileName.substr(sFileName.length - sCurExtension.length, sCurExtension.length).toLowerCase() == sCurExtension.toLowerCase()) { $('#DobverificationinPaper').prop("checked", false); blnValid = true; break; } } if (!blnValid) { oInput.value = ""; return false; } } else { oInput.value = ""; customAlertforlongtime("File size should not be greater than 1 MB. "); return false; } } } return true; } var sortOrder = ''; var sortDirection = ''; var imgID = ''; var direction = ''; var pageSize = 50; var requestedPage = 0; var pageLoadedFirst = true; var totalRecords = 0; var numOfPages = 0; var StartIndex = 0; var LastIndex = 0; var search = ''; var listAgency = null; var listEmergencyContact = null; var listRestricted = null; function addcontact(value) { if ($(value).val() == 2) { $(value).closest('tr').find('td:eq(4) :input[type="checkbox"]').prop("disabled", false).prop("checked", false); } else { $(value).closest('tr').find('td:eq(4) :input[type="checkbox"]').prop("disabled", true).prop("checked", false); } } function Addphone() { var PhoneTypeP = "ParentPhone1[" + rounds + "].PhoneTypeP"; var phonenoP = "ParentPhone1[" + rounds + "].phonenoP"; var StateP = "ParentPhone1[" + rounds + "].StateP"; var notesP = "ParentPhone1[" + rounds + "].notesP"; var SmsP = "ParentPhone1[" + rounds + "].SmsP"; var tr = '<tr><td><select class="form-control" style="width:100%;" disabled="disabled" name=' + PhoneTypeP + ' onchange="addcontact(this);" >' + ' <option value="1">Home</option><option value="2">Mobile</option><option value="3">Work</option> ' + '</select></td><td ><input class = "form-control" disabled="disabled" name=' + phonenoP + ' type="text" ></td><td><input type="checkbox" disabled="disabled" value="true" name=' + StateP + ' data-val="true" class="chcktbl" onchange="uncheckParentother(this);"/></td><td ><input class = "form-control" disabled="disabled" type="text" id="Pnotes" data-val="true" name=' + notesP + ' name="Pnotes" maxlength="100"></td> <td><input type="checkbox" style="width:50%;" disabled="disabled" id="PSms" name=' + SmsP + ' value="true" class="chcktbl" /></td><td><a href="javascript:void(0)" onclick="RemovePhone(this);" style=" text-decoration:underline;">Delete</a></td></tr>'; $('#gridphone > tbody').append(tr); $('#gridphone > tbody tr').each(function () { var y = $(this).find('td:eq(1) :input[type="text"]').mask("(999) 999-9999"); }); $('#gridphone > tbody tr:last').find('td:eq(0) :input').val(""); rounds = rounds + 1; } function Addphone1() { var PhoneTypeP1 = "ParentPhoneNos1[" + round1 + "].PhoneTypeP1"; var phonenoP1 = "ParentPhoneNos1[" + round1 + "].phonenoP1"; var StateP1 = "ParentPhoneNos1[" + round1 + "].StateP1"; var notesP1 = "ParentPhoneNos1[" + round1 + "].notesP1"; var SmsP1 = "ParentPhoneNos1[" + round1 + "].SmsP1"; $('#gridphone1').show(); var tr = '<tr><td><select class="form-control" style="width:100%;" disabled="disabled" name=' + PhoneTypeP1 + ' onchange="addcontact(this);" id="P1phoneType" >' + ' <option value="1">Home</option><option value="2">Mobile</option><option value="3">Work</option> ' + '</select></td><td><input class = "form-control" disabled="disabled" id="addPPhone1" name=' + phonenoP1 + ' type="text" ></td> <td><input disabled="disabled" type="checkbox" onchange="uncheckParent1other(this);" name=' + StateP1 + ' data-val="true" id="P1State"/></td><td ><input disabled="disabled" class = "form-control" type="text" id="P1notes" data-val="true" name=' + notesP1 + ' maxlength="100" ></td><td><input type="checkbox" disabled="disabled" style="width:50%;" id="P1Sms" name=' + SmsP1 + ' value="true" /></td><td><a href="javascript:void(0)" onclick="RemovePhone1(this);" style=" text-decoration:underline;">Delete</a></td></tr>'; $('#gridphone1 > tbody').append(tr); $('#gridphone1 > tbody tr').each(function () { var y = $(this).find('td:eq(1) :input[type="text"]').mask("(999) 999-9999"); }); $('#gridphone1 > tbody tr:last').find('td:eq(0) :input').val(""); round1 = round1 + 1; } function RemovePhone(value) { if ($(value).attr("accesskey")) { if ($('#gridphone > tbody tr').length > 1) { BootstrapDialog.confirm('Do you want to delete this contact ?', function (result) { if (result) { $.ajax({ url: HostedDir + "/Agencyuser/DeleteParentContact", type: "POST", data: { phoneId: $(value).attr("accesskey"), HouseHoldId: $('#HouseholdId').val(), Parentid: $('#ParentID').val(), }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { customAlert("Contact deleted successfully. "); rounds = 0; if ($('#gridphone > tbody tr').length > 1) { $(value).closest('tr').remove(); } $('#gridphone > tbody tr').each(function () { var PhoneTypeP = "ParentPhone1[" + rounds + "].PhoneTypeP"; var phonenoP = "ParentPhone1[" + rounds + "].phonenoP"; var StateP = "ParentPhone1[" + rounds + "].StateP"; var notesP = "ParentPhone1[" + rounds + "].notesP"; var SmsP = "ParentPhone1[" + rounds + "].SmsP"; var Phoneid = "ParentPhone1[" + rounds + "].PPhoneId"; $(this).find('td:eq(0)').find(':input').attr('name', PhoneTypeP); $(this).find('td:eq(1) :input[type="text"]').attr('name', phonenoP); $(this).find('td:eq(2)').find(':input').attr('name', StateP); $(this).find('td:eq(3) :input[type="text"]').attr('name', notesP); $(this).find('td:eq(4)').find(':input').attr('name', SmsP); $(this).find('td:eq(5)').find(':input').attr('name', Phoneid); rounds = rounds + 1; }); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } }); } } else { rounds = 0; if ($('#gridphone > tbody tr').length > 1) { $(value).closest('tr').remove(); } $('#gridphone > tbody tr').each(function () { var PhoneTypeP = "ParentPhone1[" + rounds + "].PhoneTypeP"; var phonenoP = "ParentPhone1[" + rounds + "].phonenoP"; var StateP = "ParentPhone1[" + rounds + "].StateP"; var notesP = "ParentPhone1[" + rounds + "].notesP"; var SmsP = "ParentPhone1[" + rounds + "].SmsP"; var Phoneid = "ParentPhone1[" + rounds + "].PPhoneId"; $(this).find('td:eq(0)').find(':input').attr('name', PhoneTypeP); $(this).find('td:eq(1) :input[type="text"]').attr('name', phonenoP); $(this).find('td:eq(2)').find(':input').attr('name', StateP); $(this).find('td:eq(3) :input[type="text"]').attr('name', notesP); $(this).find('td:eq(4)').find(':input').attr('name', SmsP); $(this).find('td:eq(5)').find(':input').attr('name', Phoneid); rounds = rounds + 1; }); } } function RemovePhone1(value) { if ($(value).attr("accesskey")) { if ($('#gridphone1 > tbody tr').length > 1) { BootstrapDialog.confirm('Do you want to delete this contact ?', function (result) { if (result) { $.ajax({ url: HostedDir + "/Agencyuser/DeleteParent1Contact", type: "POST", data: { phoneId: $(value).attr("accesskey"), HouseHoldId: $('#HouseholdId').val(), Parentid1: $('#ParentID1').val(), }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { customAlert("Contact deleted successfully. "); round1 = 0; if ($('#gridphone1 > tbody tr').length > 1) { $(value).closest('tr').remove(); } $('#gridphone1 > tbody tr').each(function () { var PhoneTypeP1 = "ParentPhoneNos1[" + round1 + "].PhoneTypeP1"; var phonenoP1 = "ParentPhoneNos1[" + round1 + "].phonenoP1"; var StateP1 = "ParentPhoneNos1[" + round1 + "].StateP1"; var notesP1 = "ParentPhoneNos1[" + round1 + "].notesP1"; var SmsP1 = "ParentPhoneNos1[" + round1 + "].SmsP1"; var PPhoneId1 = "ParentPhoneNos1[" + round1 + "].PPhoneId1"; $(this).find('td:eq(0)').find(':input').attr('name', PhoneTypeP1); $(this).find('td:eq(1) :input[type="text"]').attr('name', phonenoP1); $(this).find('td:eq(2)').find(':input').attr('name', StateP1); $(this).find('td:eq(3) :input[type="text"]').attr('name', notesP1); $(this).find('td:eq(4)').find(':input').attr('name', SmsP1); $(this).find('td:eq(5)').find(':input').attr('name', PPhoneId1); round1 = round1 + 1; }); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } }); } } else { round1 = 0; if ($('#gridphone1 > tbody tr').length > 1) { $(value).closest('tr').remove(); } $('#gridphone1 > tbody tr').each(function () { var PhoneTypeP1 = "ParentPhoneNos1[" + round1 + "].PhoneTypeP1"; var phonenoP1 = "ParentPhoneNos1[" + round1 + "].phonenoP1"; var StateP1 = "ParentPhoneNos1[" + round1 + "].StateP1"; var notesP1 = "ParentPhoneNos1[" + round1 + "].notesP1"; var SmsP1 = "ParentPhoneNos1[" + round1 + "].SmsP1"; var PPhoneId1 = "ParentPhoneNos1[" + round1 + "].PPhoneId1"; $(this).find('td:eq(0)').find(':input').attr('name', PhoneTypeP1); $(this).find('td:eq(1) :input[type="text"]').attr('name', phonenoP1); $(this).find('td:eq(2)').find(':input').attr('name', StateP1); $(this).find('td:eq(3) :input[type="text"]').attr('name', notesP1); $(this).find('td:eq(4)').find(':input').attr('name', SmsP1); $(this).find('td:eq(5)').find(':input').attr('name', PPhoneId1); round1 = round1 + 1; }); } } function AddParent() { if ($('#DdlPRole').val() == 6) { $('#addrow').show(); } else { $('#addrow').hide(); } if ($('.Pmale').prop("checked")) { if ($('#DdlPRole').val() == 2) { customAlert("Please select valid parent/guardian. "); } } if ($('.Pfemale').prop("checked")) { if ($('#DdlPRole').val() == 1) { customAlert("Please select valid parent/guardian. "); } } if ($('.Pother').prop("checked")) { if ($('#DdlPRole').val() == 1 || $('#DdlPRole').val() == 2) { customAlert("Please select valid parent/guardian. "); } } } function AddParent1() { if ($('#DdlP1Role').val() == 6) { $('#addrow1').show(); } else { $('#addrow1').hide(); } if ($('.P1male').prop("checked")) { if ($('#DdlP1Role').val() == 2) { customAlert("Please select valid parent/guardian. "); } } if ($('.P1female').prop("checked")) { if ($('#DdlP1Role').val() == 1) { customAlert("Please select valid parent/guardian. "); } } if ($('.P1other').prop("checked")) { if ($('#DdlP1Role').val() == 1 || $('#DdlP1Role').val() == 2) { customAlert("Please select valid parent/guardian. "); } } } function AddphoneE1() { var phonetype = "PhoneNos[" + round + "].PhoneType"; var phoneno = "PhoneNos[" + round + "].PhoneNo"; var primarycontact = "PhoneNos[" + round + "].IsPrimary"; var notes = "PhoneNos[" + round + "].Notes"; var sms = "PhoneNos[" + round + "].IsSms"; $('#gridphoneE1').show(); var tr = '<tr><td><select class="form-control" style="width:100%;" name=' + phonetype + ' onchange="addcontact(this);" >' + ' <option value="1">Home</option><option value="2">Mobile</option><option value="3">Work</option> ' + '</select></td><td><input name=' + phoneno + ' class = "form-control" type="text" ></td> <td><input onchange="uncheckother(this);" class="chcketbl" value="true" name=' + primarycontact + ' type="checkbox" data-val="true" /></td><td ><input data-val="true" maxlength="100" class = "form-control" type="text" name=' + notes + '></td><td><input style="width:50%;" disabled="disabled" type="checkbox" class="chcketbl" name=' + sms + ' value="true"/></td><td><a href="javascript:void(0)" onclick="RemovePhoneE1(this);" style=" text-decoration:underline;">Delete</a></td></tr>'; $('#gridphoneE1 > tbody').append(tr); $('#gridphoneE1 > tbody tr').each(function () { $(this).find('td:eq(1) :input[type="text"]').mask("(999) 999-9999"); }); $('#gridphoneE1 > tbody tr:last').find('td:eq(0) :input').val(""); round = round + 1; } function uncheckother(value) { $('#gridphoneE1 > tbody tr').each(function () { $(this).find('td:eq(2) :checkbox').prop("checked", false); }); $(value).prop("checked", true); } function AddQuestion() { $('#Pquestionyes').prop('checked', false); $('#Pquestionno').prop('checked', false); $("#Pregnantmotherprogram").hide(); $('#addrow').hide(); $("#addquestion").show(); $("#DdlQuestion").show(); $("#lblQuestion").show(); $('#Pregnantmotherenrolled').prop("checked", false); if ($('#DdlPRole').val() !== "" && $('#DdlPRole').val() == 1) { customAlert("Please select valid parent/guardian. "); } } function RemoveQuestion() { $('#Pquestionyes').prop('checked', false); $('#Pquestionno').prop('checked', false); $("#Pregnantmotherprogram").hide(); $('#addrow').hide(); $("#addquestion").hide(); $("#DdlQuestion").hide(); $("#lblQuestion").hide(); $("#Div3").hide(); $('#Pregnantmotherenrolled').prop("checked", false); if ($('#DdlPRole').val().trim() != "" && $('#DdlPRole').val() == 2) { customAlert("Please select valid parent/guardian. "); } } function RemoveQuestionOther() { $('#Pquestionyes').prop('checked', false); $('#Pquestionno').prop('checked', false); $("#addquestion").hide(); $("#DdlQuestion").hide(); $("#lblQuestion").hide(); $("#Pregnantmotherprogram").hide(); $('#Pregnantmotherenrolled').prop("checked", false); $("#Div3").hide(); if ($('#DdlPRole').val().trim() !== "" && ($('#DdlPRole').val() == 2 || $('#DdlPRole').val() == 1)) { customAlert("Please select valid parent/guardian. "); } if ($('#DdlPRole').val().trim() == 1) { customAlert("Please select valid parent/guardian. "); } } function AddQuestion1() { $('#Pquestionyes1').prop('checked', false); $('#Pquestionno1').prop('checked', false); $('#PregnantmotherenrolledP1').prop("checked", false); $("#Pregnantmotherprogram1").hide(); $("#Divp3").hide(); $('#addrow1').hide(); $("#addquestion1").show(); $("#DdlQuestion1").show(); $("#lblQuestion1").show(); if ($('#DdlP1Role').val() !== "" && $('#DdlP1Role').val() == 1) { customAlert("Please select valid parent/guardian. "); } } function RemoveQuestion1() { $('#Pquestionyes1').prop('checked', false); $('#Pquestionno1').prop('checked', false); $('#PregnantmotherenrolledP1').prop("checked", false); $("#Pregnantmotherprogram1").hide(); $("#Divp3").hide(); $('#addrow1').hide(); $("#addquestion1").hide(); $("#DdlQuestion1").hide(); $("#lblQuestion1").hide(); if ($('#DdlP1Role').val().trim() != "" && $('#DdlP1Role').val() == 2) { customAlert("Please select valid parent/guardian. "); } } function RemoveQuestionOther1() { $('#Pquestionyes1').prop('checked', false); $('#Pquestionno1').prop('checked', false); $('#PregnantmotherenrolledP1').prop("checked", false); $("#Pregnantmotherprogram1").hide(); $("#Divp3").hide(); $("#addquestion1").hide(); $("#DdlQuestion1").hide(); $("#lblQuestion1").hide(); if ($('#DdlP1Role').val().trim() !== "" && ($('#DdlP1Role').val() == 2 || $('#DdlP1Role').val() == 1)) { customAlert("Please select valid parent/guardian. "); } if ($('#DdlP1Role').val().trim() == 1) { customAlert("Please select valid parent/guardian. "); } } function getPhoneListParent1() { $.ajax({ url: HostedDir + "/Nurse/listParentPhoneDetails1", type: "POST", dataType: "json", data: { ParentID: $('#ParentID').val(), HouseHoldId: $('#HouseholdId').val() }, secureuri: false, async: false, success: function (data) { getPhoneData(data); } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } function getPhoneListParent2() { $.ajax({ url: HostedDir + "/Nurse/listParentPhoneDetails2", type: "POST", dataType: "json", data: { ParentID: $('#ParentID1').val(), HouseHoldId: $('#HouseholdId').val() }, secureuri: false, async: false, success: function (data) { getPhoneData1(data); } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } function getPhoneData(dataPhone) { listPhone = dataPhone; } function getPhoneData1(dataPhone) { listPhone = dataPhone; } function drawParent1phonelist() { getPhoneListParent1(); bindGridPhone(listPhone, $("#gridphone").find('tr')[0].cells.length); } function drawParent2phonelist() { getPhoneListParent2(); bindGridPhone1(listPhone, $("#gridphone1").find('tr')[0].cells.length); } function bindGridPhone(dataPhoneDetail, num_cols) { rounds = 0; if (dataPhoneDetail.listPhone.length == 0) { $('#divP1').show(); } else { $('#divP1').hide(); var tbody = $('#gridphone > tbody'); $('#gridphone > tbody > tr').remove(); for (var i = 0; i < dataPhoneDetail.listPhone.length; i++) { var PhoneTypeP = "ParentPhone1[" + rounds + "].PhoneTypeP"; var phonenoP = "ParentPhone1[" + rounds + "].phonenoP"; var StateP = "ParentPhone1[" + rounds + "].StateP"; var notesP = "ParentPhone1[" + rounds + "].notesP"; var SmsP = "ParentPhone1[" + rounds + "].SmsP"; var Phoneid = "ParentPhone1[" + rounds + "].PPhoneId"; $('#gridphone').show(); var tr = ""; tr += "<tr><style='text-align:center;'>"; if (dataPhoneDetail.listPhone[i].PhoneTypeP == "1") { tr = tr + '<td><select class="form-control" style="width:100%;" disabled="disabled" name=' + PhoneTypeP + ' onchange="addcontact(this);" >' + ' <option selected="selected" value="1">Home</option><option value="2">Mobile</option><option value="3">Work</option> ' + '</select></td>'; tr = tr + '<td><input name=' + phonenoP + ' class = "form-control" type="text" disabled="disabled" value="' + dataPhoneDetail.listPhone[i].phonenoP + '" ></td>'; if (dataPhoneDetail.listPhone[i].StateP) { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParentother(this);" name=' + StateP + ' type="checkbox" data-val="true" checked=checked /></td>'; } else { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParentother(this);" name=' + StateP + ' type="checkbox" data-val="true" /></td>'; } tr = tr + '<td ><input data-val="true" disabled="disabled" class = "form-control" maxlength="100" type="text" name=' + notesP + ' value="' + dataPhoneDetail.listPhone[i].notesP + '"></td>'; tr = tr + '<td><input style="width:50%;" disabled="disabled" type="checkbox" name=' + SmsP + ' value="true"/></td>'; } if (dataPhoneDetail.listPhone[i].PhoneTypeP == "2") { tr = tr + '<td><select class="form-control" disabled="disabled" style="width:100%;" name=' + PhoneTypeP + ' onchange="addcontact(this);" >' + ' <option value="1">Home</option><option selected="selected" value="2">Mobile</option><option value="3">Work</option> ' + '</select></td>'; tr = tr + '<td><input name=' + phonenoP + ' disabled="disabled" class = "form-control" type="text" value="' + dataPhoneDetail.listPhone[i].phonenoP + '" ></td>'; if (dataPhoneDetail.listPhone[i].StateP) { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParentother(this);" name=' + StateP + ' type="checkbox" data-val="true" checked=checked /></td>'; } else { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParentother(this);" name=' + StateP + ' type="checkbox" data-val="true" /></td>'; } tr = tr + '<td ><input data-val="true" disabled="disabled" class = "form-control" maxlength="100" type="text" name=' + notesP + ' value="' + dataPhoneDetail.listPhone[i].notesP + '"></td>'; if (dataPhoneDetail.listPhone[i].SmsP) { tr = tr + '<td><input style="width:50%;" disabled="disabled" type="checkbox" checked=checked name=' + SmsP + ' value="true"/></td>'; } else { tr = tr + '<td><input style="width:50%;" disabled="disabled" type="checkbox" name=' + SmsP + ' value="true"/></td>'; } } if (dataPhoneDetail.listPhone[i].PhoneTypeP == "3") { tr = tr + '<td><select class="form-control" disabled="disabled" style="width:100%;" name=' + PhoneTypeP + ' onchange="addcontact(this);" >' + ' <option value="1">Home</option><option value="2">Mobile</option><option selected="selected" value="3">Work</option> ' + '</select></td>'; tr = tr + '<td><input name=' + phonenoP + ' disabled="disabled" class = "form-control" type="text" value="' + dataPhoneDetail.listPhone[i].phonenoP + '" ></td>'; if (dataPhoneDetail.listPhone[i].StateP) { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParentother(this);" name=' + StateP + ' type="checkbox" data-val="true" checked=checked /></td>'; } else { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParentother(this);" name=' + StateP + ' type="checkbox" data-val="true" /></td>'; } tr = tr + '<td ><input data-val="true" disabled="disabled" class = "form-control" maxlength="100" type="text" name=' + notesP + ' value="' + dataPhoneDetail.listPhone[i].notesP + '"></td>'; tr = tr + '<td><input style="width:50%;" disabled="disabled" type="checkbox" name=' + SmsP + ' value="true"/></td>'; } tr = tr + '<td><input type="hidden" name="' + Phoneid + '" value="' + dataPhoneDetail.listPhone[i].PPhoneId + '" /><a href="javascript:void(0)" onclick="RemovePhone(this);" accesskey="' + dataPhoneDetail.listPhone[i].PPhoneId + '" style=" text-decoration:underline;">Delete</a></td></tr>'; $('#gridphone > tbody').append(tr); $('#gridphone > tbody tr').each(function () { var y = $(this).find('td:eq(1) :input[type="text"]').mask("(999) 999-9999"); }); rounds = rounds + 1; } } } function bindGridPhone1(dataPhoneDetail, num_cols) { round1 = 0; if (dataPhoneDetail.listPhone.length > 0) { $('#gridphone1 > tbody > tr').remove(); var tbody = $('#gridphone1 > tbody'); for (var i = 0; i < dataPhoneDetail.listPhone.length; i++) { var PhoneTypeP = "ParentPhoneNos1[" + round1 + "].PhoneTypeP1"; var phonenoP = "ParentPhoneNos1[" + round1 + "].phonenoP1"; var StateP = "ParentPhoneNos1[" + round1 + "].StateP1"; var notesP = "ParentPhoneNos1[" + round1 + "].notesP1"; var SmsP = "ParentPhoneNos1[" + round1 + "].SmsP1"; var Phoneid = "ParentPhoneNos1[" + round1 + "].PPhoneId1"; var tr = ""; tr += "<tr><style='text-align:center;'>"; if (dataPhoneDetail.listPhone[i].PhoneTypeP == "1") { tr = tr + '<td><select class="form-control" disabled="disabled" style="width:100%;" name=' + PhoneTypeP + ' onchange="addcontact(this);" >' + ' <option selected="selected" value="1">Home</option><option value="2">Mobile</option><option value="3">Work</option> ' + '</select></td>'; tr = tr + '<td><input name=' + phonenoP + ' disabled="disabled" class = "form-control" type="text" value="' + dataPhoneDetail.listPhone[i].phonenoP + '" ></td>'; if (dataPhoneDetail.listPhone[i].StateP) { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParent1other(this);" name=' + StateP + ' type="checkbox" data-val="true" checked=checked /></td>'; } else { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParent1other(this);" name=' + StateP + ' type="checkbox" data-val="true" /></td>'; } tr = tr + '<td ><input data-val="true" disabled="disabled" class = "form-control" maxlength="100" type="text" name=' + notesP + ' value="' + dataPhoneDetail.listPhone[i].notesP + '"></td>'; tr = tr + '<td><input style="width:50%;" disabled="disabled" type="checkbox" name=' + SmsP + ' value="true"/></td>'; } if (dataPhoneDetail.listPhone[i].PhoneTypeP == "2") { tr = tr + '<td><select class="form-control" disabled="disabled" style="width:100%;" name=' + PhoneTypeP + ' onchange="addcontact(this);" >' + ' <option value="1">Home</option><option selected="selected" value="2">Mobile</option><option value="3">Work</option> ' + '</select></td>'; tr = tr + '<td><input name=' + phonenoP + ' disabled="disabled" class = "form-control" type="text" value="' + dataPhoneDetail.listPhone[i].phonenoP + '" ></td>'; if (dataPhoneDetail.listPhone[i].StateP) { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParent1other(this);" name=' + StateP + ' type="checkbox" data-val="true" checked=checked /></td>'; } else { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParent1other(this);" name=' + StateP + ' type="checkbox" data-val="true" /></td>'; } tr = tr + '<td ><input data-val="true" disabled="disabled" class = "form-control" maxlength="100" type="text" name=' + notesP + ' value="' + dataPhoneDetail.listPhone[i].notesP + '"></td>'; if (dataPhoneDetail.listPhone[i].SmsP) { tr = tr + '<td><input style="width:50%;" disabled="disabled" type="checkbox" checked=checked name=' + SmsP + ' value="true"/></td>'; } else { tr = tr + '<td><input style="width:50%;" disabled="disabled" type="checkbox" name=' + SmsP + ' value="true"/></td>'; } } if (dataPhoneDetail.listPhone[i].PhoneTypeP == "3") { tr = tr + '<td><select class="form-control" disabled="disabled" style="width:100%;" name=' + PhoneTypeP + ' onchange="addcontact(this);" >' + ' <option value="1">Home</option><option value="2">Mobile</option><option selected="selected" value="3">Work</option> ' + '</select></td>'; tr = tr + '<td><input name=' + phonenoP + ' disabled="disabled" class = "form-control" type="text" value="' + dataPhoneDetail.listPhone[i].phonenoP + '" ></td>'; if (dataPhoneDetail.listPhone[i].StateP) { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParent1other(this);" name=' + StateP + ' type="checkbox" data-val="true" checked=checked /></td>'; } else { tr = tr + '<td><input value="true" disabled="disabled" onchange="uncheckParent1other(this);" name=' + StateP + ' type="checkbox" data-val="true" /></td>'; } tr = tr + '<td ><input data-val="true" disabled="disabled" class = "form-control" maxlength="100" type="text" name=' + notesP + ' value="' + dataPhoneDetail.listPhone[i].notesP + '"></td>'; tr = tr + '<td><input style="width:50%;" disabled="disabled" disabled="disabled" type="checkbox" name=' + SmsP + ' value="true"/></td>'; } tr = tr + '<td><input type="hidden" disabled="disabled" name="' + Phoneid + '" value="' + dataPhoneDetail.listPhone[i].PPhoneId + '" /><a href="javascript:void(0)" onclick="RemovePhone1(this);" accesskey="' + dataPhoneDetail.listPhone[i].PPhoneId + '" style=" text-decoration:underline;">Delete</a></td></tr>'; $('#gridphone1 > tbody').append(tr); $('#gridphone1 > tbody tr').each(function () { var y = $(this).find('td:eq(1) :input[type="text"]').mask("(999) 999-9999"); }); round1 = round1 + 1; } } } //Added by Akansha on 19Dec2016 function ShowEhsChildVitaminSupplmentcomment() { $('#divEhsVitaminPopup').show(); } function HideEhsChildVitaminSupplmentcomment() { $('#divEhsVitaminPopup').hide(); // $('#Cvstext').val(""); $('#EhsCvstext').html(''); $('#ChildVitaminSupplementlist input:checked').each(function () { $(this).prop("checked", false); }); } //End function deleteParent(value) { if ($('#ParentID').val() != "0" && $('#ParentID1').val() != "0") { if ($(value).attr("accesskey") == "Parent1") { BootstrapDialog.confirm('Do you want to delete this parent/guardian ?', function (result) { if (result) { $.ajax({ url: HostedDir + "/Agencyuser/Deleteparent1", type: "POST", data: { parentid: $('#ParentID').val(), HouseHoldId: $('#HouseholdId').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { window.location.href = HostedDir + "/Agencyuser/FamilyDetails/" + $('#HouseholdId').val(); } if (response == 2) { customAlert("Parent/Guardian already successfully. "); window.location.href = HostedDir + "/Agencyuser/FamilyDetails/" + $('#HouseholdId').val(); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } }); } if ($(value).attr("accesskey") == "Parent2") { BootstrapDialog.confirm('Do you want to delete this parent/guardian ?', function (result) { if (result) { $.ajax({ url: HostedDir + "/Agencyuser/Deleteparent1", type: "POST", data: { parentid: $('#ParentID1').val(), HouseHoldId: $('#HouseholdId').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { window.location.href = HostedDir + "/Agencyuser/FamilyDetails/" + $('#HouseholdId').val(); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } }); } } } function emptyParent1() { $('#Pfirstname')[0].value = ""; $('#Plastname')[0].value = ""; $('#Pmidddlename')[0].value = ""; $('#Pemailid')[0].value = ""; $('#PDOB').val(""); } function deleteParent2(value) { BootstrapDialog.confirm('Do you want to delete parent 2 ?', function (result) { if (result) { $.ajax({ url: HostedDir + "/Agencyuser/Deleteparent2", type: "POST", data: { // childid: $(value).attr("accesskey"), HouseHoldId: $('#HouseholdId').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { customAlert("Parent 1 deleted successfully. "); emptyParent2(); //$(value).closest('tr').remove(); //if ($('#gridViewAgency > tbody tr').length == 0) // $('#div1').show(); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } }); } function emptyParent2() { $('#P1firstname')[0].value = ""; $('#P1lastname')[0].value = ""; $('#P1midddlename')[0].value = ""; $('#P1emailid')[0].value = ""; $('#P1DOB').val(""); } function uncheckParentother(value) { $('#gridphone > tbody tr').each(function () { $(this).find('td:eq(2) :checkbox').prop("checked", false); }); $(value).prop("checked", true); } function uncheckParent1other(value) { $('#gridphone1 > tbody tr').each(function () { $(this).find('td:eq(2) :checkbox').prop("checked", false); }); $(value).prop("checked", true); } function AddDoctor() { if ($('#Medicalhome').val() == 3) { $('#addrowC1').show(); $('#CDoctor').val(''); } else if ($('#Medicalhome').val() == 4) { $('#addrowC1').show(); $('#CDoctor').val(''); } else if ($('#Medicalhome').val() == 2) { $('#addrowC1').show(); $('#CDoctor').val(''); } else { $('#addrowC1').hide(); $('#Doctor').val(0); } } function AddDoctorP1() { if ($('#MedicalhomePreg1').val() == 2 || $('#MedicalhomePreg1').val() == 3 || $('#MedicalhomePreg1').val() == 4) { $('#addp1').show(); } else { $('#addp1').hide(); } } function AddDoctorP2() { if ($('#MedicalhomePreg2').val() == 2 || $('#MedicalhomePreg2').val() == 3 || $('#MedicalhomePreg2').val() == 4) { $('#addp2').show(); } else { $('#addp2').hide(); } } function AddDentist() { if ($('#CDentalhome').val() == 3) { $('#addrowDentist').show(); } else if ($('#CDentalhome').val() == 4) { $('#addrowDentist').show(); } else if ($('#CDentalhome').val() == 2) { $('#addrowDentist').show(); } else { $('#addrowDentist').hide(); $('#Dentist').val(0); } } function uncheckdata() { if ($('#None').prop("checked")) { $('#TANF').prop("checked", false); $('#SSI').prop("checked", false); $('#WIC').prop("checked", false); $('#SNAP').prop("checked", false); // $('#OGendermale').prop("checked", false); } } function uncheckdataNone() { if (($('#TANF').prop("checked")) || ($('#SSI').prop("checked")) || ($('#WIC').prop("checked")) || ($('#SNAP').prop("checked"))) { $('#None').prop("checked", false); // $('#OGendermale').prop("checked", false); } } function checkZipCode(inputTextObject) { if ($(inputTextObject).val() != "") { var ret = true; var Zipcode = $(inputTextObject).val(); var len = Zipcode.length; if ((isNaN(inputTextObject.value)) && (len < 5)) { $(inputTextObject).val(''); customAlert("Zip code must be numeric. "); var ret = false; } else if (len < 5) { $(inputTextObject).val(''); customAlert("Zip code length must be 5 digit. "); var ret = false; } else if (isNaN(inputTextObject.value)) { $(inputTextObject).val(''); customAlert("Zip code must be numeric. "); var ret = false; } return ret; } } function CheckAddress() { $.ajax({ url: HostedDir + "/Agencyuser/Checkaddress", type: "POST", data: { Address: $('#Street').val(), HouseHoldId: $('#HouseholdId').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { customAlert("Address already exists. "); $('#Street').val(""); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } function clearuploader() { $('#FiledobRAvatar').val(""); } function Showotherlanguage() { $('#OtherLanguageDetail').val(""); if ($('#PrimaryLanguauge').val() == 12) $('#div2').show(); else $('#div2').hide(); } function CheckPregenancy() { if ('@Model.ExistPmprogram' > 0) { $('#Pregnantmotherprogram').show(); } } function CheckPregenancy1() { if ('@Model.ExistPmprogram' > 0) { $('#Pregnantmotherprogram1').show(); } } function HidePregenancy() { $("#Div3").hide(); $('#Pregnantmotherprogram').hide(); $('#Pregnantmotherenrolled').prop("checked", false); } function HidePregenancy1() { $("#Divp3").hide(); $('#Pregnantmotherprogram1').hide(); $('#PregnantmotherenrolledP1').prop("checked", false); } function ShowdivParentotherrelationship() { $('#ParentRelatioshipOther').val(''); if ($('#ParentRelatioship').val() == 6) $('#divParentrelatioship').show(); else $('#divParentrelatioship').hide(); } function Pregnantmotherenrolled1() { if ('@Model.ExistPmprogram' > 0) { if ($('#Pregnantmotherenrolled').prop("checked")) { $("#Div3").show(); } else { BootstrapDialog.confirm('All qualifier data for this guardian will be lost. Do you want to continue?', function (result) { if (result) { $.ajax({ url: HostedDir + "/Agencyuser/Deletepmmother", type: "POST", data: { ParentId: $('#ParentID').val(), HouseHoldId: $('#HouseholdId').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { customAlert("Record deleted successfully. "); $('#Pregnantmotherprimaryinsurance').val(''); $('#Pregnantmotherprimaryinsurancenotes').val(''); $('#TrimesterEnrolled').val(''); $('#MedicalhomePreg1').val(''); $('#CDoctorP1').val(''); $('#P1Doctor').val(0); window.location.href = HostedDir + "/AgencyUser/FamilyDetails?Id=" + $('#HouseholdId').val(); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); $("#Div3").hide(); } else { $('#Pregnantmotherenrolled').prop("checked", true); } }); } } } function Pregnantmotherenrolled2() { if ('@Model.ExistPmprogram' > 0) { if ($('#PregnantmotherenrolledP1').prop("checked")) { $("#Divp3").show(); } else { BootstrapDialog.confirm('All qualifier data for this guardian will be lost. Do you want to continue?', function (result) { if (result) { $.ajax({ url: HostedDir + "/Agencyuser/Deletepmmother", type: "POST", data: { ParentId: $('#ParentID1').val(), HouseHoldId: $('#HouseholdId').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { customAlert("Record deleted successfully. "); $('#Pregnantmotherprimaryinsurance1').val(''); $('#Pregnantmotherprimaryinsurancenotes1').val(''); $('#TrimesterEnrolled1').val(''); $('#MedicalhomePreg2').val(''); $('#CDoctorP2').val(''); $('#P2Doctor').val(0); window.location.href = HostedDir + "/AgencyUser/FamilyDetails?Id=" + $('#HouseholdId').val(); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); $("#Divp3").hide(); } else { $('#PregnantmotherenrolledP1').prop("checked", true); } }); } } } function Custodychange1() { $('#Dualcustody').hide(); } function Custodychange() { $('#Dualcustody').show(); $('#Parentcity').val(''); //if ($('#Cfirstname')[0].value.trim() == "") { // isValid = false; // customAlert("First name is required."); // plainValidation('#Cfirstname'); // $(val).prop("checked", false); // return isValid; //} //else { //BootstrapDialog.confirm('Do you want search child in associated family?', function (result) { // if (result) { // $.ajax({ // url: HostedDir + "/Agencyuser/Getassociatefamily", // type: "POST", // data: { // childname: $('#CRace').val() // }, // dataType: "json", // secureuri: false, // async: false, // success: function (response) { // if (response.length > 0) { // var option = ""; // for (var i = 0; i < response.length; i++) { // option = option + '<option value="' + response[i].RaceSubCategoryID + '">' + response[i].Name + '</option>'; // } // $('#CRaceSubCategory').find('option').remove().end().append(option); // $('#CRaceSubCategory').val(''); // } // else { // $('#CRaceSubCategory').find('option').remove(); // } // } // , error: function (response) { // customAlert("Error occured please try again later. "); // } // }); // } //}); } function Searchparent() { isValid = true; if ($('#Parentfirstname')[0].value.trim() == "") { isValid = false; customAlert("First name is required."); plainValidation('#Parentfirstname'); return isValid; } if ($('#ParentLastname')[0].value.trim() == "") { isValid = false; customAlert("Last name is required."); plainValidation('#ParentLastname'); return isValid; } if ($('#ParentStrretaddress')[0].value.trim() == "") { isValid = false; customAlert("Address is required."); plainValidation('#ParentStrretaddress'); return isValid; } if ($('#Parentzipcode')[0].value.trim() == "") { isValid = false; customAlert("Zip code is required."); plainValidation('#Parentzipcode'); return isValid; } if ($('#Parentcity')[0].value.trim() == "") { isValid = false; customAlert("City is required."); plainValidation('#Parentcity'); return isValid; } if ($('#Parentstate')[0].value.trim() == "") { isValid = false; customAlert("State is required."); plainValidation('#Parentstate'); return isValid; } cleanValidation(); $.ajax({ url: HostedDir + "/Agencyuser/Getassociatefamily", type: "POST", data: { Firstname: $('#Parentfirstname').val(), Lastname: $('#ParentLastname').val(), Address: $('#ParentStrretaddress').val(), ZipCode: $('#Parentzipcode').val(), City: $('#Parentcity').val(), State: $('#Parentstate').val(), mode: 0 }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { $('#Dualcustodyparent').text(ucwords($('#ParentLastname').val()) + ' Household'); $('#Dualcustodyparent1').text(ucwords($('#ParentLastname').val()) + ' Household'); } if (response == 0) { $('#Dualcustodyparent').text(''); $('#Dualcustodyparent').text(''); BootstrapDialog.confirm('No record found. Do you want to add new record?', function (result) { if (result) { addparentindualtable(); } }); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } function ucwords(str) { return (str + '').replace(/^([a-z])|\s+([a-z])/g, function ($1) { return $1.toUpperCase(); }); } function addparentindualtable() { $.ajax({ url: HostedDir + "/Agencyuser/Getassociatefamily", type: "POST", data: { Firstname: $('#Parentfirstname').val(), Lastname: $('#ParentLastname').val(), Address: $('#ParentStrretaddress').val(), ZipCode: $('#Parentzipcode').val(), City: $('#Parentcity').val(), State: $('#Parentstate').val(), mode: 1 }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response == 1) { customAlert("Record added successfully. "); } if (response == 2) { customAlert("Address already exist. "); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } function SaveNotes() { if ($('#Applicationidnotes').val().trim() == "") { isValid = false; plainValidation('#Applicationidnotes'); return isValid; } else { $.ajax({ //url: HostedDir + "/Agencyuser/SaveNotes", url: HostedDir + "/Nurse/SaveNotes", type: "POST", data: { HouseHoldId: $('#HouseholdId').val(), Notes: $('#Applicationidnotes').val(), mode: 0 }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response.result == 1) { customAlert("Record added successfully. "); $('#Applicationidnotes').val(''); bindnotes(response.noteslist); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } } function getNotes() { $.ajax({ url: HostedDir + "/Nurse/SaveNotes", type: "POST", data: { HouseHoldId: $('#HouseholdId').val(), mode: 1 }, dataType: "json", secureuri: false, async: false, success: function (response) { bindnotes(response.noteslist); } , error: function (response) { //customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); customAlert('@ViewBag.message'); } }); } function bindnotes(data) { $('#gridViewfilenotes > tbody > tr').remove(); if (data.length == 0) { $('#divnotes').show(); } else { $('#divnotes').hide(); var tbody = $('#gridViewfilenotes > tbody'); for (var i = 0; i < data.length; i++) { var tr = ""; tr += "<tr><style='text-align:center;'>"; tr += "<td '>" + ((typeof (data[i].notes) != 'undefined') && (data[i].notes != null) ? data[i].notes : '') + "</td>"; tr += "<td '>" + ((typeof (data[i].Name) != 'undefined') && (data[i].Name != null) ? data[i].Name : '') + "</td>"; tr += "<td '>" + ((typeof (data[i].CreatedOn) != 'undefined') && (data[i].CreatedOn != null) ? data[i].CreatedOn : '') + "</td>"; tr += "</tr>"; $('#gridViewfilenotes > tbody').append(tr); } } } function bindsubcategory() { if ($('#CRace').val() == '1e5304d3-6182-483a-8b27-5269a2dd9936') $('#divRaceother').show(); else $('#divRaceother').hide(); $.ajax({ url: HostedDir + "/Agencyuser/getsubcategory", type: "POST", data: { Raceid: $('#CRace').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response.length > 0) { var option = ""; for (var i = 0; i < response.length; i++) { option = option + '<option value="' + response[i].RaceSubCategoryID + '">' + response[i].Name + '</option>'; } $('#CRaceSubCategory').find('option').remove().end().append(option); $('#CRaceSubCategory').val(''); } else { $('#CRaceSubCategory').find('option').remove(); } } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } function CalculatePercentage(el) { var ex = /^(100([\.][0]{1,})?$|[0-9]{1,2}([\.][0-9]{1,})?)$/; if (ex.test(el.value) == false) { el.value = ""; $('#Amountqca1').val(''); $('#Childincome').val($('#Amountqca2').val()); } else { if ($('#C1').val().trim() != "" && $('#percage1').val().trim() != "") { $('#Amountqca1').val(Math.round((Math.round($('#C1').val()) * parseFloat($('#percage1').val())) / 100)); if ($('#Amountqca1').val().trim() != "" && $('#Amountqca2').length > 0 && $('#Amountqca2').val().trim() != "") { $('#Childincome').val(parseInt($('#Amountqca1').val()) + parseInt($('#Amountqca2').val())); } else if ($('#Amountqca1').val().trim() != "") { $('#Childincome').val($('#Amountqca1').val()); } else if ($('#Amountqca2').length > 0 && $('#Amountqca2').val().trim() != "") { $('#Childincome').val($('#Amountqca2').val()); } else if ($('#Amountqca1').val().trim() == "" && $('#Amountqca2').val().trim() == "") { $('#Childincome').val(''); } } } if ($('#Childincome').val() != "") CalculatePoverty(); } function CalculatePercentage1(el) { var ex = /^(100([\.][0]{1,})?$|[0-9]{1,2}([\.][0-9]{1,})?)$/; if (ex.test(el.value) == false) { el.value = ""; $('#Amountqca2').val(''); $('#Childincome').val($('#Amountqca1').val()); } else { if ($('#Cp1').val().trim() != "" && $('#percage2').val().trim() != "") { $('#Amountqca2').val(Math.round((Math.round($('#Cp1').val()) * parseFloat($('#percage2').val())) / 100)); if ($('#Amountqca1').length > 0 && $('#Amountqca1').val().trim() != "" && $('#Amountqca2').val().trim() != "") { $('#Childincome').val(parseInt($('#Amountqca1').val()) + parseInt($('#Amountqca2').val())); } else if ($('#Amountqca2').val().trim() != "") { $('#Childincome').val($('#Amountqca2').val()); } else if ($('#Amountqca1').length > 0 && $('#Amountqca1').val().trim() != "") { $('#Childincome').val($('#Amountqca1').val()); } else if ($('#Amountqca1').length > 0 && $('#Amountqca1').val().trim() == "" && $('#Amountqca2').val().trim() == "") { $('#Childincome').val(''); } } } if ($('#Childincome').val() != "") CalculatePoverty(); } var value = null; function CalculatePoverty() { if ($('#Childincome').val().trim() != "") { $.ajax({ url: HostedDir + "/Agencyuser/GetPovertyCalculation", type: "POST", data: { HouseHoldId: $('#HouseholdId').val(), PovertyPercentage: $('#Childincome').val(), Totalhousehold: $('#Peopleinhousehold').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { $('#PovertyPercentage').val(response); } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } else { customAlert("Child income is required."); plainValidation('#Childincome'); } } function Showpoverty() { if ($('#PovertyPercentage').val().trim() != "") { $.ajax({ url: HostedDir + "/Agencyuser/SavePovertyCalculation", type: "POST", data: { HouseHoldId: $('#HouseholdId').val(), clientid: $(value).attr("accesskey"), Parentid1: $('#ParentID').val(), Parentid2: $('#ParentID1').val(), Percentage1: $('#percage1').val(), Percentage2: $('#percage2').val(), Amount1: $('#Amountqca1').val(), Amount2: $('#Amountqca2').val(), ChildIncome: $('#Childincome').val(), PovertyPercentage: $('#PovertyPercentage').val(), mode: 0 }, dataType: "json", secureuri: false, async: false, success: function (response) { if (response.result == 1) customAlert("Record added successfully."); if (response.result == 2) customAlert("Record updated successfully."); } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); if (value != null) { $(value).html($('#PovertyPercentage').val() + ' % <i class="fa fa-arrow-up"></i>'); if ($('#PovertyPercentage').val().trim() != "" && parseInt($('#PovertyPercentage').val()) > 100) { $(value).css("color", "orange"); } else { $(value).css("color", "#337ab7"); } } $('#PovertyPercentage').val(''); $('#MyQualifier').modal('toggle'); } else { customAlert("Poverty Percentage is required."); plainValidation('#PovertyPercentage'); } } function SetPoverty(item) { value = item; $.ajax({ url: HostedDir + "/Agencyuser/SavePovertyCalculation", type: "POST", data: { HouseHoldId: $('#HouseholdId').val(), clientid: $(value).attr("accesskey"), Parentid1: $('#ParentID').val(), Parentid2: $('#ParentID1').val(), Percentage1: $('#percage1').val(), Percentage2: $('#percage2').val(), Amount1: $('#Amountqca1').val(), Amount2: $('#Amountqca2').val(), ChildIncome: $('#Childincome').val(), PovertyPercentage: $('#PovertyPercentage').val(), mode: 1 }, dataType: "json", secureuri: false, async: false, success: function (response) { //$('#percage1').val(100); $('#percage2').val(100); //if ($('#C1').val().trim() != "" && $('#percage1').val().trim() != "") { // $('#Amountqca1').val(Math.round((Math.round($('#C1').val()) * parseFloat($('#percage1').val())) / 100)); // if ($('#Amountqca1').val().trim() != "" && $('#Amountqca2').val().trim() != "") { // $('#Childincome').val(parseInt($('#Amountqca1').val()) + parseInt($('#Amountqca2').val())); // } // else if ($('#Amountqca1').val().trim() != "") { // $('#Childincome').val($('#Amountqca1').val()); // } // else if ($('#Amountqca2').val().trim() != "") { // $('#Childincome').val($('#Amountqca2').val()); // } // else if ($('#Amountqca1').val().trim() == "" && $('#Amountqca2').val().trim() == "") { // $('#Childincome').val(''); // } //} //if ($('#Cp1').val().trim() != "" && $('#percage2').val().trim() != "") { // $('#Amountqca2').val(Math.round((Math.round($('#Cp1').val()) * parseFloat($('#percage2').val())) / 100)); // if ($('#Amountqca1').val().trim() != "" && $('#Amountqca2').val().trim() != "") { // $('#Childincome').val(parseInt($('#Amountqca1').val()) + parseInt($('#Amountqca2').val())); // } // else if ($('#Amountqca2').val().trim() != "") { // $('#Childincome').val($('#Amountqca2').val()); // } // else if ($('#Amountqca1').val().trim() != "") { // $('#Childincome').val($('#Amountqca1').val()); // } // else if ($('#Amountqca1').val().trim() == "" && $('#Amountqca2').val().trim() == "") { // $('#Childincome').val(''); // } //} //rohit if (response.PovertyCalculation != null && response.PovertyCalculation.PovertyCalculated != null && response.PovertyCalculation.PovertyCalculated != null) { $('#percage1').val(response.PovertyCalculation.Percentage1); $('#percage2').val(response.PovertyCalculation.Percentage2); $('#Amountqca1').val(response.PovertyCalculation.Amount1); $('#Amountqca2').val(response.PovertyCalculation.Amount2); $('#PovertyPercentage').val(response.PovertyCalculation.PovertyCalculated); $('#Childincome').val(response.PovertyCalculation.ChildIncome); } $('#percage1').blur(); $('#percage2').blur(); if ($('#Childincome').val() != "") CalculatePoverty(); //if (value != null) { // $(value).html($('#PovertyPercentage').val() + ' % <i class="fa fa-arrow-up"></i>'); // if ($('#PovertyPercentage').val().trim() != "" && parseInt($('#PovertyPercentage').val()) > 100) { // $(value).css("color", "orange"); // } // else { // $(value).css("color", "#337ab7"); // } //} } , error: function (response) { customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } var selectionobject = null; function getselectionpoint(value) { selectionobject = value; $.ajax({ url: HostedDir + "/Agencyuser/getselectionpoints", type: "POST", data: { Programid: $(value).attr("accesskey"), clientid: $(value).attr("clientdid"), householdid: $('#HouseholdId').val() }, dataType: "json", secureuri: false, async: false, success: function (response) { bindselectiontablePoint(response, $(value).attr("clientype")); } , error: function (response) { // console.log(response); customAlert("Session Ended Log Onto The System Again.");setTimeout(function () {window.location.href= HostedDir + '/login/Loginagency'; }, 2000); } }); } function bindselectiontablePoint(Data, programid) { if (Data != null) { var tbody = ""; $('#selectionpoint > tbody > tr').remove(); if ($('#FamilyType').prop("checked") && Data._Selectionpoints.SingleParent != 0) { tbody = tbody + "<tr><td>Single Parent Family</td><td>" + Data._Selectionpoints.SingleParent + "</td></tr>"; } if ($('#FamilyType1').prop("checked") && Data._Selectionpoints.TwoParent != 0) { tbody = tbody + "<tr><td>Two Parent Family</td><td>" + Data._Selectionpoints.TwoParent + "</td></tr>"; } if ($('#HomeType1').prop("checked") && Data._Selectionpoints.HomelessYes != 0) { tbody = tbody + "<tr><td>Is family Homeless at this time: Yes</td><td>" + Data._Selectionpoints.HomelessYes + "</td></tr>"; } if ($('#HomeType2').prop("checked") && Data._Selectionpoints.HomelessNo != 0) { tbody = tbody + "<tr><td>Is family Homeless at this time: No</td><td>" + Data._Selectionpoints.HomelessNo + "</td></tr>"; } if ($('#TANF').prop("checked") && Data._Selectionpoints.TANF != 0) { tbody = tbody + "<tr><td>TANF</td><td>" + Data._Selectionpoints.TANF + "</td></tr>"; } if ($('#SSI').prop("checked") && Data._Selectionpoints.SSI != 0) { tbody = tbody + "<tr><td>SSI</td><td>" + Data._Selectionpoints.SSI + "</td></tr>"; } if ($('#SNAP').prop("checked") && Data._Selectionpoints.SNAP != 0) { tbody = tbody + "<tr><td>SNAP</td><td>" + Data._Selectionpoints.SNAP + "</td></tr>"; } if ($('#WIC').prop("checked") && Data._Selectionpoints.WIC != 0) { tbody = tbody + "<tr><td>WIC</td><td>" + Data._Selectionpoints.WIC + "</td></tr>"; } if ($('#NONE').prop("checked") && Data._Selectionpoints.NONE != 0) { tbody = tbody + "<tr><td>NONE</td><td>" + Data._Selectionpoints.NONE + "</td></tr>"; } if ($('#PrimaryLanguauge').val() == 1 && Data._Selectionpoints.English != 0) { tbody = tbody + "<tr><td>Primary Language Spoken: English</td><td>" + Data._Selectionpoints.English + "</td></tr>"; } if ($('#PrimaryLanguauge').val() == 12 && Data._Selectionpoints.Other != 0) { tbody = tbody + "<tr><td>Primary Language Spoken: Other</td><td>" + Data._Selectionpoints.Other + "</td></tr>"; } //Parent1 if ($('#PDOB').val() != "" && $('#PDOB').val() != "MM/DD/YYYY") { isValiddob = true; var age = null; var now = null; var past = null; var nowYear = null; var pastYear = null; now = new Date(); past = new Date($("#PDOB").val()); nowYear = now.getFullYear(); pastYear = past.getFullYear(); age = nowYear - pastYear; if (age < 18 && Data._Selectionpoints.Teenager != 0) { tbody = tbody + "<tr><td>Guardian1: Teenager</td><td>" + Data._Selectionpoints.Teenager + "</td></tr>"; } if (age > 20 && age < 30 && Data._Selectionpoints.Age20 != 0) { tbody = tbody + "<tr><td>Guardian1: Age 20 to 30</td><td>" + Data._Selectionpoints.Age20 + "</td></tr>"; } if (age > 30 && Data._Selectionpoints.Age30over != 0) { tbody = tbody + "<tr><td>Guardian1: Age above 30</td><td>" + Data._Selectionpoints.Age30over + "</td></tr>"; } } if ($('#PMilitaryStatus1').prop("checked") && Data._Selectionpoints.MilitaryStatusNone != 0) { tbody = tbody + "<tr><td>Guardian1 Military Status: None</td><td>" + Data._Selectionpoints.MilitaryStatusNone + "</td></tr>"; } if ($('#PMilitaryStatus2').prop("checked") && Data._Selectionpoints.MilitaryStatusActive != 0) { tbody = tbody + "<tr><td>Guardian1 Military Status: Active</td><td>" + Data._Selectionpoints.MilitaryStatusActive + "</td></tr>"; } if ($('#PMilitaryStatus3').prop("checked") && Data._Selectionpoints.MilitaryStatusVeteran != 0) { tbody = tbody + "<tr><td>Guardian1 Military Status: Veteran</td><td>" + Data._Selectionpoints.MilitaryStatusVeteran + "</td></tr>"; } if ($('#PCurrentlyWorking').prop("checked") && Data._Selectionpoints.CurrentlyWorkYes