# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'collegeinfo-college.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets
import re
import sqlite3

from PyQt5.QtPrintSupport import QPrinter, QPrintPreviewDialog

import college1


class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.setWindowModality(QtCore.Qt.NonModal)
        Form.setEnabled(True)
        Form.resize(983, 613)
        Form.setWindowFlags(QtCore.Qt.FramelessWindowHint)
        Form.setAttribute(QtCore.Qt.WA_TranslucentBackground)
        Form.setInputMethodHints(QtCore.Qt.ImhNone)
        self.a1widget = QtWidgets.QWidget(Form)
        self.a1widget.setGeometry(QtCore.QRect(10, 20, 1101, 641))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.a1widget.setFont(font)
        self.a1widget.setStyleSheet("")
        self.a1widget.setObjectName("a1widget")
        self.a1label = QtWidgets.QLabel(self.a1widget)
        self.a1label.setGeometry(QtCore.QRect(10, 40, 931, 581))
        self.a1label.setStyleSheet("background-color:rgba(255,255,255,255);\n"
"border-bottom-right-radius:50px")
        self.a1label.setText("")
        self.a1label.setObjectName("a1label")
        self.a1label_2 = QtWidgets.QLabel(self.a1widget)
        self.a1label_2.setGeometry(QtCore.QRect(0, 20, 211, 71))
        self.a1label_2.setStyleSheet("border-top-left-radius:50px;\n"
"background-color:rgba(0,0,0,80);\n"
"background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(11, 131, 120, 219), stop:1 rgba(85, 98, 112, 226));")
        self.a1label_2.setText("")
        self.a1label_2.setObjectName("a1label_2")
        self.a1label_5 = QtWidgets.QLabel(self.a1widget)
        self.a1label_5.setGeometry(QtCore.QRect(20, 40, 181, 41))
        font = QtGui.QFont()
        font.setPointSize(22)
        font.setBold(True)
        font.setWeight(75)
        self.a1label_5.setFont(font)
        self.a1label_5.setStyleSheet("color:rgba(255,255,255,220);")
        self.a1label_5.setObjectName("a1label_5")
        self.a1label_6 = QtWidgets.QLabel(self.a1widget)
        self.a1label_6.setGeometry(QtCore.QRect(380, 50, 301, 31))
        font = QtGui.QFont()
        font.setPointSize(22)
        font.setBold(True)
        font.setWeight(75)
        self.a1label_6.setFont(font)
        self.a1label_6.setStyleSheet("color:rgba(0,0,0,200);")
        self.a1label_6.setObjectName("a1label_6")
        self.a1home = QtWidgets.QPushButton(self.a1widget)
        self.a1home.setGeometry(QtCore.QRect(850, 60, 75, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.a1home.setFont(font)
        self.a1home.setStyleSheet("QPushButton{\n"
"    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(11, 131, 120, 219), stop:1 rgba(85, 98, 112, 226));\n"
"    color:rgba(255,255,255,210);\n"
"    border-radius:5px;\n"
"}\n"
"QPushButton:pressed{\n"
"    padding-left:5px;\n"
"    padding-top:5px;\n"
"    background-color:rgba(150,123,111,255);\n"
"}\n"
"QPushButton:hover{\n"
"    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(150, 123, 111, 219), stop:1 rgba(85, 81, 84, 226));\n"
"}")
        self.a1home.setObjectName("a1home")
        self.lineEdit_Fname = QtWidgets.QLineEdit(self.a1widget)
        self.lineEdit_Fname.setGeometry(QtCore.QRect(40, 180, 190, 31))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(False)
        font.setWeight(50)
        self.lineEdit_Fname.setFont(font)
        self.lineEdit_Fname.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
        self.lineEdit_Fname.setStyleSheet("background-color:rgba(0,0,0,0);\n"
"border:none;\n"
"border-bottom:2px solid rgba(46,82,101,200);\n"
"color:rgba(0,0,0,240);\n"
"padding-bottom:7px;")
        self.lineEdit_Fname.setText("")
        self.lineEdit_Fname.setObjectName("lineEdit_Fname")
        self.lineEdit_LName = QtWidgets.QLineEdit(self.a1widget)
        self.lineEdit_LName.setGeometry(QtCore.QRect(250, 180, 190, 31))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(False)
        font.setWeight(50)
        self.lineEdit_LName.setFont(font)
        self.lineEdit_LName.setStyleSheet("background-color:rgba(0,0,0,0);\n"
"border:none;\n"
"border-bottom:2px solid rgba(46,82,101,200);\n"
"color:rgba(0,0,0,240);\n"
"padding-bottom:7px;")
        self.lineEdit_LName.setObjectName("lineEdit_LName")
        self.a1label_7 = QtWidgets.QLabel(self.a1widget)
        self.a1label_7.setGeometry(QtCore.QRect(40, 130, 181, 31))
        font = QtGui.QFont()
        font.setPointSize(22)
        font.setBold(True)
        font.setWeight(75)
        self.a1label_7.setFont(font)
        self.a1label_7.setStyleSheet("color:rgba(0,0,0,200);")
        self.a1label_7.setObjectName("a1label_7")
        self.lineEdit_Mobile = QtWidgets.QLineEdit(self.a1widget)
        self.lineEdit_Mobile.setGeometry(QtCore.QRect(460, 180, 190, 31))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(False)
        font.setWeight(50)
        self.lineEdit_Mobile.setFont(font)
        self.lineEdit_Mobile.setStyleSheet("background-color:rgba(0,0,0,0);\n"
"border:none;\n"
"border-bottom:2px solid rgba(46,82,101,200);\n"
"color:rgba(0,0,0,240);\n"
"padding-bottom:7px;")
        self.lineEdit_Mobile.setObjectName("lineEdit_Mobile")
        self.lineEdit_Email = QtWidgets.QLineEdit(self.a1widget)
        self.lineEdit_Email.setGeometry(QtCore.QRect(660, 180, 190, 31))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(False)
        font.setWeight(50)
        self.lineEdit_Email.setFont(font)
        self.lineEdit_Email.setStyleSheet("background-color:rgba(0,0,0,0);\n"
"border:none;\n"
"border-bottom:2px solid rgba(46,82,101,200);\n"
"color:rgba(0,0,0,240);\n"
"padding-bottom:7px;")
        self.lineEdit_Email.setText("")
        self.lineEdit_Email.setObjectName("lineEdit_Email")
        self.lineEdit_Address = QtWidgets.QLineEdit(self.a1widget)
        self.lineEdit_Address.setGeometry(QtCore.QRect(40, 230, 611, 21))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(False)
        font.setWeight(50)
        self.lineEdit_Address.setFont(font)
        self.lineEdit_Address.setStyleSheet("background-color:rgba(0,0,0,0);\n"
"border:none;\n"
"border-bottom:2px solid rgba(46,82,101,200);\n"
"color:rgba(0,0,0,240);\n"
"padding-bottom:7px;")
        self.lineEdit_Address.setObjectName("lineEdit_Address")
        self.astudentinfo_10Marksheet = QtWidgets.QPushButton(self.a1widget)
        self.astudentinfo_10Marksheet.setGeometry(QtCore.QRect(80, 410, 301, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.astudentinfo_10Marksheet.setFont(font)
        self.astudentinfo_10Marksheet.setStyleSheet("QPushButton{\n"
"    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(11, 131, 120, 219), stop:1 rgba(85, 98, 112, 226));\n"
"    color:rgba(255,255,255,210);\n"
"    border-radius:5px;\n"
"}\n"
"QPushButton:pressed{\n"
"    padding-left:5px;\n"
"    padding-top:5px;\n"
"    background-color:rgba(150,123,111,255);\n"
"}\n"
"QPushButton:hover{\n"
"    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(150, 123, 111, 219), stop:1 rgba(85, 81, 84, 226));\n"
"}")
        self.astudentinfo_10Marksheet.setObjectName("astudentinfo_10Marksheet")
        self.astudentinfo_12Marksheet = QtWidgets.QPushButton(self.a1widget)
        self.astudentinfo_12Marksheet.setGeometry(QtCore.QRect(40, 410, 41, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.astudentinfo_12Marksheet.setFont(font)
        self.astudentinfo_12Marksheet.setStyleSheet("QPushButton{\n"
"    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(11, 131, 120, 219), stop:1 rgba(85, 98, 112, 226));\n"
"    color:rgba(255,255,255,210);\n"
"    border-radius:5px;\n"
"}\n"
"QPushButton:pressed{\n"
"    padding-left:5px;\n"
"    padding-top:5px;\n"
"    background-color:rgba(150,123,111,255);\n"
"}\n"
"QPushButton:hover{\n"
"    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(150, 123, 111, 219), stop:1 rgba(85, 81, 84, 226));\n"
"}")
        self.astudentinfo_12Marksheet.setObjectName("astudentinfo_12Marksheet")
        self.lineEdit_Address_2 = QtWidgets.QLineEdit(self.a1widget)
        self.lineEdit_Address_2.setGeometry(QtCore.QRect(40, 260, 611, 91))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(False)
        font.setWeight(50)
        self.lineEdit_Address_2.setFont(font)
        self.lineEdit_Address_2.setStyleSheet("background-color:rgba(0,0,0,0);\n"
"border:none;\n"
"border-bottom:2px solid rgba(46,82,101,200);\n"
"color:rgba(0,0,0,240);\n"
"padding-bottom:7px;")
        self.lineEdit_Address_2.setText("")
        self.lineEdit_Address_2.setObjectName("lineEdit_Address_2")
        self.tableWidget = QtWidgets.QTableWidget(self.a1widget)
        self.tableWidget.setGeometry(QtCore.QRect(40, 450, 371, 141))
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(3)
        self.tableWidget.setRowCount(3)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setVerticalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setVerticalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setVerticalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(0, 0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(0, 1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(0, 2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(1, 0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(1, 1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(1, 2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(2, 0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(2, 1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(2, 2, item)
        self.a1label_8 = QtWidgets.QLabel(self.a1widget)
        self.a1label_8.setGeometry(QtCore.QRect(40, 370, 311, 31))
        font = QtGui.QFont()
        font.setPointSize(22)
        font.setBold(True)
        font.setWeight(75)
        self.a1label_8.setFont(font)
        self.a1label_8.setStyleSheet("color:rgba(0,0,0,200);")
        self.a1label_8.setObjectName("a1label_8")
        self.astudentinfo_Submit_2 = QtWidgets.QPushButton(self.a1widget)
        self.astudentinfo_Submit_2.setGeometry(QtCore.QRect(600, 470, 191, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.astudentinfo_Submit_2.setFont(font)
        self.astudentinfo_Submit_2.setStyleSheet("QPushButton{\n"
"    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(11, 131, 120, 219), stop:1 rgba(85, 98, 112, 226));\n"
"    color:rgba(255,255,255,210);\n"
"    border-radius:5px;\n"
"}\n"
"QPushButton:pressed{\n"
"    padding-left:5px;\n"
"    padding-top:5px;\n"
"    background-color:rgba(150,123,111,255);\n"
"}\n"
"QPushButton:hover{\n"
"    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(150, 123, 111, 219), stop:1 rgba(85, 81, 84, 226));\n"
"}")
        self.astudentinfo_Submit_2.setObjectName("astudentinfo_Submit_2")

        # self.Print_Preview = QtWidgets.QPushButton(self.a1widget)
        # self.Print_Preview.setGeometry(QtCore.QRect(730, 470, 191, 31))
        # font = QtGui.QFont()
        # font.setPointSize(11)
        # font.setBold(True)
        # font.setWeight(75)
        # self.Print_Preview.setFont(font)
        # self.Print_Preview.setStyleSheet("QPushButton{\n"
        #                                  "    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(11, 131, 120, 219), stop:1 rgba(85, 98, 112, 226));\n"
        #                                  "    color:rgba(255,255,255,210);\n"
        #                                  "    border-radius:5px;\n"
        #                                  "}\n"
        #                                  "QPushButton:pressed{\n"
        #                                  "    padding-left:5px;\n"
        #                                  "    padding-top:5px;\n"
        #                                  "    background-color:rgba(150,123,111,255);\n"
        #                                  "}\n"
        #                                  "QPushButton:hover{\n"
        #                                  "    background-color: qlineargradient(spread:pad, x1:0, y1:0.505682, x2:1, y2:0.477, stop:0 rgba(150, 123, 111, 219), stop:1 rgba(85, 81, 84, 226));\n"
        #                                  "}")
        # self.Print_Preview.setObjectName("Print Preview")

        self.messageLabel = QtWidgets.QLabel(Form)
        self.messageLabel.setGeometry(QtCore.QRect(500, 420, 371, 40))
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(20)
        font.setBold(False)
        font.setItalic(False)
        font.setUnderline(False)
        font.setWeight(50)
        font.setStrikeOut(False)
        self.messageLabel.setFont(font)
        self.messageLabel.setStyleSheet("color: #6B6B6B;")
        self.messageLabel.setText("")
        self.messageLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.messageLabel.setWordWrap(False)
        self.messageLabel.setObjectName("messageLabel")
        
        self.a1home.clicked.connect(self.passage1)
        # self.Print_Preview.setEnabled(False)
        # self.Print_Preview.clicked.connect(self.passage1)
        self.astudentinfo_Submit_2.clicked.connect(self.passage2)

        self.retranslateUi(Form)
        try:
            connection = sqlite3.connect("Project.db")
            cursor = connection.cursor()
            S_user=cursor.execute(f"SELECT * FROM Current_login WHERE No = 2")
            record = S_user.fetchone()
            self.user = record[0]
            data=cursor.execute(f"SELECT * FROM College_Registration WHERE College_name = '{self.user}'")
            records = data.fetchone()
            c_name=records[0]
            address=records[2]
            website=records[3]
            mobile=records[4]
            email=records[5]
            self.lineEdit_Fname.setText(f"{c_name}")
            self.lineEdit_Address.setText(f"{address}")
            self.lineEdit_LName.setText(f"{website}")
            self.lineEdit_Mobile.setText(f"{mobile}")
            self.lineEdit_Email.setText(f"{email}")
        except Exception as e:
             print(e)
             print("Previous data not uploaded")
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.a1label_5.setText(_translate("Form", "College"))
        self.a1label_6.setText(_translate("Form", "College Information"))
        self.a1home.setText(_translate("Form", "Home"))
        self.lineEdit_Fname.setPlaceholderText(_translate("Form", "College Name"))
        self.lineEdit_LName.setPlaceholderText(_translate("Form", "Website"))
        self.a1label_7.setText(_translate("Form", "<html><head/><body><p><span style=\" font-size:14pt; font-weight:400;\">College Details</span></p></body></html>"))
        self.lineEdit_Mobile.setPlaceholderText(_translate("Form", "Contact no."))
        self.lineEdit_Email.setPlaceholderText(_translate("Form", "Email ID"))
        self.lineEdit_Address.setPlaceholderText(_translate("Form", "Address"))
        self.astudentinfo_10Marksheet.setText(_translate("Form", "Streams"))
        self.astudentinfo_12Marksheet.setText(_translate("Form", "Year"))
        self.lineEdit_Address_2.setPlaceholderText(_translate("Form", "Description"))
        item = self.tableWidget.verticalHeaderItem(0)
        item.setText(_translate("Form", "2018"))
        item = self.tableWidget.verticalHeaderItem(1)
        item.setText(_translate("Form", "2019"))
        item = self.tableWidget.verticalHeaderItem(2)
        item.setText(_translate("Form", "2020"))
        item = self.tableWidget.horizontalHeaderItem(0)
        item.setText(_translate("Form", "Computer Sciene"))
        item = self.tableWidget.horizontalHeaderItem(1)
        item.setText(_translate("Form", "Mechanical"))
        item = self.tableWidget.horizontalHeaderItem(2)
        item.setText(_translate("Form", "Chemical"))
        __sortingEnabled = self.tableWidget.isSortingEnabled()
        self.tableWidget.setSortingEnabled(False)
        item = self.tableWidget.item(0, 0)
        item.setText(_translate("Form", ""))
        item = self.tableWidget.item(0, 1)
        item.setText(_translate("Form", ""))
        item = self.tableWidget.item(0, 2)
        item.setText(_translate("Form", ""))
        item = self.tableWidget.item(1, 0)
        item.setText(_translate("Form", ""))
        item = self.tableWidget.item(1, 1)
        item.setText(_translate("Form", ""))
        item = self.tableWidget.item(1, 2)
        item.setText(_translate("Form", ""))
        item = self.tableWidget.item(2, 0)
        item.setText(_translate("Form", ""))
        item = self.tableWidget.item(2, 1)
        item.setText(_translate("Form", ""))
        item = self.tableWidget.item(2, 2)
        item.setText(_translate("Form", ""))
        self.tableWidget.setSortingEnabled(__sortingEnabled)
        self.a1label_8.setText(_translate("Form", "<html><head/><body><p><span style=\" font-size:14pt; font-weight:400;\">Previous Year Cut-offs (in percentile)</span></p></body></html>"))
        self.astudentinfo_Submit_2.setText(_translate("Form", "Submit"))
        # self.Print_Preview.setText(_translate("Form", "Print Preview"))
        global check
        check = True
        if(check):
                global x
                x = Form
                check = False

    # def passage2(self):
    #     printer=QPrinter(QPrinter.HighResolution)
    #     previewdialog=QPrintPreviewDialog(printer, self)
    #     previewdialog.paintRequested.connect(self.print_preview)
    #     previewdialog.exec_()
    #
    # def print_preview(self, printer):
    #         self.a1widget.print_(printer)
    def college1(self,x):
        self.window3 = QtWidgets.QMainWindow()
        self.ui = college1.Ui_Form()
        self.ui.setupUi(self.window3)
        self.window3.show()
        x.close()
    def passage1(self):
        self.college1(x)

    def passage2(self):
        self.submit_Check(x)

    def submit_Check(self,x):
        College_Name = self.lineEdit_Fname.text()
        Address = self.lineEdit_Address.text()
        Website = self.lineEdit_LName.text()
        Contact_no = self.lineEdit_Mobile.text()
        Email_ID = self.lineEdit_Email.text()
        Description=self.lineEdit_Address_2.text()

        item = self.tableWidget.item(0, 0)
        Y2018S1 = item.text()
        item = self.tableWidget.item(0, 1)
        Y2018S2 = item.text()
        item = self.tableWidget.item(0, 2)
        Y2018S3 = item.text()
        item = self.tableWidget.item(1, 0)
        Y2019S1 = item.text()
        item = self.tableWidget.item(1, 1)
        Y2019S2 = item.text()
        item = self.tableWidget.item(1, 2)
        Y2019S3 = item.text()
        item = self.tableWidget.item(2, 0)
        Y2020S1 = item.text()
        item = self.tableWidget.item(2, 1)
        Y2020S2 = item.text()
        item = self.tableWidget.item(2, 2)
        Y2020S3 = item.text()


        if College_Name == "":
            self.messageLabel.setText("Field Cannot Be Empty")
            return
        if Address == "":
            self.lineEdit_Address.setText("Field Cannot Be Empty")
            return
        if Website == "":
            self.lineEdit_Fname.setText("Field Cannot Be Empty")
            return
        if Contact_no == "":
            self.lineEdit_Mobile.setText("Field Cannot Be Empty")
            return
        if Email_ID == "":
            self.lineEdit_Email.setText("Field Cannot Be Empty")
            return
        if Description == "":
            self.lineEdit_Address_2.setText("Field Cannot Be Empty")
            return


        try:
            int(Contact_no, 10)
            if len(Contact_no) != 10:
                self.lineEdit_Mobile.setText("Invalid Contact No.")
            else:
                regex = '^(\w|\.|\_|\-)+[@](\w|\_|\-|\.)+[.]\w{2,3}$'
                if (re.search(regex, str(Email_ID))):
                    try:
                        connection = sqlite3.connect("Project.db")
                        connection.execute(f"Update College_Registration set College_Name='{College_Name}',Address='{Address}',Website='{Website}',Contact_no={Contact_no},Email_ID='{Email_ID}' where College_Name='{self.user}'")
                        connection.commit()
                        connection.close()
                    except Exception as e:
                        print(e)
                        self.messageLabel.setText("Failed!!!!! Try Again")
                else:
                    self.lineEdit_Email.setText("Invalid Email-ID")
        except:
            self.lineEdit_Mobile.setText("Invalid Contact No.")
        try:
            connection = sqlite3.connect("Project.db")
            connection.execute(
                "Insert into  College_Verification(College_Name,Description,Y2018S1,Y2018S2,Y2018S3,Y2019S1,Y2019S2,Y2019S3,Y2020S1,Y2020S2,Y2020S3)VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
                (College_Name, Description, Y2018S1, Y2018S2, Y2018S3, Y2019S1, Y2019S2, Y2019S3, Y2020S1, Y2020S2,
                 Y2020S3))
            # self.Print_Preview.setEnabled(True)
            self.messageLabel.setText("Information Uploaded Successfully")
            self.astudentinfo_Submit_2.setEnabled(False)
            connection.commit()
            connection.close()
        except Exception as e:
            print(e)
            self.messageLabel.setText("Failed Try Again")
        try:
            connection = sqlite3.connect("Project.db")
            connection.execute(
                "Insert into  C_Stream_Count(College_Name, Count_Stream1, Count_Stream2, Count_Stream3)VALUES(?, ?, ?, ?)",
                (College_Name,0,0,0))
            # self.Print_Preview.setEnabled(True)
            # self.passage1()
            connection.commit()
            connection.close()
        except:
            self.messageLabel.setText("Failed Try Again")


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Form = QtWidgets.QWidget()
    ui = Ui_Form()
    ui.setupUi(Form)
    Form.show()
    sys.exit(app.exec_())
