コード例 #1
0
    def senddata(self):
        cn = db.createconnection()
        code = self.cmbcode.currentText()
        if code == "Select":
            msg.messagebox("Please select college code")
        else:
            branch = self.cmbbranch.currentText()
            if branch == "":
                msg.messagebox("Please select branch")
            else:
                if branch != "Select":
                    clgname = self.lblname.text()
                    year = self.yearbox.value()
                    adm = self.passbox.value()
                    querycheck = "select * from year_collegedetail where college_code=%s && Branch=%s && year=%s"
                    cursor = cn.cursor()
                    a = cursor.execute(querycheck, (code, branch, year))
                    if (a):

                        msg.messagebox("This record already exsist")
                    else:
                        query = "insert into year_collegedetail(college_code,college_name,Branch,total_admission,year) values(%s,%s,%s,%s,%s)"
                        cursor = cn.cursor()
                        cursor.execute(query,
                                       (code, clgname, branch, adm, year))
                        cn.commit()
                        msg.messagebox("Accepted")
                else:
                    msg.messagebox("Select any branch")
コード例 #2
0
ファイル: placement.py プロジェクト: Aniket2005/Aniket
    def populatepassing(self):
            if self.comboBoxyear.currentText()!="Select":
                cn=db.createconnection()
                query="select passed from passratio where college_code=%s && branch=%s && year=%s"
                cursor=cn.cursor()
                cursor.execute(query,(self.clgcode,self.comboBoxbranch.currentText(),self.comboBoxyear.currentText()))
                totalrow=cursor.fetchone()
                if totalrow!=None:

                    for data in totalrow:
                        self.placed.setMaximum(int(data))
            else:
                msg.messagebox("Select year")
コード例 #3
0
    def senddata(self):
        cn = db.createconnection()
        code = self.cmbcode.currentText()
        if code == "Select":
            msg.messagebox("Please select college code")
        else:
            branch = self.cmbbranch.currentText()
            if branch != "Select":
                clgname = self.lblname.text()
                year = self.cmbyear.currentText()
                passs = self.passbox.value()
                querycheck = "select * from passratio where college_code=%s && branch=%s && year=%s"
                cursor = cn.cursor()
                a = cursor.execute(querycheck, (code, branch, year))
                if (a):
                    msg.messagebox("This record already exsist")
                else:
                    query1 = "select total_admission from year_collegedetail where college_code=%s && Branch=%s && year=%s"
                    cursor1 = cn.cursor()
                    cursor1.execute(query1, (code, branch, year))
                    tota = cursor1.fetchall()
                    for data in tota:
                        a = int(data[0])
                        passrat = (passs * 100) // a

                    query = "insert into passratio(college_code,college_name,branch,passed,year,passratio) values(%s,%s,%s,%s,%s,%s)"
                    cursor = cn.cursor()
                    cursor.execute(
                        query, (code, clgname, branch, passs, year, passrat))
                    cn.commit()
                    msg.messagebox("Accepted")
            else:
                msg.messagebox("Select any branch")
コード例 #4
0
ファイル: admin.py プロジェクト: Aniket2005/Aniket
        def signin(self):
            cn = db.createconnection()
            self.username = self.txtusername.text()
            self.password = self.txtpass.text()
            query = "select username,password from adminlogin where username=%s && password=%s"
            cursor = cn.cursor()
            a = cursor.execute(query, (self.username, self.password))
            cursor.fetchone()
            if (a):
                print("okkk")
                self.showpage()

            else:
                m.messagebox("Inccorect details")
コード例 #5
0
ファイル: admin_result.py プロジェクト: Aniket2005/Aniket
 def populatetable(self):
     cn = db.createconnection()
     query = "select year,passratio from passratio where college_code=%s && branch=%s"
     cursor = cn.cursor()
     a = cursor.execute(
         query, (self.cmbcode.currentText(), self.cmbbranch.currentText()))
     if a:
         self.tbl.setRowCount(a)
         totalrow = cursor.fetchall()
         for rowno, rowdata in enumerate(totalrow):
             for colno, coldata in enumerate(rowdata):
                 self.tbl.setItem(rowno, colno,
                                  QTableWidgetItem(str(coldata)))
     else:
         msg.messagebox("Record Not Found")
コード例 #6
0
ファイル: updatemanager.py プロジェクト: Aniket2005/Aniket
 def fetch(self):
     self.txtuserid.setReadOnly(True)
     cn = db.createconnection()
     self.userid = self.txtuserid.text()
     query = "select Name,Email,Password from manager where UserId=%s"
     cursor = cn.cursor()
     a = cursor.execute(query, (self.userid))
     totalrows = cursor.fetchall()
     if (a):
         for rowdata in totalrows:
             self.txtname.setText(rowdata[0])
             self.txtemail.setText(rowdata[1])
             self.txtpassword.setText(rowdata[2])
     else:
         msg.messagebox("Invalid UserId")
コード例 #7
0
    def populatepassing(self):
        if self.cmbyear.currentText() != "Select":
            cn = db.createconnection()
            query = "select total_admission from year_collegedetail where college_code=%s && Branch=%s && year=%s"
            cursor = cn.cursor()
            cursor.execute(
                query,
                (self.cmbcode.currentText(), self.cmbbranch.currentText(),
                 self.cmbyear.currentText()))
            totalrow = cursor.fetchone()
            if totalrow != None:

                for data in totalrow:
                    self.passbox.setMaximum(int(data))
        else:
            msg.messagebox("Select year")
コード例 #8
0
 def deleteacc(self):
     userid = self.txtuserid.text()
     cn = db.createconnection()
     query = "delete from manager where UserId=%s"
     cursor = cn.cursor()
     a = cursor.execute(query, (userid))
     if (a):
         cn.commit()
         msgg = QMessageBox()
         msgg.setWindowTitle("Delete")
         msgg.setText("Record Deleted")
         msgg.setIcon(QMessageBox.Information)
         msgg.setStandardButtons(QMessageBox.Ok)
         msgg.buttonClicked.connect(self.dlgbutton)
         a = msgg.exec()
     else:
         msg.messagebox("UserId not found")
コード例 #9
0
 def sendotp(self):
     email = self.txtemail.text()
     if email == "":
         msg.messagebox("Email Id cannot be Empty")
     else:
         if email == "*****@*****.**":
             self.otp = randint(1001, 9999)
             mail.sendemail(
                 from_addr='*****@*****.**',
                 to_addr_list=['*****@*****.**'],
                 cc_addr_list=['*****@*****.**'],
                 subject='OTP',
                 message=str(self.otp),
                 login='******',
                 password='******')
             self.lblmsg.setText("OTP has been sent to your mail")
             self.txtotp.setReadOnly(False)
         else:
             msg.messagebox("Email Id not matched")
コード例 #10
0
ファイル: adminresetpwd.py プロジェクト: Aniket2005/Aniket
 def up(self):
     ans=self.txtanswer.text()
     newpwd=self.txtnewpwd.text()
     con=self.txtconnewpwd.text()
     if ans=="cat":
         if newpwd==con:
            cn=db.createconnection()
            query="update adminlogin set password=%s where username=%s"
            name="admin"
            cursor=cn.cursor()
            cursor.execute(query,(newpwd,name))
            cn.commit()
            self.cm=QMessageBox()
            self.cm.setWindowTitle("Password Change")
            self.cm.setIcon(QMessageBox.Information)
            self.cm.setText("Password Changed Successfully")
            self.cm.setStandardButtons(QMessageBox.Ok)
            q=self.cm.buttonClicked.connect(self.dlgbutton)
            self.cm.exec()
         else:
             msg.messagebox("Password doesnot match")
     else:
         msg.messagebox("Answer doesnot match")
コード例 #11
0
 def check(self):
     otpp = self.txtotp.text()
     if self.txtemail.text() == "":
         msg.messagebox("Please enter email")
     else:
         if otpp == "":
             msg.messagebox("Please enter OTP")
         else:
             if int(otpp) == self.otp:
                 self.aaa = adminreset()
                 self.aaa.show()
                 self.close()
             else:
                 msg.messagebox("OTP doesnot match")
コード例 #12
0
ファイル: addCollege.py プロジェクト: Aniket2005/Aniket
 def insertcollege(self):
     self.clg_name= self.txtcollegename.text()
     if self.clg_name=="":
         msg.messagebox("Please enter College Name")
     else:
         self.clg_code= self.txtcollegecode.text()
         if self.clg_code == "":
             msg.messagebox("Please enter College Code")
         else:
             self.aft=self.comboBox.currentText()
     # print(self.clg_name)
     # print(self.clg_code)
     # print(self.aft)
             con = db.createconnection()
             query = "insert into add_college(college_name,college_code,affilation) values(%s,%s,%s)"
             cursor = con.cursor()
             cursor.execute(query,(self.clg_name,self.clg_code,self.aft))
             con.commit()
             msg.messagebox("College added")
             print("College Added")
コード例 #13
0
ファイル: placement.py プロジェクト: Aniket2005/Aniket
    def senddata(self):
        cn = db.createconnection()
        #code = self.comboBoxcode.currentText()
        if self.clgcode=="Select":
            msg.messagebox("Please select college code")
        else:
            branch=self.comboBoxbranch.currentText()
            if branch!="Select":
                clgname=self.clgname.text()
                year=self.comboBoxyear.currentText()
                place=self.placed.value()
                querycheck = "select college_code from passratio where branch=%s && year=%s"
                cursor=cn.cursor()
                a=cursor.execute(querycheck,(branch,year))

                query="update passratio set placed=%s where college_code=%s && branch=%s && year=%s "
                cursor=cn.cursor()
                cursor.execute(query,(place,self.clgcode,branch,year))
                cn.commit()
                msg.messagebox("{0} Students Placed in {1} {2}".format(place,branch,year))
            else:
                msg.messagebox("Select any branch")