Professional Documents
Culture Documents
REVIEW-3
TEAM MEMBERS :
19MIS0305 – K.SHIVANVITHA
19MIS0361 – V.TANMAYEE
ABSTRACT:
The scheme of providing basic domestic commodities on subsidy to poor
families in developing countries like India is important aspect to meet
fundamental requirement of people "e-Ration card services" is an
automated system developed to dispense the correct quantity of ration to
the card holders depending on type of card and the number of members in
the family, and also maintain the transactions. The existing manual
distribution system requires maintenance persons to measure the quantity
and to maintain record of transactions etc. The online system avoids many
problems like:
Card holders wasting time for collecting ration by standing in a queue for
hours together.
Lot of fraudulent activities in ration dispensing societies.
Human intervention in updating transactions.
The card holder can access the system for ration at any time in a month, no
human intervention in ration shop. The RFID reader(radio frequency
identification) will read unique number from RFID card and sends it to GUI,
which is created using Visual basic 6.0.This rfid is a wireless communication
form that incorporates the use of electromagnetic or electrostatic coupling in
the radio frequency portion of the electromagnetic spectrum to uniquely
identify an object, animal or person. Once the disbursed quantity (weight)
matches the requested amount then the valve will close and the ration status
is automatically updated after each transaction.
KEYWORDS :
Public Distribution System
Ration Distribution
Unique Identification
LITERATURE SURVEY:
1) This Paper proposes a new technique for ration services. E-smart ration
cards are used. The main reason is to eradicate inefficiency which resulted in
leakage of subsides from the public distribution system. It is similar to swipe
card. Using this, the customer can get his/her grocery items at reasonable
prices. The smart card is coded in microprocessor chip. According to each
family, Credits are allotted by state government. Based on credits, the
customer can purchase his/her items. To implement this system, a unique
database of residents in India is surveyed, so that to eradicate duplicate
users. The Customer can access to the system by swiping the card, on the
machine. The machine checks the database, and provides the customer to
shop for allotted credits. Based on customer’s selected groceries, credits are
deducted. If there is any change in details provide by the customer, it will be
immediately updated by the respective database
2) As a citizen of India, ration card is very important; it acts as an address
proof for various purposes. The basic ration system has some disadvantages,
weight of the materials is imprecise and the goods which are not bought by
the customer, is sold to outsiders for high-costs without any intimation. This
paper proposes an Automatic Ration Distribution using GSM (Global System
for Mobile) and RFID (Radio Frequency Identification). The Customer just
need to show RFID tag, then the machine automatically shows the customer
code and amount present in the card. The Customer then enters his
required groceries, and the system gets processed. After receiving the
supplies, the customer can send the feedback information to government
office using the GSM.
3) Corruption plays a vital role in present world. E-Government is used
rapidly to decrease the corruption all over the country. The aim of this
paper is to organize theoretical and empirical work on corruption.
Computerization helps in modernizing the public distribution system. To
overcome corruption from leakages of delivering goods to customers the
system is proposed as a kind of electrodynamics web template where
distribution of groceries is checked monitored and filtering the problem of
corruption and adulteration. In this new system, all information is stored in
a database. The higher authority can check details through use of servers.
The ration can be taken by entering the ID and Password of the Customer.
BUDGET PLAN:
As seen in Table , food subsidy has been the largest component of the
Department’s expenditure (94% in 2017-18), and expenditure on food
subsidy has increased six-fold over the past 10 years. Food subsidy is given
to FCI under the National Food Security Act, 2013 (NFSA) or to states for the
decentralised procurement (DCP) of food grains. NFSA covers 80 crore
people, and it is mandated to cover 75% of the population from rural areas
and 50% from urban areas.
UTILITY TO CITIZENS :
The goal of Public Distribution System does not limit itself with the
distribution of rationed articles. Major goals of public distribution system are
as under Make goods available to consumers, especially the
disadvantaged/vulnerable sections of society at fair prices. Rectify the
existing imbalances between the supply and demand for consumer goods.
Check and prevent hoarding and black marketing in essential commodities.
Ensure social justice in distribution of basic necessities of life. Even out
fluctuations in prices and availability of mass consumption goods.
Minimum RAM : 1 GB
Hard Disk : 40 GB
Processor : Intel Pentium 4 /AMD Processor
Operating System : All operating systems.
DESIGN:
SOFTWARE ARCHITECTURE DIAGRAM:
PROJECT LIFE CYCLE:
The project life cycle stands on the basis of how desktop application works
and as far the Application and the database is working properly the way of
house hold on for bookings.
The new way of improvising the desktop application according to the
requirements of modern users get the desktop application a chance to
withstand the higher perspectives of the usage.
Login
OTP
UPI Payments
Gmail Notifications
Delivery
So, as far the servers have all the data without crash it works tremendously good.
Implementation:
There mainly 10 modules Signup, login, servies, forgotpassword,
changepassword,myaccount, QR-code, status, register, caller.
SIGN UP MODULE:
If the customer doesn’t have a login account in e-Ration card services.Then
by entering all the details of the customer can create new account.
Username,date of birth.
LOGIN MODULE:
Here the login page gives an account to the user in the desktop application.
This is just a security holder in order to proceed and buy ration. Now, this is
a mandatory to every user if they need the service from the application.
Login page is for existing users of e- Ratoion card services.
User Ration card number(10 digits) and password will be taken and will be verified with
details in databse in order to proceed and utilize e-ration services.
If user forgots the password he/she can know their password by clicking on
forgot password button.An One Time Password(OTP) will be generated and
sent to user gmail id.
If the user is new then he/she can create new acccount by pressing sign up
button.
Login Page:
If Invalid Details are entered:
• User can select necessary items from available items and quantity.
If user Enters Purchase Button Then QR-code will be displayed and the detailed
prices aslo
After User enters his/her a unique ration card number and press get-password button
the user gets an One Time Password to gmail id.
After successfull verification of OTP the user can see his/her password.
If OTP is valid user password will be displayed:
Purchase Module
The user data will be stored and retrived according to the required task of the
application.
It is the main module which defines the fuctionality for of all the modules discussed till
now.This module is core of the application.
Coding:
PYTHON CODE FOR SING UP MODULE:
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(532, 458)
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(90, 10, 441, 81))
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setGeometry(QtCore.QRect(60, 130, 111, 51))
self.label_2.setObjectName("label_2")
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setGeometry(QtCore.QRect(60, 180, 111, 71))
self.label_3.setObjectName("label_3")
self.signupbutton = QtWidgets.QPushButton(Dialog)
self.signupbutton.setGeometry(QtCore.QRect(330, 390, 121, 41))
self.signupbutton.setObjectName("signupbutton")
self.loginbutton = QtWidgets.QPushButton(Dialog)
self.loginbutton.setGeometry(QtCore.QRect(190, 280, 101, 41))
self.loginbutton.setObjectName("loginbutton")
self.user = QtWidgets.QLineEdit(Dialog)
self.user.setGeometry(QtCore.QRect(190, 120, 251, 51))
self.user.setCursorMoveStyle(QtCore.Qt.LogicalMoveStyle)
self.user.setObjectName("user")
self.password = QtWidgets.QLineEdit(Dialog)
self.password.setGeometry(QtCore.QRect(190, 200, 251, 51))
self.password.setEchoMode(QtWidgets.QLineEdit.Password)
self.password.setObjectName("password")
self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setGeometry(QtCore.QRect(70, 360, 261, 91))
self.label_4.setObjectName("label_4")
self.forgotpasswordbutton = QtWidgets.QPushButton(Dialog)
self.forgotpasswordbutton.setGeometry(QtCore.QRect(300, 280, 151, 41))
self.forgotpasswordbutton.setObjectName("forgotpasswordbutton")
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Login"))
self.label.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-
size:14pt; font-weight:600;\">E-RATION CARD SERVICES</span></p></body></html>"))
self.label_2.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-
size:10pt;\">UserId</span></p></body></html>"))
self.label_3.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-
size:10pt;\">Password</span></p></body></html>"))
self.signupbutton.setText(_translate("Dialog", "Sign up"))
self.loginbutton.setText(_translate("Dialog", "Log in"))
self.user.setPlaceholderText(_translate("Dialog", "Enter Ration Card Number"))
self.password.setPlaceholderText(_translate("Dialog", "Enter Your Password"))
self.label_4.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-
size:10pt; font-weight:600;\">Don\'t Have An Account?</span></p></body></html>"))
self.forgotpasswordbutton.setText(_translate("Dialog", "Forgot Password"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
PYTHON CODE FOR ACCOUNT MODULE:
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "User-Info"))
self.label_6.setText(_translate("Dialog", "Date Of Birth"))
self.label.setText(_translate("Dialog", "Ration Card Number"))
self.backbutton.setText(_translate("Dialog", "Back"))
self.label_9.setText(_translate("Dialog", "Annual Income"))
self.label_8.setText(_translate("Dialog", "Mobile Number"))
self.label_7.setText(_translate("Dialog", "Address"))
self.label_2.setText(_translate("Dialog", "Name"))
self.label_3.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-
size:18pt; font-weight:600;\">My Account</span></p></body></html>"))
self.label_10.setText(_translate("Dialog", "Gmail-id"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
self.retranslateUi(Change_Password)
QtCore.QMetaObject.connectSlotsByName(Change_Password)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Change_Password = QtWidgets.QDialog()
ui = Ui_Change_Password()
ui.setupUi(Change_Password)
Change_Password.show()
sys.exit(app.exec_())
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
class Ui_Dialog(object):
Dialog.setObjectName("Dialog")
Dialog.resize(335, 276)
self.frame = QtWidgets.QFrame(Dialog)
self.frame.setFrameShape(QtWidgets.QFrame.Panel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame")
self.paid = QtWidgets.QRadioButton(self.frame)
self.paid.setAutoFillBackground(False)
self.paid.setObjectName("paid")
self.notpaid = QtWidgets.QRadioButton(self.frame)
self.notpaid.setGeometry(QtCore.QRect(20, 60, 131, 71))
self.notpaid.setObjectName("notpaid")
self.submit = QtWidgets.QPushButton(self.frame)
self.submit.setObjectName("submit")
self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label")
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
_translate = QtCore.QCoreApplication.translate
self.paid.setText(_translate("Dialog", "Paid"))
self.submit.setText(_translate("Dialog", "Submit"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
def send_ord_mail(sub,b0,b1,b2,b3,b4,b5,b7,b8,to):
mail=smtplib.SMTP_SSL("smtp.gmail.com",465)
mail.login('e.ration.services@gmail.com','Service@123')
to=to+''
msg= f'{sub}\n\n{b0}\n{b1}\n{b2}\n{b3}\n{b4}\n{b5}\n{b7}\n{b8}'
mail.sendmail('e.ration.services@gmail.com',to,msg)
mail.close()
#status class
class status(QDialog,Ui_status):
def __init__(self,parent=None):
QDialog.__init__(self,parent)
self.setupUi(self)
self.submit.clicked.connect(self.sub)
def sub(self):
if(self.paid.isChecked()):
Details=register_database.forgot_search(datau[0])
lis=' ,'.join(ordered_data)
sub='Your order is confirmed'
b0='Hello '+Details[0][0]+'!'
b1='We recevied your payment of '+str(paid_mon[0])+' Rs succesfully.'
b2='Your ordered items are :'
b3=lis+'.'
b5='We will send you updates via to this mail once your order is prepared and ready to
ship.'
b4='Delivering at :'+Details[0][5]+'.'
b7='Thank you,'
b8='Team E-Ration Services.'
to=Details[0][7]
pay_flag.clear()
pay_flag.append(True)
fill_pop=QtWidgets.QMessageBox()
fill_pop.setWindowTitle('Order Confirmed.')
fill_pop.setText('Just Checking Few Things Enter ok to continue')
fill_pop.setIcon(QtWidgets.QMessageBox.Information)
fill_pop.exec_()
send_ord_mail(sub,b0,b1,b2,b3,b4,b5,b7,b8,to)
self.close()
if(self.notpaid.isChecked()):
print('Payment Failed\n\n')
self.close()
#upi class
class showupi(QDialog,Ui_Qrcode):
def __init__(self,parent=None):
QDialog.__init__(self,parent)
self.setupUi(self)
self.backbutton.clicked.connect(self.close)
self.verifypayment.clicked.connect(self.check)
def check(self):
stobj=status()
stobj.exec_()
self.close()
pop=QtWidgets.QMessageBox()
pop.setWindowTitle('OTP Generating')
pop.setText('Press ok to get OTP\nWe are trying to send the OTP\nThis might take upto 1
minute depending on Network connectivity')
pop.setIcon(QtWidgets.QMessageBox.Information)
pop.exec_()
sendemail(sub,b1,b2,b3,b4,b5,to)
text = "Enter the OTP Sent To The Register Gmail :"+to
title = "OTP Portal"
default_password = ""
output = passwordbox(text, title, default_password)
user_otp =str(output)
return [OTP,user_otp]
def sendemail(sub,b1,b2,b3,b4,b5,to):
mail=smtplib.SMTP_SSL("smtp.gmail.com",465)
mail.login('e.ration.services@gmail.com','Service@123')
to=to+''
s='OTP For E-Ration Services'
msg= f'{sub}\n\n{s}\n\n{b1}\n{b2}\n{b3}\n{b4}\n{b5}'
mail.sendmail('e.ration.services@gmail.com',to,msg)
mail.close()
#change password call
class Changepassword(QDialog,Ui_Change_Password):
def __init__(self,parent=None):
QDialog.__init__(self,parent)
self.setupUi(self)
self.cancelbutton.clicked.connect(self.close)
self.forgotbutton.clicked.connect(self.generateforgotpassword)
self.okbutton.clicked.connect(self.cp)
def cp(self):
op=self.oldpass.text()
np=self.newpass.text()
cp=self.conpass.text()
if(len(op)==0 or len(np)==0 or len(cp)==0):
self.fill_pop=QtWidgets.QMessageBox()
self.fill_pop.setWindowTitle('Change Password')
self.fill_pop.setText('Please Fill All The Fields')
self.fill_pop.setIcon(QtWidgets.QMessageBox.Information)
self.fill_pop.exec_()
elif(op!=datap[0]):
self.fill_pop=QtWidgets.QMessageBox()
self.fill_pop.setWindowTitle('Change Password')
self.fill_pop.setText('You Entered Incorrect Old Passsword')
self.fill_pop.setIcon(QtWidgets.QMessageBox.Warning)
self.fill_pop.exec_()
elif(len(np)<6):
self.Mpass_pop=QtWidgets.QMessageBox()
self.Mpass_pop.setWindowTitle('change password')
self.Mpass_pop.setText('Minimum length of password is 6')
self.Mpass_pop.setIcon(QtWidgets.QMessageBox.Critical)
self.Mpass_pop.exec_()
elif(np!=cp):
self.Mpass_pop=QtWidgets.QMessageBox()
self.Mpass_pop.setWindowTitle('Change Password')
self.Mpass_pop.setText('New and Conform passwords did\'nt matched')
self.Mpass_pop.setIcon(QtWidgets.QMessageBox.Critical)
self.Mpass_pop.exec_()
else:
det=register_database.forgot_search(datau[0])
otp=generateOTP(det[0][3],det[0][0],'Chage Password Verification')
if(otp[0]==otp[1]):
register_database.update_pass(datau[0],np)
datap.clear()
datap.append(np)
self.acc_cre=QtWidgets.QMessageBox()
self.acc_cre.setWindowTitle('Change Password')
self.acc_cre.setText('Succesfully Changed Password ')
self.acc_cre.setIcon(QtWidgets.QMessageBox.Information)
self.acc_cre.exec_()
self.close()
else:
self.acc_cre=QtWidgets.QMessageBox()
self.acc_cre.setWindowTitle('Change Password')
self.acc_cre.setText('Wrong OTP entered please try again.')
self.acc_cre.setIcon(QtWidgets.QMessageBox.Critical)
self.acc_cre.exec_()
def generateforgotpassword(self):
forgotpassobj=Forgortpassword()
forgotpassobj.exec_()
def getpass(self):
if(len(self.ration.text())==0):
self.for_pop=QtWidgets.QMessageBox()
self.for_pop.setWindowTitle('Forgot Password')
self.for_pop.setText('Please Enter User Id')
self.for_pop.setIcon(QtWidgets.QMessageBox.Information)
self.for_pop.exec_()
else:
u=self.ration.text()
det=register_database.forgot_search(u)
if(det==False):
self.for_pop=QtWidgets.QMessageBox()
self.for_pop.setWindowTitle('Forgot Password')
self.for_pop.setText('Please Enter A Valid User Id')
self.for_pop.setIcon(QtWidgets.QMessageBox.Warning )
self.for_pop.exec_()
else:
pas=det[0][2]
phno=det[0][3]
n=det[0][0]
datau.clear()
datau.clear()
datau.append(det[0][1])
datap.append(det[0][2])
otp=generateOTP(phno,n,'Forgot Password Verification')
if(otp[0]==otp[1]):
self.showpass_pop=QtWidgets.QMessageBox()
self.showpass_pop.setWindowTitle('Password')
pas='Your Password :'+pas
self.showpass_pop.setText(pas)
self.showpass_pop.setIcon(QtWidgets.QMessageBox.Information)
self.showpass_pop.show()
self.showpass_pop.exec_()
self.close()
else:
self.errpass_pop=QtWidgets.QMessageBox()
self.errpass_pop.setWindowTitle('OTP')
self.errpass_pop.setText('Wrong OTP Entered')
self.errpass_pop.setIcon(QtWidgets.QMessageBox.Warning)
self.errpass_pop.show()
self.errpass_pop.exec_()
self.close()
def close_Forgotpassword(self):
self.close()
def close_myaccount(self):
self.close()
def close_signup(self):
self.close()
def adduser(self):
n=self.name.text()
userid=self.ration.text()
v_uid=re.findall('[0-9]+', userid)
datau.clear()
datau.append(userid)
password=self.password.text()
phno=self.phoneno.text()
lstph = re.findall('[0-9]+', phno)
sal=self.income.text()
dob=self.date.text()#
address=self.address.text()
emailid=self.email.text()
verify_email.clear()
verify_email.append(emailid)
lst=re.findall('\S+@gmail.com',emailid)
self.flag=register_database.forgot_search(userid)
if(len(self.name.text())==0 or len(self.ration.text())==0 or len(self.password.text())==0 or
len(self.conformpass.text())==0 or len(self.phoneno.text())==0 or len(self.income.text())==0 or
len(self.date.text())==0 or len(self.address.text())==0 or len(emailid)==0):
self.fill_pop=QtWidgets.QMessageBox()
self.fill_pop.setWindowTitle('Signup')
self.fill_pop.setText('Fill All The Fields')
self.fill_pop.setIcon(QtWidgets.QMessageBox.Information)
self.fill_pop.exec_()
elif(len(v_uid[0])!=10):
self.Mpass_pop=QtWidgets.QMessageBox()
self.Mpass_pop.setWindowTitle('Acoount creation')
self.Mpass_pop.setText('Ration Card Number Must be 10 digits')
self.Mpass_pop.setIcon(QtWidgets.QMessageBox.Information)
self.Mpass_pop.exec_()
elif(self.password.text()!=self.conformpass.text()):
self.Mpass_pop=QtWidgets.QMessageBox()
self.Mpass_pop.setWindowTitle('Acoount creation')
self.Mpass_pop.setText('passwords did\'nt matched')
self.Mpass_pop.setIcon(QtWidgets.QMessageBox.Critical)
self.Mpass_pop.exec_()
elif(len(self.password.text())<6):
self.Mpass_pop=QtWidgets.QMessageBox()
self.Mpass_pop.setWindowTitle('Acoount creation')
self.Mpass_pop.setText('Minimum length of password is 6')
self.Mpass_pop.setIcon(QtWidgets.QMessageBox.Critical)
self.Mpass_pop.exec_()
elif(len(lstph[0])!=10):
self.f_pop=QtWidgets.QMessageBox()
self.f_pop.setWindowTitle('Phone Number')
self.f_pop.setText('Phone Number Must Be 10 Digits')
self.f_pop.setIcon(QtWidgets.QMessageBox.Information)
self.f_pop.exec_()
elif(len(lst)==0):
self.f_pop=QtWidgets.QMessageBox()
self.f_pop.setWindowTitle('Invalid Gmail')
self.f_pop.setText('Please Enter Valid Gmail Id')
self.f_pop.setIcon(QtWidgets.QMessageBox.Information)
self.f_pop.exec_()
else:
if(self.flag==False):
otp=generateOTP(phno,n,'Sign Up Verification')
if(otp[0]==otp[1]):
self.acc_cre=QtWidgets.QMessageBox()
self.acc_cre.setWindowTitle('Acoount creation')
self.acc_cre.setText('Succesfully created account')
self.acc_cre.setIcon(QtWidgets.QMessageBox.Information)
self.acc_cre.exec_()
register_database.add(n,userid,password,phno,sal,address,dob,emailid)
self.close()
else:
self.errpass_pop=QtWidgets.QMessageBox()
self.errpass_pop.setWindowTitle('Acoount creation')
self.errpass_pop.setText('Wrong OTP entered failed to create new account')
self.errpass_pop.setIcon(QtWidgets.QMessageBox.Warning)
self.errpass_pop.show()
self.errpass_pop.exec_()
else:
self.u_cre=QtWidgets.QMessageBox()
self.u_cre.setWindowTitle('Acoount creation')
self.u_cre.setText('Account Already exists')
self.u_cre.setIcon(QtWidgets.QMessageBox.Warning)
self.u_cre.exec_()
def generateforgotpassword(self):
forgotpassobj=Forgortpassword()
forgotpassobj.exec_()
def checkval(self):
self.u=self.user.text()
rationno=self.user.text()
p=self.password.text()
self.flag=register_database.search(self.u,p)
if(len(self.user.text())==0 or len(self.password.text())==0):
self.fill_pop=QtWidgets.QMessageBox()
self.fill_pop.setWindowTitle('Login')
self.fill_pop.setText('Fill All The Fields')
self.fill_pop.setIcon(QtWidgets.QMessageBox.Information)
self.fill_pop.exec_()
elif(self.flag==False):
self.p_pop=QtWidgets.QMessageBox()
self.p_pop.setWindowTitle('Login')
self.p_pop.setText('Invalid Login Details')
self.p_pop.setIcon(QtWidgets.QMessageBox.Warning)
self.p_pop.exec_()
elif(self.flag==True):
datau.clear()
datap.clear()
datau.append(self.u)
datap.append(p)
self.s_pop=QtWidgets.QMessageBox()
self.s_pop.setWindowTitle('Congrats')
self.s_pop.setText('Succesfully logged in')
self.s_pop.setIcon(QtWidgets.QMessageBox.Information)
self.s_pop.exec_()
self.close()
def generatesignup(self):
signobj=Signup()
signobj.exec_()
def open_cp(self):
self.chapassobj=Changepassword()
self.chapassobj.exec_()
def close_win(self):
self.poplog_out=QtWidgets.QMessageBox()
self.poplog_out.setWindowTitle('Log out')
self.poplog_out.setText('Succesfully Logged Out')
self.poplog_out.setIcon(QtWidgets.QMessageBox.Information)
self.close()
self.poplog_out.exec_()
def checklogin(self):
self.loginobj=Login()
self.loginobj.exec_()
if self.loginobj.flag is True:
self.data=register_database.getbyuser(self.loginobj.u)
def getdetail(self):
userobj=Myaccount()
userobj.name.setText(self.data[0][0])
userobj.ration.setText(self.data[0][1])
userobj.phoneno.setText(self.data[0][3])
userobj.income.setText(self.data[0][4])
userobj.address.setText(self.data[0][5])
userobj.dob.setText(self.data[0][6])
userobj.email.setText(self.data[0][7])
userobj.exec_()
def calc(self):
sum=0
ordered_data.clear()
if(self.ricebox.isChecked()):
sum=sum+self.qrice.value()*7
print('Rice Quantity :',self.qrice.value(),' Cost :',self.qrice.value()*7)
ordered_data.append('Rice '+str(self.qrice.value())+' Kg')
if(self.sugarbox.isChecked()):
sum=sum+self.qsugar.value()*13
print('Sugar Quantity :',self.qsugar.value(),' Cost :',self.qsugar.value()*13)
ordered_data.append('Sugar '+str(self.qsugar.value())+' Kg')
if(self.kerosenebox.isChecked()):
sum=sum+self.qkerosene.value()*22
print('Kerosene Quantity :',self.qkerosene.value(),' Cost :',self.qkerosene.value()*22)
ordered_data.append('Kerosene '+str(self.qkerosene.value())+' L')
if(self.oilbox.isChecked()):
sum=sum+self.qoil.value()*30
print('Oil Quantity :',self.qoil.value(),' Cost :',self.qoil.value()*30)
ordered_data.append('Oil '+str(self.qoil.value())+' L')
if(self.fertilizersbox.isChecked()):
sum=sum+self.qfertilizers.value()*37
print('Fertilizers Quantity :',self.qfertilizers.value(),' Cost :',self.qfertilizers.value()*37)
ordered_data.append('Fertilizers '+str(self.qfertilizers.value())+' Bag')
if(self.wheatbox.isChecked()):
sum=sum+self.qwheat.value()*26
print('Atta Quantity :',self.qwheat.value(),' Cost :',self.qwheat.value()*26)
ordered_data.append('Atta '+str(self.qwheat.value())+' Kg')
if(self.saltbox.isChecked()):
sum=sum+self.qsalt.value()*9
print('Salt Quantity :',self.qsalt.value(),' Cost :',self.qsalt.value()*9)
ordered_data.append('Salt '+str(self.qsalt.value())+' Kg')
self.popbill=QtWidgets.QMessageBox()
self.popbill.setWindowTitle('Scan QR Code')
print('Total Bill : ',sum)
print()
paid_mon.clear()
paid_mon.append(sum)
if(sum!=0):
self.popbill.setText('Use Google pay / Paytm / phonePe / Any BHMI upi app to scan the
QR code.')
self.popbill.setIcon(QtWidgets.QMessageBox.Information)
self.popbill.show()
self.popbill.exec_()
obj=showupi()
obj.exec_()
if(pay_flag[0]):
print('Payment Successfull.')
print('Check Your Mail For Further Details.\n\n')
pay_flag.clear()
pay_flag.append(False)
self.clear()
def clear(self):
self.ricebox.setChecked(False)
self.sugarbox.setChecked(False)
self.kerosenebox.setChecked(False)
self.oilbox.setChecked(False)
self.wheatbox.setChecked(False)
self.fertilizersbox.setChecked(False)
self.saltbox.setChecked(False)
self.qrice.setValue(0)
self.qsugar.setValue(0)
self.qkerosene.setValue(0)
self.qoil.setValue(0)
self.qwheat.setValue(0)
self.qfertilizers.setValue(0)
self.qsalt.setValue(0)
if __name__=="__main__":
#to create application
app=QApplication(sys.argv)
#main window object
w=MainWindow()
w.show()
sys.exit(app.exec_())