source: StockMaster/Views/Report/EmployeePerformance.cshtml@ dfe03b8

main
Last change on this file since dfe03b8 was dfe03b8, checked in by Ceyda <ceyda.huseini@…>, 4 days ago

Initialize StockMaster project

  • Property mode set to 100644
File size: 2.0 KB
Line 
1@model List<StockMaster.Models.VwEmployeeRanking>
2@{
3 ViewData["Title"] = "Employee Performance";
4}
5
6<div class="d-flex justify-content-between align-items-center mb-3">
7 <h2>Employee Performance Ranking</h2>
8 <div>
9 <a href="/Report/Index" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Back</a>
10 <a href="/Report/ExportEmployeeRanking" class="btn btn-success"><i class="fas fa-file-csv"></i> CSV</a>
11 <button onclick="exportToPDF()" class="btn btn-danger"><i class="fas fa-file-pdf"></i> PDF</button>
12 </div>
13</div>
14
15<div id="reportContent">
16 <table class="table table-bordered table-striped">
17 <thead class="table-dark">
18 <tr>
19 <th>Rank</th>
20 <th>Name</th>
21 <th>Role</th>
22 <th>Sales Count</th>
23 <th>Revenue</th>
24 <th>Avg Sale</th>
25 </tr>
26 </thead>
27 <tbody>
28 @foreach (var item in Model)
29 {
30 <tr>
31 <td><strong>#@item.RevenueRank</strong></td>
32 <td>@item.FullName</td>
33 <td>@item.Role</td>
34 <td>@item.TotalSales</td>
35 <td>@item.TotalRevenue.ToString("N2") MKD</td>
36 <td>@item.AvgSaleValue.ToString("N2") MKD</td>
37 </tr>
38 }
39 </tbody>
40 </table>
41</div>
42
43@section Scripts {
44 <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
45 <script>
46 function exportToPDF() {
47 var element = document.getElementById('reportContent');
48 var opt = {
49 margin: 0.5,
50 filename: 'EmployeePerformanceReport.pdf',
51 image: { type: 'jpeg', quality: 0.98 },
52 html2canvas: { scale: 2 },
53 jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
54 };
55 html2pdf().set(opt).from(element).save();
56 }
57 </script>
58}
Note: See TracBrowser for help on using the repository browser.