Commit inicial Ventas Productivo
This commit is contained in:
217
GPS/RepEventos.aspx
Normal file
217
GPS/RepEventos.aspx
Normal file
@@ -0,0 +1,217 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEventos.aspx.vb" Inherits="GPS_RepEventos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Eventos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:HyperLink ID="LnkGrafica" runat="server" NavigateUrl="javascript:CargaGraficaEventos(false);$('#DivModalGraficaEventos').modal({ backdrop: 'static', keyboard: false });"><i class="fa fa-file-pdf-o"></i> Ver Grafica</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkPDF" OnClientClick="ImprimeGrafica(); return false;" OnClick="LnkPDF_Click" runat="server"><i class="fa fa-file-pdf-o"></i> Imprimir PDF</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPDF" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Grupo:
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlGrupo" runat="server" Width="200px" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-2" Text="Seleccione"></asp:ListItem>
|
||||
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlGrupo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-2" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</li>
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<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="GrpGuardar"></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" style="display: inline-block;">
|
||||
<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="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Eventos</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<asp:GridView ID="GvEventos" runat="server" Style="overflow-x: auto;" GridLines="None" OnRowDataBound="GvEventos_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="2" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas">
|
||||
<Columns>
|
||||
<asp:HyperLinkField Target="_blank" DataTextField="Vehiculo" DataNavigateUrlFormatString='/GPS/Conductores.aspx?CveDispositivo={0}' DataNavigateUrlFields="CveDispositivo" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Conductor" ItemStyle-Width="12.5%" HeaderText="Conductor" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoExcesosVelocidad" ItemStyle-Width="12.5%" HeaderText="Excesos de Velocidad" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoAceleraciones" ItemStyle-Width="12.5%" HeaderText="Aceleraciones" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoAceleraciones" ItemStyle-Width="12.5%" HeaderText="Aceleraciones" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoFrenados" ItemStyle-Width="12.5%" HeaderText="Frenados" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoRalentis" ItemStyle-Width="12.5%" HeaderText="Ralentí" ItemStyle-HorizontalAlign="Center" />
|
||||
<%--
|
||||
<asp:BoundField DataField="Ponderacion" ItemStyle-Width="12.5%" HeaderText="Ponderación" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Riesgo" ItemStyle-Width="12.5%" HeaderText="Riesgo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Desgaste" ItemStyle-Width="12.5%" HeaderText="Desgaste" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
<asp:BoundField DataField="TotalEventos" ItemStyle-Width="12.5%" HeaderText="Total Eventos" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivModalGraficaEventos" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGraficaEventos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnImagen" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<asp:HiddenField ID="HdnGraficaEventos" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<div id="DvGraficaEventos" style="min-width: 900px; height: 500px; margin: 0 auto"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
function CargaGraficaEventos(print) {
|
||||
var datosKM = JSON.parse($('#HdnGraficaEventos').val());
|
||||
var datosgrupo = $("#C_DdlGrupo").select2('data');
|
||||
var titulo = "";
|
||||
if (typeof (datosgrupo) !== 'undefined') {
|
||||
titulo = "TOTAL DE EVENTOS OCURRIDOS DEL GRUPO:<b>" + datosgrupo[0].text + "</b>";
|
||||
}
|
||||
$("#DvGraficaEventos").highcharts({
|
||||
chart: {
|
||||
type: 'column'
|
||||
},
|
||||
title: {
|
||||
text: titulo
|
||||
},
|
||||
subtitle: {
|
||||
text: ''
|
||||
},
|
||||
xAxis: {
|
||||
categories: datosKM.categories,
|
||||
crosshair: true
|
||||
},
|
||||
yAxis: {
|
||||
min: 0,
|
||||
title: {
|
||||
text: ''
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
|
||||
pointFormat: '<tr><td style="color:{series.color};padding:0">Total de {series.name}: </td>' +
|
||||
'<td style="padding:0"><b>{point.y:.1f}</b></td></tr>',
|
||||
footerFormat: '</table>',
|
||||
shared: true,
|
||||
useHTML: true
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
pointPadding: 0.2,
|
||||
borderWidth: 0
|
||||
}
|
||||
},
|
||||
series: datosKM.series
|
||||
});
|
||||
save_chart($('#DvGraficaEventos').highcharts(), 'chart',print);
|
||||
|
||||
}
|
||||
EXPORT_WIDTH = 1000;
|
||||
function save_chart(chart, filename,print) {
|
||||
var render_width = EXPORT_WIDTH;
|
||||
var render_height = render_width * chart.chartHeight / chart.chartWidth
|
||||
|
||||
var svg = chart.getSVG({
|
||||
exporting: {
|
||||
sourceWidth: chart.chartWidth,
|
||||
sourceHeight: chart.chartHeight
|
||||
}
|
||||
});
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.height = render_height;
|
||||
canvas.width = render_width;
|
||||
|
||||
var image = new Image;
|
||||
image.onload = function () {
|
||||
canvas.getContext('2d').drawImage(this, 0, 0, render_width, render_height);
|
||||
var data = canvas.toDataURL("image/png");
|
||||
|
||||
$("#HdnImagen").val(data);
|
||||
if (print) {
|
||||
javascript: __doPostBack('ctl00$H$LnkPDF', '')
|
||||
}
|
||||
};
|
||||
//image.src = 'data:image/svg+xml;base64,' + window.btoa(svg);
|
||||
image.src = 'data:image/svg+xml;base64,' + utoa(svg);
|
||||
}
|
||||
function utoa(str) {
|
||||
return window.btoa(unescape(encodeURIComponent(str)));
|
||||
}
|
||||
function ImprimeGrafica() {
|
||||
CargaGraficaEventos(true);
|
||||
}
|
||||
//function download(data, filename) {
|
||||
// var a = document.createElement('a');
|
||||
// a.download = filename;
|
||||
// a.href = data
|
||||
// document.body.appendChild(a);
|
||||
// a.click();
|
||||
// a.remove();
|
||||
//}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
Reference in New Issue
Block a user