Skip to content

Commit a372308

Browse files
committed
bug fixes and performance improvements
1 parent 54653db commit a372308

18 files changed

+208
-136
lines changed

README.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,61 +15,60 @@ cd src
1515
* Run command
1616

1717
```bash
18-
g++ main.cpp admin.cpp customer.cpp ticket.cpp
18+
g++ main.cpp bus.cpp ticket.cpp
1919
```
2020

2121
* Run `.exe` file in `src` folder
2222

23-
### Root Passwords
24-
25-
Password : `123`
26-
2723
### Admin Credentials
2824

2925
Username : `admin`
3026
Password : `pass`
3127

3228
## Screenshots
3329

34-
### Root Login Screen
30+
### Welcome Screen
3531

36-
<img width="800px" src="/assets/screenshots/root_login_screen.png" alt="Screenshot 1" />
32+
<img width="100%" src="/screenshots/1.png" alt="Screenshot 1" />
3733

38-
### Welcome Screen
34+
### Main Menu
3935

40-
<img width="800px" src="/assets/screenshots/welcome_screen.png" alt="Screenshot 2" />
36+
<img width="100%" src="/screenshots/2.png" alt="Screenshot 2" />
4137

42-
### User Portal Screen
38+
### User Menu
4339

44-
<img width="800px" src="/assets/screenshots/user_portal_screen.png" alt="Screenshot 3" />
40+
<img width="100%" src="/screenshots/3.png" alt="Screenshot 3" />
4541

46-
### Admin Portal Screen
42+
### Book Ticket
4743

48-
<img width="800px" src="/assets/screenshots/admin_portal_screen.png" alt="Screenshot 4" />
44+
<img width="100%" src="/screenshots/4.png" alt="Screenshot 4" />
4945

50-
### Add Bus Screen
46+
### Admin Menu
5147

52-
<img width="800px" src="/assets/screenshots/add_bus_screen.png" alt="Screenshot 5" />
48+
<img width="100%" src="/screenshots/5.png" alt="Screenshot 5" />
5349

54-
### View Bus Screen
50+
### Bus List
5551

56-
<img width="800px" src="/assets/screenshots/view_bus_screen.png" alt="Screenshot 6" />
52+
<img width="100%" src="/screenshots/6.png" alt="Screenshot 6" />
5753

5854
## Connect With Me
5955

60-
[<img align="left" alt="nixrajput | GitHub" width="24px" src="https://raw.githubusercontent.com/nixrajput/nixlab-files/master/images/icons/github-brands.svg" />][website]
56+
[<img align="left" alt="nixrajput | Website" width="24px" src="https://raw.githubusercontent.com/nixrajput/nixlab-files/master/images/icons/globe-icon.svg" />][website]
57+
58+
[<img align="left" alt="nixrajput | GitHub" width="24px" src="https://raw.githubusercontent.com/nixrajput/nixlab-files/master/images/icons/github-brands.svg" />][github]
59+
60+
[<img align="left" alt="nixrajput | Instagram" width="24px" src="https://raw.githubusercontent.com/nixrajput/nixlab-files/master/images/icons/instagram-brands.svg" />][instagram]
6161

6262
[<img align="left" alt="nixrajput | Facebook" width="24px" src="https://raw.githubusercontent.com/nixrajput/nixlab-files/master/images/icons/facebook-brands.svg" />][facebook]
6363

6464
[<img align="left" alt="nixrajput | Twitter" width="24px" src="https://raw.githubusercontent.com/nixrajput/nixlab-files/master/images/icons/twitter-brands.svg" />][twitter]
6565

6666
[<img align="left" alt="nixrajput | LinkedIn" width="24px" src="https://raw.githubusercontent.com/nixrajput/nixlab-files/master/images/icons/linkedin-in-brands.svg" />][linkedin]
6767

68-
[<img align="left" alt="nixrajput | Instagram" width="24px" src="https://raw.githubusercontent.com/nixrajput/nixlab-files/master/images/icons/instagram-brands.svg" />][instagram]
69-
68+
[pub]: https://pub.dev/packages/get_time_ago
7069
[github]: https://github.com/nixrajput
71-
[website]: https://github.com/nixrajput
70+
[website]: https://nixlab.co.in
7271
[facebook]: https://facebook.com/nixrajput07
73-
[twitter]: https://facebook.com/nixrajput07
72+
[twitter]: https://twitter.com/nixrajput07
7473
[instagram]: https://instagram.com/nixrajput
7574
[linkedin]: https://linkedin.com/in/nixrajput

screenshots/1.png

97.6 KB
Loading

screenshots/2.png

92 KB
Loading

screenshots/3.png

94.8 KB
Loading

screenshots/4.png

90.9 KB
Loading

screenshots/5.png

103 KB
Loading

screenshots/6.png

111 KB
Loading

screenshots/add_bus_screen.png

-95.5 KB
Binary file not shown.

screenshots/admin_portal_screen.png

-98.9 KB
Binary file not shown.

screenshots/root_login_screen.png

-91.4 KB
Binary file not shown.

screenshots/user_portal_screen.png

-95.9 KB
Binary file not shown.

screenshots/view_bus_screen.png

-91.8 KB
Binary file not shown.

screenshots/welcome_screen.png

-96.1 KB
Binary file not shown.

src/bus.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include <string>
33
#include <fstream>
44
#include <iomanip>
5-
#include <conio.h>
6-
#include <iomanip>
75

86
#include "bus.h"
97
#include "ticket.h"
@@ -160,10 +158,24 @@ void Bus::editBus()
160158
printHeading("EDIT BUS");
161159

162160
showBusDetails();
163-
char n[20];
164-
cout << "\n\t\t\t\t\t\t\t\t\t\tEnter Passenger Name :-> ";
165-
cin.getline(n, 20);
166-
// setName(n);
161+
char s[20], d[20], sTime[20], dTime[20];
162+
double fare;
163+
cout << "\n\t\t\t\t\t\t\t\t\t\tEnter Source:-> ";
164+
cin.getline(s, 20);
165+
cout << "\n\t\t\t\t\t\t\t\t\t\tEnter Destination:-> ";
166+
cin.getline(d, 20);
167+
cout << "\n\t\t\t\t\t\t\t\t\t\tEnter Source Time:-> ";
168+
cin.getline(sTime, 20);
169+
cout << "\n\t\t\t\t\t\t\t\t\t\tEnter Destination Time:-> ";
170+
cin.getline(dTime, 20);
171+
cout << "\n\t\t\t\t\t\t\t\t\t\tEnter Bus Fare:-> ";
172+
cin.ignore();
173+
cin >> fare;
174+
setSource(s);
175+
setDestination(d);
176+
setSourceTime(sTime);
177+
setDestinationTime(dTime);
178+
setBusFare(fare);
167179
tempFileStream.write((char *)this, sizeof(*this));
168180

169181
chk = 1;

src/bus.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,35 @@ class Bus
8686
{
8787
bookedSeats--;
8888
}
89+
90+
void setSource(char *s)
91+
{
92+
if (s && s[0])
93+
strcpy(source, s);
94+
}
95+
96+
void setDestination(char *d)
97+
{
98+
if (d && d[0])
99+
strcpy(destination, d);
100+
}
101+
102+
void setSourceTime(char *s)
103+
{
104+
if (s && s[0])
105+
strcpy(sourceTime, s);
106+
}
107+
108+
void setDestinationTime(char *d)
109+
{
110+
if (d && d[0])
111+
strcpy(destinationTime, d);
112+
}
113+
114+
void setBusFare(double f)
115+
{
116+
if (f)
117+
busFare = f;
118+
}
89119
};
90120
#endif // !BUS_H

0 commit comments

Comments
 (0)