source: RebuMKReact/src/Components/Reports/driverReport.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.5 KB
RevLine 
[364f27d]1import React from "react";
2import '../UtilComponents/App.css'
3
4const DriverReport = (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 on your passengers</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"}>Passenger Email</th>
16 <th scope={"col"}>Passenger Name Surname</th>
17 <th scope={"col"}>Kilometers Travelled With Passenger</th>
18 <th scope={"col"}>Total Earnings from passenger</th>
19 <th scope={"col"}>Earnings Per Kilometer</th>
20 <th scope={"col"}>Average Grade Received Per Drive</th>
21 <th scope={"col"}>Number Of Drives</th>
22 </tr>
23 </thead>
24 <tbody>
25 {props.report.map((term) => {
26 return(
27 <tr>
28 <td>{term.passengerEmail}</td>
29 <td>{term.passengerName} {term.passengerSurname}</td>
30 <td>{(Math.round(term.kmTravelledWithPassenger * 100) / 100).toFixed(2)} km</td>
31 <td>{(Math.round(term.totalEarnings * 100) / 100).toFixed(2)} MKD</td>
32 <td>{(Math.round(term.earningsPerKm * 100) / 100).toFixed(2)} MKD per km</td>
33 <td>{(Math.round(term.averageGradeReceivedPerDrive * 100) / 100).toFixed(2)}</td>
34 <td>{term.numberOfDrives} drives</td>
35 </tr>
36 )
37 })}
38 </tbody>
39 </table>
40 </div>
41 </div>
42 <div style={{textAlign: "center"}}>
43 <a className="myButton btn btn-primary" onClick={() => props.onDownloadReport(localStorage.getItem("driverId"))} style={{borderColor: 'black', backgroundColor: 'cyan', color: "black"}}>Download Report</a>
44 </div>
45 </div>
46 )
47}
48
49export default DriverReport;
Note: See TracBrowser for help on using the repository browser.