from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

from PyQt5 import QtCore, QtGui, QtWidgets

class new_testCenterProfile(object):
    def setup(self, testCenterProfile,userdata):
        self.userdata = userdata
        testCenterProfile.setObjectName("testCenterProfile")
        testCenterProfile.resize(550, 524)
        self.frame = QtWidgets.QFrame(testCenterProfile)
        self.frame.setGeometry(QtCore.QRect(10, 20, 531, 441))
        self.frame.setStyleSheet("")
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.nameLabel = QtWidgets.QLabel(self.frame)
        self.nameLabel.setGeometry(QtCore.QRect(25, 40, 81, 41))
        self.nameLabel.setObjectName("nameLabel")
        self.addressLabel = QtWidgets.QLabel(self.frame)
        self.addressLabel.setGeometry(QtCore.QRect(25, 90, 91, 41))
        self.addressLabel.setObjectName("addressLabel")
        self.contactLabel = QtWidgets.QLabel(self.frame)
        self.contactLabel.setGeometry(QtCore.QRect(25, 250, 131, 41))
        self.contactLabel.setObjectName("contactLabel")
        self.stateLabel = QtWidgets.QLabel(self.frame)
        self.stateLabel.setGeometry(QtCore.QRect(290, 210, 61, 41))
        self.stateLabel.setObjectName("stateLabel")
        self.pinCodeLabel = QtWidgets.QLabel(self.frame)
        self.pinCodeLabel.setGeometry(QtCore.QRect(25, 170, 91, 41))
        self.pinCodeLabel.setObjectName("pinCodeLabel")
        self.cityLabel = QtWidgets.QLabel(self.frame)
        self.cityLabel.setGeometry(QtCore.QRect(25, 210, 61, 41))
        self.cityLabel.setObjectName("cityLabel")
        self.name = QtWidgets.QLabel(self.frame)
        self.name.setGeometry(QtCore.QRect(170, 40, 281, 41))
        self.name.setStyleSheet("font-size:12pt;")
        self.name.setObjectName("name")
        self.address = QtWidgets.QLabel(self.frame)
        self.address.setGeometry(QtCore.QRect(170, 90, 281, 71))
        self.address.setStyleSheet("font-size:12pt;")
        self.address.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.address.setObjectName("address")
        self.pinCode = QtWidgets.QLabel(self.frame)
        self.pinCode.setGeometry(QtCore.QRect(170, 170, 181, 41))
        self.pinCode.setStyleSheet("font-size:12pt;")
        self.pinCode.setObjectName("pinCode")
        self.state = QtWidgets.QLabel(self.frame)
        self.state.setGeometry(QtCore.QRect(350, 210, 181, 41))
        self.state.setStyleSheet("font-size:12pt;")
        self.state.setObjectName("state")
        self.city = QtWidgets.QLabel(self.frame)
        self.city.setGeometry(QtCore.QRect(80, 210, 181, 41))
        self.city.setStyleSheet("font-size:12pt;")
        self.city.setObjectName("city")
        self.contactNo = QtWidgets.QLabel(self.frame)
        self.contactNo.setGeometry(QtCore.QRect(170, 255, 181, 31))
        self.contactNo.setStyleSheet("font-size:12pt;")
        self.contactNo.setObjectName("contactNo")
        self.IDLabel = QtWidgets.QLabel(self.frame)
        self.IDLabel.setGeometry(QtCore.QRect(25, 10, 141, 41))
        self.IDLabel.setObjectName("IDLabel")
        self.testCenterID = QtWidgets.QLabel(self.frame)
        self.testCenterID.setGeometry(QtCore.QRect(170, 10, 281, 41))
        self.testCenterID.setStyleSheet("font-size:12pt;\n"
"font-weight:bold;")
        self.testCenterID.setObjectName("testCenterID")
        self.bloodDetailsLabel_2 = QtWidgets.QLabel(self.frame)
        self.bloodDetailsLabel_2.setGeometry(QtCore.QRect(20, 335, 191, 31))
        self.bloodDetailsLabel_2.setObjectName("bloodDetailsLabel_2")
        self.bloodDetailsLabel_3 = QtWidgets.QLabel(self.frame)
        self.bloodDetailsLabel_3.setGeometry(QtCore.QRect(20, 375, 191, 31))
        self.bloodDetailsLabel_3.setObjectName("bloodDetailsLabel_3")
        self.eventsOrganized = QtWidgets.QPushButton(self.frame)
        self.eventsOrganized.setGeometry(QtCore.QRect(220, 375, 111, 28))
        self.eventsOrganized.setStyleSheet("text-decoration:underline;\n"
"color:blue;\n"
"border:none;")
        self.eventsOrganized.setObjectName("eventsOrganized")
        self.billingRecords = QtWidgets.QPushButton(self.frame)
        self.billingRecords.setGeometry(QtCore.QRect(220, 335, 111, 28))
        self.billingRecords.setStyleSheet("text-decoration:underline;\n"
"color:blue;\n"
"border:none;")
        self.billingRecords.setObjectName("billingRecords")
        self.bloodQuantities = QtWidgets.QPushButton(self.frame)
        self.bloodQuantities.setGeometry(QtCore.QRect(220, 295, 111, 28))
        self.bloodQuantities.setStyleSheet("text-decoration:underline;\n"
"color:blue;\n"
"border:none;")
        self.bloodQuantities.setObjectName("bloodQuantities")
        self.bloodQuantitiesLabel = QtWidgets.QLabel(self.frame)
        self.bloodQuantitiesLabel.setGeometry(QtCore.QRect(20, 290, 191, 41))
        self.bloodQuantitiesLabel.setObjectName("bloodQuantitiesLabel")
        self.removeButton = QtWidgets.QPushButton(testCenterProfile)
        self.removeButton.setGeometry(QtCore.QRect(390, 470, 131, 41))
        self.removeButton.setObjectName("removeButton")

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

    def retranslateUi(self, testCenterProfile):
        _translate = QtCore.QCoreApplication.translate
        testCenterProfile.setWindowTitle(_translate("testCenterProfile", "Test Center Profile"))
        self.nameLabel.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">Name :</span></p></body></html>"))
        self.addressLabel.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">Address :</span></p></body></html>"))
        self.contactLabel.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">Contact No. :</span></p></body></html>"))
        self.stateLabel.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">State :</span></p></body></html>"))
        self.pinCodeLabel.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">Pin Code :</span></p></body></html>"))
        self.cityLabel.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">City :</span></p></body></html>"))
        self.name.setText(_translate("testCenterProfile", "name"))
        self.address.setText(_translate("testCenterProfile", "address"))
        self.pinCode.setText(_translate("testCenterProfile", "pin_code"))
        self.state.setText(_translate("testCenterProfile", "state"))
        self.city.setText(_translate("testCenterProfile", "city"))
        self.contactNo.setText(_translate("testCenterProfile", "contact_no"))
        self.IDLabel.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">ID :</span></p></body></html>"))
        self.testCenterID.setText(_translate("testCenterProfile", "test_center_ID"))
        self.bloodDetailsLabel_2.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">Billing Records :</span></p></body></html>"))
        self.bloodDetailsLabel_3.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">Events Orgranized :</span></p></body></html>"))
        self.eventsOrganized.setText(_translate("testCenterProfile", "Check Here"))
        self.billingRecords.setText(_translate("testCenterProfile", "Check Here"))
        self.bloodQuantities.setText(_translate("testCenterProfile", "Check Here"))
        self.bloodQuantitiesLabel.setText(_translate("testCenterProfile", "<html><head/><body><p><span style=\" font-size:12pt; font-weight:600;\">Test Records :</span></p></body></html>"))
        self.removeButton.setText(_translate("testCenterProfile", "OK"))

        self.events(testCenterProfile)

    def events(self,parent):
        data = self.userdata
        self.address.setText(str(data["address"]))
        self.testCenterID.setText(str(data["id"]))
        self.pinCode.setText(str(data["pin"]))
        self.state.setText(str(data["state"]))
        self.city.setText(str(data["city"]))
        #self.contactNo.setText(str(data["contact"]))
        self.contactNo.setText("nil")
        self.name.setText(str(data["name"]))

        self.removeButton.clicked.connect(lambda: parent.close())

