730 lines
38 KiB
Plaintext
730 lines
38 KiB
Plaintext
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="RepPuntosDeInteres.aspx.vb" Inherits="GPS_RepPuntosDeInteres" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
|
</asp:Content>
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
|
<link href="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.css" rel="stylesheet" />
|
|
<style>
|
|
html, body {
|
|
width: 100%;
|
|
height: 100%;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
#map {
|
|
width: 100%;
|
|
height: calc(100% - 51px);
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
|
|
#map {
|
|
position: fixed !important;
|
|
}
|
|
|
|
.pac-container.pac-logo {
|
|
z-index: 100000;
|
|
}
|
|
|
|
#showdiv1 {
|
|
left: 0 !important;
|
|
width: 100% !important;
|
|
}
|
|
|
|
#ShowDiv3:hover {
|
|
line-height: 34px !important;
|
|
-webkit-transition: line-height ease 1s;
|
|
-moz-transition: line-height ease 1s;
|
|
-o-transition: line-height ease 1s;
|
|
transition: line-height ease 1s;
|
|
}
|
|
|
|
.ADScroller-body {
|
|
max-height: 400px;
|
|
}
|
|
|
|
.pac-container.pac-logo {
|
|
z-index: 100000;
|
|
}
|
|
|
|
#iw-container {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
#iw-container .iw-title {
|
|
font-family: 'Open Sans Condensed', sans-serif;
|
|
font-size: 22px;
|
|
font-weight: 400;
|
|
padding: 10px;
|
|
background-color: #48b5e9;
|
|
color: white;
|
|
margin: 0;
|
|
border-radius: 2px 2px 0 0;
|
|
}
|
|
|
|
#iw-container .iw-content {
|
|
font-size: 13px;
|
|
line-height: 18px;
|
|
font-weight: 400;
|
|
margin-right: 1px;
|
|
padding: 15px 5px 20px 15px;
|
|
max-height: 140px;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
.iw-content img {
|
|
float: right;
|
|
margin: 0 5px 5px 10px;
|
|
}
|
|
|
|
.iw-subTitle {
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
padding: 5px 0;
|
|
}
|
|
|
|
.iw-bottom-gradient {
|
|
position: absolute;
|
|
width: 326px;
|
|
height: 25px;
|
|
bottom: 10px;
|
|
right: 18px;
|
|
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
|
|
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
|
|
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
|
|
background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
|
|
}
|
|
|
|
.modal.fade:not(.in).left .modal-dialog {
|
|
-webkit-transform: translate3d(-25%, 0, 0);
|
|
transform: translate3d(-25%, 0, 0);
|
|
}
|
|
|
|
.modal.fade:not(.in).right .modal-dialog {
|
|
-webkit-transform: translate3d(25%, 0, 0);
|
|
transform: translate3d(25%, 0, 0);
|
|
}
|
|
|
|
.modal.fade:not(.in).bottom .modal-dialog {
|
|
-webkit-transform: translate3d(0, 25%, 0);
|
|
transform: translate3d(0, 25%, 0);
|
|
}
|
|
|
|
/* Alternative Angles */
|
|
.modal.fade:not(.in).top-left .modal-dialog {
|
|
-webkit-transform: translate3d(-25%, -25%, 0);
|
|
transform: translate3d(-25%, -25%, 0);
|
|
}
|
|
|
|
.modal.fade:not(.in).top-right .modal-dialog {
|
|
-webkit-transform: translate3d(25%, -25%, 0);
|
|
transform: translate3d(25%, -25%, 0);
|
|
}
|
|
|
|
.modal.fade:not(.in).bottom-left .modal-dialog {
|
|
-webkit-transform: translate3d(-25%, 25%, 0);
|
|
transform: translate3d(-25%, 25%, 0);
|
|
}
|
|
|
|
.modal.fade:not(.in).bottom-right .modal-dialog {
|
|
-webkit-transform: translate3d(25%, 25%, 0);
|
|
transform: translate3d(25%, 25%, 0);
|
|
}
|
|
|
|
.minicolors {
|
|
position: relative;
|
|
MARGIN-TOP: 10PX;
|
|
WIDTH: 20%;
|
|
}
|
|
|
|
table.dataTable,
|
|
table.dataTable th,
|
|
table.dataTable td {
|
|
-webkit-box-sizing: content-box;
|
|
-moz-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
}
|
|
|
|
.dataTables_scrollBody > .dataTable > thead {
|
|
display: none !important;
|
|
}
|
|
|
|
tr td:nth-child(4) {
|
|
text-align: center;
|
|
}
|
|
|
|
.form-horizontal .control-label {
|
|
text-align: left;
|
|
}
|
|
</style>
|
|
</asp:Content>
|
|
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
|
|
<div id="map"></div>
|
|
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
|
<div class="modal-dialog">
|
|
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
<h4 class="modal-title" id="H1" runat="server">Consultar Reporte de Puntos</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px; margin-bottom: 20px;">
|
|
<li>Fecha Inicio:
|
|
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" >
|
|
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
|
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
</div>
|
|
</li>
|
|
<li>Fecha Fin:
|
|
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy">
|
|
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
|
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
|
<div style="margin-right: 15px">
|
|
<input type="text" id="TxtBusquedaEventos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GvPuntos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GvPuntos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
|
</div>
|
|
</div>
|
|
<asp:GridView ID="GvPuntos" runat="server" GridLines="None" DataKeyNames="Punto,PuntoDeInteres,CvePuntoDeInteres" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-height="150" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
|
<Columns>
|
|
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
|
<HeaderTemplate>
|
|
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickGR" />
|
|
</HeaderTemplate>
|
|
<ItemTemplate>
|
|
<asp:CheckBox runat="server" ID="chkGR" CssClass="ChkAllGR" />
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="45%" HeaderText="Punto De Interés" ItemStyle-HorizontalAlign="Left" />
|
|
<asp:BoundField DataField="Descripcion" ItemStyle-Width="45%" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
|
|
</Columns>
|
|
</asp:GridView>
|
|
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
|
<div style="margin-right: 15px">
|
|
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" data-height="150" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
|
</div>
|
|
</div>
|
|
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="800" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
|
<Columns>
|
|
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
|
<HeaderTemplate>
|
|
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickDisp" />
|
|
</HeaderTemplate>
|
|
<ItemTemplate>
|
|
<asp:CheckBox runat="server" ID="chkDis" CssClass="ChkAllDisp" />
|
|
</ItemTemplate>
|
|
</asp:TemplateField>
|
|
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
|
|
<asp:BoundField DataField="ModeloVehiculo" ItemStyle-Width="25%" HeaderText="Modelo Vehículo" ItemStyle-HorizontalAlign="Left" />
|
|
<asp:BoundField DataField="AñoVehiculo" ItemStyle-Width="25%" HeaderText="Año Vehículo" ItemStyle-HorizontalAlign="center" />
|
|
<asp:BoundField DataField="PlacasVehiculo" ItemStyle-Width="25%" HeaderText="Placas Vehículo" ItemStyle-HorizontalAlign="center" />
|
|
</Columns>
|
|
</asp:GridView>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<asp:LinkButton ID="BtnConsultar" runat="server" Text="Consultar Reporte" ValidationGroup="GrpFechas" CssClass="btn btn-primary"></asp:LinkButton>
|
|
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
</div>
|
|
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel1">
|
|
<ContentTemplate>
|
|
<asp:HiddenField runat="server" ID="HdnPunto" ClientIDMode="static" Value="0" />
|
|
<asp:HiddenField runat="server" ID="HdnDispositivo" ClientIDMode="static" Value="0" />
|
|
<div id="dvHistorico" class="modal ADS fade" role="dialog">
|
|
<div class="modal-dialog">
|
|
<asp:UpdatePanel ID="UpHistorico" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
<h4 class="modal-title" id="H2" runat="server"><i class="fa fa-bell-o"></i>Historial Visitas: </h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UpdatePanel3">
|
|
<ContentTemplate>
|
|
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
|
<div style="margin-right: 15px">
|
|
<input type="text" id="TxtBusquedaHist" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorico.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorico.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
|
</div>
|
|
</div>
|
|
<asp:GridView ID="GVHistorico" runat="server" GridLines="None" DataKeyNames="CveDispositivoEvento" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-heightfijo="100" data-height="100" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
|
<Columns>
|
|
<asp:BoundField DataField="Conductor" ItemStyle-Width="35%" HeaderStyle-HorizontalAlign="center" HeaderText="Conductor" ItemStyle-HorizontalAlign="left" />
|
|
<asp:BoundField DataField="FechaEntrada" ItemStyle-Width="35%" HeaderStyle-HorizontalAlign="center" HeaderText="Fecha Visita" ItemStyle-HorizontalAlign="center" />
|
|
<asp:BoundField DataField="Duracion" DataFormatString="{0} Minutos" HeaderStyle-HorizontalAlign="center" HeaderText="Duración" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="center" />
|
|
</Columns>
|
|
</asp:GridView>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<asp:UpdatePanel runat="server" ID="uphidden">
|
|
<ContentTemplate>
|
|
<asp:Button Style="display: none" ID="BtnCargarGV" runat="server" />
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
<div class="modal fade bottom in" style="bottom: unset; z-index: 539" id="h">
|
|
<div class="modal-dialog" style="position: fixed; bottom: 0; margin: 0px,0px,0px,0px; width: 100%; padding: 0px, 0px, 0px, 0px; border-style: solid; border-color: rgb(68, 77, 88); z-index: 539;">
|
|
<div class="modal-content">
|
|
<div class="modal-body" style="padding: 5px;">
|
|
<asp:UpdatePanel runat="server" ID="UPGV" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<div runat="server" id="rowImpresiones" class="row" style="margin: 0px 10px 10px 0px; text-align: right;">
|
|
<a onclick="doScaledCLick('#C_btnImprimir');;" class="btn btn-circle btn-sm grey"><i class='fa fa-print' aria-hidden='true'></i></a>
|
|
<a onclick="doScaledCLick('#C_BtnImprimirEX');" class="btn btn-circle btn-sm green"><i class='fa fa-file-excel-o' aria-hidden='true'></i></a>
|
|
</div>
|
|
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
|
<div style="margin-right: 15px">
|
|
<input type="text" id="TxtBusquedaBarra" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaBarra','{0}')", GvBarra.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaBarra','{0}')", GvBarra.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
|
</div>
|
|
</div>
|
|
<asp:GridView ID="GvBarra" runat="server" GridLines="None" PageSize="1000" AllowPaging="true" AllowCustomPaging="true" CssClass="table table-striped table-advance table-hover Widthall" data-sort="true" data-height="150px;" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
|
<Columns>
|
|
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="30%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Left" />
|
|
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="30%" HeaderText="Punto De Interes" ItemStyle-HorizontalAlign="Left" />
|
|
<asp:BoundField DataField="Visitas" ItemStyle-Width="20%" DataFormatString="{0} Visitas" HeaderText="Visitas" ItemStyle-HorizontalAlign="Center" />
|
|
<asp:BoundField DataField="UltimaVisita" ItemStyle-Width="20%" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ultima Visita" ItemStyle-HorizontalAlign="Center" />
|
|
</Columns>
|
|
<PagerSettings Mode="NextPrevious" Visible="true" Position="Top" />
|
|
</asp:GridView>
|
|
<asp:HiddenField ID="HdnIndexGvBarra" runat="server" ClientIDMode="Static" Value="-1" />
|
|
<asp:HiddenField ID="HdnTextFilter" runat="server" ClientIDMode="Static" Value="" />
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div runat="server" class="row" style="margin: 0px 0px 10px 0px; display: none">
|
|
<asp:Button runat="server" OnClick="btnImprimir_Click" ID="btnImprimir" CommandArgument="PDF" ToolTip="Imprimir en PDF" CssClass="btn btn-circle btn-sm grey" Text="<i class='fa fa-print' aria-hidden='true'></i>"></asp:Button>
|
|
<asp:Button runat="server" OnClick="btnImprimir_Click" ID="BtnImprimirEX" CommandArgument="EXCEL" ToolTip="Imprimir en EXCEL" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-file-excel-o' aria-hidden='true'></i>"></asp:Button>
|
|
</div>
|
|
</asp:Content>
|
|
<asp:Content ID="Content4" ContentPlaceHolderID="H" runat="Server">
|
|
<li>
|
|
<asp:LinkButton ID="BtnRep" OnClientClick="CargaDivs('Rep');return false;" Text="<i class='fa fa-location-arrow'></i><span>Reporte de puntos</span>" runat="server">
|
|
</asp:LinkButton>
|
|
</li>
|
|
</asp:Content>
|
|
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
|
<script>
|
|
|
|
function doScaledCLick(boton) {
|
|
|
|
setTimeout(function () {
|
|
$(boton).click();
|
|
}, 250);
|
|
}
|
|
|
|
var markers = [];
|
|
var lastOpenedInfoWindow;
|
|
var geocoder;
|
|
var map;
|
|
var circles = [];
|
|
|
|
$('body').on('click', '.ChkAllClickGR input', function () { $(".ChkAllGR input").not(this).prop('checked', $('.ChkAllClickGR input').is(':checked')); });
|
|
$('body').on('click', '.ChkAllClickDisp input', function () { $(".ChkAllDisp input").not(this).prop('checked', $('.ChkAllClickDisp input').is(':checked')); });
|
|
|
|
function initMap() {
|
|
map = new google.maps.Map(document.getElementById('map'), {
|
|
center: { lat: 19.4326, lng: -99.13329 },
|
|
zoom: 8
|
|
});
|
|
|
|
var ShowDiv1 = document.createElement('div');
|
|
var ShowDivControl = new ShowDiv(ShowDiv1, map);
|
|
|
|
ShowDiv1.index = 1;
|
|
ShowDiv1.id = "showdiv1"
|
|
|
|
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1);
|
|
|
|
if (navigator.geolocation) {
|
|
navigator.geolocation.getCurrentPosition(function (position) {
|
|
var pos = {
|
|
lat: position.coords.latitude,
|
|
lng: position.coords.longitude
|
|
};
|
|
map.setCenter(pos);
|
|
}, function () {
|
|
handleLocationError(true, infoWindow, map.getCenter());
|
|
});
|
|
}
|
|
//CargaPickers();
|
|
////directionsService = new google.maps.DirectionsService;
|
|
////directionsDisplay = new google.maps.DirectionsRenderer;
|
|
////directionsDisplay.setMap(map);
|
|
|
|
//var upControlDiv = document.createElement('div');
|
|
//var upControl = new ControlUltimoPunto(upControlDiv, map);
|
|
|
|
//upControlDiv.index = 1;
|
|
//map.controls[google.maps.ControlPosition.TOP_RIGHT].push(upControlDiv);
|
|
|
|
//var routeControlDiv = document.createElement('div');
|
|
//var routeControl = new ControlGuardarRuta(routeControlDiv, map);
|
|
|
|
//routeControlDiv.index = 2;
|
|
//map.controls[google.maps.ControlPosition.TOP_RIGHT].push(routeControlDiv);
|
|
|
|
//service = new google.maps.DistanceMatrixService;
|
|
// map.addListener('click', addLatLng);
|
|
}
|
|
|
|
//$(document).ready(function () {
|
|
// GvBarraPaginator();
|
|
// initMap();
|
|
// Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
|
|
// function EndRequestHandler(sender, args) {
|
|
// $("#C_GvBarra_filter > div > input").on("keypress", function (e) {
|
|
// HdnTextFilter.value = $(this).val() + String.fromCharCode(e.which);
|
|
// });
|
|
// }
|
|
//});
|
|
|
|
function GvBarraPaginator() {
|
|
$('.table.PaginarGV').each(function () {
|
|
var Tthis = $(this);
|
|
if (!$.fn.DataTable.isDataTable(Tthis) && Tthis.find("th").length > 0) {
|
|
Tthis.prepend(("<thead></thead>"));
|
|
Tthis.find('thead').append($("#C_GvBarra").find("tr:first"));
|
|
var table = Tthis.DataTable({
|
|
//data: datasource,
|
|
//columns: [
|
|
// { title: "Vehiculo" },
|
|
// { title: "Fecha" },
|
|
// { title: "TiempoDetenido" },
|
|
// { title: "Extn." },
|
|
// { title: "Start date" },
|
|
// { title: "Salary" }
|
|
//],
|
|
deferRender: true,
|
|
deferLoading: 100,
|
|
scrollY: 130,
|
|
scrollCollapse: true,
|
|
scroller: {
|
|
displayBuffer: 20
|
|
},
|
|
ordering: true
|
|
});
|
|
var tkeys = new $.fn.dataTable.KeyTable(table, {
|
|
// options
|
|
});
|
|
var parent = Tthis.parent().parent().parent();
|
|
$('.dataTables_scrollHeadInner > .table.ADScrollPaginator2').find('th').addClass('importantth');
|
|
parent.find(".dataTables_paginate").css("display", "none");
|
|
parent.find(".dataTables_length").css("display", "none");
|
|
}
|
|
});
|
|
}
|
|
|
|
function ShowDiv(controlDiv, map) {
|
|
// Set CSS for the control border.
|
|
var controlUI = document.createElement('div');
|
|
controlUI.style.backgroundColor = '#444d58';
|
|
controlUI.style.border = '2px solid #444d58';
|
|
controlUI.style.borderRadius = '3px';
|
|
controlUI.style.width = '100%'
|
|
controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';
|
|
controlUI.style.cursor = 'pointer';
|
|
controlUI.style.marginRight = '5px';
|
|
controlUI.style.marginTop = '5px';
|
|
controlUI.style.marginBottom = '0px';
|
|
controlUI.style.textAlign = 'center';
|
|
// controlUI.title = 'Click para borrar el último punto dibujado';
|
|
controlDiv.appendChild(controlUI);
|
|
|
|
// Set CSS for the control interior.
|
|
var controlText = document.createElement('div');
|
|
controlText.style.color = '#ebebeb';
|
|
controlText.id = "ShowDiv3"
|
|
controlText.style.fontFamily = ' "Open Sans", sans-serif; ';
|
|
controlText.style.fontSize = '14px';
|
|
controlText.style.lineHeight = '20px';
|
|
controlText.style.paddingLeft = '5px';
|
|
controlText.style.paddingRight = '5px';
|
|
controlText.innerHTML = '<i class="fa fa-angle-up" aria-hidden="true"></i>';
|
|
controlUI.appendChild(controlText);
|
|
|
|
// Setup the click event listeners: simply set the map to Chicago.
|
|
controlUI.addEventListener('click', function () {
|
|
FNShowDiv();
|
|
});
|
|
}
|
|
|
|
function FNShowDiv() {
|
|
if (open === false) {
|
|
//$("#ChkSeguimiento").appendTo("#DivSeguimiento");
|
|
//$("#ChkSeguimiento").appendTo("#DivSeguimiento");
|
|
$("#h").modal()
|
|
$("#ShowDiv3").css("line-height", "34px")
|
|
open = true
|
|
$("#ShowDiv3").html('<i class="fa fa-angle-down" aria-hidden="true"></i>')
|
|
setTimeout(function () {
|
|
$('.table.ADScrollPaginator2').DataTable().draw();
|
|
}, 150);
|
|
if ($("#HdnOpcion").val() === 'All' || $("#HdnOpcion").val() === 'Idle' || $("#HdnOpcion").val() === 'Ralenti') {
|
|
$('#btnPlay').css('display', '');
|
|
$('#btnPrintExcel').css('display', '');
|
|
$('#btnPrintPDF').css('display', '');
|
|
$("#btnPlay").click(function () {
|
|
pause = !pause;
|
|
if (pause) {
|
|
stopTimeout();
|
|
} else {
|
|
if (startPlay) {
|
|
startPlay = false;
|
|
Play();
|
|
} else {
|
|
Play();
|
|
}
|
|
}
|
|
if ($('#btnPlay > i').hasClass("fa-pause")) {
|
|
$('#btnPlay > i').removeClass("fa-pause").addClass("fa-play");
|
|
} else if ($('#btnPlay > i').hasClass("fa-play")) {
|
|
$('#btnPlay > i').removeClass("fa-play").addClass("fa-pause");
|
|
}
|
|
|
|
});
|
|
$("#btnPrintExcel").click(function () {
|
|
var s;
|
|
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
|
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
|
}
|
|
$("#HdnDirecciones").val(s);
|
|
doScaledCLick("#C_BtnImprimirEX")
|
|
});
|
|
$("#btnPrintPDF").click(function () {
|
|
var s = "";
|
|
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
|
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
|
}
|
|
$("#HdnDirecciones").val(s);
|
|
doScaledCLick("#C_btnImprimir")
|
|
});
|
|
} else if ($("#HdnOpcion").val() === 'Speed') {
|
|
|
|
$('#btnPrintExcel').css('display', '');
|
|
$('#btnPrintPDF').css('display', '');
|
|
|
|
$("#btnPrintExcel").click(function () {
|
|
var s;
|
|
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
|
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
|
}
|
|
$("#HdnDirecciones").val(s);
|
|
doScaledCLick("#C_BtnImprimirEX")
|
|
});
|
|
$("#btnPrintPDF").click(function () {
|
|
var s = "";
|
|
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
|
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
|
}
|
|
$("#HdnDirecciones").val(s);
|
|
doScaledCLick("#C_btnImprimir")
|
|
});
|
|
} else if ($("#HdnOpcion").val() === 'Last') {
|
|
$('#btnPrintExcel').css('display', '');
|
|
$("#btnPrintExcel").click(function () {
|
|
var s;
|
|
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
|
|
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
|
|
}
|
|
$("#HdnDirecciones").val(s);
|
|
doScaledCLick("#C_BtnImprimirEX");
|
|
});
|
|
}
|
|
} else {
|
|
$("#h").modal('hide')
|
|
$("#ShowDiv3").css("line-height", "20px")
|
|
open = false
|
|
$("#ShowDiv3").html('<i class="fa fa-angle-up" aria-hidden="true"></i>')
|
|
}
|
|
}
|
|
|
|
function CargaDivs(Tipo) {
|
|
if (Tipo === "PointGroup") {
|
|
$("#C_TxtNombre").val("")
|
|
$("#C_TxtDescripcion").val("")
|
|
$('#divAgregarTipo').modal();
|
|
$("#HdnTipo").val(Tipo)
|
|
$("#lblPuntos").text("Nombre Grupo de Puntos")
|
|
$("#dvEventos").css("display", "none")
|
|
$("#dvAdd").css("display", "")
|
|
}
|
|
else if (Tipo === "Point") {
|
|
if (markers.length > 0) {
|
|
$('#divAgregarTipo').modal();
|
|
$("#C_TxtNombre").val("")
|
|
$("#C_TxtDescripcion").val("")
|
|
$("#HdnTipo").val(Tipo)
|
|
$("#lblPuntos").text("Nombre Punto(s) de Interés")
|
|
$("#dvEventos").css("display", "")
|
|
$("#dvAdd").css("display", "")
|
|
} else { DeleteMarkers(); alert('Haga click en el mapa para dibujar puntos de interés') }
|
|
}
|
|
else if (Tipo === "GroupRoute") {
|
|
DeleteMarkers();
|
|
$("#C_TxtNombre").val("1")
|
|
$("#C_TxtDescripcion").val("1")
|
|
$('#divAgregarTipo').modal();
|
|
$("#HdnTipo").val(Tipo)
|
|
$("#dvEventos").css("display", "")
|
|
$("#dvAdd").css("display", "none")
|
|
}
|
|
else if (Tipo === "Route") {
|
|
DeleteMarkers();
|
|
$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });
|
|
} else if (Tipo === "Rep") {
|
|
$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });
|
|
CargaPickers();
|
|
}
|
|
|
|
|
|
}
|
|
function CreaCirculo(coords, color) {
|
|
//var Circle = new google.maps.Circle({
|
|
// strokeColor: color,
|
|
// strokeOpacity: 0.8,
|
|
// strokeWeight: 2,
|
|
// fillColor: color,
|
|
// fillOpacity: 0.35,
|
|
// map: map,
|
|
// center: coords,
|
|
// radius: 15
|
|
//});
|
|
var Circle = new google.maps.Marker({
|
|
position: coords,
|
|
icon: {
|
|
path: google.maps.SymbolPath.CIRCLE,
|
|
scale: 10,
|
|
fillColor: color,
|
|
fillOpacity: 0.35,
|
|
strokeWeight: 2,
|
|
strokeColor: color,
|
|
strokeOpacity: 0.8
|
|
},
|
|
map: map
|
|
});
|
|
circles.push(Circle);
|
|
}
|
|
function DeleteMarkers() {
|
|
for (var i = 0; i < markers.length; i++) {
|
|
markers[i].setMap(null);
|
|
}
|
|
markers = [];
|
|
for (var i = 0; i < circles.length; i++) {
|
|
circles[i].setMap(null);
|
|
}
|
|
circles = [];
|
|
markers = [];
|
|
}
|
|
function CreaMarcador(coords, nomPunto, ContentString) {
|
|
var marker = new google.maps.Marker({
|
|
position: coords,
|
|
title: nomPunto,
|
|
map: map
|
|
});
|
|
var infowindow = new google.maps.InfoWindow({
|
|
content: ContentString
|
|
});
|
|
marker.addListener('click', function () {
|
|
closeLastOpenedInfoWindow();
|
|
infowindow.open(map, marker);
|
|
lastOpenedInfoWindow = infowindow;
|
|
});
|
|
markers.push(marker);
|
|
if (markers.length > 1) {
|
|
fitBoundsToVisibleMarkers()
|
|
} else if (markers.length === 1) {
|
|
map.setZoom(15);
|
|
map.setCenter(coords);
|
|
}
|
|
}
|
|
function closeLastOpenedInfoWindow() {
|
|
if (lastOpenedInfoWindow) {
|
|
lastOpenedInfoWindow.close();
|
|
}
|
|
}
|
|
|
|
function fitBoundsToVisibleMarkers() {
|
|
|
|
var bounds = new google.maps.LatLngBounds();
|
|
|
|
for (var i = 0; i < markers.length; i++) {
|
|
if (markers[i].getVisible()) {
|
|
bounds.extend(markers[i].getPosition());
|
|
}
|
|
}
|
|
|
|
map.fitBounds(bounds);
|
|
|
|
}
|
|
|
|
function CargaPickers() {
|
|
$.datetimepicker.setLocale('es');
|
|
$('input.ADDateTimePicker').each(function () {
|
|
var TThis = $(this);
|
|
if (Tthis.siblings().length <= 2) {
|
|
TThis.datetimepicker({
|
|
dayOfWeekStart: 1,
|
|
lang: 'es',
|
|
format: 'd/m/Y H:i',
|
|
formatDate: 'd/m/Y H:i',
|
|
step: 30
|
|
});
|
|
var Div = TThis.parent()
|
|
var boton = document.createElement('span');
|
|
boton.className = "input-group-btn"
|
|
|
|
var subboton = document.createElement('a')
|
|
subboton.className = "btn default"
|
|
subboton.innerHTML = "<i class='fa fa-calendar'></i>"
|
|
subboton.addEventListener('click', function () {
|
|
TThis.datetimepicker('show')
|
|
});
|
|
boton.appendChild(subboton)
|
|
|
|
Div[0].appendChild(boton)
|
|
}
|
|
});
|
|
}
|
|
|
|
function CargaGV(CveDispositivo, CvePunto) {
|
|
$("#HdnPunto").val(CvePunto + '')
|
|
$("#HdnDispositivo").val(CveDispositivo + '')
|
|
$("#C_BtnCargarGV").click()
|
|
}
|
|
|
|
</script>
|
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
|
</asp:Content>
|
|
|