USSceript

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 51

<!

DOCTYPE html>
<html lang="en-US" data-lang="en-US" crm-lang="en-US" dir="ltr"
crm-lcid="1033"
same-site-mode="None">
<head>

<meta charset="utf-8" /><meta name="viewport"


content="width=device-width,&#32;initial-scale=1.0" /><meta http-
equiv="X-UA-Compatible" content="IE=edge" />
<script type="text/javascript" >

</script>
<title>

Applicant Schedule OFC Appointment


&nbsp;· Customer Self-Service
</title>

<script src="/_resources/getresourcemanager?lang=en-
US"></script>

<script type="text/javascript">
// Refresh all powerBI Iframes on Login in one Iframe
window.addEventListener('message', function (event) {
if (event && event.data && event.data ==
'refreshPowerBI') {
$("iframe.powerbi").each(function () {
this.src = this.src;
});
}
});

// Fix for incorrect viewport width setting in IE 10 on


Windows Phone 8.
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle =
document.createElement("style");

msViewportStyle.appendChild(document.createTextNode("@-
ms-viewport{width:auto!important}"));
document.getElementsByTagName("head")
[0].appendChild(msViewportStyle);
}
</script>

<link href="/bootstrap.min.css?1697740083000"
rel="stylesheet" />

<link href="/dist/font-awesome.bundle-3d8a58a48f.css"
rel="stylesheet" />

<link href="/dist/preform.bundle-
739eaba11a.css" rel="stylesheet" />

<!--[if lt IE 9]>
<script
src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!--[if lt IE 10]>
<script src="~/js/formdata.js"></script>
<![endif]-->

<link href="/dialog.css?1697740083000"
rel="stylesheet" />
<link href="/gudea.css?1697740084000" rel="stylesheet" />
<link href="/fjallaOne.css?1697740084000" rel="stylesheet" />
<link href="/font-awesome-4.1.0.min.css?1697740084000"
rel="stylesheet" />
<link href="/atlas_validation.css?1697740083000" rel="stylesheet" />
<link href="/theme.css?1697740086000" rel="stylesheet" />
<link href="/main.css?1697740085000" rel="stylesheet" />
<link href="/uswds.min.css?1697740087000" rel="stylesheet" />
<link href="/jquery-ui.css?1697740084000" rel="stylesheet" />
<link href="/Atlas_Styles.css?1697740083000" rel="stylesheet" />
<link href="/dist/pwa-style.bundle-2739c60227.css"
rel="stylesheet" />

</head>
<body data-sitemap-state="/ofc-schedule/:/"
data-dateformat="M/d/yyyy"
data-timeformat="h:mm tt"
data-datetimeformat="M/d/yyyy h:mm tt"
data-app-path="/"

data-ckeditor-basepath="/js/BaseHtmlContentDesigner/Libs/msdyncr
m_/libs/ckeditor/"
data-case-deflection-url="/_services/search/7b138792-1090-
45b6-9241-8f8d96d8c372">

<link href="/dist/pcf-style.bundle-0d8f841437.css"
rel="stylesheet" />

<div id="offlineNotificationBar" style="display: none;">


<img alt="web" id="web"
src="/css/images/web.png"></img>
<div id="message">You&#8217;re offline. This is a read
only version of the page.</div>
<div id="close"
onclick="this.parentElement.style.display='none';"><img alt="close"
src="/css/images/close.png"></img></div>
</div>

<script type="text/javascript">
window.DisableCkEditor = window.DisableCkEditor || {};
DisableCkEditor.Value = 'False';
</script>

<script type="text/javascript">
window["Microsoft"] = window["Microsoft"] || {};
window["Microsoft"].Dynamic365 = {
Portal: {

User: {
userName: '9470d5df-1ecf-49e7-a12a-
374ec1a11fd1',
contactId: '275622b0-512b-ee11-9965-
001dd803e5ed'
},

version: '9.5.8.10',
type: 'CustomerPortal',
id: '3961e737-f1e1-4028-9a1a-5ed2652d979a',
geo: 'USG',
tenant: '25395e5d-f99f-4228-ada2-
ef7c8663cec3',
correlationId: '035a700d-4aec-410a-b62b-
f960daa3563a',
isTelemetryEnabled: 'True',
InstrumentationSettings: {
instrumentationKey:
'4a07e143372c46aabf3841dc4f0ef795-a753031e-2005-4282-9451-
a086fea4234a-6942',
collectorEndpoint:
'https://tb.events.data.microsoft.com/OneCollector/1.0/'
},
timerProfileForBatching: 'NEAR_REAL_TIME'
}
}

// Mark request not cacheable if


Dynamics365PortalAnalytics cookie is being refreshed by the server
or if the cookie in request header is invalid

// For client side telemetry intializing


Dynamics365PortalAnalytics cookie object
window["Microsoft"].Dynamic365.Portal.dynamics365PortalAnalytic
s = 'YhRcFzNOYk7UilmIo0POmWdCCajB_ezxLcJhDvc-
Wwf1k6uEfIE1NGfdYQT_e3iTcG7PO_I4S-a0bDie89TP5XcdDxYXh-
SUr2iOUDQba6jZ60ihJRnGUHx4LFcuKMStn6NMsvp_N_WZsca6eueG
rA2';

</script>

<div style='display: none'>

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">
</div></div>

</div></div>

</div>

<script>
let returnUrl = "ReturnUrl";
if (window.location.search.indexOf(returnUrl) > -1) {
let pararms = window.location.search.split('&');

for (let i = 0; i < pararms.length; i++) {


if (pararms[i].indexOf(returnUrl)) {
let kvp = pararms[i].split('=');
window.location = decodeURIComponent(kvp[1]);
}
}
}
</script>

<style>
html {
display: none;
}

.usa-banner {
background-color: rgba(240, 240, 240, 1);
color: black;
}

.bannertext {
line-height: 1.127em;
font-weight: 400;
font-family: Roboto sans-serif;
padding-left: 10px;
padding-top: 3.5px;
}

.usa-navbar {
background-color: rgba(255, 255, 255, 1);
min-height: 150px;
display: flex;
flex-direction: column;
justify-content: center;
}

.text-primary-light {
font-size: 2.12em;
font-family: "Arial Black", Gadget, sans-serif;
font-style: normal;
font-weight: 700;
}

.text-primary {
font-size: 2.12em;
font-family: "Arial Black", Gadget, sans-serif;
font-style: normal;
font-weight: 700;
}

.nav-combo {
display: flex;
flex-direction: row;
justify-content: flex-start;
}

li {
border-radius: 3px;
list-style-type: none;
}

li a {
color: #1a4480;
text-decoration: none;
}

.dropdown-toggle {
display: flex;
flex-direction: row;
justify-content: center;
}

li a:hover, a:active {
text-decoration: none;
color: #1a4480;
font-weight: 700;
}

.row {
display: flex;
flex-direction: row;
justify-content: flex-start;
}

.caret {
position: relative;
top: 7px;
}

.clearlist {
list-style-type: none !important;
}
</style>

<div class="usa-banner" role="banner">


<div class="container">
<header class="usa-banner__header minh-0">
<div class="usa-banner__inner">
<div class="navbar-left hidden-xs">
<div class="container">
<div class="row">
<div class="col-md-9">
<div class="nav-combo">
<div class="usa-banner__header-
flag" alt="U.S. Flag">
<div class="xrm-editable-
html&#32;xrm-attribute" data-languageContext="English"><div
class="xrm-attribute-value"><p><img class="usa-banner__header-
text" src="/us_flag_small.png" style="width:16px;
height=11px;"></p></div></div>
</div>
<div class="bannertext">
<p>Official U.S. Department of
State Visa Appointment Service</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="banner-right">
<li class="dropdown clearlist"
role="none">
<a href="#" class="dropdown-
toggle" title="NITIN SAXENA" data-toggle="dropdown"
role="menuitem" aria-haspopup="true" aria-expanded="false">
<span class="username">
NITIN SAXENA (59111040) </span>
<span
class="caret"></span>
</a>
<ul class="dropdown-menu"
role="menu">

<li role="none"
class="clearlist">
<a role="menuitem"
aria-label="Profile" href="/en-US/profile/" title="Profile">Profile</a>
</li>

<li class="divider clearlist"


role="separator" aria-hidden="true"></li>
<li role="none"
class="clearlist">
<a role="menuitem"
aria-label="Sign out" href="/en-US/Account/Login/LogOff?returnUrl=
%2Fen-US%2Fofc-schedule%2F%3Femergency%3Dtrue" title="Sign
out">
Sign out
</a>
</li>
</ul>
</li>

</div>
</div>
</div>
</div>
</div>
</header>
</div>
</div>

<!-- add anti-forgery token-->


<div id="antiforgerytoken" data-url="/_layout/tokenhtml"></div>

<!-- Client Telemetry init if telemetry enabled-->


<script src="/dist/client-telemetry.bundle-4335d2f4b0.js"
type="text/javascript"></script>

<!-- Client Telemetry Wrapper init -->


<script src="/dist/client-telemetry-wrapper.bundle-
963910d4c3.js" type="text/javascript"></script>

<script>
window.clientLogWrapper = new ClientLogWrapper();
</script>
<script src="/dist/preform.moment_2_29_4.bundle-
79a29b80d8.js" type="text/javascript"></script>

<script src="/dist/pcf-dependency.bundle-805a1661b7.js"
type="text/javascript"></script>

<script src="/dist/pcf.bundle-001b8ad91d.js"
type="text/javascript"></script>

<script src="/dist/pcf-extended.bundle-
e303d53553.js" type="text/javascript"></script>

<div style='display: none'>


<div class="xrm-editable-html&#32;xrm-attribute"><div
class="xrm-attribute-value"><script
src="https://www.usvisascheduling.com/app_insights.js"></script>
<script>
appInsightsEvent("[email protected]","889e4033-fec9-
f204-8c1f-87f59b0f854e");
</script></div></div>

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">
</div></div>

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">
<!--Group Stages-->

<!--Group Types-->
<!--payment ref status-->

<!--Payment Types-->

<!--receipt status-->

<!--post type-->

<!--state code-->

<!--status code-->

<!--Application Status-->

<!-- Document Tracker Status -->


</div></div>

<div class="xrm-editable-html&#32;xrm-attribute"><div
class="xrm-attribute-value">
</div></div>

</div>

<div class="aspNetHidden">

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">
</div></div>

</div></div>

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">
<div class="xrm-editable-html&#32;xrm-attribute" data-
languageContext="English"><div class="xrm-attribute-value">
</div></div>

</div></div>

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">
<!--Group Stages-->
<!--Group Types-->

<!--payment ref status-->

<!--Payment Types-->

<!--receipt status-->

<!--post type-->

<!--state code-->

<!--status code-->

<!--Application Status-->
<!-- Document Tracker Status -->

</div></div>

</div>

<script>
/**
* used for non-OFC messaging to show warnings or errors
* @param approachingAppointmentLimitMessage
* @param appointmentLimitReachedMessage
*/
function
validateAppointmentLimit_SchedulePage(approachingAppointmentLi
mitMessage, appointmentLimitReachedMessage) {

showAppointmentLimitMessage(approachingAppointmentLimitMess
age);

/**
* used for OFC messaging to show warnings or errors
* @param approachingAppointmentLimitMessage
* @param appointmentLimitReachedMessage
*/
function
validateAppointmentLimit_AppointmentManagerPage(approachingAp
pointmentLimitMessage, appointmentLimitReachedMessage) {

showAppointmentLimitMessage(approachingAppointmentLimitMess
age);

/**
* creates the error row as raw html string
* @param appointmentLimitReachedMessage
*/
function
replaceHtmlWithMessage(appointmentLimitReachedMessage) {
//in JS, array Join is faster than other forms of string
concatonation
var html = [
'<div id="main_container" class="container-fluid">',
' <div class="row">',
' <div id="error_row" class="col-md-12">',
' <div class="alert alert-warning" style="padding:
5px; border-radius: 15px; text-align: center;">',
appointmentLimitReachedMessage,
' </div>',
' </div>',
'</div>'
].join('');

$('#main_container').parent().html(html);
}

/**
* creates the warning row as raw html string
* @param approachingAppointmentLimitMessage
*/
function
showAppointmentLimitMessage(approachingAppointmentLimitMess
age) {
var html = [
'<div id="appointment_limit_warning" class="alert alert-
warning" style="padding: 5px; border-radius: 15px; text-align:
center;">',
approachingAppointmentLimitMessage,
'</div>'
].join('');

$('#error_row').html(html).parent().show();
}

/**
* removes the cancel button
* */
function removeCancelFromAppointmentManager() {
var checkExist = setInterval(function () {
if ($('td[aria-label="action menu"]').length) {
clearInterval(checkExist);

$('td[aria-label="action menu"]').each(function () {
var menuItems = $(this).children();
if (1 <= menuItems.length) {
$(this).html('');
}

$('#cancel-all').parent().html('');
});
}
}, 100);
}
</script>

<!-- Query for primary Application here! -->


<script src="https://www.usvisascheduling.com/scripts.js"></script>

<style>
h1 {
color: white;
}

.round-shadow {
border-radius: 18px;
border-style: groove;
box-shadow: 5px 11px 47px black;
}

.btn-atlas-submit:hover,
.btn-atlas-submit:active {
background: #1A4480;
border-color: #1A4480;
color: #D9E0EA;
}
</style>

<style>
#entity-content > div > div {
border-radius: 18px;
border-style: groove;
box-shadow: 5px 11px 47px black;
}

h2 {
color: white;
font-size: 30px;
font-weight: bold;
line-height: 1.5;
}

.atlas_section {
border: 2px solid black;
border-radius: 10px;
overflow: hidden;
margin: 5px;
}

.atlas_section_header_row {
text-align: center;
background-color: #1a4480;
width: 100%;
}

.atlas_validationalert {
padding: 5px;
border-radius: 10px;
}
.redday {
background-color: red;
}

.greenday {
background-color: green;
}

.alert-warning {
padding: 5px;
border-radius: 15px;
text-align: center;
}

#calendar_header_row {
}

#class_select_container {
margin: 0 15px;
}

#group_header_row {
}

#jsdata {
width: inherit;
resize: none;
}

.margin-x25 {
margin-left: auto;
margin-right: auto;
}

.mt-3 {
margin-top: 1rem;
}

.py-0 {
padding-top: 0;
padding-bottom: 0;
}
.px-0 {
padding-left: 0;
padding-right: 0;
}

.warning {
padding: 5px;
border-radius: 15px;
text-align: center;
}

.d-none {
display: none;
}
</style>

<div class="apply-banner">
<section class="usa-hero bg-primary-dark" style="background-
image:none">
<div class="container">
<h1 id="pagetitle" class="font-serif-xl tablet:font-serif-
3xl">Applicant Schedule OFC Appointment:</h1>
<div class="usa-hero__body">

<style>
.breadcrumb {
background-color: #1a4480;
}
.activebreadcrumb {
color:white !important;
background-color: #1a4480;
font-weight: bold;
}
.link a{
color:white !important;
}
</style>

</br>
<ul class="breadcrumb" role="navigation" aria-label="breadcrumb">
<li class="link">
<a href="/" title="Visa Application Home">Visa Application
Home</a>
</li>
<li>
<a href="#" class="activebreadcrumb" aria-current="page"
title="Applicant Schedule OFC Appointment">Applicant Schedule
OFC Appointment</a>
</li>
</ul></div>
</div>
</section>
</div>
<br />
<main id="entity-content">
<div class="grid-container desktop:padding-x-1">
<div class="grid-container bg-white border border-base-
lighter padding-y-4 position-relative radius-sm shadow-2 round-
shadow">

<div id="main_container" class="container-fluid">


<div class="row d-none">
<div id="error_row" class="col-sm-12">
</div>
</div>
<div id="page_form">
<!-- Primary Controls -->
<div class="row">
<!-- Family -->
<div class="col-sm-4 atlas_section">
<!-- Title -->
<div class="row">
<div class="col-sm-12 px-0">
<div id="family_header_row"
class="atlas_section_header_row">
<h2>Group Members</h2>
</div>
</div>
</div>
<!-- Member Selection -->
<div class="row">
<div class="col-sm-12">
<ul id="gm_select" class="list-group">
<li>
<div class="alert alert-warning">
No Class Selected
</div>
</li>
</ul>
</div>
</div>
<!-- Spacer -->
<div class="row">
<div class="col-sm-12">
<hr />
</div>
</div>
</div>
<!-- Post and Calendar -->
<div class="col-sm-8 atlas_section">
<!-- Title -->
<div class="row">
<div class="col-sm-12 atlas_section_header_row">
<h2>Calendar</h2>
</div>
</div>
<!-- Post Select Dropdown -->
<div class="row">
<div class="col-sm-4 margin-x25">
<label class="control-label"
for="post_select">OFC Post</label>
<select class="select form-control"
id="post_select">
<option></option>

<option value="3f6bf614-b0db-ec11-a7b4-
001dd80234f6">CHENNAI VAC</option>

<option value="436bf614-b0db-ec11-a7b4-
001dd80234f6">HYDERABAD VAC</option>

<option value="466bf614-b0db-ec11-a7b4-
001dd80234f6">KOLKATA VAC</option>

<option value="486bf614-b0db-ec11-a7b4-
001dd80234f6">MUMBAI VAC</option>

<option value="4a6bf614-b0db-ec11-a7b4-
001dd80234f6">NEW DELHI VAC</option>

</select>
</div>
</div>
<!-- Calendar -->
<div class="row">
<div class="col-sm-4 margin-x25">
<!-- Date Picker -->
<div class="row">
<div class="col-sm-12">
<label class="control-label"
for="datepicker">Date</label>
<input id="datepicker" class="form-
control" type="text" autocomplete="off" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 margin-x25">
<!-- Spacer -->
<div class="row">
<div class="col-sm-12">
<hr />
</div>
</div>
<!-- Time Slot Picker -->
<div class="row">
<div class="col-sm-6">
<ul id="time_select_left" class="list-
group">
</ul>
</div>
<div class="col-sm-6">
<ul id="time_select_right" class="list-
group">
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Submit Button -->
<div class="row">
<div class="col-sm-12 mt-3">

<input type="submit"
class="btn-atlas btn-atlas-submit pull-right"
id="submitbtn"
value="Submit"
onclick="onClickSubmit();">
</div>
</div>
</div>
</div>

</div>
</div>
</main>

<script>

var jsdata = {};


jsdata['primaryId'] = "f919c947-722b-ee11-9965-001dd80a752c";
jsdata['applications'] = [];
jsdata['scheduleDayId'] = "";
jsdata['scheduleEntryId'] = "";

$(document).ready(function () {
onPageLoad();
});

function onPageLoad() {

schedulePageViews();
$("#datepikcer").val("Select post and applicant(s)...");

$.when(queryFamilyMembers().done(function (data) {
if (data.Members.length == 0) {
window.location = '/en-US/schedule';
}
}));

onPostChange();

$("#post_select").change(onPostChange);

validateAppointmentLimit_SchedulePage('You may only


reschedule 1 more time. If you continue you will be unable to
reschedule again.', 'Appointment limit reached. You can no longer
schedule appointments.<br /> Please use the Feedback/Requests
link on the Visa Application Home page for assistance in
rescheduling your appointment.');

checkValidReceipts();

onVisaClassSelectChange();
onPostChange();
toggleSubmit();
}

function schedulePageViews() {
var route = "/api/v1/page-views/schedule/single-family-
schedule-page-views";
var cacheString = new Date().getTime();
var request = {
"PrimaryId": "f919c947-722b-ee11-9965-001dd80a752c"
};

$.ajax({
url: "/en-US/custom-actions/?route=" + encodeURI(route)
+ "&cacheString=" + cacheString,
type: "GET",
data: "parameters=" + JSON.stringify(request),
contentType: "application/x-www-form-urlencoded;
charset=UTF-8",
dataType: "json",
success: function(response) {
console.log("Show Warning: " +
response.showWarning);
console.log("Can View: " + response.canViewPage);

if (response.showWarning == true) {
var html = [];
html.push('<div class="alert alert-warning
warning">');
html.push('You are approaching the maximum
number of times you may view this page. Please complete your
transaction at this time.');
html.push('</div>');
$('#error_row').html(html.join('')).parent().show();
}

if (response.canViewPage == false) {
var html = [];
html.push('<div class="alert alert-warning
warning">');
html.push('You have exceeded the limit for
viewing this page.');
html.push('</div>');
$('#error_row').html(html.join('')).parent().show();
$('#page_form').remove();
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert("An error has occurred!");
}
})
}

function queryFamilyMembers() {

var route = "/api/v1/schedule-group/query-family-


members-ofc-emergency";

var cacheString = new Date().getTime();


var requestData = {
"primaryId": "f919c947-722b-ee11-9965-001dd80a752c",
"visaClass": "all"
};

var currentRequest =
$.ajax({
url: '/en-US/custom-actions/?route=' +
encodeURI(route) + '&cacheString=' + cacheString,
type: 'POST',
data: 'parameters=' + JSON.stringify(requestData),
contentType: 'application/x-www-form-urlencoded;
charset=UTF-8',
dataType: 'json',
beforeSend: function () {
if (currentRequest != null) {
currentRequest.abort();
}
},
success: function (data) {
if (data.HasError) {

showErrorMessage(data.Errors.m_StringValue);
$("#submitbtn").prop('disabled',
false).css('opacity', 1.0);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert("An error has occurred!");
}
});
return currentRequest;
}

function onVisaClassSelectChange() {
$.when(queryFamilyMembers().done(function (data) {
if (data.Members.length == 0) {
showErrorMessage('No Class Selected');
}
else {
let html = [];
for (var i = 0; i < data.Members.length; i++) {
html.push('<li class="list-group-item py-0">');
html.push('<label>' + data.Members[i].FullName +
'</label>');
html.push('</li>');

jsdata.applications.push(data.Members[i].ApplicationID);
}
$("#gm_select").html(html.join(''));
setTimeout(()=> onPostChange(), 1000);
}
}));
}

function clearApplicants() {
jsdata.applications = [];
toggleSubmit();
}

function clearDatePicker() {
$("#datepicker").datepicker("destroy");
$("#time_select_left").html("");
$("#time_select_right").html("");
$("#datepicker").val("Select post and applicant(s)...")
}

function onPostChange() {
clearDatePicker();

jsdata['postId'] = $("#post_select").val();

if (validateScheduleQueryTrigger()) {
$("#datepicker").val("Loading...");
getScheduleDays(function (data) {
populateCalendar(data);
});
}
else {
clearDatePicker();
}

toggleSubmit();
}

function getScheduleDays(callback) {

var route = "/api/v1/schedule-group/get-family-ofc-


emergency-schedule-days";

var cacheString = new Date().getTime();

$.ajax({
url: '/en-US/custom-actions/?route=' + encodeURI(route) +
'&cacheString=' + cacheString,
type: 'POST',
data: 'parameters=' + JSON.stringify(jsdata),
contentType: 'application/x-www-form-urlencoded;
charset=UTF-8',
dataType: 'json',
success: function (data) {
if (data.HasError) {
showErrorMessage(data.Errors.m_StringValue);
}
else {
callback(data.ScheduleDays);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert("An error has occurred!");
}
});
}

function populateCalendar(data) {
if (data.length == 0) {
showErrorMessage('No Slots Available');
$("#datepicker").val("");
$("#time_select_left").html("");
$("#time_select_right").html("");
return;
}
else {
$("#error_row").hide();
}

var dates = [];


for (var i = 0; i < data.length; i++) {
data[i].Date = new Date(Date.parse(data[i].Date));
dates.push(jQuery.datepicker.formatDate("yy-mm-dd",
data[i].Date));
}

initDatePicker(data, dates);

$("#datepicker").val("Select Date");
}

function initDatePicker(data, dates) {


$("#datepicker").datepicker({
beforeShowDay: function (date) {
if (dates.includes(jQuery.datepicker.formatDate("yy-
mm-dd", date))) {
return [true, "greenday", ""];
}
else {
return [false, "redday", "No Available
Appointments"];
}
},
onSelect: function (date, inst) {
date = new Date(Date.parse(date));
var scheduleDay = $.grep(data, x =>
jQuery.datepicker.formatDate("yy-mm-dd", x.Date)
=== jQuery.datepicker.formatDate("yy-mm-dd", date));

jsdata.scheduleDayId = scheduleDay[0].ID;
getScheduleEntries(function (data) {
var lHtml = "";
var rHtml = "";

for (var i = 0; i < data.length; i++) {


var id = data[i].ID;
var time = data[i].Time;
var slots = data[i].EntriesAvailable;
var html = [];
html.push('<li class="list-group-item py-0">');
html.push('<div class="radio">');
html.push('<label>');
html.push('<input type="radio" id="' + id + '"
name="schedule-entries" value="' + id
+ '" data-slots="' + slots + '"
onclick="onSelectScheduleEntry(this)">');
html.push(time + ' (' + slots + ')');
html.push('</label>');
html.push('</div>');
html.push('</li>')

if (i % 2) {
rHtml += html.join("");
}
else {
lHtml += html.join("");
}
}

$("#time_select_left").html(lHtml);
$("#time_select_right").html(rHtml);
});

var localizeDate =
Date.parse(date).toLocaleDateString("en-US");
$("#datepicker").val(localizeDate);
},
changeYear: true,
changeMonth: true
});
}

function getScheduleEntries(callback) {
var route = "/api/v1/schedule-group/get-family-ofc-
emergency-schedule-entries";

var cacheString = new Date().getTime();

$.ajax({
url: "/en-US/custom-actions/?route=" + encodeURI(route)
+ "&cacheString=" + cacheString,
type: "POST",
data: "parameters=" + JSON.stringify(jsdata),
contentType: "application/x-www-form-urlencoded;
charset=UTF-8",
dataType: "json",
success: function (data) {
if (data.HasError) {
showErrorMessage(data.Errors.m_StringValue);
}
else {
callback(data.ScheduleEntries);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert("An error has occurred!");
}
});
}

function onSelectScheduleEntry(ele) {
jsdata.scheduleEntryId = ele.value;
toggleSubmit();
}

function onClickSubmit() {
if (validateData()) {
$("#submitbtn").prop("disabled", true).css("opacity", 0.5);
$("#error_row").parent().hide();

var route = "/api/v1/schedule-group/schedule-ofc-


emergency-appointments-for-family";
var cacheString = new Date().getTime();

$.ajax({
url: "/en-US/custom-actions/?route=" +
encodeURI(route) + "&cacheString=" + cacheString,
type: "POST",
data: "parameters=" + JSON.stringify(jsdata),
contentType: "application/x-www-form-urlencoded;
charset=UTF-8",
dataType: "json",
success: function (data) {
if (data.HasError) {

showErrorMessage(data.Errors.m_StringValue);
$("#submitbtn").prop("disabled",
false).css("opacity", 1.0);
}
else if (data.AllScheduled) {

window.location = "/en-US/" +
data.RedirectStub;

}
else {
onVisaClassSelectChange();
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert("An error has occured!");
$("#submitbtn").prop("disabled",
false).css("opacity", 1.0);
}
});
}
}

function checkValidReceipts() {
var dto = {
"applicationId": "f919c947-722b-ee11-9965-
001dd80a752c",
}

customAjax({
url: '/api/v1/receipt/validatereceiptandpaymentreference',
type: 'GET',
data: dto,
langCode: 'en-US',
success: function (data) {
if (data.HasError) {
showErrorMessage(data.Errors.m_StringValue);
$('#submitbtn').remove();
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert("An error has occured!");
}
});
}

function validateApplicantSelected() {
return jsdata.applications != null &&
jsdata.applications.length > 0;
}

function validatePostSelected() {
return jsdata.postId != null && jsdata.postId != "";
}

function validateEntrySelected() {
return jsdata.scheduleEntryId != null &&
jsdata.scheduleEntryId != "";
}

function validateScheduleQueryTrigger() {
return validateApplicantSelected() &&
validatePostSelected();
}

function validateSlotCount() {
if (!validateEntrySelected() || !validateApplicantSelected()) {
return false;
}

return $("#" + jsdata.scheduleEntryId).data("slots") >=


jsdata.applications.length;
}
function validateData() {
return validateApplicantSelected() &&
validatePostSelected() && validateEntrySelected() &&
validateSlotCount();
}

function toggleSubmit() {
if (validateData()) {
$("#submitbtn").prop('disabled', false).css('opacity', 1.0);
}
else {
$("#submitbtn").prop('disabled', true).css('opacity', 0.5);
}
}

function showErrorMessage(message) {
var html = [];
html.push('<div class="atlas_validationalert alert alert-
danger warning">');
html.push(message);
html.push('</div>');
$('#error_row').html(html.join('')).parent().show();
}
</script>

<script src="/dist/pcf-loader.bundle-f4a0e619b8.js"
type="text/javascript"></script>

<div style='display: none'>

<div class="xrm-editable-html&#32;xrm-attribute" data-


languageContext="English"><div class="xrm-attribute-value">
<div class="xrm-editable-html&#32;xrm-attribute" data-
languageContext="English"><div class="xrm-attribute-value">
</div></div>

</div></div>

</div>

<head>
<link rel="stylesheet"
href="https://www.usvisascheduling.com/fjallaOne.css" />
<link rel="stylesheet"
href="https://www.usvisascheduling.com/gudea.css" />
</head>

<style>
.content-info {
background-color: #2D2D2D;
}

.copyright {
color: white;
font-weight: Bold;
font-size: 1.2em;
display: flex;
justify-content: flex-end;
}

.return-top {
padding-bottom: 15px;
font-weight: 600;
}

.return-top a {
text-decoration: underline;
}

.footer p {
font-family: 'Gudea', sans-serif;
}

footer .footer-bottom {
width: 100%;
min-height: 36px;
background-color: #000;
font-size: 12px;
display: flex;
align-items: center;
margin-bottom: -15%;
}

footer .footer-bottom {
width: 100%;
min-height: 36px;
background-color: #000;
font-size: 12px;
display: flex;
align-items: center;
margin-bottom: -15%;
}

.footer-bottom {
background-color: #15224f;
max-height: 8px;
position: absolute;
bottom: 0;
width: 100%;
height: 100px;
margin-top: -125px;
margin-bottom: -150px;
}
.copyright {
color: #fff;
line-height: 8px;
max-height: 8px;
padding: 3px 0;
}
</style>
<link href="https://www.usvisascheduling.com/en-US/font-awesome-
4.1.0.min.css" rel="stylesheet" />
<div class="return-top">
<div class="container">
<a class="usa-link" href="#">Return to top</a>
</div>
</div>

<footer role="contentinfo">
<div class="footer-bottom hidden-print">
<div class="container">
<div class="row">
<div class="col-md-9">
</div>
<div class="col-md-3">
<div class="copyright">
<p>&copy; 2023. CGI Federal Inc.</p>
</div>
</div>
</div>
</div>
</div>
</footer>

<script>
//helps with the navigation blinking
setTimeout(() => { showBody() }, 200);
function showBody() {
$("html").show();
}
</script>
<script src="/dist/bootstrap.bundle-105a4995b8.js"
type="text/javascript"></script>

<script src="/dist/postpreform.bundle-184c77da50.js"
type="text/javascript"></script>

<script src="/dist/app.bundle-c8a369882b.js"
type="text/javascript"></script>

<script src="/dist/default-1033.moment_2_29_4.bundle-
eda4e638fd.js" type="text/javascript"></script>

<script
src="https://www.usvisascheduling.com/app_insights.js"></script>
<script>
appInsightsEvent("[email protected]","889e4033-fec9-
f204-8c1f-87f59b0f854e");
</script>
<script>
//this event will update the title of the page based on
active breadcrumb
$('.breadcrumb').ready(function () {
if ($('.breadcrumb').is(':visible')) {
document.querySelector('title').innerHTML =
($('.breadcrumb > li.active').text() + "&nbsp;· Customer Self-
Service");
}
});

function GoToNewEditor() {
var editCmsUrlSegment = "EditInCms";
var currentUrl = window.location.href;
if (currentUrl.indexOf('?') > -1) {
var urlSegments = currentUrl.split("?");
window.location.href = window.location.origin
+ '/' + editCmsUrlSegment + window.location.pathname + '?' +
urlSegments[1];
}
else {
window.location.href = window.location.origin
+ '/' + editCmsUrlSegment + window.location.pathname;
}
}
</script>

<script>
if ('serviceWorker' in navigator) {

navigator.serviceWorker.getRegistrations().then(function(registratio
ns) {
for(let registration of registrations) {
registration.unregister();
}}).catch(function(err) {
console.log('Service Worker unregister
action failed: ', err);
});
}
</script>

<!--Start Show Session Expire Warning Popup here -->

</body>
</html>
<!-- Generated at 10/25/2023 1:24:22 PM -->
<!-- Page OK -->

You might also like