720 lines
		
	
	
		
			28 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			720 lines
		
	
	
		
			28 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
<%@ Page Title="" Language="C#" MasterPageFile="~/IronIntelMasterPage.master" AutoEventWireup="true" CodeFile="FuelReport.aspx.cs" Inherits="FuelReport" %>
 | 
						|
 | 
						|
<asp:Content ID="Content1" ContentPlaceHolderID="holder_head" runat="Server">
 | 
						|
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
 | 
						|
    <link href="<%=GetFileUrlWithVersion("css/sections.css")%>" rel="stylesheet" type="text/css" />
 | 
						|
    <link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" />
 | 
						|
    <link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" type="text/css" />
 | 
						|
    <script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
 | 
						|
    <style type="text/css">
 | 
						|
        .fa {
 | 
						|
            display: inline-block;
 | 
						|
            font: normal normal normal 14px/1 FontAwesome;
 | 
						|
            font-size: inherit;
 | 
						|
            text-rendering: auto;
 | 
						|
            -webkit-font-smoothing: antialiased;
 | 
						|
            -moz-osx-font-smoothing: grayscale;
 | 
						|
        }
 | 
						|
 | 
						|
        .icon-settings {
 | 
						|
            width: 20px;
 | 
						|
            height: 20px;
 | 
						|
        }
 | 
						|
 | 
						|
            .icon-settings::before {
 | 
						|
                content: '\f0ae';
 | 
						|
            }
 | 
						|
    </style>
 | 
						|
    <style>
 | 
						|
        .maintable {
 | 
						|
            border-collapse: collapse;
 | 
						|
            width: 100%;
 | 
						|
            page-break-inside: avoid;
 | 
						|
            line-height: 24px;
 | 
						|
            table-layout: fixed;
 | 
						|
        }
 | 
						|
 | 
						|
            .maintable td {
 | 
						|
                /*border: 1px solid #a9a9a9;*/
 | 
						|
                padding-left: 3px;
 | 
						|
                padding-right: 3px;
 | 
						|
            }
 | 
						|
 | 
						|
            .maintable .mainlabel {
 | 
						|
                font-weight: bold;
 | 
						|
            }
 | 
						|
 | 
						|
        .catelog {
 | 
						|
            color: #444;
 | 
						|
            height: 30px;
 | 
						|
            line-height: 30px;
 | 
						|
            margin-top: 8px;
 | 
						|
            padding-left: 10px;
 | 
						|
            padding-right: 10px;
 | 
						|
            font-size: 20px;
 | 
						|
            font-style: italic;
 | 
						|
        }
 | 
						|
 | 
						|
        .page {
 | 
						|
            /*background-color: #d3d3d3;*/
 | 
						|
            /*height: 52px;*/
 | 
						|
            line-height: 52px;
 | 
						|
            margin-top: 8px;
 | 
						|
            padding-left: 10px;
 | 
						|
            padding-right: 10px;
 | 
						|
            font-size: 26px;
 | 
						|
            font-weight: 700;
 | 
						|
            color: #333;
 | 
						|
        }
 | 
						|
 | 
						|
        .section {
 | 
						|
            /*background-color: #eaeaea;*/
 | 
						|
            /*height: 40px;*/
 | 
						|
            line-height: 40px;
 | 
						|
            padding-left: 30px;
 | 
						|
            padding-right: 10px;
 | 
						|
            font-size: 20px;
 | 
						|
            font-weight: 400;
 | 
						|
            color: #222;
 | 
						|
        }
 | 
						|
 | 
						|
        .question {
 | 
						|
            min-height: 30px;
 | 
						|
            line-height: 30px;
 | 
						|
            padding-left: 70px;
 | 
						|
            padding-right: 10px;
 | 
						|
            font-size: 14px;
 | 
						|
            font-weight: bold;
 | 
						|
            color: #111;
 | 
						|
            /*display: flex;*/
 | 
						|
        }
 | 
						|
 | 
						|
        .answer {
 | 
						|
            min-height: 30px;
 | 
						|
            line-height: 30px;
 | 
						|
            padding-left: 90px;
 | 
						|
            padding-right: 10px;
 | 
						|
        }
 | 
						|
 | 
						|
        .media {
 | 
						|
            width: 120px;
 | 
						|
            height: 120px;
 | 
						|
            margin-top: 5px;
 | 
						|
            margin-bottom: 10px;
 | 
						|
            margin-right: 10px;
 | 
						|
            cursor: pointer;
 | 
						|
            border: 1px solid #b0b0b0;
 | 
						|
            border-radius: 2px;
 | 
						|
            box-shadow: rgba(0, 0, 0, 0.4);
 | 
						|
            text-align: center;
 | 
						|
            float: left;
 | 
						|
        }
 | 
						|
 | 
						|
        .video {
 | 
						|
            line-height: 120px;
 | 
						|
            font-size: 30px;
 | 
						|
            margin: 0 auto;
 | 
						|
            font-family: 'Fontawesome';
 | 
						|
        }
 | 
						|
 | 
						|
            .video::before {
 | 
						|
                content: '\f03d';
 | 
						|
            }
 | 
						|
 | 
						|
        .circle {
 | 
						|
            width: 12px;
 | 
						|
            height: 12px;
 | 
						|
            border-radius: 6px;
 | 
						|
            display: inline-block;
 | 
						|
        }
 | 
						|
 | 
						|
        .label_level {
 | 
						|
            float: right;
 | 
						|
            margin-right: 10px;
 | 
						|
        }
 | 
						|
 | 
						|
        .tab_header { /*corver*/
 | 
						|
            font-size: 18px;
 | 
						|
            font-weight: 500;
 | 
						|
        }
 | 
						|
 | 
						|
            .tab_header [data-href] {
 | 
						|
                line-height: 16px;
 | 
						|
                height: 16px;
 | 
						|
            }
 | 
						|
 | 
						|
                .tab_header [data-href].selected {
 | 
						|
                    line-height: 20px;
 | 
						|
                    height: 20px;
 | 
						|
                }
 | 
						|
 | 
						|
        .assettrmobile {
 | 
						|
            display: none;
 | 
						|
        }
 | 
						|
 | 
						|
        #right_popup {
 | 
						|
            left: 320px;
 | 
						|
        }
 | 
						|
 | 
						|
        .inspect-asset td b {
 | 
						|
            text-align: right;
 | 
						|
        }
 | 
						|
 | 
						|
        @media screen and (orientation: portrait) {
 | 
						|
            #right_popup {
 | 
						|
                left: 0;
 | 
						|
            }
 | 
						|
 | 
						|
            .inspect-asset td b {
 | 
						|
                text-align: left;
 | 
						|
            }
 | 
						|
 | 
						|
            .inspect-asset td span {
 | 
						|
                display: block;
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        #divreport {
 | 
						|
            padding-left: 50px;
 | 
						|
        }
 | 
						|
 | 
						|
        .img-logo {
 | 
						|
            width: 100px;
 | 
						|
        }
 | 
						|
 | 
						|
        .headertable {
 | 
						|
            width: 100%;
 | 
						|
            margin-bottom: 20px;
 | 
						|
        }
 | 
						|
 | 
						|
        .footertable {
 | 
						|
            width: 100%;
 | 
						|
            margin-top: 30px;
 | 
						|
            margin-bottom: 20px;
 | 
						|
        }
 | 
						|
    </style>
 | 
						|
    <script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
 | 
						|
    <script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
 | 
						|
    <script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
 | 
						|
    <script data-main="<%=GetFileUrlWithVersion("js/view-main.js")%>" src="<%=GetFileUrlWithVersion("../js/lib/require-2.3.6.min.js")%>"></script>
 | 
						|
    <script type="text/javascript">
 | 
						|
        var reportid = "<%=ReportID %>";
 | 
						|
        var teamintelligence =<%=TeamIntelligence ?"true":"false"%>;
 | 
						|
        var isAdmin = <%=IsAdminOrSuper ? "true" : "false"%>;
 | 
						|
        var vm;
 | 
						|
        var vm1;
 | 
						|
        var reportdata;
 | 
						|
 | 
						|
        function inspectionrequest(method, param, callback, error) {
 | 
						|
            _network.request("Inspection/Inspection.aspx", -1, method, param, callback, error || function (e) {
 | 
						|
                showAlert(GetTextByKey('P_IPT_PAGEERROR', 'An unknown error occurred.  Please refresh page.'), GetTextByKey('P_IPT_QUERY', 'Query'));
 | 
						|
            });
 | 
						|
        }
 | 
						|
 | 
						|
        function showRightPopup(state) {
 | 
						|
            if (state) {
 | 
						|
                $('#content').css('overflow', 'hidden');
 | 
						|
                $("#mask_bg").show();
 | 
						|
                $("#right_popup").css("left", $("#set_left").width()).show();
 | 
						|
            }
 | 
						|
            else {
 | 
						|
                $('#content').css('overflow', '');
 | 
						|
                $("#mask_bg").hide();
 | 
						|
                $("#right_popup").hide();
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        function OnDownLoad() {
 | 
						|
            window.open("Inspection.aspx?rt=f&t=3&id=" + reportid + "&team=" + (teamintelligence ? 1 : 0), '_blank');
 | 
						|
        }
 | 
						|
 | 
						|
        function OnPrint() {
 | 
						|
            if (navigator.userAgent.indexOf('Firefox') >= 0 ||
 | 
						|
                navigator.userAgent.indexOf('Opera') >= 0) {
 | 
						|
                window.open("Inspection.aspx?rt=f&t=4&id=" + reportid + "&team=" + (teamintelligence ? 1 : 0), '_blank');
 | 
						|
                return;
 | 
						|
            }
 | 
						|
            $("#ifdiv").attr('src', "Inspection.aspx?rt=f&t=4&id=" + reportid + "&team=" + (teamintelligence ? 1 : 0));
 | 
						|
            if (!$("#ifdiv").data('inited')) {
 | 
						|
                $("#ifdiv").on('load', function () {
 | 
						|
                    onifload();
 | 
						|
                }).show();
 | 
						|
                $("#ifdiv").data('inited', 1);
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        function onifload() {
 | 
						|
            var iframe = document.getElementById('ifdiv');
 | 
						|
            iframe.contentWindow.focus();
 | 
						|
            iframe.contentWindow.print();
 | 
						|
        }
 | 
						|
 | 
						|
        var grid_fddt;
 | 
						|
        function showFuelDetailList(data) {
 | 
						|
            var rows = [];
 | 
						|
            for (var i = 0; i < data.length; i++) {
 | 
						|
                var r = data[i];
 | 
						|
                for (var j in r) {
 | 
						|
                    if (j === "AssetMeter") {
 | 
						|
                        r[j] = { DisplayValue: r["AssetMeterStr"], Value: r[j] };
 | 
						|
                    }
 | 
						|
                    if (j === "MasterMeter") {
 | 
						|
 | 
						|
                        r[j] = { DisplayValue: r["MasterMeterStr"], Value: r[j] };
 | 
						|
                    }
 | 
						|
                    if (j === "QtyPumped") {
 | 
						|
 | 
						|
                        r[j] = { DisplayValue: r["QtyPumpedStr"], Value: r[j] };
 | 
						|
                    }
 | 
						|
                    if (j === "QtyOnTruck") {
 | 
						|
 | 
						|
                        r[j] = { DisplayValue: r["QtyOnTruckStr"], Value: r[j] };
 | 
						|
                    }
 | 
						|
                }
 | 
						|
                var fr = { Values: r };
 | 
						|
                rows.push(fr);
 | 
						|
            }
 | 
						|
 | 
						|
            var height = 28 * data.length;
 | 
						|
            if (height < 300)
 | 
						|
                height = 300;
 | 
						|
            $("#fueldetaillist").css("height", height);
 | 
						|
            grid_fddt.setData(rows);
 | 
						|
        }
 | 
						|
 | 
						|
        function InitGridData() {
 | 
						|
            grid_fddt = new GridView('#fueldetaillist');
 | 
						|
            grid_fddt.lang = {
 | 
						|
                all: GetTextByKey("P_GRID_ALL", "(All)"),
 | 
						|
                ok: GetTextByKey("P_GRID_OK", "OK"),
 | 
						|
                reset: GetTextByKey("P_GRID_RESET", "Reset")
 | 
						|
            };
 | 
						|
            var list_columns = [
 | 
						|
                { name: 'AssetName', caption: GetTextByKey("P_IPT_EQUIPMENT", "Equipment #"), valueIndex: 'AssetName', css: { 'width': 150, 'text-align': 'left' } },
 | 
						|
                { name: 'AssetMeter', caption: GetTextByKey("P_IPT_HOURMETERODOMETER", "Hour Meter/Odometer"), valueIndex: 'AssetMeter', css: { 'width': 136, 'text-align': 'right' } },
 | 
						|
                { name: 'MasterMeter', caption: GetTextByKey("P_IPT_MASTERMETER", "Master Meter"), valueIndex: 'MasterMeter', css: { 'width': 88, 'text-align': 'right' } },
 | 
						|
                { name: 'QtyPumped', caption: GetTextByKey("P_IPT_GALLONSPUMPED", "Gallons Pumped"), valueIndex: 'QtyPumped', css: { 'width': 104, 'text-align': 'right' } },
 | 
						|
                { name: 'QtyOnTruck', caption: GetTextByKey("P_IPT_GALLONSONTRUCK", "Gallons on Truck"), valueIndex: 'QtyOnTruck', css: { 'width': 104, 'text-align': 'right' } },
 | 
						|
                { name: 'JobsiteCode', caption: GetTextByKey("P_IPT_CERTJOB", "CERT JOB #"), valueIndex: 'JobsiteCode', css: { 'width': 150, 'text-align': 'left' } },
 | 
						|
                { name: 'JobsiteName', caption: GetTextByKey("P_IPT_LOCATION", "Location"), valueIndex: 'JobsiteName', css: { 'width': 150, 'text-align': 'left' } },
 | 
						|
                { name: 'EquipmentCondition', caption: GetTextByKey("P_IPT_EQUIPMENTCONDITION", "Equipment Condition"), valueIndex: 'EquipmentCondition', css: { 'width': 140, 'text-align': 'left' } }
 | 
						|
            ];
 | 
						|
            var columns = [];
 | 
						|
            // head
 | 
						|
            for (var hd in list_columns) {
 | 
						|
                var col = {};
 | 
						|
                col.name = list_columns[hd].name;
 | 
						|
                col.caption = list_columns[hd].caption;
 | 
						|
                col.visible = true;
 | 
						|
                col.sortable = true;
 | 
						|
                col.width = list_columns[hd].css.width;
 | 
						|
                col.align = list_columns[hd].css["text-align"]
 | 
						|
                col.key = list_columns[hd].valueIndex;
 | 
						|
                col.allowFilter = list_columns[hd].allowFilter;
 | 
						|
                columns.push(col);
 | 
						|
            }
 | 
						|
            grid_fddt.canMultiSelect = false;
 | 
						|
            grid_fddt.columns = columns;
 | 
						|
            grid_fddt.init();
 | 
						|
 | 
						|
            grid_fddt.selectedrowchanged = function (rowindex) {
 | 
						|
                var rowdata = grid_fddt.source[rowindex];
 | 
						|
                if (rowdata) {
 | 
						|
                }
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
 | 
						|
        function showEmailList(data) {
 | 
						|
            var rows = [];
 | 
						|
            for (var i = 0; i < data.length; i++) {
 | 
						|
                var r = data[i];
 | 
						|
                if (!r.Selected)
 | 
						|
                    r.Selected = false;
 | 
						|
                for (var j in r) {
 | 
						|
                    if (j === "UID")
 | 
						|
                        r[j] = { DisplayValue: r["Name"] + "(" + r["ID"] + ")", Value: r[j] };
 | 
						|
                }
 | 
						|
                var fr = { Values: r };
 | 
						|
                rows.push(fr);
 | 
						|
            }
 | 
						|
 | 
						|
            $("#contactlist").css("height", 270);
 | 
						|
            grid_dtemail.setData(rows);
 | 
						|
        }
 | 
						|
 | 
						|
        var grid_dtemail;
 | 
						|
        function InitEmailGridData() {
 | 
						|
            grid_dtemail = new GridView('#contactlist');
 | 
						|
            grid_dtemail.lang = {
 | 
						|
                all: GetTextByKey("P_GRID_ALL", "(All)"),
 | 
						|
                ok: GetTextByKey("P_GRID_OK", "OK"),
 | 
						|
                reset: GetTextByKey("P_GRID_RESET", "Reset")
 | 
						|
            };
 | 
						|
            var list_columns = [
 | 
						|
                { name: 'UID', caption: GetTextByKey("P_IPT_CONTACTNAME", "Contact Name"), valueIndex: 'UID', css: { 'width': 320, 'text-align': 'left' } },
 | 
						|
                //{ name: 'ContactType', caption: GetTextByKey("P_IPT_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactType', css: { 'width': 148, 'text-align': 'left' } },
 | 
						|
                //{ name: 'Text', caption: GetTextByKey("P_MV_TEXT", "Text"), valueIndex: 'Text', type: 3, css: { 'width': 45, 'text-align': 'center' } },
 | 
						|
                { name: 'Selected', caption: GetTextByKey("P_IPT_EMAIL", "Email"), valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } }
 | 
						|
            ];
 | 
						|
            var columns = [];
 | 
						|
            // head
 | 
						|
            for (var hd in list_columns) {
 | 
						|
                var col = {};
 | 
						|
                col.name = list_columns[hd].name;
 | 
						|
                col.caption = list_columns[hd].caption;
 | 
						|
                col.visible = true;
 | 
						|
                col.sortable = true;
 | 
						|
                col.width = list_columns[hd].css.width;
 | 
						|
                col.align = list_columns[hd].css["text-align"]
 | 
						|
                col.key = list_columns[hd].valueIndex;
 | 
						|
                if (list_columns[hd].type) {
 | 
						|
                    col.type = list_columns[hd].type;
 | 
						|
                }
 | 
						|
                columns.push(col);
 | 
						|
            }
 | 
						|
            grid_dtemail.canMultiSelect = false;
 | 
						|
            grid_dtemail.columns = columns;
 | 
						|
            grid_dtemail.init();
 | 
						|
 | 
						|
            grid_dtemail.selectedrowchanged = function (rowindex) {
 | 
						|
                var rowdata = grid_dtemail.source[rowindex];
 | 
						|
                if (rowdata) {
 | 
						|
                }
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        $(function () {
 | 
						|
            $('#divLeftTitle').remove();
 | 
						|
            $('#content').css('margin-left', 0);
 | 
						|
            $('#fuelrpt_headers_left').html('');
 | 
						|
            $('#fuelrpt_headers_middle').html('');
 | 
						|
            $('#fuelrpt_headers_right').html('');
 | 
						|
            $('#fuelrpt_footers_left').html('');
 | 
						|
            $('#fuelrpt_footers_middle').html('');
 | 
						|
            $('#fuelrpt_footers_right').html('');
 | 
						|
            InitGridData();
 | 
						|
            InitEmailGridData();
 | 
						|
 | 
						|
            vm = new Vue({
 | 
						|
                el: '#tab_report1',
 | 
						|
                data: {
 | 
						|
                    report: {
 | 
						|
                        Asset: {},
 | 
						|
                        Template: {}
 | 
						|
                    }
 | 
						|
                },
 | 
						|
                methods: {
 | 
						|
                    reload: function (data) {
 | 
						|
                        this.report = data;
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            });
 | 
						|
            vm1 = new Vue({
 | 
						|
                el: '#tab_report2',
 | 
						|
                data: {
 | 
						|
                    report: {
 | 
						|
                        Asset: {},
 | 
						|
                        Template: {}
 | 
						|
                    }
 | 
						|
                },
 | 
						|
                methods: {
 | 
						|
                    reload: function (data) {
 | 
						|
                        this.report = data;
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            });
 | 
						|
 | 
						|
            GetFuelReport();
 | 
						|
 | 
						|
            $('#dialog_sendemail').dialog(function () {
 | 
						|
                $('#mask_bg').hide();
 | 
						|
            });
 | 
						|
 | 
						|
            $('#sendlocation_search').bind('input propertychange', function () {
 | 
						|
                searchEmail(false);
 | 
						|
            });
 | 
						|
 | 
						|
            $('#sendlocation_search').keydown(function () {
 | 
						|
                searchEmail(false);
 | 
						|
            });
 | 
						|
 | 
						|
            if (!canExport) {
 | 
						|
                $('#button-print').hide();
 | 
						|
                $('#button-dl').hide();
 | 
						|
            }
 | 
						|
 | 
						|
        });
 | 
						|
        function GetFuelReport() {
 | 
						|
            showmaskbg(true);
 | 
						|
            var p = JSON.stringify([teamintelligence, htmlencode(reportid)]);
 | 
						|
            inspectionrequest("GetFuelReport", p, function (data) {
 | 
						|
                if (typeof (data) === "string") {
 | 
						|
                    showAlert(data, GetTextByKey("P_IPT_ERROR", 'Error'));
 | 
						|
                }
 | 
						|
                else {
 | 
						|
                    reportdata = data;
 | 
						|
                    if (data.FuelDetailItems)
 | 
						|
                        showFuelDetailList(data.FuelDetailItems);
 | 
						|
                    vm.reload(data);
 | 
						|
                    vm1.reload(data);
 | 
						|
                    $('#fuelrpt_headers_left').html(data.HeaderFooter.HeaderLeft.replace(/\n/g, '<br/>'));
 | 
						|
                    $('#fuelrpt_headers_middle').html(data.HeaderFooter.HeaderMiddle.replace(/\n/g, '<br/>'));
 | 
						|
                    $('#fuelrpt_headers_right').html(data.HeaderFooter.HeaderRight.replace(/\n/g, '<br/>'));
 | 
						|
                    $('#fuelrpt_footers_left').html(data.HeaderFooter.FooterLeft.replace(/\n/g, '<br/>'));
 | 
						|
                    $('#fuelrpt_footers_middle').html(data.HeaderFooter.FooterMiddle.replace(/\n/g, '<br/>'));
 | 
						|
                    $('#fuelrpt_footers_right').html(data.HeaderFooter.FooterRight.replace(/\n/g, '<br/>'));
 | 
						|
                }
 | 
						|
 | 
						|
                showmaskbg(false);
 | 
						|
            }, function (err) {
 | 
						|
                showmaskbg(false);
 | 
						|
            });
 | 
						|
        }
 | 
						|
 | 
						|
 | 
						|
        function CheckEmail(mail) {
 | 
						|
            var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
 | 
						|
            if (mail.length == 0)
 | 
						|
                return true;
 | 
						|
            return filter.test(mail);
 | 
						|
        }
 | 
						|
 | 
						|
        function GetEmailList() {
 | 
						|
            inspectionrequest("GetFuelLogEmailList", '', function (data) {
 | 
						|
                if (typeof (data) !== "string") {
 | 
						|
                    isloademail = true;
 | 
						|
                    allemails = data;
 | 
						|
                    showEmailList(data);
 | 
						|
                }
 | 
						|
            }, function (err) {
 | 
						|
            });
 | 
						|
        }
 | 
						|
 | 
						|
        function searchEmail(newopen) {//newopen新打开
 | 
						|
            var filter = $('#sendlocation_search').val().trim().toLowerCase();
 | 
						|
            if (isloademail && allemails) {
 | 
						|
                var emails = [];
 | 
						|
                for (var i = 0; i < allemails.length; i++) {
 | 
						|
                    var m = allemails[i];
 | 
						|
                    if (newopen) {
 | 
						|
                        m.Selected = false;
 | 
						|
                        emails.push(m);
 | 
						|
                    }
 | 
						|
                    else {
 | 
						|
                        if (!m.Selected) {
 | 
						|
                            if (m.ID.toLowerCase().indexOf(filter) >= 0 || m.Name.toLowerCase().indexOf(filter) >= 0)
 | 
						|
                                emails.push(m);
 | 
						|
                        }
 | 
						|
                        else
 | 
						|
                            emails.push(m);
 | 
						|
                    }
 | 
						|
                }
 | 
						|
                showEmailList(emails);
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        var isloademail = false;
 | 
						|
        var allemails = [];
 | 
						|
        function openSendEmail() {
 | 
						|
            $('#sendlocation_search').val('').attr('placeholder', GetTextByKey('P_IPT_SEARCH','Search'));
 | 
						|
            
 | 
						|
            if (!isloademail)
 | 
						|
                GetEmailList();
 | 
						|
            else
 | 
						|
                searchEmail(true);
 | 
						|
 | 
						|
            $('#sendlocation_otheremailaddress').val('');
 | 
						|
            $('#sendlocation_desc').val('');
 | 
						|
            $('#mask_bg').show();
 | 
						|
            $('#dialog_sendemail .dialog-title span.title').text(GetTextByKey("P_IPT_SENDEMAIL", 'Send Email'));
 | 
						|
            //$('#mask_bg').show();
 | 
						|
            $('#dialog_sendemail')
 | 
						|
                .attr('act', 'edit')
 | 
						|
                .css({
 | 
						|
                    'width': 510,
 | 
						|
                    'top': (document.documentElement.clientHeight - $('#dialog_sendemail').height()) / 4,
 | 
						|
                    'left': (document.documentElement.clientWidth - $('#dialog_sendemail').width()) / 2
 | 
						|
                })
 | 
						|
                .showDialogfixed();
 | 
						|
 | 
						|
            setTimeout(function () {
 | 
						|
                $("#contactlist").css("height", 270);
 | 
						|
                grid_dtemail && grid_dtemail.resize();
 | 
						|
            });
 | 
						|
        }
 | 
						|
        function onSendEmail() {
 | 
						|
            if (grid_dtemail.source.length == 0) {
 | 
						|
                $('#dialog_sendemail').hideDialog();
 | 
						|
                $('#mask_bg').hide();
 | 
						|
                return;
 | 
						|
            }
 | 
						|
 | 
						|
            var emailaddress = [];
 | 
						|
 | 
						|
            var otheremailaddressstr = $('#sendlocation_otheremailaddress').val();
 | 
						|
            if (otheremailaddressstr !== "")
 | 
						|
                emailaddress = otheremailaddressstr.split(';');
 | 
						|
            for (var i = 0; i < emailaddress.length; i++) {
 | 
						|
                if (!CheckEmail($.trim(emailaddress[i]))) {
 | 
						|
                    showAlert(GetTextByKey("P_IPT_OTHEREMAILADDRESSISINVALID", 'The other email address {0} is invalid.').replace('{0}', emailaddress[i]), GetTextByKey("P_IPT_SENDEMAIL", 'Send Email'));
 | 
						|
                    return;
 | 
						|
                }
 | 
						|
            }
 | 
						|
 | 
						|
            for (var i = 0; i < grid_dtemail.source.length; i++) {
 | 
						|
                var ct = grid_dtemail.source[i].Values;
 | 
						|
                if (ct.Selected)
 | 
						|
                    emailaddress.push(ct.ID);
 | 
						|
            }
 | 
						|
 | 
						|
            if (emailaddress.length == 0) {
 | 
						|
                $('#dialog_sendemail').hideDialog();
 | 
						|
                $('#mask_bg').hide();
 | 
						|
                return;
 | 
						|
            }
 | 
						|
 | 
						|
            var p = [teamintelligence, reportid, htmlencode(JSON.stringify(emailaddress))];
 | 
						|
            inspectionrequest("SendFuelTruckFuelReport", JSON.stringify(p), function (data) {
 | 
						|
                if (data !== "OK") {
 | 
						|
                    showAlert(data, GetTextByKey("P_IPT_ERROR", 'Error'));
 | 
						|
                }
 | 
						|
                else {
 | 
						|
                    //showAlert(GetTextByKey("P_IPT_MESSAGESENT", 'Message sent.'), GetTextByKey("P_IPT_SENDEMAIL", 'Send Email'));
 | 
						|
                    $('#dialog_sendemail').hideDialog();
 | 
						|
                    $('#mask_bg').hide();
 | 
						|
                }
 | 
						|
 | 
						|
            }, function (err) {
 | 
						|
                showAlert(GetTextByKey("P_IPT_FAILEDTOSENDEMAIL", 'Failed to send email.'), GetTextByKey("P_IPT_SENDEMAIL", 'Send Email'));
 | 
						|
            });
 | 
						|
        }
 | 
						|
    </script>
 | 
						|
</asp:Content>
 | 
						|
<asp:Content ID="Content2" ContentPlaceHolderID="holder_content" runat="Server">
 | 
						|
    <div class="function_title" style="text-align: right; margin-top: 2px; margin-bottom: 2px;">
 | 
						|
        <span id="button-email" class="sbutton iconmail" onclick="openSendEmail();" data-lgid="P_IPT_SENDEMAIL">Send Email</span>
 | 
						|
        <span id="button-dl" class="sbutton icondownload" onclick="OnDownLoad();" data-lgid="P_IPT_DOWNLOAD">Download</span>
 | 
						|
        <span id="button-print" class="sbutton iconprint" onclick="OnPrint();" data-lgid="P_IPT_PRINT">Print</span>
 | 
						|
    </div>
 | 
						|
    <div id="divreport" style="width: 1120px; margin: 0px auto;">
 | 
						|
        <table class="maintable">
 | 
						|
            <tr>
 | 
						|
                <td style="width: 100px;"><%=Logo2 %></td>
 | 
						|
                <td>
 | 
						|
                    <h1>Fuel Log * Shipping Paper</h1>
 | 
						|
                </td>
 | 
						|
            </tr>
 | 
						|
        </table>
 | 
						|
        <table class="headertable">
 | 
						|
            <tr>
 | 
						|
                <td id="fuelrpt_headers_left"></td>
 | 
						|
                <td id="fuelrpt_headers_middle" style="text-align: center;"></td>
 | 
						|
                <td id="fuelrpt_headers_right" style="text-align: right;"></td>
 | 
						|
            </tr>
 | 
						|
        </table>
 | 
						|
        <table id="tab_report1" class="maintable">
 | 
						|
            <tr>
 | 
						|
                <td>
 | 
						|
                    <label data-lgid="P_IPT_EMPLOYEENUMBER_COLON">Employee #:</label>
 | 
						|
                    {{report.EmployeeNumber}} </td>
 | 
						|
                <td>
 | 
						|
                    <label style="margin-left: 50px;" data-lgid="P_IPT_DATE_COLON">Date:</label>
 | 
						|
                    {{report.LocalCalendarDateStr}}</td>
 | 
						|
                <td>
 | 
						|
                    <label style="margin-left: 50px;" data-lgid="P_IPT_EMPLOYEENAME_COLON">Employee Name:</label>
 | 
						|
                    {{report.EmployeeName}}</td>
 | 
						|
                <td>
 | 
						|
                    <label style="margin-left: 50px;" data-lgid="P_IPT_FUELTRUCKNUMBER_COLON">Fuel Truck#:</label>
 | 
						|
                    {{report.AssetName}}</td>
 | 
						|
            </tr>
 | 
						|
        </table>
 | 
						|
        <table class="maintable">
 | 
						|
            <tr>
 | 
						|
                <td id="tdgrid" style="padding: 0;">
 | 
						|
                    <div id="fueldetaillist" style="margin-top: 10px; width: 1120px; height: 300px;"></div>
 | 
						|
                </td>
 | 
						|
                <td></td>
 | 
						|
            </tr>
 | 
						|
        </table>
 | 
						|
        <table id="tab_report2" class="maintable">
 | 
						|
            <tr>
 | 
						|
                <td style="width: 830px;">
 | 
						|
                    <label data-lgid="P_IPT_IWITNESSEDANACCIDENTINJURYTODAY_COLON">I witnessed an accident/injury today:</label>
 | 
						|
                    {{report.WitnessedAccident}}</td>
 | 
						|
                <td>
 | 
						|
                    <label data-lgid="P_IPT_BULKPUMPMTRBEGINNING_COLON">Bulk Pump Mtr Beginning: </label>
 | 
						|
                    {{report.StartMasterMeterStr}} </td>
 | 
						|
            </tr>
 | 
						|
            <tr>
 | 
						|
                <td>
 | 
						|
                    <label data-lgid="P_IPT_IWASINVOLVEDINANACCIDENTTODAY_COLON">I was involved in an accident today: </label>
 | 
						|
                    {{report.InvolvedAccident}} </td>
 | 
						|
                <td>
 | 
						|
                    <label data-lgid="P_IPT_BULKPUMPMTRENDING_COLON">Bulk Pump Mtr Ending: </label>
 | 
						|
                    {{report.EndMasterMeterStr}}</td>
 | 
						|
            </tr>
 | 
						|
            <tr>
 | 
						|
                <td>
 | 
						|
                    <label data-lgid="P_IPT_IFYESTIPS">If YES, your supervisor must be notified and an accident report filled out.</label></td>
 | 
						|
                <td>
 | 
						|
                    <label data-lgid="P_IPT_GALLONSDISPENSED_COLON">Gallons Dispensed:</label>
 | 
						|
                    {{report.TotalQtyStr}}</td>
 | 
						|
            </tr>
 | 
						|
            <tr>
 | 
						|
                <td></td>
 | 
						|
                <td>
 | 
						|
                    <label data-lgid="P_IPT_INCHESLEFTONTRUCK_COLON">Inches Left on Truck:</label>
 | 
						|
                    {{report.InchesLeftonTruckStr}}</td>
 | 
						|
            </tr>
 | 
						|
        </table>
 | 
						|
        <table class="footertable">
 | 
						|
            <tr>
 | 
						|
                <td id="fuelrpt_footers_left"></td>
 | 
						|
                <td id="fuelrpt_footers_middle" style="text-align: center;"></td>
 | 
						|
                <td id="fuelrpt_footers_right" style="text-align: right;"></td>
 | 
						|
            </tr>
 | 
						|
        </table>
 | 
						|
 | 
						|
    </div>
 | 
						|
    <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
 | 
						|
    <div id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;">
 | 
						|
    </div>
 | 
						|
    <iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>
 | 
						|
 | 
						|
    <div class="dialog" id="dialog_sendemail" style="display: none; width: 320px;">
 | 
						|
        <div class="dialog-title"><span class="title" data-lgid="P_IPT_SENDEMAIL">Send Email</span><em class="dialog-close"></em></div>
 | 
						|
        <div class="dialog-content" style="height: 378px;">
 | 
						|
            <table style="line-height: 25px;">
 | 
						|
                <tr>
 | 
						|
                    <td colspan="2" data-lgid="P_IPT_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
 | 
						|
                </tr>
 | 
						|
                <tr>
 | 
						|
                    <td colspan="2">
 | 
						|
                        <input type="text" id="sendlocation_search" style="width: 445px; margin-left: 10px;" placeholder="Search" /></td>
 | 
						|
                </tr>
 | 
						|
                <tr>
 | 
						|
                    <td colspan="2">
 | 
						|
                        <div id="contactlist" style="height: 270px; width: 450px; margin-left: 10px; margin-right: 10px;"></div>
 | 
						|
                    </td>
 | 
						|
                </tr>
 | 
						|
                <tr style="height: 24px;">
 | 
						|
                    <td colspan="2" data-lgid="P_IPT_EMAILADDRESSESTIPS">Separate multiple manually entered email or text addresses with a semi-colon (;).</td>
 | 
						|
                </tr>
 | 
						|
                <tr style="height: 24px;">
 | 
						|
                    <td><span data-lgid="P_IPT_OTHEREMAILADDRESS">Other Email Address</span>
 | 
						|
                    </td>
 | 
						|
                    <td>
 | 
						|
                        <input type="text" id="sendlocation_otheremailaddress" style="width: 312px;" autocomplete="off" /></td>
 | 
						|
                </tr>
 | 
						|
            </table>
 | 
						|
        </div>
 | 
						|
        <div class="dialog-func">
 | 
						|
            <input type="button" value="Cancel" data-lgid="P_IPT_CANCEL" class="dialog-close" tabindex="12" />
 | 
						|
            <input type="button" onclick="onSendEmail();" value="Send" data-lgid="P_IPT_SEND" style="width:unset;" tabindex="11" />
 | 
						|
            <div class="clear"></div>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
</asp:Content>
 | 
						|
 |