<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KartyEwidencjiObecnosciKartaWydruk.aspx.cs" Inherits="KOLKaP_WEB.KOLKaP.KartyEwidencjiObecnosciKartaWydruk" %>

<%@ Register TagPrefix="dx" Namespace="DevExpress.XtraReports.Web" Assembly="DevExpress.XtraReports.v14.2.Web, Version=14.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Karta ewidencji obecności wydruk</title>
    <link href="../Web.css?2" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="../jquery/themes/ui-lightness/jquery-ui-1.9.2.custom.min.css" />
    <script src="../jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="../jquery/ui/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script>
    <script src="../jquery/jquery.blockUI.js" type="text/javascript"></script>
    <script src="../Skrypty.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            $("#btnZamknij").button({ icons: { primary: 'ui-icon-check' } });
            $("#btnZatwierdz").button({ icons: { primary: 'ui-icon-check' } });
            $("#btnZatwierdzPomimo").button({ icons: { primary: 'ui-icon-check' } });
            $("#btnFormZatwierdz").button({ icons: { primary: 'ui-icon-check' } });
            $("#btnFormAnuluj").button({ icons: { primary: 'ui-icon-cancel' } });


            $("#dialog-form-powod").dialog({
                autoOpen: false,
                height: 180,
                width: 350,
                modal: true,
                position: "center",
                resizable: false
            });

            var tbPowod = $("#tbPowod"),
                allFields = $([]).add(tbPowod)

        });

        function OtworzOkienkoPowod() {
            $("#btnFormZatwierdz").show();
            $("#dialog-form-powod").parent().appendTo(jQuery("form:first"));
            $("#dialog-form-powod").dialog("open");
        }

        function UkryjOpcjeExportu() {
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI1_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI1_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI2_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI2_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI3_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI3_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI4_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI4_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI5_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI5_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI6_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI6_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI7_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I0_PM_DXI7_').style.display = 'none';
            }

            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI1_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI1_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI2_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI2_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI3_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI3_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI4_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI4_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI5_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI5_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI6_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI6_').style.display = 'none';
            }
            if (document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI7_') != null) {
                document.getElementById('dv_Splitter_RibbonToolbar_T0G1I1_PM_DXI7_').style.display = 'none';
            }
        }
    </script>
    <script type="text/javascript">
        function init(s) {
            var createFrameElement = s.viewer.printHelper.createFrameElement;
            s.viewer.printHelper.createFrameElement = function (name) {
                var frameElement = createFrameElement.call(this, name);
                var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
                if (isChrome) {
                    frameElement.addEventListener("load", function (e) {
                        if (frameElement.contentDocument && frameElement.contentDocument.contentType !== "text/html")
                            frameElement.contentWindow.print();
                    });
                }
                return frameElement;
            }
        }
    </script>
</head>
<body onload="UkryjOpcjeExportu();" style="font-size: 8pt;">
    <form id="Form2" method="post" runat="server">
        <div> 
<%--            <iframe id="pdfIframe" src="../pdfjs/web/viewer.html" style="width: 100%; height: 100%;" runat="server"></iframe>--%>
            <div>
                <div id="divError">
                    <asp:Label ID="lblError" runat="server"></asp:Label>
                </div>
                <div style="padding-left: 5px; float: left; padding-top: 0px; padding-bottom: 5px;">

                    <asp:LinkButton ID="btnZamknij" runat="server" Text="Akceptuj" OnClick="btnZamknij_Click"></asp:LinkButton>
                    <asp:LinkButton ID="btnZatwierdz" runat="server" Text="Zatwierdź" OnClick="btnZatwierdz_Click"></asp:LinkButton>
                    <button id="btnZatwierdzPomimo" runat="server" type="button" value="Zatwierdź" onclick="OtworzOkienkoPowod();" style="font-weight: normal; color: Black;">Zatwierdź</button>

                </div>
            </div>
            <br />
            <div style="clear: both" id="divDv" runat="server">
                <dx:ASPxDocumentViewer ID="dv" runat="server" ToolbarMode="Ribbon">
                    <ClientSideEvents Init="init" />
                </dx:ASPxDocumentViewer>

            </div>
        </div>
        <div id="divPdfHandler" style="display: none;" runat="server">
            <iframe src="KartyEwidencjiObecnosciPdfHandler.ashx" style="width:100%; height:1000px;" runat="server" id="ifEmbeddedPdfHandler"></iframe>
        </div>
        <!-- Okienko dialogu -->
        <div id="dialog-form-powod" title="Powód zatwierdzenia" style="display: none;">
            <div style="width: 100%;">
                <span>Podaj powód zatwierdzenia mimo braku akceptacji pracownika:</span>
            </div>
            <div style="height: 80px;">
                <asp:TextBox ID="tbPowod" runat="server" TextMode="MultiLine" Rows="4" class="text ui-widget-content ui-corner-all" Style="width: 300px;" EnableViewState="true"></asp:TextBox>
            </div>
            <div>
                <div style="float: right;">
                    <asp:LinkButton ID="btnFormZatwierdz" runat="server" OnClick="btnFormZatwierdz_Click" Style="display: none;">Zatwierdź</asp:LinkButton>
                    <asp:LinkButton ID="btnFormAnuluj" runat="server" OnClick="btnFormAnuluj_Click">Anuluj</asp:LinkButton>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
