EOS/Scripts/out/files/Home_Dashboard.js.html
Nidhi Bhargava f0c1ab20e1 code push
2025-09-04 16:25:07 +05:30

785 lines
37 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Home\Dashboard.js</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title=""></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: </em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/CallFeedbackRating.html">CallFeedbackRating</a></li>
<li><a href="../classes/CloseTicketReport.html">CloseTicketReport</a></li>
<li><a href="../classes/ConsolidatedReport.html">ConsolidatedReport</a></li>
<li><a href="../classes/CustomerReport.html">CustomerReport</a></li>
<li><a href="../classes/DealerWiseCallDetails.html">DealerWiseCallDetails</a></li>
<li><a href="../classes/DeclinedCalls.html">DeclinedCalls</a></li>
<li><a href="../classes/DropDownData.html">DropDownData</a></li>
<li><a href="../classes/EicherPromise.html">EicherPromise</a></li>
<li><a href="../classes/EosCallCount.html">EosCallCount</a></li>
<li><a href="../classes/GeoAnalysis.html">GeoAnalysis</a></li>
<li><a href="../classes/HdBusLmdContrCallFeedbackRatingibution.html">HdBusLmdContrCallFeedbackRatingibution</a></li>
<li><a href="../classes/HdBusLmdContribution.html">HdBusLmdContribution</a></li>
<li><a href="../classes/HistoryTracking.html">HistoryTracking</a></li>
<li><a href="../classes/LiveTracking.html">LiveTracking</a></li>
<li><a href="../classes/ManageEscalation.html">ManageEscalation</a></li>
<li><a href="../classes/ManageFleet.html">ManageFleet</a></li>
<li><a href="../classes/ManageFleet_Detail.html">ManageFleet_Detail</a></li>
<li><a href="../classes/ManageFleet_details.html">ManageFleet_details</a></li>
<li><a href="../classes/ManageOwner.html">ManageOwner</a></li>
<li><a href="../classes/ManageReason.html">ManageReason</a></li>
<li><a href="../classes/ManageVechile.html">ManageVechile</a></li>
<li><a href="../classes/ManageVehicle.html">ManageVehicle</a></li>
<li><a href="../classes/NonVecvUserManagement.html">NonVecvUserManagement</a></li>
<li><a href="../classes/Notifications.html">Notifications</a></li>
<li><a href="../classes/OpenTicketReport.html">OpenTicketReport</a></li>
<li><a href="../classes/OrganizationChart.html">OrganizationChart</a></li>
<li><a href="../classes/PositioningTool.html">PositioningTool</a></li>
<li><a href="../classes/PositioningTool_Report.html">PositioningTool_Report</a></li>
<li><a href="../classes/ReasonForClosure.html">ReasonForClosure</a></li>
<li><a href="../classes/Report.html">Report</a></li>
<li><a href="../classes/ShowDealerMap.html">ShowDealerMap</a></li>
<li><a href="../classes/TicketAdministration.html">TicketAdministration</a></li>
<li><a href="../classes/TicketAdministration_FullDetail.html">TicketAdministration_FullDetail</a></li>
<li><a href="../classes/TicketFeedback.html">TicketFeedback</a></li>
<li><a href="../classes/TicketForDealer.html">TicketForDealer</a></li>
<li><a href="../classes/TicketForDealer_FullDetails.html">TicketForDealer_FullDetails</a></li>
<li><a href="../classes/TicketReassign.html">TicketReassign</a></li>
<li><a href="../classes/TileDashboard.html">TileDashboard</a></li>
<li><a href="../classes/TimeSlotClosure.html">TimeSlotClosure</a></li>
<li><a href="../classes/TollFreeAndOpportunityLoss.html">TollFreeAndOpportunityLoss</a></li>
<li><a href="../classes/VanCoverageDesigner.html">VanCoverageDesigner</a></li>
<li><a href="../classes/VecvUserManagement.html">VecvUserManagement</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/Dashboard.html">Dashboard</a></li>
<li><a href="../modules/DropDownData.html">DropDownData</a></li>
<li><a href="../modules/Geo.html">Geo</a></li>
<li><a href="../modules/Inventory.html">Inventory</a></li>
<li><a href="../modules/Notifications.html">Notifications</a></li>
<li><a href="../modules/ReportModule.html">ReportModule</a></li>
<li><a href="../modules/Ticket.html">Ticket</a></li>
<li><a href="../modules/TrackingModule.html">TrackingModule</a></li>
<li><a href="../modules/UserManagement.html">UserManagement</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: Home\Dashboard.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
/*================================================================================================================\
+
+ Project : GODATA-EICHER
+ Filename : Dashboard.js
+ Module Name : Tile Dashboard Module
+ Purpose : To show Tile Dashboard KPIs between 2 dates.
+ Coded By : Pankaj Khandal
+
+================================================================================================================*/
/**
* To show Tile Dashboard KPIs between 2 dates.
* @module Dashboard
*/
/**
* To show Tile Dashboard KPIs between 2 dates.
* @class TileDashboard
* @constructor
*/
/**
* Global References: To store Ajax Request&#x27;s XHR object.
* @for TileDashboard
*/
var xhr_refreshDashboard = null;
var xhr_exportToCSV = null;
var MONTHS = [&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;, &quot;December&quot;];
//
/**
* Global References: Setting countUp options (To change the gradient of tiles and slowly incresing the numbers on tiles)
* @for TileDashboard
*/
var options = {
useEasing: true, // toggle easing
useGrouping: true, // 1,000,000 vs 1000000
separator: &#x27;&#x27;, // character to use as a separator
decimal: &#x27;.&#x27;, // character to use as a decimal
};
var demo;
/**
* Global References: To store color-combinations to show gradient effect on tiles.
* @for TileDashboard
*/
var startingColor11 = &#x27;rgb(47,128,227)&#x27;, // dark blue color code
startingColor12 = &#x27;rgb(109,192,254)&#x27;, // light blue color code
endColor11 = &#x27;rgb(200,36,27)&#x27;, // red color code
endColor12 = &#x27;rgb(254,112,69)&#x27;, // red
startingColor21 = &#x27;rgb(125,188,29)&#x27;, // light green
startingColor22 = &#x27;rgb(42,169,28)&#x27;, // green
warningColor11 = &#x27;rgb(249, 140, 29)&#x27;,// yellow
warningColor21 = &#x27;rgb(254, 180, 44)&#x27;;// yellow
lightOcean = &#x27;rgb(0, 171, 169)&#x27;;
darkOcean = &#x27;rgb(46, 98, 98)&#x27;;
lightBlue = &#x27;rgb(66, 146, 234)&#x27;;
darkBlue = &#x27;rgb(24, 57, 134)&#x27;;
//========================== Drop down functionality ==================================================
/**
* common function for close all popup and remove active toolbutton class
* @method closeArea
* @for TileDashboard
*/
function closeArea() {
&#x27;use strict&#x27;;
$(&quot;.toolPopupBoxJs&quot;).hide();
$(&quot;#divRegionPopup&quot;).hide();
$(&quot;.toolOpenerJs&quot;).removeClass(&#x27;toolBtnActive&#x27;);
}
/**
* body click functionality
* @method bodyClick
* @for TileDashboard
*/
function bodyClick() {
&#x27;use strict&#x27;;
$(&quot;body&quot;).click(function () {
closeArea(); //function calling - common function for close all popup and remove active toolbutton class
});
}
/**
* add closeBox class to popup submit button to close popup
* @method closePopup
* @for TileDashboard
*/
function closePopup() {
&#x27;use strict&#x27;;
$(&quot;.closeBox&quot;).click(function () {
closeArea(); //function calling - common function for close all popup and remove active toolbutton class
});
}
/**
* select popup box element on click
* @method selectPopupElement
* @for TileDashboard
*/
function selectPopupElement() {
&#x27;use strict&#x27;;
var currentSelection, $this;
$(&quot;.toolPopupBoxJs table tbody tr&quot;).click(function () {
$this = $(this);
$(&quot;.toolPopupBoxJs table tbody &gt; tr&quot;).removeClass(&quot;selected&quot;);
$this.addClass(&quot;selected&quot;);
currentSelection = $this.find(&#x27;td&#x27;).html();
$this.parent().parent().parent().parent().parent().find(&#x27;.currentSelection&#x27;).html(currentSelection);
closeArea(); //function calling - common function for close all popup and remove active toolbutton class
});
}
/**
* title bar popup functionality
* @method popupOpenerAction
* @for TileDashboard
*/
function popupOpenerAction() {
$(&quot;.toolOpenerJs&quot;).click(function (e) {
e.stopPropagation();
var currentPopup;
closeArea();
currentPopup = $(this).find(&quot;.toolPopupBox&quot;);
if (currentPopup.css(&#x27;display&#x27;) === &#x27;none&#x27;) {
currentPopup.css(&#x27;display&#x27;, &#x27;block&#x27;);
$(this).addClass(&#x27;toolBtnActive&#x27;);
} else { currentPopup.css(&#x27;display&#x27;, &#x27;none&#x27;); $(this).removeClass(&#x27;toolBtnActive&#x27;); }
});
$(&quot;.toolPopupBoxJs&quot;).click(function (e) {
e.stopPropagation();
});
}
//==========================End of Drop down functionality ==================================================
/**
* Get Hidden field values and make it globally available.
* @method getHiddenFieldInfraURL
* @for TileDashboard
*/
function getHiddenFieldInfraURL() {
defaultURL = $(&quot;#hiddenInfraUrl&quot;).val();
}
/**
* Convert HH:mm format to Minutes.
* @method convertToMin
* @for TileDashboard
*/
function convertToMin(time) {
var timeArray = time.split(&quot;:&quot;);
return parseInt(timeArray[0], 10) * 60 + parseInt(timeArray[1], 10);
}
/**
* To bind values on infra tile dashboard for selected circles.
* @method refreshDashboard
* @for TileDashboard
*/
function refreshDashboard() {
SecurityToken = securityToken;
utcMinutes = parseInt(UtcMinutes, 10);
UserId = userId;
// Getting first and last date from a month
var startDate = $(&quot;#monthpickerFrom&quot;).val();
var endDate = $(&quot;#monthpickerTo&quot;).val();
$(&#x27;.wrapup-pod&#x27;).find(&#x27;h4&#x27;).html(0);
// Sending the Ajax Request for showing the dashboard values and handling its completion.
if (xhr_refreshDashboard &amp;&amp; xhr_refreshDashboard.readystate != 4) {
xhr_refreshDashboard.abort();
}
xhr_refreshDashboard = $.ajax({
type: &quot;POST&quot;,
url: WCFRESTURL.GetGlobalDashboard,
data: { Token: SecurityToken, UtcMinutes: utcMinutes, UserId: UserId, FromDate: startDate + &#x27; 00:00:00&#x27;, ToDate: endDate + &#x27; 23:59:59&#x27; },
dataType: &quot;json&quot;,
success: function (model) {
// Setting KPI values in each tile, formatting and creating links for redirections.
for (var i = 0; i &lt; model.length; i++) {
// Getting and setting value for total_van
if (model[i].Key == &quot;total_van&quot;) {
if (parseInt(model[i].KeyValue, 10) &gt; 0) {
//slowing increasing numbers on tiles
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#total_van&quot;).text(model[i].KeyValue);
$(&quot;#textFor_total_van&quot;).text(model[i].KeyName);
}
// Getting and setting value for average_response_time
else if (model[i].Key == &quot;average_response_time&quot;) {
$(&quot;#average_response_time&quot;).text(model[i].KeyValue);
$(&quot;#textFor_average_response_time&quot;).text(model[i].KeyName);
if (parseInt(model[i].KeyValue, 10) &gt; 120) {
$(&quot;#average_response_time&quot;).css(&#x27;background-color&#x27;, &#x27;red&#x27;);
}
}
// Getting and setting value for total_vans_on_service
else if (model[i].Key == &quot;total_vans_on_service&quot;) {
if (parseInt(model[i].KeyValue, 10) &gt; 0) {
//slowing increasing numbers on tiles
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#total_vans_on_service&quot;).text(model[i].KeyValue);
$(&quot;#textFor_total_vans_on_service&quot;).text(model[i].KeyName);
// Adding link to open ticket
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Open?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;assignedTo=van&#x27;);
}
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, darkOcean, lightOcean, 2);
}
// Getting and setting value for no_of_dealer_tickets
else if (model[i].Key == &quot;no_of_dealer_tickets&quot;) {
if (parseInt(model[i].KeyValue, 10) &gt; 0) {
//slowing increasing numbers on tiles
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#no_of_dealer_tickets&quot;).text(model[i].KeyValue);
$(&quot;#textFor_no_of_dealer_tickets&quot;).text(model[i].KeyName);
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, darkBlue, lightBlue, 2);
}
// Getting and setting value for total_breakdowns
else if (model[i].Key == &quot;total_breakdowns&quot;) {
if (parseInt(model[i].KeyValue, 10) &gt; 0) {
//slowing increasing numbers on tiles
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#total_breakdowns&quot;).text(model[i].KeyValue);
$(&quot;#textFor_total_breakdowns&quot;).text(model[i].KeyName);
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, darkBlue, lightBlue, 2);
}
// Getting and setting value for no_of_van_on_duty
else if (model[i].Key == &quot;no_of_van_on_duty&quot;) {
if (parseInt(model[i].KeyValue, 10) &gt; 0) {
//slowing increasing numbers on tiles
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#no_of_van_tickets&quot;).text(model[i].KeyValue);
$(&quot;#textFor_no_of_van_tickets&quot;).text(model[i].KeyName);
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, darkBlue, lightBlue, 2);
}
// Getting and setting value for no_of_dealer_open_tickets
else if (model[i].Key == &quot;no_of_dealer_open_tickets&quot;) {
if (parseFloat(model[i].KeyValue, 10) &gt; 0) {
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Open?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;assignedTo=dealer&#x27;);
}
}
// Getting and setting value for no_of_dealer_closed_tickets
else if (model[i].Key == &quot;no_of_dealer_closed_tickets&quot;) {
if (parseFloat(model[i].KeyValue, 10) &gt; 0) {
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;assignedTo=dealer&#x27;);
}
}
// Getting and setting value for no_of_van_open_ticket
else if (model[i].Key == &quot;no_of_van_open_ticket&quot;) {
if (parseFloat(model[i].KeyValue, 10) &gt; 0) {
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Open?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;assignedTo=van&#x27;);
}
}
// Getting and setting value for no_of_van_closed_ticket
else if (model[i].Key == &quot;no_of_van_closed_ticket&quot;) {
if (parseFloat(model[i].KeyValue, 10) &gt; 0) {
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;assignedTo=van&#x27;);
}
}
// Getting and setting value for no_of_van_closed_ticket
else if (model[i].Key == &quot;no_of_open_tickets&quot;) {
if (parseFloat(model[i].KeyValue, 10) &gt; 0) {
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
// Adding link to open ticket
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Open?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate);
}
if (parseInt(model[i].KeyValue, 10) &gt;= 1) {
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, endColor11, endColor12, 2);
}
}
// Getting and setting value for call_distribution_hd
else if (model[i].Key == &quot;call_distribution_hd&quot;) {
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;vehicleTag=HD&#x27;);
}
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent().parent().parent().parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, darkOcean, lightOcean, 2);
}
// Getting and setting value for call_distribution_lmd
else if (model[i].Key == &quot;call_distribution_lmd&quot;) {
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;vehicleTag=LMD&#x27;);
}
}
// Getting and setting value for call_distribution_bus
else if (model[i].Key == &quot;call_distribution_bus&quot;) {
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;vehicleTag=BUS&#x27;);
}
}
// Getting and setting value for call_closed_within_24hrs_hd
else if (model[i].Key == &quot;call_closed_within_24hrs_hd&quot;) {
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;vehicleTag=HD&amp;age=24&#x27;);
}
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent().parent().parent().parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, darkBlue, lightBlue, 2);
}
// Getting and setting value for call_closed_within_24hrs_lmd
else if (model[i].Key == &quot;call_closed_within_24hrs_lmd&quot;) {
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;vehicleTag=LMD&amp;age=24&#x27;);
}
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent().parent().parent().parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, darkBlue, lightBlue, 2);
}
// Getting and setting value for call_closed_within_24hrs_bus
else if (model[i].Key == &quot;call_closed_within_24hrs_bus&quot;) {
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;vehicleTag=BUS&amp;age=24&#x27;);
}
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent().parent().parent().parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, darkBlue, lightBlue, 2);
}
// Getting and setting value for All other tiles which needs to be animated and changing in color
else if (model[i].Key == &quot;least_response_time&quot;) {
if (model[i].KeyValue != &#x27;&#x27;) {
//demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
//demo.start();
$(&quot;#least_response_time&quot;).text(model[i].KeyValue);
$(&quot;#labelFor_least_response_time&quot;).show();
} else {
$(&quot;#least_response_time&quot;).text(&quot;-&quot;);
$(&quot;#labelFor_least_response_time&quot;).hide();
}
$(&quot;#textFor_least_response_time&quot;).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
//pankaj
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;responseTime=&#x27; + convertToMin(model[i].KeyValue));
}
if (parseInt(convertToMin(model[i].KeyValue), 10) &gt; 120) {
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, endColor11, endColor12, 2);
}
}
// Getting and setting value for highest_response_time
else if (model[i].Key == &quot;highest_response_time&quot;) {
if (parseInt(model[i].KeyValue, 10) &gt;= 0) {
//demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
//demo.start();
$(&quot;#highest_response_time&quot;).text(model[i].KeyValue);
$(&quot;#labelFor_worst_response_time&quot;).show();
} else {
$(&quot;#highest_response_time&quot;).text(&quot;-&quot;);
$(&quot;#labelFor_worst_response_time&quot;).hide();
}
$(&quot;#textFor_highest_response_time&quot;).text(model[i].KeyName);
if (userRole.toLowerCase() != &#x27;dealer&#x27;) {
$(&quot;#link_&quot; + model[i].Key).attr(&#x27;href&#x27;, &#x27;/Report/Ticket_Close?startDate=&#x27; + startDate + &#x27;&amp;endDate=&#x27; + endDate + &#x27;&amp;responseTime=&#x27; + convertToMin(model[i].KeyValue));
}
if (parseInt(convertToMin(model[i].KeyValue), 10) &gt; 120) {
var parentOfTarget = $(&#x27;#&#x27; + model[i].Key).parent();
colorAnimationTheDiv(parentOfTarget, startingColor21, startingColor22, endColor11, endColor12, 2);
}
}
// Getting and setting value for closur_within_24hrs
else if (model[i].Key == &quot;closur_within_24hrs&quot;) {
if (parseInt(model[i].KeyValue, 10) &gt; 0) {
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (parseFloat(model[i].KeyValue, 10) &lt; 90) {
$(&quot;#closur_within_24hrs&quot;).css(&#x27;background-color&#x27;, &#x27;red&#x27;);
}
}
// Getting and setting value for response_within_2hrs
else if (model[i].Key == &quot;response_within_2hrs&quot;) {
if (parseInt(model[i].KeyValue, 10) &gt; 0) {
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
if (parseFloat(model[i].KeyValue, 10) &lt; 90) {
$(&quot;#response_within_2hrs&quot;).css(&#x27;background-color&#x27;, &#x27;red&#x27;);
}
}
else if (model[i].Key == &quot;least_response_time_state&quot;) {
//model[i].KeyValue = &quot;tambidffdfgddfdffdmotersfdcomapany-varsai (varsai,mumbai,majarastra)&quot;;
var valueToShow = model[i].KeyValue;
//console.log(model[i].KeyValue.length);
if (model[i].KeyValue.length &gt; 30)
{
valueToShow = valueToShow.substring(0, 29) + &#x27;..&#x27;;
}
$(&quot;#&quot; + model[i].Key).text(valueToShow);
$(&quot;#&quot; + model[i].Key).attr(&quot;title&quot;, model[i].KeyValue);
}
else if (model[i].Key == &quot;highest_response_time_state&quot;) {
var valueToShow = model[i].KeyValue;
if (model[i].KeyValue.length &gt; 30) {
valueToShow = valueToShow.substring(0, 29) + &#x27;..&#x27;;
}
$(&quot;#&quot; + model[i].Key).text(valueToShow);
$(&quot;#&quot; + model[i].Key).attr(&quot;title&quot;, model[i].KeyValue);
}
else {
if ((parseInt(model[i].KeyValue, 10) != &#x27;NaN&#x27;) &amp;&amp; (parseInt(model[i].KeyValue, 10) &gt; 0)) {
//slowing increasing numbers on tiles
demo = new countUp(model[i].Key, 0, parseInt(model[i].KeyValue, 10), 0, 0, options);
demo.start();
}
$(&quot;#&quot; + model[i].Key).text(model[i].KeyValue);
$(&quot;#textFor_&quot; + model[i].Key).text(model[i].KeyName);
}
}
},
complete: function () {
$(&#x27;.excelIcon&#x27;).show();
},
error: function (data) {
console.log(&quot;Error&quot;);
}
});
}
/**
* To show Tile dashboard.
* @method showTileDashboard
* @for TileDashboard
*/
function showTileDashboard() {
refreshDashboard();
}
/**
* To Export relevent data when a Excel-Icon is clicked.
* @method exportToCSV
* @param {Int} technologyId technology Id
* @param {Int} categoryId category Id
* @param {String} technologyName technology Name
* @for TileDashboard
*/
function exportToCSV() {
// Sending the Ajax request to show report and handling its completion
if (xhr_exportToCSV &amp;&amp; xhr_exportToCSV.readystate != 4) {
xhr_exportToCSV.abort();
}
xhr_exportToCSV = $.ajax({
type: &quot;POST&quot;,
url: &quot;/Home/Export_GlobalTileDashboard/&quot;,
//data: { technologyId: technologyId, categoryId: categoryId, technologyName: technologyName, networkType: networkType },
success: function (data) {
// dowloading the generated report file
window.location.href = data;
},
complete: function () {
},
error: function () {
console.log(&quot;Error in Export to CSV&quot;);
}
});
}
//==========================DOCUMNET READY=========================
/**
* To do some initial functionality on page when Document is ready.
* @event document.ready
* @for TileDashboard
*/
$(document).ready(function () {
// body click functionality
bodyClick();
//common function for close all popup and remove active toolbutton class
closePopup();
// title bar popup functionality
popupOpenerAction();
//select popup box element on click
selectPopupElement();
//Getting Hidden field values and making it available globally.
getHiddenFieldInfraURL();
// Loading Dashboard data.
showTileDashboard();
//Refresh Dashboard every-hour
setInterval(&quot;showTileDashboard()&quot;, 1000 * 60 * 60);
// for image cycle.
$(&#x27;#defaultCube,#defaultCube1,#defaultCube2,#defaultCube3,#defaultCube4&#x27;).cycle({
fx: &#x27;slideY&#x27;,
speed: 1000,
timeout: 20000//set your time b/w every image scrolldown effect
});
});
//==========================DOCUMNET READY END=======================
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>