You are on page 1of 78

E-GOVERNANCE

PROJECT TITTLE : E-RATION CARD SERVICES

REVIEW-3

COURSE CODE : SWE1012


SLOT : C2

TEAM MEMBERS :

19MIS0305 – K.SHIVANVITHA
19MIS0361 – V.TANMAYEE

OBJECTIVE LIST OF SERVICES:


The objective of the issue of ration card is to implement the Targeted Public Distribution
System (TPDS) that provides the essential commodities like rice, oil, sugar, kerosene,
fertilizers, atta, etc. to its citizens at highly subsidized prices.
Make goods available to consumers, especially the disadvantaged /vulnerable sections
of society at fair prices.
The Department is also entrusted with the responsibility of ensuring availability of
Essential Commodities in the Market at reasonable price and prevention of hoarding,
black-marketing and artificial price hike.
Since most of the Foodgrains in the State come from outside the State, the PDS is
totally dependent on the Foodgrains supplied by the Govt. of India through FCI.

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:

Department of Food and Public Distribution is responsible for ensuring


food security through procurement, storage and distribution of food grains.
The Food Corporation of India (FCI) is responsible for some of these
functions. In 2017-18, the Department has been allocated Rs 1,50,505 crore,
which is 98% of the Ministry’s allocation. Allocation to this Department
accounts for 7.6% of the central government’s budgeted expenditure.

Department of Consumer Affairs is responsible for spreading awareness


among consumers about their rights, protecting their interests and
preventing black marketing. In 2017-18, the Department has been
allocated Rs 3.727 core, which is 2% of the Ministry’s allocation.

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.

SOCIAL MEDIA ENGAGEMENT:


Social media engagement measures the public shares, likes and
comments for an online business' social media efforts.
Engagement has historically been a common metric for evaluating social
media performance but doesn't necessarily translate to sales.
The targeted PDS is costly and gives rise to much corruption in the process
of extricating the poor from those who are less needy. Also many retail
shopkeepers have large number of bogus cards to sell food grains in the
open market. Many FPS dealers resort to malpractice since they acquire less
salary.
Most of the times Users do not get their rightful entitlement in terms of
quantity. What's meant for them or the farm produce procured by the FPS's
is diverted to the open market. So in order to avoid all these drawbacks we
are going to use the Smart ration card which will help us to avoid the
corruption in PDS.

GOVERNANACES AND SERVICES ON DEMAND:


There is a huge demand for white ration cards. The government distributed
more than 1.81 lakhs cards during the recently concluded Janmabhoomi-
maa vooru programme, taking the number to a whopping 1,40,70,242.
It is evident that the cards distribution drew thousands to the gram sabhas
compared to other activities such as health camps, distribution of spectacles,
discussions, competitions, exhibitions and cultural programmes.
The Public Distribution System contribute significantly in the provision of
food security.
The objective of the issue of ration card is to implement the Targeted Public
Distribution System (TPDS) that provides the essential commodities like
rice, wheat, sugar, kerosene, fertilizers, atta, etc. to its citizens at highly
subsidized prices.
Make goods available to consumers, especially the disadvantaged
/vulnerable sections of society at fair prices
The Department is also entrusted with the responsibility of ensuring
availability of Essential Commodities in the Market at reasonable price and
prevention of hoarding, black-marketing and artificial price hike.
Since most of the Foodgrains in the State come from outside the State, the
PDS is totally dependent on the Foodgrains supplied by the Govt of India
through FCI.

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.

SOFTWARE AND HARDWARE RESOURCES:

software requirements are:

Python software with pip


PyQt5
Easygui
SMTP
Database : sqlite3

Hardware requirements are :

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

Booking house hold items

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.

A unique 10 digit ration card number .

Password must have Min length 6 Characters.

Username,date of birth.

Address in order to deliver the purchased ration.

Gmail id is for sharing information and for security purpose.

An One Time Password(OTP) will be generated and sent to user gmail id


and upon succesfull verification the user gets new account.
Signup Page:
An Otp will be sent to gmail id after succesful verification only account will be
created:
A pop up will be popped asking for OTP:
If User Enters Wrong OTP:
If user Enters Correct OTP:

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:

If Login Details are Correct:


MY ACCOUNT MODULE:
This gives the personal information about the user as per his entered content during
Sign up time.
Read Only Window

The details of the user will be displayed:


SERVICES MODULE:
This is the main module of the E Ration Services. This module can be subdivided
into many other smaller modules. But this basically explains the functionalities
carried out by the E-Ration Services.

• User can select necessary items from available items and quantity.

• User can make payments using purchase button. (PURCHASE MODULE)

• User can change password using change password button.

(CHANGE PASSWORD and FORGORT PASSWORD MODULES)

• User can get his personal details through myaccount/userinfo button.(MY


ACCOUNT MODULE)

• User can exit the application by pressing the logout button.

• User can clear the items by using clear button.

• User can view the prices of ration and select accordingly.


User can select items and required quantity:

If user Enters Purchase Button Then QR-code will be displayed and the detailed
prices aslo

If user Enters clear Then all fields will be cleared:


If users Enters Logout the application will be closed after logging out:

Forgot Password Module

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:

Change Password Module


It has two secure steps in order to change password by account holder only.
1st step is verfying current password
2nd step is verfying One Time Password which is sent gmail id.
The user gets help with forgort password if he/she does not remember their current
password.
The password must have min length 6 Characters.
Change Password:

If user enters wrong current password:


If user enters correct password then otp will sent to mail for further verification:

If Entered OTP is valid then password will be changed:

Purchase Module

It has another 2 sub modules Qrcode module and status module.


On clicking the puchase button:
The user can make payment by scanning the QR-Code in google
pay/Paytm/PhonePe/BHMI upi apps.
QR-CODE MODULE:
After user scans and made the payment.
The user must press verify payment inorder to process his/her payment request to
sever.
If users enters Purchase Button:

The Bill will be displayed to user:


User can make the payment by scanning the QR-Code and presses verify payment in
order to request server to check payment status.
STATUS MODULE:
After user enters verify payment button.
The request goes to server side status window.
At Server side if they received payment , paid radio button will be selected by server
then the order will conformed and the user gets updates via gmail id.
If the payment is unsuccessfull the user will get refund within seconds.(In case of user
paid any money)

Register Module: (DATABASE sqlite3)

The user data will be stored and retrived according to the required task of the
application.

Caller Module: (Main module for functionality )

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:

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(1013, 986)
self.password = QtWidgets.QLineEdit(Dialog)
self.password.setGeometry(QtCore.QRect(460, 250, 291, 51))
self.password.setMaxLength(20)
self.password.setEchoMode(QtWidgets.QLineEdit.Password)
self.password.setObjectName("password")
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setGeometry(QtCore.QRect(400, 0, 271, 81))
self.label_3.setObjectName("label_3")
self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setGeometry(QtCore.QRect(280, 240, 101, 61))
self.label_4.setObjectName("label_4")
self.label_9 = QtWidgets.QLabel(Dialog)
self.label_9.setGeometry(QtCore.QRect(280, 650, 161, 91))
self.label_9.setObjectName("label_9")
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setGeometry(QtCore.QRect(280, 170, 101, 51))
self.label_2.setObjectName("label_2")
self.label_6 = QtWidgets.QLabel(Dialog)
self.label_6.setGeometry(QtCore.QRect(270, 380, 141, 121))
self.label_6.setObjectName("label_6")
self.conformpass = QtWidgets.QLineEdit(Dialog)
self.conformpass.setGeometry(QtCore.QRect(460, 330, 301, 51))
self.conformpass.setMaxLength(20)
self.conformpass.setEchoMode(QtWidgets.QLineEdit.Password)
self.conformpass.setObjectName("conformpass")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(280, 70, 191, 101))
self.label.setObjectName("label")
self.label_5 = QtWidgets.QLabel(Dialog)
self.label_5.setGeometry(QtCore.QRect(270, 300, 191, 121))
self.label_5.setObjectName("label_5")
self.cancelbutton = QtWidgets.QPushButton(Dialog)
self.cancelbutton.setGeometry(QtCore.QRect(260, 830, 191, 71))
self.cancelbutton.setObjectName("cancelbutton")
self.name = QtWidgets.QLineEdit(Dialog)
self.name.setGeometry(QtCore.QRect(460, 170, 291, 51))
self.name.setInputMethodHints(QtCore.Qt.ImhNone)
self.name.setText("")
self.name.setEchoMode(QtWidgets.QLineEdit.Normal)
self.name.setObjectName("name")
self.label_8 = QtWidgets.QLabel(Dialog)
self.label_8.setGeometry(QtCore.QRect(280, 570, 131, 101))
self.label_8.setObjectName("label_8")
self.label_7 = QtWidgets.QLabel(Dialog)
self.label_7.setGeometry(QtCore.QRect(280, 500, 91, 71))
self.label_7.setObjectName("label_7")
self.phoneno = QtWidgets.QLineEdit(Dialog)
self.phoneno.setGeometry(QtCore.QRect(450, 590, 311, 51))
self.phoneno.setMaxLength(10)
self.phoneno.setObjectName("phoneno")
self.date = QtWidgets.QDateEdit(Dialog)
self.date.setGeometry(QtCore.QRect(460, 420, 301, 51))
self.date.setObjectName("date")
self.ration = QtWidgets.QLineEdit(Dialog)
self.ration.setGeometry(QtCore.QRect(460, 90, 291, 51))
self.ration.setObjectName("ration")
self.income = QtWidgets.QLineEdit(Dialog)
self.income.setGeometry(QtCore.QRect(450, 670, 311, 51))
self.income.setMaxLength(15)
self.income.setObjectName("income")
self.signupButton = QtWidgets.QPushButton(Dialog)
self.signupButton.setGeometry(QtCore.QRect(570, 830, 191, 71))
self.signupButton.setObjectName("signupButton")
self.address = QtWidgets.QLineEdit(Dialog)
self.address.setGeometry(QtCore.QRect(450, 510, 311, 51))
self.address.setMaxLength(100)
self.address.setObjectName("address")
self.email = QtWidgets.QLineEdit(Dialog)
self.email.setGeometry(QtCore.QRect(450, 750, 311, 51))
self.email.setMaxLength(100)
self.email.setObjectName("email")
self.label_10 = QtWidgets.QLabel(Dialog)
self.label_10.setGeometry(QtCore.QRect(280, 730, 161, 91))
self.label_10.setObjectName("label_10")

self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):


_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Signup"))
self.password.setPlaceholderText(_translate("Dialog", "Enter Your Password"))
self.label_3.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-
size:14pt; font-weight:600;\">SING UP</span></p></body></html>"))
self.label_4.setText(_translate("Dialog", "Password"))
self.label_9.setText(_translate("Dialog", "Annual Income"))
self.label_2.setText(_translate("Dialog", "Name"))
self.label_6.setText(_translate("Dialog", "Date Of Birth"))
self.conformpass.setPlaceholderText(_translate("Dialog", "Renter Your Password "))
self.label.setText(_translate("Dialog", "Ration Card Number"))
self.label_5.setText(_translate("Dialog", "Conform Password"))
self.cancelbutton.setText(_translate("Dialog", "Cancel"))
self.name.setPlaceholderText(_translate("Dialog", "Enter Your Name"))
self.label_8.setText(_translate("Dialog", "Mobile Number"))
self.label_7.setText(_translate("Dialog", "Address"))
self.phoneno.setPlaceholderText(_translate("Dialog", "Enter 10 digit Mobile Number"))
self.date.setDisplayFormat(_translate("Dialog", "M/d/yyyy"))
self.ration.setPlaceholderText(_translate("Dialog", "Enter Ration Number"))
self.income.setPlaceholderText(_translate("Dialog", "Enter Your Annual Income"))
self.signupButton.setText(_translate("Dialog", "SIGN UP"))
self.address.setPlaceholderText(_translate("Dialog", "Enter Your Address"))
self.email.setPlaceholderText(_translate("Dialog", "Enter Gmail Id"))
self.label_10.setText(_translate("Dialog", "E-mail"))

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 LOGIN MODULE:


from PyQt5 import QtCore, QtGui, QtWidgets

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:

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(668, 932)
self.label_6 = QtWidgets.QLabel(Dialog)
self.label_6.setGeometry(QtCore.QRect(90, 330, 141, 121))
self.label_6.setObjectName("label_6")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(40, 130, 191, 101))
self.label.setObjectName("label")
self.name = QtWidgets.QLineEdit(Dialog)
self.name.setGeometry(QtCore.QRect(230, 260, 311, 51))
self.name.setInputMethodHints(QtCore.Qt.ImhNone)
self.name.setText("")
self.name.setEchoMode(QtWidgets.QLineEdit.Normal)
self.name.setReadOnly(True)
self.name.setPlaceholderText("")
self.name.setObjectName("name")
self.backbutton = QtWidgets.QPushButton(Dialog)
self.backbutton.setGeometry(QtCore.QRect(390, 850, 151, 61))
self.backbutton.setObjectName("backbutton")
self.label_9 = QtWidgets.QLabel(Dialog)
self.label_9.setGeometry(QtCore.QRect(100, 660, 161, 91))
self.label_9.setObjectName("label_9")
self.ration = QtWidgets.QLineEdit(Dialog)
self.ration.setGeometry(QtCore.QRect(230, 160, 311, 51))
self.ration.setReadOnly(True)
self.ration.setPlaceholderText("")
self.ration.setObjectName("ration")
self.label_8 = QtWidgets.QLabel(Dialog)
self.label_8.setGeometry(QtCore.QRect(100, 550, 131, 101))
self.label_8.setObjectName("label_8")
self.label_7 = QtWidgets.QLabel(Dialog)
self.label_7.setGeometry(QtCore.QRect(100, 450, 91, 71))
self.label_7.setObjectName("label_7")
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setGeometry(QtCore.QRect(100, 260, 101, 51))
self.label_2.setObjectName("label_2")
self.income = QtWidgets.QLineEdit(Dialog)
self.income.setGeometry(QtCore.QRect(230, 680, 311, 51))
self.income.setMaxLength(15)
self.income.setReadOnly(True)
self.income.setPlaceholderText("")
self.income.setObjectName("income")
self.phoneno = QtWidgets.QLineEdit(Dialog)
self.phoneno.setGeometry(QtCore.QRect(230, 570, 311, 51))
self.phoneno.setMaxLength(15)
self.phoneno.setReadOnly(True)
self.phoneno.setPlaceholderText("")
self.phoneno.setObjectName("phoneno")
self.address = QtWidgets.QLineEdit(Dialog)
self.address.setGeometry(QtCore.QRect(230, 460, 311, 51))
self.address.setMaxLength(300)
self.address.setReadOnly(True)
self.address.setPlaceholderText("")
self.address.setObjectName("address")
self.dob = QtWidgets.QLineEdit(Dialog)
self.dob.setGeometry(QtCore.QRect(230, 360, 311, 51))
self.dob.setMaxLength(15)
self.dob.setReadOnly(True)
self.dob.setPlaceholderText("")
self.dob.setObjectName("dob")
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setGeometry(QtCore.QRect(220, 20, 211, 81))
self.label_3.setObjectName("label_3")
self.email = QtWidgets.QLineEdit(Dialog)
self.email.setGeometry(QtCore.QRect(230, 770, 311, 51))
self.email.setMaxLength(100)
self.email.setReadOnly(True)
self.email.setPlaceholderText("")
self.email.setObjectName("email")
self.label_10 = QtWidgets.QLabel(Dialog)
self.label_10.setGeometry(QtCore.QRect(100, 750, 161, 91))
self.label_10.setObjectName("label_10")

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_())

PYTHON CODE FOR SERVICES MODULE:

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(780, 811)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(260, 0, 251, 81))
self.label.setObjectName("label")
self.ricebox = QtWidgets.QCheckBox(self.centralwidget)
self.ricebox.setGeometry(QtCore.QRect(30, 100, 91, 61))
self.ricebox.setObjectName("ricebox")
self.sugarbox = QtWidgets.QCheckBox(self.centralwidget)
self.sugarbox.setGeometry(QtCore.QRect(30, 190, 91, 71))
self.sugarbox.setObjectName("sugarbox")
self.kerosenebox = QtWidgets.QCheckBox(self.centralwidget)
self.kerosenebox.setGeometry(QtCore.QRect(30, 290, 121, 61))
self.kerosenebox.setObjectName("kerosenebox")
self.oilbox = QtWidgets.QCheckBox(self.centralwidget)
self.oilbox.setGeometry(QtCore.QRect(30, 370, 111, 61))
self.oilbox.setObjectName("oilbox")
self.fertilizersbox = QtWidgets.QCheckBox(self.centralwidget)
self.fertilizersbox.setGeometry(QtCore.QRect(30, 440, 151, 101))
self.fertilizersbox.setObjectName("fertilizersbox")
self.wheatbox = QtWidgets.QCheckBox(self.centralwidget)
self.wheatbox.setGeometry(QtCore.QRect(30, 570, 81, 51))
self.wheatbox.setObjectName("wheatbox")
self.saltbox = QtWidgets.QCheckBox(self.centralwidget)
self.saltbox.setGeometry(QtCore.QRect(380, 110, 91, 51))
self.saltbox.setObjectName("saltbox")
self.purchasebutton = QtWidgets.QPushButton(self.centralwidget)
self.purchasebutton.setGeometry(QtCore.QRect(420, 710, 121, 41))
self.purchasebutton.setObjectName("purchasebutton")
self.Price_Display = QtWidgets.QTextBrowser(self.centralwidget)
self.Price_Display.setEnabled(False)
self.Price_Display.setGeometry(QtCore.QRect(390, 260, 341, 281))
self.Price_Display.setReadOnly(False)
self.Price_Display.setObjectName("Price_Display")
self.logoutbutton = QtWidgets.QPushButton(self.centralwidget)
self.logoutbutton.setGeometry(QtCore.QRect(610, 710, 121, 41))
self.logoutbutton.setObjectName("logoutbutton")
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setGeometry(QtCore.QRect(500, 180, 211, 81))
self.label_2.setObjectName("label_2")
self.userinfo = QtWidgets.QPushButton(self.centralwidget)
self.userinfo.setGeometry(QtCore.QRect(30, 710, 121, 41))
self.userinfo.setObjectName("userinfo")
self.clearbutton = QtWidgets.QPushButton(self.centralwidget)
self.clearbutton.setGeometry(QtCore.QRect(220, 710, 131, 41))
self.clearbutton.setObjectName("clearbutton")
self.changepasswordbutton = QtWidgets.QPushButton(self.centralwidget)
self.changepasswordbutton.setGeometry(QtCore.QRect(570, 600, 161, 51))
self.changepasswordbutton.setObjectName("changepasswordbutton")
self.qrice = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.qrice.setGeometry(QtCore.QRect(190, 120, 71, 41))
self.qrice.setAccelerated(True)
self.qrice.setMaximum(10.0)
self.qrice.setSingleStep(0.5)
self.qrice.setStepType(QtWidgets.QAbstractSpinBox.DefaultStepType)
self.qrice.setObjectName("qrice")
self.qsugar = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.qsugar.setGeometry(QtCore.QRect(190, 210, 71, 41))
self.qsugar.setAccelerated(True)
self.qsugar.setMaximum(10.0)
self.qsugar.setSingleStep(0.5)
self.qsugar.setObjectName("qsugar")
self.qkerosene = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.qkerosene.setGeometry(QtCore.QRect(190, 300, 71, 41))
self.qkerosene.setAccelerated(True)
self.qkerosene.setMaximum(10.0)
self.qkerosene.setSingleStep(0.5)
self.qkerosene.setObjectName("qkerosene")
self.qoil = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.qoil.setGeometry(QtCore.QRect(190, 380, 71, 41))
self.qoil.setAccelerated(True)
self.qoil.setMaximum(10.0)
self.qoil.setSingleStep(0.5)
self.qoil.setObjectName("qoil")
self.qfertilizers = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.qfertilizers.setGeometry(QtCore.QRect(190, 470, 71, 41))
self.qfertilizers.setAccelerated(True)
self.qfertilizers.setMaximum(10.0)
self.qfertilizers.setSingleStep(0.5)
self.qfertilizers.setObjectName("qfertilizers")
self.qwheat = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.qwheat.setGeometry(QtCore.QRect(190, 570, 71, 41))
self.qwheat.setAccelerated(True)
self.qwheat.setMaximum(10.0)
self.qwheat.setSingleStep(0.5)
self.qwheat.setObjectName("qwheat")
self.qsalt = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.qsalt.setGeometry(QtCore.QRect(520, 120, 71, 41))
self.qsalt.setAutoFillBackground(False)
self.qsalt.setWrapping(False)
self.qsalt.setFrame(True)
self.qsalt.setAccelerated(True)
self.qsalt.setMaximum(10.0)
self.qsalt.setSingleStep(0.5)
self.qsalt.setObjectName("qsalt")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 780, 18))
self.menubar.setObjectName("menubar")
self.menuHome = QtWidgets.QMenu(self.menubar)
self.menuHome.setObjectName("menuHome")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.menubar.addAction(self.menuHome.menuAction())

self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):


_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Services"))
self.label.setText(_translate("MainWindow", "<html><head/><body><p><span style=\"
font-size:14pt; font-weight:600;\">SERVICES</span></p></body></html>"))
self.ricebox.setText(_translate("MainWindow", "Rice"))
self.sugarbox.setText(_translate("MainWindow", "Sugar"))
self.kerosenebox.setText(_translate("MainWindow", "kerosene"))
self.oilbox.setText(_translate("MainWindow", "oil"))
self.fertilizersbox.setText(_translate("MainWindow", "Fertilizers"))
self.wheatbox.setText(_translate("MainWindow", "Atta"))
self.saltbox.setText(_translate("MainWindow", "Salt"))
self.purchasebutton.setText(_translate("MainWindow", "Purchase"))
self.Price_Display.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-
//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8pt; font-weight:400;
font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-
indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\';\"> </span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-
indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:12pt;\">Rice
7 rs per kg</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-
indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:12pt;\">Atta
26 rs per kg</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-
indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-
size:12pt;\">Sugar 13 rs per kg</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-
indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:12pt;\">Salt
9 rs per kg</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-
indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:12pt;\">oil
30 rs per liter</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-
indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-
size:12pt;\">Kerosene 22 rs per liter</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-
indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-
size:12pt;\">Fertilizers 37 rs per bag</span></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\'; font-
size:12pt;\"><br /></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\'; font-
size:12pt;\"><br /></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'MS Shell Dlg 2\'; font-
size:12pt;\"><br /></p></body></html>"))
self.logoutbutton.setText(_translate("MainWindow", "LOGOUT"))
self.label_2.setText(_translate("MainWindow", "<html><head/><body><p><span style=\"
font-size:14pt; font-weight:600;\">Prices</span></p></body></html>"))
self.userinfo.setText(_translate("MainWindow", "User Info"))
self.clearbutton.setText(_translate("MainWindow", "Clear"))
self.changepasswordbutton.setText(_translate("MainWindow", "Change Password"))
self.menuHome.setTitle(_translate("MainWindow", "Home"))

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_())

PYTHON CODE FOR FORGOT PASSWORD MODULE:

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Forgot Password")
Dialog.resize(396, 178)
self.getpasswordbutton = QtWidgets.QPushButton(Dialog)
self.getpasswordbutton.setGeometry(QtCore.QRect(200, 100, 151, 41))
self.getpasswordbutton.setObjectName("getpasswordbutton")
self.ration = QtWidgets.QLineEdit(Dialog)
self.ration.setGeometry(QtCore.QRect(110, 30, 241, 51))
self.ration.setObjectName("ration")
self.cancelbutton = QtWidgets.QPushButton(Dialog)
self.cancelbutton.setGeometry(QtCore.QRect(110, 100, 71, 41))
self.cancelbutton.setObjectName("cancelbutton")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(20, 30, 111, 51))
self.label.setObjectName("label")

self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):


_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Forgot Password"))
self.getpasswordbutton.setText(_translate("Dialog", "Get Password"))
self.ration.setPlaceholderText(_translate("Dialog", "Enter Ration Card Number"))
self.cancelbutton.setText(_translate("Dialog", "Cancel"))
self.label.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-
weight:600;\">User Id</span></p></body></html>"))

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 CHANGE PASSWORD MODULE:

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Change_Password(object):
def setupUi(self, Change_Password):
Change_Password.setObjectName("Change_Password")
Change_Password.resize(510, 363)
self.oldpass = QtWidgets.QLineEdit(Change_Password)
self.oldpass.setGeometry(QtCore.QRect(210, 50, 231, 41))
self.oldpass.setMaxLength(20)
self.oldpass.setEchoMode(QtWidgets.QLineEdit.Password)
self.oldpass.setObjectName("oldpass")
self.newpass = QtWidgets.QLineEdit(Change_Password)
self.newpass.setGeometry(QtCore.QRect(210, 110, 231, 41))
self.newpass.setMaxLength(20)
self.newpass.setEchoMode(QtWidgets.QLineEdit.Password)
self.newpass.setObjectName("newpass")
self.conpass = QtWidgets.QLineEdit(Change_Password)
self.conpass.setGeometry(QtCore.QRect(210, 170, 231, 41))
self.conpass.setMaxLength(20)
self.conpass.setEchoMode(QtWidgets.QLineEdit.Password)
self.conpass.setObjectName("conpass")
self.label = QtWidgets.QLabel(Change_Password)
self.label.setGeometry(QtCore.QRect(10, 40, 121, 51))
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(Change_Password)
self.label_2.setGeometry(QtCore.QRect(10, 100, 151, 51))
self.label_2.setObjectName("label_2")
self.label_3 = QtWidgets.QLabel(Change_Password)
self.label_3.setGeometry(QtCore.QRect(10, 160, 181, 61))
self.label_3.setObjectName("label_3")
self.okbutton = QtWidgets.QPushButton(Change_Password)
self.okbutton.setGeometry(QtCore.QRect(380, 230, 61, 41))
self.okbutton.setObjectName("okbutton")
self.cancelbutton = QtWidgets.QPushButton(Change_Password)
self.cancelbutton.setGeometry(QtCore.QRect(290, 230, 71, 41))
self.cancelbutton.setObjectName("cancelbutton")
self.label_4 = QtWidgets.QLabel(Change_Password)
self.label_4.setGeometry(QtCore.QRect(30, 270, 261, 71))
self.label_4.setObjectName("label_4")
self.forgotbutton = QtWidgets.QPushButton(Change_Password)
self.forgotbutton.setGeometry(QtCore.QRect(290, 290, 151, 41))
self.forgotbutton.setObjectName("forgotbutton")

self.retranslateUi(Change_Password)
QtCore.QMetaObject.connectSlotsByName(Change_Password)

def retranslateUi(self, Change_Password):


_translate = QtCore.QCoreApplication.translate
Change_Password.setWindowTitle(_translate("Change_Password", "Change Password"))
self.oldpass.setPlaceholderText(_translate("Change_Password", "Enter Your Old
Password"))
self.newpass.setPlaceholderText(_translate("Change_Password", "Enter New Password"))
self.conpass.setPlaceholderText(_translate("Change_Password", "Renter Your New
Password"))
self.label.setText(_translate("Change_Password", "<html><head/><body><p><span
style=\" font-size:10pt;\">Old Password</span></p></body></html>"))
self.label_2.setText(_translate("Change_Password", "<html><head/><body><p><span
style=\" font-size:10pt;\">New Password</span></p></body></html>"))
self.label_3.setText(_translate("Change_Password", "<html><head/><body><p><span
style=\" font-size:10pt;\">Conform Password</span></p></body></html>"))
self.okbutton.setText(_translate("Change_Password", "OK"))
self.cancelbutton.setText(_translate("Change_Password", "Cancel"))
self.label_4.setText(_translate("Change_Password", "<html><head/><body><p><span
style=\" font-size:9pt;\">Need Help With Old Password?</span></p></body></html>"))
self.forgotbutton.setText(_translate("Change_Password", "Forgot 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_())

PYTHON CODE FOR QR-CODE MODULE:

from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(672, 763)
self.qrcode = QtWidgets.QLabel(Dialog)
self.qrcode.setGeometry(QtCore.QRect(10, 30, 641, 621))
self.qrcode.setFrameShape(QtWidgets.QFrame.Box)
self.qrcode.setText("")
self.qrcode.setTextFormat(QtCore.Qt.AutoText)
self.qrcode.setPixmap(QtGui.QPixmap("PaytmQr.jpeg"))
self.qrcode.setScaledContents(False)
self.qrcode.setObjectName("qrcode")
self.backbutton = QtWidgets.QPushButton(Dialog)
self.backbutton.setGeometry(QtCore.QRect(220, 680, 141, 61))
self.backbutton.setObjectName("backbutton")
self.verifypayment = QtWidgets.QPushButton(Dialog)
self.verifypayment.setGeometry(QtCore.QRect(390, 680, 261, 61))
self.verifypayment.setObjectName("verifypayment")

self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):


_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Scan QR code"))
self.backbutton.setText(_translate("Dialog", "Cancel"))
self.verifypayment.setText(_translate("Dialog", "Verify Payment"))
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 STATUS MODULE:

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):

def setupUi(self, Dialog):

Dialog.setObjectName("Dialog")

Dialog.resize(335, 276)

self.frame = QtWidgets.QFrame(Dialog)

self.frame.setGeometry(QtCore.QRect(60, 60, 211, 201))

self.frame.setFrameShape(QtWidgets.QFrame.Panel)

self.frame.setFrameShadow(QtWidgets.QFrame.Raised)

self.frame.setObjectName("frame")

self.paid = QtWidgets.QRadioButton(self.frame)

self.paid.setGeometry(QtCore.QRect(20, 30, 231, 41))

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.setGeometry(QtCore.QRect(100, 140, 101, 41))

self.submit.setObjectName("submit")

self.label = QtWidgets.QLabel(Dialog)

self.label.setGeometry(QtCore.QRect(20, 0, 371, 71))

self.label.setObjectName("label")

self.retranslateUi(Dialog)

QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):

_translate = QtCore.QCoreApplication.translate

Dialog.setWindowTitle(_translate("Dialog", "Server Side"))

self.paid.setText(_translate("Dialog", "Paid"))

self.notpaid.setText(_translate("Dialog", "Not Paid"))

self.submit.setText(_translate("Dialog", "Submit"))

self.label.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-


size:7pt;\">This Process Will Happens On server Side</span></p></body></html>"))

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 REGISTER MODULE:


import sqlite3
class Register:
def __init__(self,db):
self.conn=sqlite3.connect(db)
self.cur=self.conn.cursor()
self.cur.execute("CREATE TABLE IF NOT EXISTS LOGIN(name Text,user TEXT,password
TEXT,phoneno TEXT,income TEXT,address TEXT,dob TEXT,emailid TEXT)")
self.conn.commit()
def add(self,name,user,password,phoneno,sal,address,dob,emailid):
self.cur.execute("INSERT INTO LOGIN VALUES
(?,?,?,?,?,?,?,?)",(name,user,password,phoneno,sal,address,dob,emailid,))
self.conn.commit()
def search(self,u,p):
row=self.cur.execute("SELECT * FROM LOGIN WHERE user=? and
password=?",(u,p)).fetchall()
if not row:
return False
else:
return True
def forgot_search(self,u):
row=self.cur.execute("SELECT * FROM LOGIN WHERE user=?",(u,)).fetchall()
if not row:
return False
else:
return row
def update_pass(self,u,np):
self.cur.execute("UPDATE LOGIN SET password=? WHERE user=?",(np,u))
self.conn.commit()
def getbyuser(self,user):
row=self.cur.execute("SELECT * FROM LOGIN WHERE user=?",(user,)).fetchall()
return row

PYTHON CODE FOR CALLER MODULE:


from Modules.main import *
from Modules.Login import Ui_Dialog as Ui_Login
from Modules.signup import Ui_Dialog as Ui_Signup
from Modules.Myaccount import Ui_Dialog as Ui_Myaccount
from Modules.Forgotpassword import Ui_Dialog as Ui_Forgotpassword
from Modules.Changepassword import Ui_Change_Password
from Modules.Qrcode import Ui_Dialog as Ui_Qrcode
from Modules.register import *
from Modules.status import Ui_Dialog as Ui_status
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import sys
from easygui import *
import math, random
import smtplib
import re
ordered_data=list()
pay_flag=list()
pay_flag.append(False)
paid_mon=list()

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()

#Register class object


register_database=Register("cred.db")
datau=list()
datap=list()
verify_email=list()
sub=' '
#otp genetator
def generateOTP(phno,n,sub) :
digits = "0123456789"
OTP = ""
for i in range(6) :
OTP += digits[math.floor(random.random() * 10)]
b1='Dear '+n+','
b2=OTP+' is your one time password(OTP).'
b3='Please enter the OTP to proceed.'
b4='Thank you,'
b5='Team E-Ration Services'
#to get email from database
det=register_database.forgot_search(datau[0])
if(det==False):
to=verify_email[0]
else:
to=det[0][7]

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_()

#Forgot Password call


class Forgortpassword(QDialog,Ui_Forgotpassword):
def __init__(self,parent=None):
QDialog.__init__(self,parent)
self.setupUi(self)
self.cancelbutton.clicked.connect(self.close_Forgotpassword)
self.getpasswordbutton.clicked.connect(self.getpass)

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()

#Myaccount class call


class Myaccount(QDialog,Ui_Myaccount):
def __init__(self,parent=None):
QDialog.__init__(self,parent)
self.setupUi(self)
self.backbutton.clicked.connect(self.close_myaccount)

def close_myaccount(self):
self.close()

#signup class call


class Signup(QDialog,Ui_Signup):
def __init__(self,parent=None):
QDialog.__init__(self,parent)
self.setupUi(self)
self.signupButton.clicked.connect(self.adduser)
self.cancelbutton.clicked.connect(self.close_signup)

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_()

#login class call


class Login(QDialog,Ui_Login):
def __init__(self,parent=None):
QDialog.__init__(self,parent)
self.setupUi(self)
self.loginbutton.clicked.connect(self.checkval)
self.signupbutton.clicked.connect(self.generatesignup)
self.forgotpasswordbutton.clicked.connect(self.generateforgotpassword)

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_()

#serivces/main window class call


class MainWindow(QMainWindow,Ui_MainWindow):
def __init__(self,parent=None):
QMainWindow.__init__(self,parent)
self.setupUi(self)
self.checklogin()
self.logoutbutton.clicked.connect(self.close_win)
self.purchasebutton.clicked.connect(self.calc)
self.userinfo.clicked.connect(self.getdetail)
self.clearbutton.clicked.connect(self.clear)
self.changepasswordbutton.clicked.connect(self.open_cp)

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_())

You might also like