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.0 KB
|
Line | |
---|
1 | import React from "react";
|
---|
2 | import '../UtilComponents/App.css'
|
---|
3 |
|
---|
4 | const PassengerReport = (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 drivers and drives</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 Name Surname</th>
|
---|
16 | <th scope={"col"}>Kilometers travelled with driver</th>
|
---|
17 | <th scope={"col"}>Total price paid to driver</th>
|
---|
18 | <th scope={"col"}>Price per kilometer</th>
|
---|
19 | </tr>
|
---|
20 | </thead>
|
---|
21 | <tbody>
|
---|
22 | {props.report.map((term) => {
|
---|
23 | return(
|
---|
24 | <tr>
|
---|
25 | <td>{term.driverName} {term.driverSurname}</td>
|
---|
26 | <td>{(Math.round(term.kmTravelledWithDriver * 100) / 100).toFixed(2)} km</td>
|
---|
27 | <td>{(Math.round(term.totalPricePaid * 100) / 100).toFixed(2)} MKD</td>
|
---|
28 | <td>{(Math.round(term.pricePerKm * 100) / 100).toFixed(2)} MKD per km</td>
|
---|
29 | </tr>
|
---|
30 | )
|
---|
31 | })}
|
---|
32 | </tbody>
|
---|
33 | </table>
|
---|
34 | </div>
|
---|
35 | </div>
|
---|
36 | <div style={{textAlign: "center"}}>
|
---|
37 | <a className="myButton btn btn-primary" onClick={() => props.onDownloadReport(localStorage.getItem("passengerId"))} style={{borderColor: 'black', backgroundColor: 'cyan', color: "black"}}>Download Report</a>
|
---|
38 | </div>
|
---|
39 | </div>
|
---|
40 | )
|
---|
41 | }
|
---|
42 |
|
---|
43 | export default PassengerReport; |
---|
Note:
See
TracBrowser
for help on using the repository browser.