-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainFile.py
More file actions
276 lines (266 loc) · 11.5 KB
/
MainFile.py
File metadata and controls
276 lines (266 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
import mysql.connector
mydb=mysql.connector.connect(
host='localhost',
user='root',
password='sanjadit',
database='pratik'
)
print("_"*52)
while(True):
print("\t\t..............................................")
print("\t\t*****WELCOME TO COURIER MANAGEMENT SYSTEM*****")
print("\t\t..............................................")
print("\n\t\t********PURV INTERNATIONAL SCHOOL********")
print("Enter 1. INFO")
print("Enter 2. ADMIN")
print("Enter 3. STAFF")
print("Enter 4. CUSTOMER")
print("Enter 5. EXIT")
print("----------------------------")
try:
a=int(input("Enter Your Choice: "))
print()
if(a==1):
info=open("info.txt",'r')
lines=info.read()
print(lines)
elif(a==2):
print("Sample ID =admin")
print("Sample PASSWORD = pass")
b1=str(input("Enter the ID"))
p1=str(input("Enter the Password"))
if b1=="admin" and p1=="pass":
print("Enter 1. VEHICLES TABLE")
print("Enter 2. STAFF TABLE")
print("Enter 3. ORDERS TABLE")
a2=int(input("Enter Your Choice: "))
print()
if(a2==1):
print("Enter 1. SHOW TABLE")
print("Enter 2. EDIT TABLE")
a21=int(input("Enter Your Choice: "))
print()
if (a21==1):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM vehicle")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
elif(a21==2):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM vehicle")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
print("SAMPLE EDIT QUERY =UPDATE vehicle set status='on the way' where Vehicle_no = 32102;")
qu=str(input("ENTER THER QUERY : "))
mycursor=mydb.cursor()
mycursor.execute(qu)
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
else:
print("Enter a valid choice")
elif(a2==2):
print("Enter 1. SHOW TABLE")
print("Enter 2. EDIT TABLE")
a22=int(input("Enter Your Choice: "))
print()
if (a22==1):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM STAFF")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
elif(a22==2):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM STAFF")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
print("SAMPLE EDIT QUERY =UPDATE STAFF set salary = 42100 where EMP_NAME = 'JOHN';")
qu=str(input("ENTER THER QUERY : "))
mycursor=mydb.cursor()
mycursor.execute(qu)
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
else:
print("Please enter a valid choice")
elif(a2==3):
print("Enter 1. SHOW TABLE")
print("Enter 2. EDIT TABLE")
a23=int(input("Enter Your Choice: "))
print()
if (a23==1):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM order")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
elif(a23==2):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM order")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
print("SAMPLE EDIT QUERY =UPDATE order set status='on the way' where ORDER_ID = 12307;")
qu=str(input("ENTER THER QUERY : "))
mycursor=mydb.cursor()
mycursor.execute(qu)
myresult=mycursor.fetchall()
for x in myresult:
print(x)
else:
print("Please enter a valid choice")
else:
print("Please enter a valid choice")
else:
print("Please enter correct id password")
elif(a==3):
print("Sample ID =staff")
print("Sample PASSWORD = pass")
b2=str(input("Enter the ID"))
p2=str(input("Enter the Password"))
if b2=="staff" and p2=="pass":
print("Enter 1. VEHICLES TABLE")
print("Enter 2. STAFF TABLE")
print("Enter 3. ORDERS TABLE")
a3=int(input("Enter Your Choice: "))
print()
if(a3==1):
print("Enter 1. SHOW TABLE")
print("Enter 2. EDIT TABLE")
a31=int(input("Enter Your Choice: "))
print()
if (a31==1):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM vehicle")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
elif(a31==2):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM vehicle")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
print("SAMPLE EDIT QUERY =UPDATE vehicle set status='on the way' where Vehicle_no = 32102;")
qu=str(input("ENTER THER QUERY : "))
mycursor=mydb.cursor()
mycursor.execute(qu)
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
else:
print("Enter a valid choice")
elif(a3==2):
print("Enter 1. SHOW TABLE")
a32=int(input("Enter Your Choice: "))
print()
if (a32==1):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM STAFF")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
else:
print("Please enter a valid choice")
elif(a3==3):
print("Enter 1. SHOW TABLE")
print("Enter 2. EDIT TABLE")
a33=int(input("Enter Your Choice: "))
print()
if (a33==1):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM order")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
elif(a33==2):
mycursor=mydb.cursor()
mycursor.execute("SELECT * FROM order")
myresult=mycursor.fetchall()
for x in myresult:
print(x)
print("_"*52)
print("SAMPLE EDIT QUERY =UPDATE order set status='on the way' where ORDER_ID = 12307;")
qu=str(input("ENTER THER QUERY : "))
mycursor=mydb.cursor()
mycursor.execute(qu)
myresult=mycursor.fetchall()
for x in myresult:
print(x)
else:
print("Please enter a valid choice")
else:
print("Please enter a valid choice")
else:
print("Please enter correct id pass")
except Exception as e:
print("Please input as suggested.",e)
elif(a==4):
print("Enter customer details")
n1=str(input("Enter your name = "))
e1=str(input("Enter your mail = "))
print("Enter 1. Place order")
print("Enter 2. Track Order")
print("Enter 3. Contact Details")
a4=int(input("Enter Your Choice: "))
print()
print("Welcome " ,n1)
if(a4==1):
print("enter order details :")
print("SAMPLE ORDER DETAILS")
print("pickp : durgapur")
print("drop : asansol")
print("weight(in kgs) : 3")
pick=str(input("Enter package pickup loaction : "))
drop=str(input("Enter package drop loaction : "))
weig=str(input("Enter package weight : "))
dis=str(input("Package distance in kms : "))
pay=int(int(weig)*5*int(dis))
print("_"*55)
print("Your order is confirmed")
print("SELECT PAYMENT OPTION")
print("ENTER 1: ONLINE PAYMENT")
print("ENTER 2: COD")
bi=int(input("Enter the command : "))
if (bi==1):
print("ACCOUNT NUMBER-1203848719273")
print(" IFSC CODE-827389 ")
print(" PH-7319482358")
print("AMOUNT IN INR=",pay)
print("Confirm payment and enter the transaction id ")
print("SAMPLE ID=1234567890")
tran=int(input("Enter transaction ID : "))
elif(bi==2):
print("AMOUNT IN INR=",pay)
print("Pay on delivery to delivery boy")
else:
print("Please enter a valid choice")
elif(a4==2):
print("Enter order Id")
elif(a4==3):
print("CONTACT US AT")
print("PH- 7319482358")
print("couriermanagementsoftware@gmail.com")
else:
elif(a==5):
print("Thank you for using Courier management system")
break
else:
print("Please enter a valid choice from 1-4")
except Exception as e:
print("Please input as suggested.",e)