<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Main.Master" AutoEventWireup="true" CodeBehind="AnaSayfa.aspx.cs" Inherits="Giza.Web.AnaSayfa" %>

<%@ Register TagPrefix="ezUc" TagName="DuyurularYatay" Src="~/UserControls/ucDuyurularYatay.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHeader" runat="server">
    <link href="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/bootstrap-table.min.css")%>" rel="stylesheet" />
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/bootstrap-table.min.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/locale/bootstrap-table-tr-TR.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/extensions/export/bootstrap-table-export.min.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/extensions/export/tableExport.min.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/extensions/export/tableExport.min.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js")%>"></script>
    <link href="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-select/dist/css/bootstrap-select.css") %>" rel="stylesheet" />
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.js") %>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js")%>"></script>

    <%--    <script src="Content/js/flot/jquery.flot.js"></script>--%>
    <%--<script src="Content/js/flot/jquery.flot.resize.js"></script>--%>

    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/flot/jquery.flot.js") %>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/flot/jquery.flot.resize.js") %>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/flot/jquery.flot.pie.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/flot.tooltip/js/jquery.flot.tooltip.min.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/flot-orderBars/js/jquery.flot.orderBars.js")%>"></script>
    <script src="<%= Page.ResolveUrl("~/Content/vendors/bower_components/flot-orderBars/js/jquery.flot.orderBars.js")%>"></script>
    <%--Dahil etme <script src="<%= Page.ResolveUrl("~/Content/js/flot-charts/bar-chart.js")%>"></script>--%>
    <script src="<%= Page.ResolveUrl("~/Content/js/flot-charts/pie-chart.js")%>"></script>


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderBreadcrumbs" runat="server">
    <%--    <ol class="breadcrumb" style="margin-bottom: 5px;">
        <li class="active"><a href="#">Anasayfa</a></li>
    </ol>--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <asp:HiddenField ID="hdnRapor1" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnRapor2" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnRapor3" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnRapor4" runat="server" ClientIDMode="Static" />


    <div class="card-header" style="padding-top: 70px">
        <table border="0" cellspacing="0" cellpadding="0" width="100%">
            <tr>
                <td>
                    <ezUc:DuyurularYatay ID="DuyurularYatay" runat="server" />
                </td>
            </tr>
        </table>

    </div>

    <div style="margin-top: 100px">

        <div class="col-sm-2 col-xs-2"></div>

        <a href="<%= Page.ResolveUrl("~/Pano/Default.aspx") %>">
            <img src="<%= Page.ResolveUrl("~/Content/img/dashboard.png") %>" title="Pano" alt="" class="col-sm-2 col-xs-2"></a>

        <img src="<%= Page.ResolveUrl("~/Content/img/Giza_Giris_Logo.png") %>" alt="Giza" class="col-sm-4 col-xs-4" />

        <a href="<%= Page.ResolveUrl("~/Pano/Rapor.aspx") %>">
            <img src="<%= Page.ResolveUrl("~/Content/img/rapor.png") %>" title="Rapor" alt="" class="col-sm-2 col-xs-2"></a>

    </div>


    <center>
    <div style="margin-top: 300px">
        <h5>"Araç kullanırken, tüm göstergelerin önünüzde olmasını istersiniz."</h5>
    </div>
    <div style="margin-top: 5px">
        <h5>"Neden şirketinizi yönetirken, tüm göstergeler önünüzde olmasın."</h5>
    </div>
    </center>


    <script type="text/javascript">

        $(document).ready(function () {

            var barData = new Array();
            var databaseName = '<%=HttpContext.Current.Session["SeciliSirket"] == null ? "" : HttpContext.Current.Session["SeciliSirket"].ToString()%>';
            $.ajax({
                url: "DataService.asmx/GetDynamicReportList",
                data: { limit: 0, offset: 1, search: "", sort: "", order: "", databaseName: databaseName, selectedTableName: "", searchText: "", ReportId: 6, Turu: "AnasayfaBarChart" },
                success: function (data) {

                    var gruplar = [];
                    $.each(data.rows, function (index, row) {
                        var grupmu = false;
                        var label = "";
                        var renk = "";

                        $.each(row, function (i, rval) {

                            var splited = rval.Key.split(':');
                            var kolondegeri = rval.Value;

                            ////////Özellikleri okuma
                            if (splited.length > 1) {

                                var ozelliktext = splited[1];
                                var ozellikler = ozelliktext.split(',');

                                $.each(ozellikler, function (index, deger) {

                                    var ozellik = deger.split('=');

                                    if (ozellik.length > 1) {

                                        //'StokKodu:renkkodu=#4a7ac3,grupmu=evet'
                                        if (ozellik[0] == 'renkkodu' && ozellik[1] != "") {
                                            renk = ozellik[1];
                                        }
                                        if (ozellik[0] == 'grupmu' && ozellik[1] == "evet") {
                                            label = kolondegeri; //grup adı
                                            grupmu = true
                                        }

                                    }
                                });
                            }
                            ////////END Özellikleri okuma

                            if (grupmu) {
                                gruplar.push(kolondegeri)
                            }
                        });
                    });

                    //alert(gruplar)

                    $.each(gruplar, function (ind, rval) {


                        barData.push({
                            data: [[1, 10 + ind], [2, 20 + ind]],
                            label: rval,
                            bars: {
                                show: true,
                                barWidth: 0.08,
                                order: ind,
                                lineWidth: 0,
                                fillColor: '#8BC34A'
                            }

                        });

                    });

                    //var barData = data.barData;

                    //barData.push({
                    //    data: [[1, 10], [2, 20]],
                    //    label: 'Tokyo',
                    //    bars: {
                    //        show: true,
                    //        barWidth: 0.08,
                    //        order: 1,
                    //        lineWidth: 0,
                    //        fillColor: '#8BC34A'
                    //    }
                    //});

                    //barData.push({
                    //    data: [[1, 30], [2, 40]],
                    //    label: 'Seoul',
                    //    bars: {
                    //        show: true,
                    //        barWidth: 0.08,
                    //        order: 2,
                    //        lineWidth: 0,
                    //        fillColor: '#00BCD4'
                    //    }
                    //});


                    /* Let's create the chart */
                    if ($('#bar-chart')[0]) {
                        $.plot($("#bar-chart"), barData, {
                            grid: {
                                borderWidth: 1,
                                borderColor: '#eee',
                                show: true,
                                hoverable: true,
                                clickable: true
                            },

                            yaxis: {
                                tickColor: '#eee',
                                tickDecimals: 0,
                                font: {
                                    lineHeight: 13,
                                    style: "normal",
                                    color: "#9f9f9f",
                                },
                                shadowSize: 0
                            },

                            xaxis: {
                                tickColor: '#fff',
                                tickDecimals: 0,
                                font: {
                                    lineHeight: 13,
                                    style: "normal",
                                    color: "#9f9f9f"
                                },
                                shadowSize: 0,
                            },

                            legend: {
                                container: '.flc-bar',
                                backgroundOpacity: 0.5,
                                noColumns: 0,
                                backgroundColor: "white",
                                lineWidth: 0
                            }
                        });
                    }

                    /* Tooltips for Flot Charts */

                    if ($(".flot-chart")[0]) {
                        $(".flot-chart").bind("plothover", function (event, pos, item) {
                            if (item) {
                                var x = item.datapoint[0].toFixed(2),
                                    y = item.datapoint[1].toFixed(2);
                                $(".flot-tooltip").html(item.series.label + " = " + y).css({ top: item.pageY + 5, left: item.pageX + 5 }).show();
                            }
                            else {
                                $(".flot-tooltip").hide();
                            }
                        });

                        $("<div class='flot-tooltip' class='chart-tooltip'></div>").appendTo("body");
                    }
                },
                error: function (e) {
                }
            });
        });
    </script>

    <div class="row" style="display: none;">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h2>Bar Chart</h2>

                    <ul class="actions">
                        <li class="dropdown action-show">
                            <a href="" data-toggle="dropdown">
                                <i class="zmdi zmdi-more-vert"></i>
                            </a>

                            <div class="dropdown-menu pull-right">
                                <p class="p-20">
                                    You can put anything here
                                </p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="card-body card-padding-sm">
                    <div id="bar-chart" class="flot-chart"></div>
                    <div class="flc-bar"></div>
                </div>
            </div>
        </div>

        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h2>Pie Chart</h2>
                    <ul class="actions">
                        <li class="dropdown action-show">
                            <a href="" data-toggle="dropdown">
                                <i class="zmdi zmdi-more-vert"></i>
                            </a>
                            <div class="dropdown-menu pull-right">
                                <p class="p-20">
                                    You can put anything here
                                </p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="card-body card-padding">
                    <div id="pie-chart" class="flot-chart-pie"></div>
                    <div class="flc-pie hidden-xs"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <!-- Recent Items -->
            <div class="card" style="min-height: 465px;" id="divRapor1" runat="server">
                <div class="card-header">
                    <h2>
                        <asp:Label ID="lblRapor1Adi" runat="server" Text="Anasayfa raporu bulunamadı. 1"></asp:Label><small></small></h2>
                </div>
                <div class="card-body m-t-0">
                    <table id="Rapor1table" class="table"
                        data-height=""
                        data-ajax="Rapor1ajaxRequest"
                        data-cache="true"
                        data-side-pagination="server"
                        data-pagination="true"
                        data-show-refresh="false"
                        data-toolbar="#toolbar"
                        data-search="false"
                        data-search-align="left"
                        data-show-columns="false"
                        data-show-export="false"
                        data-show-toggle="false"
                        data-show-footer="false"
                        data-show-pagination-switch="false"
                        data-cookie="false"
                        data-cookie-id-table="saveUserDefinedReportId"
                        data-striped="false"
                        data-hover="false"
                        data-mobile-responsive="true"
                        data-check-on-init="true"
                        data-filter-control="false"
                        data-advanced-search="false"
                        data-id-table="advancedTable1"
                        data-page-number="1"
                        data-page-size="10"
                        data-page-list="[10, 25, 50, 100, 200, 500, Tumu]"
                        data-locale="tr-TR"
                        data-id-field="Id"
                        data-sort-name=""
                        data-sort-order=""
                        data-row-style="rowStyle">
                        <thead>
                            <tr></tr>
                        </thead>
                    </table>
                </div>
                <asp:Literal ID="ltrlTumunuGorRapor1" Visible="false" runat="server" Text="Tümünü Gör"></asp:Literal>
            </div>
            <!-- Todo Lists -->
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <!-- Recent Items -->
            <div class="card" style="min-height: 465px;" id="divRapor2" runat="server">
                <div class="card-header">
                    <h2>
                        <asp:Label ID="lblRapor2Adi" runat="server" Text="Anasayfa raporu bulunamadı. 2"></asp:Label>
                        <small></small></h2>
                </div>
                <div class="card-body m-t-0">
                    <table id="Rapor2table" class="table"
                        data-height=""
                        data-ajax="Rapor2ajaxRequest"
                        data-cache="true"
                        data-side-pagination="server"
                        data-pagination="true"
                        data-show-refresh="false"
                        data-toolbar="#toolbar"
                        data-search="false"
                        data-search-align="left"
                        data-show-columns="false"
                        data-show-export="false"
                        data-show-toggle="false"
                        data-show-footer="false"
                        data-show-pagination-switch="false"
                        data-cookie="false"
                        data-cookie-id-table="saveUserDefinedReportId"
                        data-striped="false"
                        data-hover="false"
                        data-mobile-responsive="true"
                        data-check-on-init="true"
                        data-filter-control="false"
                        data-advanced-search="false"
                        data-id-table="advancedTable2"
                        data-page-number="1"
                        data-page-size="10"
                        data-page-list="[10, 25, 50, 100, 200, 500, Tumu]"
                        data-locale="tr-TR"
                        data-id-field="Id"
                        data-sort-name=""
                        data-sort-order=""
                        data-row-style="rowStyle">
                        <thead>
                            <tr></tr>
                        </thead>
                    </table>
                </div>
                <asp:Literal ID="ltrlTumunuGorRapor2" Visible="false" runat="server" Text="Tümünü Gör"></asp:Literal>
            </div>
            <!-- Todo Lists -->
        </div>
    </div>
    <div class="modal fade" id="PagePreviewListModal" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header" style="background-color: #00a9a1;">
                    <h4 class="modal-title" style="color: #FFF;">Ön İzleme</h4>
                </div>
                <div class="modal-body" style="padding: 0px;">
                    <img id="imgPreviewDocument" src="<%=Page.ResolveUrl("~/Content/img/notifications.png")%>" alt="Resim Yüklenemedi" style="width: 50%; height: 35%; margin-left: 25%;" />
                </div>
                <div class="modal-footer" style="background-color: #00a9a1;">
                    <button type="button" class="btn bgm-teal waves-effect" data-dismiss="modal">Kapat</button>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function Rapor1ajaxRequest(params) {
            console.log(params.data);
            var limit = params.data.limit;
            var offset = (params.data.offset / limit) + 1;
            var search = params.data.search;
            var sort = params.data.sort;
            var order = params.data.order;
            var databaseName = '<%=HttpContext.Current.Session["SeciliSirket"] == null ? "" : HttpContext.Current.Session["SeciliSirket"].ToString()%>';
            var masterRaporId = '<%=Request.QueryString.Get("MasterRaporId")%>';
            var masterRaporValue = '<%=Request.QueryString.Get("MasterRaporValue")%>';
            var RaporId = $("#hdnRapor1").val();
            $.ajax({
                url: "<%=Page.ResolveUrl("~/DataService.asmx/GetRapor")%>",
                data: { limit: limit, offset: offset, search: search, sort: sort, order: order, databaseName: databaseName, RaporId: RaporId },
                success: function (result) {
                    var list = new Array();
                    $.each(result.rows, function (index, value) {
                        var obj = new Object();
                        $.each(value, function (i, v) {
                            obj[v.Key] = v.Value;
                        });
                        list.push(obj);

                    });
                    params.success({
                        total: result.total,
                        rows: list
                    });

                    $('[data-toggle="tooltip"]').tooltip();
                    GridRenkAyarla();
                    $("#Rapor1table").bootstrapTable('hideColumn', 'RENKKODU');
                }
            });
        }

        function Rapor1Listele() {
            var limit = 0;
            var offset = 1;
            var search = "";
            var sort = "";
            var order = "";
            var databaseName = '<%=HttpContext.Current.Session["SeciliSirket"] == null ? "" : HttpContext.Current.Session["SeciliSirket"].ToString()%>';
            var RaporId = $("#hdnRapor1").val();
            $.ajax({
                type: "POST",
                url: "<%=Page.ResolveUrl("~/DataService.asmx/GetRapor")%>",
                data: { limit: limit, offset: offset, search: search, sort: sort, order: order, databaseName: databaseName, RaporId: RaporId },
                success: function (response) {
                    var data = response.rows;
                    $("#Rapor1table").bootstrapTable('destroy');
                    $("#Rapor1table thead tr").html('');
                    $.each(data, function (index, value) {
                        if (index == 0) {
                            $.each(value, function (index, property) {
                                var name = property.Key.split('_');
                                var tr = "";
                                if (name.length == 1) {
                                    var sorttable = " data-sortable='true' ";

                                    if (($.inArray(name, ["FileDataBase64", "FileDataBase64Vid", "İŞLEMLER", "RENKKODU", "ALT RAPORLAR"])) != -1) {
                                        sorttable = '';
                                    }

                                    if (name[0].indexOf("FileDataBase64") == -1) {
                                        tr = $('<th ' + sorttable + ' data-field="' + property.Key + '">' + name + '</th>');
                                    }
                                }
                                else if (name.indexOf("GIZLI") != -1) {
                                    return true;

                                }
                                else {
                                    if (name[0] == 'img') {

                                        tr = $('<th  data-formatter="editLink">' + name[1] + '</th>');
                                    } else
                                        if (name[0] == 'vid') {

                                            tr = $('<th  data-formatter="editLinkVideo">' + name[1] + '</th>');
                                        }
                                        else {
                                            tr = $('<th data-sortable="true" data-field="' + property.Key + '">' + name[1] + '</th>');
                                        }
                                }
                                $("#Rapor1table thead tr").append(tr);
                            });
                        }
                    });
                    if (data.length == 0) {
                        var tr = $('<th data-field="Sonuc" align="left">Sonuc</th>');
                        $("#Rapor1table thead tr").append(tr);
                    }
                    $('#Rapor1table').bootstrapTable("destroy");
                    $('#Rapor1table').bootstrapTable();
                },
                error: function (xhr) {
                    console.log(xhr.responseText);
                }
            });
        }

        function Rapor2ajaxRequest(params) {
            console.log(params.data);
            var limit = params.data.limit;
            var offset = (params.data.offset / limit) + 1;
            var search = params.data.search;
            var sort = params.data.sort;
            var order = params.data.order;
            var databaseName = '<%=HttpContext.Current.Session["SeciliSirket"] == null ? "" : HttpContext.Current.Session["SeciliSirket"].ToString()%>';
            var masterRaporId = '<%=Request.QueryString.Get("MasterRaporId")%>';
            var masterRaporValue = '<%=Request.QueryString.Get("MasterRaporValue")%>';
            var RaporId = $("#hdnRapor2").val();
            $.ajax({
                url: "<%=Page.ResolveUrl("~/DataService.asmx/GetRapor")%>",
                data: { limit: limit, offset: offset, search: search, sort: sort, order: order, databaseName: databaseName, RaporId: RaporId },
                success: function (result) {
                    var list = new Array();
                    $.each(result.rows, function (index, value) {
                        var obj = new Object();
                        $.each(value, function (i, v) {
                            obj[v.Key] = v.Value;
                        });
                        list.push(obj);

                    });
                    params.success({
                        total: result.total,
                        rows: list
                    });

                    $('[data-toggle="tooltip"]').tooltip();
                    GridRenkAyarla();
                    $("#Rapor2table").bootstrapTable('hideColumn', 'RENKKODU');
                }
            });
        }

        function Rapor2Listele() {
            var limit = 0;
            var offset = 1;
            var search = "";
            var sort = "";
            var order = "";
            var databaseName = '<%=HttpContext.Current.Session["SeciliSirket"] == null ? "" : HttpContext.Current.Session["SeciliSirket"].ToString()%>';
            var RaporId = $("#hdnRapor2").val();
            $.ajax({
                type: "POST",
                url: "<%=Page.ResolveUrl("~/DataService.asmx/GetRapor")%>",
                data: { limit: limit, offset: offset, search: search, sort: sort, order: order, databaseName: databaseName, RaporId: RaporId },
                success: function (response) {
                    var data = response.rows;
                    $("#Rapor2table").bootstrapTable('destroy');
                    $("#Rapor2table thead tr").html('');
                    $.each(data, function (index, value) {
                        if (index == 0) {
                            $.each(value, function (index, property) {
                                var name = property.Key.split('_');
                                var tr = "";
                                if (name.length == 1) {
                                    var sorttable = " data-sortable='true' ";

                                    if (($.inArray(name, ["FileDataBase64", "FileDataBase64Vid", "İŞLEMLER", "RENKKODU", "ALT RAPORLAR"])) != -1) {
                                        sorttable = '';
                                    }

                                    if (name[0].indexOf("FileDataBase64") == -1) {
                                        tr = $('<th ' + sorttable + ' data-field="' + property.Key + '">' + name + '</th>');
                                    }
                                }
                                else if (name.indexOf("GIZLI") != -1) {
                                    return true;

                                }
                                else {
                                    if (name[0] == 'img') {

                                        tr = $('<th  data-formatter="editLink">' + name[1] + '</th>');
                                    } else
                                        if (name[0] == 'vid') {

                                            tr = $('<th  data-formatter="editLinkVideo">' + name[1] + '</th>');
                                        }
                                        else {
                                            tr = $('<th data-sortable="true" data-field="' + property.Key + '">' + name[1] + '</th>');
                                        }
                                }
                                $("#Rapor2table thead tr").append(tr);
                            });
                        }
                    });
                    if (data.length == 0) {
                        var tr = $('<th data-field="Sonuc" align="left">Sonuc</th>');
                        $("#Rapor2table thead tr").append(tr);
                    }
                    $('#Rapor2table').bootstrapTable("destroy");
                    $('#Rapor2table').bootstrapTable();
                },
                error: function (xhr) {
                    console.log(xhr.responseText);
                }
            });
        }

        function editLink(value, row, index) {
            return "<a title='Resim' class=\"btn bgm-green waves-effect\" onclick=\"Preview(this, " + index + ")\"> <span class=\"zmdi zmdi-collection-image-o c-white\"> </span> </a> ";
        }

        function editLinkVideo(value, row, index) {
            return "<a title='Video' class=\"btn bgm-green waves-effect\" onclick=\"PreviewVideo(this, " + index + ")\"> <span class=\"zmdi zmdi-videocam c-white\"> </span> </a> ";
        }

        function GridRenkAyarla() {
            $('.table').on('click-row.bs.table', function (e, row, $element) {
                //here the hidden column is readable :)
                console.log(row.cust_id);
            });
        }
        function rowStyle(row, index) {
            return {
                css: (row.RENKKODU == '') ? { "background-color": "" } : { "background-color": row.RENKKODU }
            };
        }

        function Preview(cntrl, index) {
            var row = $('#' + $(cntrl).parents('table').attr('id')).bootstrapTable('getData')[index];
            var src = '';
            src = 'data:image/* ;base64,' + row.FileDataBase64;
            document.getElementById('imgPreviewDocument').src = src;
            document.getElementById('imgPreviewDocument').title = escape(row.FileName);
            $('#PagePreviewListModal').modal('show');
        }

        function PreviewVideo(cntrl, index) {
            var table = $(cntrl).parents('table').attr('id')
            var id = 0;

            if (table == "Rapor2table") {
                id = $("#hdnRapor2").val();
            } else
                if (table == "Rapor2table") {
                    id = $("#hdnRapor2").val();
                }
            if (id != "") {
                window.location = '<%=Page.ResolveUrl("~/Moduller/Rapor/VideoGoruntule.aspx") %>' + '?Id=' + id;
            }
        }
    </script>
</asp:Content>
