source: RebuMKReact/src/Components/Reports/adminReport.js@ 364f27d

Last change on this file since 364f27d was 364f27d, checked in by MetodiMladenovski <meto.18@…>, 14 months ago

added projects and db scripts

  • Property mode set to 100644
File size: 2.9 KB
Line 
1import React from "react";
2import '../UtilComponents/App.css'
3
4const AdminReport = (props) => {
5
6 return(
7 <div style={{width: "85%", margin: 'auto'}} className={"container mm-4 mt-5"}>
8 <h2 style={{textAlign: "center", color: "darkcyan"}}>Report for every driver</h2>
9 <hr></hr>
10 <div className={"row table-responsive"}>
11 <div className={"row"} style={{margin: 'auto'}}>
12 <table className={"table table-striped"}>
13 <thead>
14 <tr>
15 <th scope={"col"}>Driver Email</th>
16 <th scope={"col"}>Driver Full Name</th>
17 <th scope={"col"}>Car make</th>
18 <th scope={"col"}>Car model</th>
19 <th scope={"col"}>Driver Grade</th>
20 <th scope={"col"}>Number Of Drives</th>
21 <th scope={"col"}>Total Money Made</th>
22 <th scope={"col"}>Number Of Different Requests</th>
23 <th scope={"col"}>Number Of Different Passengers</th>
24 <th scope={"col"}>Money Per Request</th>
25 <th scope={"col"}>Total kilometers driven</th>
26 </tr>
27 </thead>
28 <tbody>
29 {props.report.map((term) => {
30 return(
31 <tr>
32 <td>{term.driverEmail}</td>
33 <td>{term.driverName} {term.driverSurname}</td>
34 <td>{term.make}</td>
35 <td>{term.model}</td>
36 <td>{(Math.round(term.driverGrade * 100) / 100).toFixed(2)}</td>
37 <td>{term.numberOfDrives} drives</td>
38 <td>{(Math.round(term.totalMoneyMade * 100) / 100).toFixed(2)} MKD</td>
39 <td>{term.numberOfDifferentRequests} requests</td>
40 <td>{term.numberOfDifferentPassengers} passengers</td>
41 <td>{(Math.round(term.averageMoneyPerRequest * 100) / 100).toFixed(2)} MKD</td>
42 <td>{(Math.round(term.totalKmTravelled * 100) / 100).toFixed(2)} km</td>
43 </tr>
44 )
45 })}
46 </tbody>
47 </table>
48 </div>
49 </div>
50 <div style={{textAlign: "center"}}>
51 <a className="myButton btn btn-primary" onClick={() => props.onDownloadReport()} style={{borderColor: 'black', backgroundColor: 'cyan', color: "black"}}>Download Report</a>
52 </div>
53 </div>
54 )
55}
56
57export default AdminReport;
Note: See TracBrowser for help on using the repository browser.