import mysql.
connector as c
import datetime
conn=[Link](host='localhost',user='root',passwd='a',database='radiant_coaching_c
entre')
m=[Link]()
def login():
u=input('Enter username-> ')
p=input('Enter passwd-> ')
q1="select * from login where username='{}' and passwd='{}'".format(u,p)
[Link](q1)
[Link]()
if [Link]==1:
print('login successfully.....')
print('-----------------------------------------------------')
main_menu()
else:
print('login failed!!!')
def main_menu():
print("-----------------[Link]/Student Details -----------------------
")
print("------------------[Link] INFO--------------------- ")
#print("----------------[Link] Details----------------------- ")
print("-----------------[Link] Management--------------------- ")
print("--------------------[Link]--------------------------------- ")
a=int(input("Enter option you have selected-> "))
if a==1:
print("----------------------------------------------------------------------------
------------------")
print("-----------Choose the option you have to perform on table
registration--------------------------")
print("-------------- 1. register_student-------------------------")
print("--------------2. view_registration-------------------------")
print("--------------3. updation_payment_status-------------------")
print("--------------4. delete_registration-----------------------")
x=int(input("Enter option you have to select-> "))
if x==1:
stud_name=input("Enter the stud_name-> ")
fath_name=input("Enter the fath_name-> ")
moth_name=input("Enter the moth_name> ")
phone=input("Enter the mobile number of parent->")
#email=input("Enter the your email->")
#address=input("Enter the address of your house->")
b=input("Enter the competitive exam you have prepare for ----NEET
enter 1 & JEE enter 2---- ->")
print("----------------------------------------------------------------------------
--------------------")
if b=="2":
course="JEE"
clas=int(input("Enter the class you haveto take admission-
>"))#class
if clas==11:
f=int(input("Enter the percentage you have scored in class
10th->"))#validation
if f>=89:
batch_id="B004"
batch_name="STR_J1"
print("You have alotted the batch 'STR_J1'")
print("Installment-I will be-> Rs.15000 ")
print("Installment-II will be-> Rs.11000")
print("Installment-III will be-> Rs.1000")
print("Your overall fee will be-> Rs.36000 ")
print("Your section will be ->")
section="A"
elif 75<f<89:
batch_name="RNKER_J1"
print("You have alotted the batch 'RNKER_J1'")
print("Installment-I will be-> Rs.16000 ")
print("Installment-II will be-> Rs.14500 ")
print("Installment-III will be-> Rs.11000 ")
print("Your overall fee will be-> RS.")
print("Your section will be ->")
section="B"
else:
batch_name="SCHl_J1"
print("You have alotted the batch 'SCHL_J1'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> RS.")
print("Your section will be ->")
section="C"
elif clas==12:
f=int(input("Enter the percentage you have scored in class
11th->"))#validation
if f>=80:
batch_name="STR_J2"
print("You have alotted the batch 'STR_J2'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> Rs. ")
print("Your section will be ->")
section="A"
elif 68<f<80:
batch_name="RNKER_J2"
print("You have alotted the batch 'RNKER_J2'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> RS.")
print("Your section will be ->")
section="B"
else:
batch_name="SCHl_J2"
print("You have alotted the batch 'SCHL_J2'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> RS.")
print("Your section will be ->")
section="C"
elif b=="1":
course="NEET"
clas=int(input("Enter the class you haveto take admission->
"))#class
if clas==11:
f=int(input("Enter the percentage you have scored in class
10th-> "))#validation
if f>=89:
batch_name="STR_N1"
print("You have alotted the batch 'STR_N1'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> Rs. ")
print("Your section will be ->")
section="D"
elif 75<f<89:
batch_name="RNKER_N1"
print("You have alotted the batch 'RNKER_N1'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> RS.")
print("Your section will be ->E ")
section="E"
else:
batch_name="SCHL_N1"
print("You have alotted the batch 'SCHL_N1'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> RS.")
print("Your section will be-> F ")
section="F"
elif clas==12:
f=int(input("Enter the percentage you have scored in class
11th->"))#validation
if f>=80:
batch_id=""
batch_name="STR_N2"
print("You have alotted the batch 'STR_N2'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> Rs. ")
print("Your section will be ->")
section="D"
elif 68<f<80:
batch_id=""
batch_name="RNKER_N2"
print("You have alotted the batch 'RNKER_N2")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> RS.")
print("Your section will be ->E ")
section="E"
else:
batch_name="SCHL_N2"
print("You have alotted the batch 'SCHL_N2'")
print("Installment-I will be-> Rs. ")
print("Installment-II will be-> Rs. ")
print("Installment-III will be-> Rs. ")
print("Your overall fee will be-> RS.")
print("Your section will be-> F ")
section="F"
else:
print("Wrong input enter again")
b=input("Enter the competitive exam you have prepare for ----NEET
enter 1 & JEE enter 2---- ->")#validation
print("Paytem of installment")
instl_I_pay=input("either install first paid or unpaid")
instl_II_pay=input("either install second paid or unpaid")
instl_III_pay=input("either install third paid or unpaid")
reg_date= [Link]()
reg_details(stud_name,clas,course,reg_date,phone,batch_id,batch_name,instl_I_pay,in
stl_II_pay,instl_III_pay)
#print("Generated Reg ID:", reg_id)
stud_details(stud_name,email,phone,address,course,moth_name,fath_name,batch_id,batc
h_name,section,clas,reg_id)
elif x=="2":
reg_id=input("Enter the your registration id->")
view_reg_details(reg_id)
#elif x=="3":
elif a==2:
print("----------------------------------------------------------------------------
------------------")
print("-----------Choose the option you have to perform on table
batch_info--------------------------")
print("---------------------[Link] Batch
Timing----------------------------------------------------")
print("----------------------[Link] Batch Time
Slot(morning,afternoon,evening)---------------------")
print("-----------------[Link] Number of
Faculties-------------------------------------------------")
print("----------------------------------------------------------------------------
------------------")
y=input("enter")
if y=="1":
update_batch_timing()
elif y=="2":
update_batch_time_slot()
elif y=="3":
update_num_faculties()
else:
print("Invalid choice.")
def
reg_details(stud_name,clas,course,reg_date,phone,batch_id,batch_name,instl_I_pay,in
stl_II_pay,instl_III_pay):
q2=("insert into reg_details
(stud_name,clas,course,reg_date,phone,batch_id,batch_name,instl_I_pay,instl_II_pay,
instl_III_pay) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)")
[Link](q2,
(stud_name,clas,course,reg_date,phone,batch_id,batch_name,instl_I_pay,instl_II_pay,
instl_III_pay))
reg_id= [Link]
print("Generated Reg ID:", reg_id)
email=input("Enter the your email->")
address=input("Enter the address of your house->")
#stud_details(stud_name,email,phone,address,course,moth_name,fath_name,batch_id,bat
ch_name,section,clas,reg_id)
#reg_id=r
print([Link]())
[Link]()
print("----------------------------------------------------------------------------
---------------------")
print("----------------------------------
DONE,THANKYOU!!!-----------------------------------------------")
#stud_details(stud_name,email,phone,address,course,moth_name,fath_name,batch_id,bat
ch_name,section,clas,reg_id)
def view_reg_details(reg_id):
q3 = "SELECT * FROM reg_details WHERE reg_id = %s"
values =(reg_id,)
[Link](q3, values)
print("----------------------------------------------------------------------------
---------------------")
print([Link]())
[Link]()
print("----------------------------------------------------------------------------
--------------------")
print("----------------------------------
DONE,THANKYOU!!!----------------------------------------------")
def
stud_details(stud_name,email,phone,address,course,moth_name,fath_name,batch_id,batc
h_name,section,clas,reg_id):
q4=("insert into stud_info
(stud_name,email,phone,address,course,moth_name,fath_name,batch_id,batch_name,secti
on,clas,reg_id) values(%s,%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)")
[Link](q4,
(stud_name,email,phone,address,course,moth_name,fath_name,batch_id,batch_name,secti
on,clas,reg_id))
#print([Link]())
[Link]()
print("----------------------------------------------------------------------------
---------------------")
print("----------------------------------
DONE,THANKYOU!!!-----------------------------------------------")
def update_batch_timing():
batch_id = input("Enter batch ID-> ")
timing = input("Enter new timing-> ")
q5= "UPDATE batch_info SET timing = %s WHERE batch_id = %s"
values = (timing, batch_id)
[Link](q5,values)
[Link]()
print("----------------------------------------------------------------------------
--------------------")
print("----------------------------Batch timing updated
successfully.----------------------------------")
def update_batch_time_slot():
batch_id = input("Enter batch ID-> ")
time_slot = input("Enter new time slot-> ")
q = "UPDATE batch_info SET Time_slot = %s WHERE batch_id = %s"
values = (time_slot, batch_id)
[Link](q, values)
[Link]()
print("----------------------------------------------------------------------------
---------------------")
print("----------------------------Batch time slot updated
successfully.--------------------------------")
def update_num_faculties():
batch_id = input("Enter batch ID: ")
num_faculty = int(input("Enter new number of faculties: "))
q = "UPDATE batch_info SET Num_Faculty = %s WHERE batch_id = %s"
values = (num_faculty, batch_id)
[Link](q, values)
[Link]()
print("----------------------------------------------------------------------------
--------------------")
print("------------------------------Number of faculties updated
successfully.-------------------------")
login()