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

# Form implementation generated from reading ui file 'TelaCoordenador.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets
from cliente import cliente
from verificaEmail import verificaEmail,verificaCpf,verificaTelefone,verificaMat
from valida_dados import verifica_horario,verifica_dia
from geradordepdf import GeraPDF
from datetime import datetime
from enviaemail import envia_email
class Ui_MenuCoordenador(object):
    def setupUi(self, MenuCoordenador):
        MenuCoordenador.setObjectName("MenuCoordenador")
        MenuCoordenador.setEnabled(True)
        self.coordenador = None
        self.r_message = False
        MenuCoordenador.resize(711, 488)
        MenuCoordenador.setAutoFillBackground(False)
        MenuCoordenador.setAnimated(True)
        MenuCoordenador.setUnifiedTitleAndToolBarOnMac(False)
        self.centralwidget = QtWidgets.QWidget(MenuCoordenador)
        self.centralwidget.setObjectName("centralwidget")
        self.Fundogeral = QtWidgets.QLabel(self.centralwidget)
        self.Fundogeral.setGeometry(QtCore.QRect(0, -40, 791, 531))
        self.Fundogeral.setText("")
        self.Fundogeral.setPixmap(QtGui.QPixmap("../../../../fundo azul.jpg"))
        self.Fundogeral.setScaledContents(True)
        self.Fundogeral.setOpenExternalLinks(False)
        self.Fundogeral.setObjectName("Fundogeral")
        self.Tabelageral = QtWidgets.QTabWidget(self.centralwidget)
        self.Tabelageral.setGeometry(QtCore.QRect(0, 0, 741, 461))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.Tabelageral.setFont(font)
        self.Tabelageral.setStyleSheet("QWidget{\n"
"    color: rgb(3, 0, 117)\n"
"}")
        self.Tabelageral.setObjectName("Tabelageral")
        self.cadastrarprofessor = QtWidgets.QWidget()
        self.cadastrarprofessor.setObjectName("cadastrarprofessor")
        self.fundo = QtWidgets.QLabel(self.cadastrarprofessor)
        self.fundo.setGeometry(QtCore.QRect(-40, -100, 741, 531))
        self.fundo.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.fundo.setText("")
        self.fundo.setPixmap(QtGui.QPixmap("../fundo azul.jpg"))
        self.fundo.setScaledContents(True)
        self.fundo.setObjectName("fundo")
        self.layoutWidget_2 = QtWidgets.QWidget(self.cadastrarprofessor)
        self.layoutWidget_2.setGeometry(QtCore.QRect(90, 110, 441, 41))
        self.layoutWidget_2.setObjectName("layoutWidget_2")
        self.agrupamento3 = QtWidgets.QHBoxLayout(self.layoutWidget_2)
        self.agrupamento3.setContentsMargins(0, 0, 0, 0)
        self.agrupamento3.setObjectName("agrupamento3")
        self.Cpf = QtWidgets.QLabel(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.Cpf.setFont(font)
        self.Cpf.setObjectName("Cpf")
        self.agrupamento3.addWidget(self.Cpf)
        self.CampoCpf = QtWidgets.QLineEdit(self.layoutWidget_2)
        self.CampoCpf.setStyleSheet("QLineEdit{\n"
"    background-color: rgb(255, 255, 255);\n"
"}")
        self.CampoCpf.setObjectName("CampoCpf")
        self.agrupamento3.addWidget(self.CampoCpf)
        self.layoutWidget_3 = QtWidgets.QWidget(self.cadastrarprofessor)
        self.layoutWidget_3.setGeometry(QtCore.QRect(90, 190, 441, 41))
        self.layoutWidget_3.setObjectName("layoutWidget_3")
        self.agrupamento4 = QtWidgets.QHBoxLayout(self.layoutWidget_3)
        self.agrupamento4.setContentsMargins(0, 0, 0, 0)
        self.agrupamento4.setObjectName("agrupamento4")
        self.Email = QtWidgets.QLabel(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.Email.setFont(font)
        self.Email.setObjectName("Email")
        self.agrupamento4.addWidget(self.Email)
        self.CampoEmail = QtWidgets.QLineEdit(self.layoutWidget_3)
        self.CampoEmail.setStyleSheet("QLineEdit{\n"
"    background-color: rgb(255, 255, 255);\n"
"}")
        self.CampoEmail.setObjectName("CampoEmail")
        self.agrupamento4.addWidget(self.CampoEmail)
        self.layoutWidget_4 = QtWidgets.QWidget(self.cadastrarprofessor)
        self.layoutWidget_4.setGeometry(QtCore.QRect(90, 70, 441, 41))
        self.layoutWidget_4.setObjectName("layoutWidget_4")
        self.agrupamento5 = QtWidgets.QHBoxLayout(self.layoutWidget_4)
        self.agrupamento5.setContentsMargins(0, 0, 0, 0)
        self.agrupamento5.setObjectName("agrupamento5")
        self.Siape = QtWidgets.QLabel(self.layoutWidget_4)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.Siape.setFont(font)
        self.Siape.setObjectName("Siape")
        self.agrupamento5.addWidget(self.Siape)
        self.CampoSiape = QtWidgets.QLineEdit(self.layoutWidget_4)
        self.CampoSiape.setStyleSheet("QLineEdit{\n"
"    background-color: rgb(255, 255, 255);\n"
"}")
        self.CampoSiape.setObjectName("CampoSiape")
        self.agrupamento5.addWidget(self.CampoSiape)
        self.layoutWidget_5 = QtWidgets.QWidget(self.cadastrarprofessor)
        self.layoutWidget_5.setGeometry(QtCore.QRect(90, 150, 441, 41))
        self.layoutWidget_5.setObjectName("layoutWidget_5")
        self.agrupamento6 = QtWidgets.QHBoxLayout(self.layoutWidget_5)
        self.agrupamento6.setContentsMargins(0, 0, 0, 0)
        self.agrupamento6.setObjectName("agrupamento6")
        self.Senha = QtWidgets.QLabel(self.layoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.Senha.setFont(font)
        self.Senha.setObjectName("Senha")
        self.agrupamento6.addWidget(self.Senha)
        self.CampoSenha = QtWidgets.QLineEdit(self.layoutWidget_5)
        self.CampoSenha.setStyleSheet("QLineEdit{\n"
"    background-color: rgb(255, 255, 255);\n"
"}")
        self.CampoSenha.setObjectName("CampoSenha")
        self.agrupamento6.addWidget(self.CampoSenha)
        self.layoutWidget_6 = QtWidgets.QWidget(self.cadastrarprofessor)
        self.layoutWidget_6.setGeometry(QtCore.QRect(90, 230, 441, 41))
        self.layoutWidget_6.setObjectName("layoutWidget_6")
        self.agrupamento7 = QtWidgets.QHBoxLayout(self.layoutWidget_6)
        self.agrupamento7.setContentsMargins(0, 0, 0, 0)
        self.agrupamento7.setObjectName("agrupamento7")
        self.Telefone = QtWidgets.QLabel(self.layoutWidget_6)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.Telefone.setFont(font)
        self.Telefone.setObjectName("Telefone")
        self.agrupamento7.addWidget(self.Telefone)
        self.CampoTelefone = QtWidgets.QLineEdit(self.layoutWidget_6)
        self.CampoTelefone.setStyleSheet("QLineEdit{\n"
"    background-color: rgb(255, 255, 255);\n"
"}")
        self.CampoTelefone.setObjectName("CampoTelefone")
        self.agrupamento7.addWidget(self.CampoTelefone)
        self.layoutWidget_7 = QtWidgets.QWidget(self.cadastrarprofessor)
        self.layoutWidget_7.setGeometry(QtCore.QRect(90, 270, 441, 41))
        self.layoutWidget_7.setObjectName("layoutWidget_7")
        self.Agrupamento8 = QtWidgets.QHBoxLayout(self.layoutWidget_7)
        self.Agrupamento8.setContentsMargins(0, 0, 0, 0)
        self.Agrupamento8.setObjectName("Agrupamento8")
        self.Disciplina = QtWidgets.QLabel(self.layoutWidget_7)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.Disciplina.setFont(font)
        self.Disciplina.setObjectName("Disciplina")
        self.Agrupamento8.addWidget(self.Disciplina)
        self.CampoDisciplina = QtWidgets.QLineEdit(self.layoutWidget_7)
        self.CampoDisciplina.setStyleSheet("QLineEdit{\n"
"    background-color: rgb(255, 255, 255);\n"
"}")
        self.CampoDisciplina.setObjectName("CampoDisciplina")
        self.Agrupamento8.addWidget(self.CampoDisciplina)
        self.layoutWidget = QtWidgets.QWidget(self.cadastrarprofessor)
        self.layoutWidget.setGeometry(QtCore.QRect(90, 30, 441, 41))
        self.layoutWidget.setObjectName("layoutWidget")
        self.agrupamento1 = QtWidgets.QHBoxLayout(self.layoutWidget)
        self.agrupamento1.setContentsMargins(0, 0, 0, 0)
        self.agrupamento1.setObjectName("agrupamento1")
        self.Nome = QtWidgets.QLabel(self.layoutWidget)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.Nome.setFont(font)
        self.Nome.setObjectName("Nome")
        self.agrupamento1.addWidget(self.Nome)
        self.CampoNome = QtWidgets.QLineEdit(self.layoutWidget)
        self.CampoNome.setStyleSheet("QLineEdit{\n"
"    background-color: rgb(255, 255, 255);\n"
"}")
        self.CampoNome.setObjectName("CampoNome")
        self.agrupamento1.addWidget(self.CampoNome)
        self.layoutWidget1 = QtWidgets.QWidget(self.cadastrarprofessor)
        self.layoutWidget1.setGeometry(QtCore.QRect(210, 320, 308, 42))
        self.layoutWidget1.setObjectName("layoutWidget1")
        self.agrupamento2 = QtWidgets.QHBoxLayout(self.layoutWidget1)
        self.agrupamento2.setContentsMargins(0, 0, 0, 0)
        self.agrupamento2.setObjectName("agrupamento2")
        self.Cadastrar = QtWidgets.QPushButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.Cadastrar.setFont(font)
        self.Cadastrar.setObjectName("Cadastrar")
        self.agrupamento2.addWidget(self.Cadastrar)
        spacerItem = QtWidgets.QSpacerItem(108, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.agrupamento2.addItem(spacerItem)
        self.cancelar = QtWidgets.QPushButton(self.layoutWidget1)
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.cancelar.setFont(font)
        self.cancelar.setObjectName("cancelar")
        self.agrupamento2.addWidget(self.cancelar)
        self.Tabelageral.addTab(self.cadastrarprofessor, "")
        self.ReservarSala = QtWidgets.QWidget()
        self.ReservarSala.setObjectName("ReservarSala")
        self.fundo_2 = QtWidgets.QLabel(self.ReservarSala)
        self.fundo_2.setGeometry(QtCore.QRect(-10, -60, 741, 531))
        self.fundo_2.setText("")
        self.fundo_2.setPixmap(QtGui.QPixmap("../fundo azul.jpg"))
        self.fundo_2.setScaledContents(True)
        self.fundo_2.setObjectName("fundo_2")
        self.tabela = QtWidgets.QTableWidget(self.ReservarSala)
        self.tabela.setGeometry(QtCore.QRect(10, 170, 691, 241))
        self.tabela.setObjectName("tabela")
        self.tabela.setColumnCount(6)
        self.tabela.setRowCount(7)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setVerticalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setVerticalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setVerticalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setVerticalHeaderItem(3, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setVerticalHeaderItem(4, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setVerticalHeaderItem(5, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setVerticalHeaderItem(6, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setHorizontalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setHorizontalHeaderItem(3, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setHorizontalHeaderItem(4, item)
        item = QtWidgets.QTableWidgetItem()
        self.tabela.setHorizontalHeaderItem(5, item)
        self.layoutWidget2 = QtWidgets.QWidget(self.ReservarSala)
        self.layoutWidget2.setGeometry(QtCore.QRect(10, 10, 351, 144))
        self.layoutWidget2.setObjectName("layoutWidget2")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget2)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.agrupamento9 = QtWidgets.QHBoxLayout()
        self.agrupamento9.setObjectName("agrupamento9")
        self.Bloco = QtWidgets.QLabel(self.layoutWidget2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.Bloco.setFont(font)
        self.Bloco.setObjectName("Bloco")
        self.agrupamento9.addWidget(self.Bloco)
        self.CampoBloco = QtWidgets.QLineEdit(self.layoutWidget2)
        self.CampoBloco.setStyleSheet("QLineEdit{\n"
"    background-color: white;\n"
"}")
        self.CampoBloco.setObjectName("CampoBloco")
        self.agrupamento9.addWidget(self.CampoBloco)
        self.verticalLayout.addLayout(self.agrupamento9)
        self.agrupamento11 = QtWidgets.QHBoxLayout()
        self.agrupamento11.setObjectName("agrupamento11")
        self.Sala = QtWidgets.QLabel(self.layoutWidget2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.Sala.setFont(font)
        self.Sala.setObjectName("Sala")
        self.agrupamento11.addWidget(self.Sala)
        self.CampoSala = QtWidgets.QLineEdit(self.layoutWidget2)
        self.CampoSala.setStyleSheet("QLineEdit{\n"
"    background-color: white;\n"
"}")
        self.CampoSala.setObjectName("CampoSala")
        self.agrupamento11.addWidget(self.CampoSala)
        self.verticalLayout.addLayout(self.agrupamento11)
        self.agrupamento10 = QtWidgets.QHBoxLayout()
        self.agrupamento10.setObjectName("agrupamento10")
        self.Dia = QtWidgets.QLabel(self.layoutWidget2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.Dia.setFont(font)
        self.Dia.setObjectName("Dia")
        self.agrupamento10.addWidget(self.Dia)
        self.CampoDIa = QtWidgets.QLineEdit(self.layoutWidget2)
        self.CampoDIa.setStyleSheet("QLineEdit{\n"
"    background-color: white;\n"
"}")
        self.CampoDIa.setObjectName("CampoDIa")
        self.agrupamento10.addWidget(self.CampoDIa)
        self.verticalLayout.addLayout(self.agrupamento10)
        self.agrupamento10_2 = QtWidgets.QHBoxLayout()
        self.agrupamento10_2.setObjectName("agrupamento10_2")
        self.Horario = QtWidgets.QLabel(self.layoutWidget2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.Horario.setFont(font)
        self.Horario.setObjectName("Horario")
        self.agrupamento10_2.addWidget(self.Horario)
        self.CampoHorario = QtWidgets.QLineEdit(self.layoutWidget2)
        self.CampoHorario.setStyleSheet("QLineEdit{\n"
"    background-color: white;\n"
"}")
        self.CampoHorario.setObjectName("CampoHorario")
        self.agrupamento10_2.addWidget(self.CampoHorario)
        self.verticalLayout.addLayout(self.agrupamento10_2)
        self.layoutWidget3 = QtWidgets.QWidget(self.ReservarSala)
        self.layoutWidget3.setGeometry(QtCore.QRect(450, 0, 161, 121))
        self.layoutWidget3.setObjectName("layoutWidget3")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.layoutWidget3)
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.Listar = QtWidgets.QPushButton(self.layoutWidget3)
        self.Listar.setObjectName("Listar")
        self.verticalLayout_2.addWidget(self.Listar)
        self.Reservar = QtWidgets.QPushButton(self.layoutWidget3)
        self.Reservar.setObjectName("Reservar")
        self.verticalLayout_2.addWidget(self.Reservar)
        self.Tabelageral.addTab(self.ReservarSala, "")
        self.Verreservas = QtWidgets.QWidget()
        self.Verreservas.setObjectName("Verreservas")
        self.fundo_3 = QtWidgets.QLabel(self.Verreservas)
        self.fundo_3.setGeometry(QtCore.QRect(-10, 10, 791, 531))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.fundo_3.setFont(font)
        self.fundo_3.setText("")
        self.fundo_3.setPixmap(QtGui.QPixmap("../fundo azul.jpg"))
        self.fundo_3.setScaledContents(True)
        self.fundo_3.setObjectName("fundo_3")
        self.Mostrar = QtWidgets.QPushButton(self.Verreservas)
        self.Mostrar.setGeometry(QtCore.QRect(220, 330, 81, 31))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.Mostrar.setFont(font)
        self.Mostrar.setObjectName("Mostrar")
        self.GerarPDF = QtWidgets.QPushButton(self.Verreservas)
        self.GerarPDF.setGeometry(QtCore.QRect(360, 330, 81, 31))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.GerarPDF.setFont(font)
        self.GerarPDF.setObjectName("GerarPDF")
        self.listWidget = QtWidgets.QListWidget(self.Verreservas)
        self.listWidget.setGeometry(QtCore.QRect(50, 40, 571, 271))
        self.listWidget.setObjectName("listWidget")
        self.Tabelageral.addTab(self.Verreservas, "")
        self.cancelarreserva = QtWidgets.QWidget()
        self.cancelarreserva.setObjectName("cancelarreserva")
        self.fundo_4 = QtWidgets.QLabel(self.cancelarreserva)
        self.fundo_4.setGeometry(QtCore.QRect(-110, 10, 931, 401))
        self.fundo_4.setText("")
        self.fundo_4.setPixmap(QtGui.QPixmap("../fundo azul.jpg"))
        self.fundo_4.setObjectName("fundo_4")
        self.Remover = QtWidgets.QPushButton(self.cancelarreserva)
        self.Remover.setGeometry(QtCore.QRect(280, 270, 121, 41))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.Remover.setFont(font)
        self.Remover.setObjectName("Remover")
        self.layoutWidget_8 = QtWidgets.QWidget(self.cancelarreserva)
        self.layoutWidget_8.setGeometry(QtCore.QRect(170, 90, 321, 131))
        self.layoutWidget_8.setObjectName("layoutWidget_8")
        self.Agrupamento13 = QtWidgets.QVBoxLayout(self.layoutWidget_8)
        self.Agrupamento13.setContentsMargins(0, 0, 0, 0)
        self.Agrupamento13.setObjectName("Agrupamento13")
        self.subagrupamento1 = QtWidgets.QHBoxLayout()
        self.subagrupamento1.setObjectName("subagrupamento1")
        self.Bloco_2 = QtWidgets.QLabel(self.layoutWidget_8)
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.Bloco_2.setFont(font)
        self.Bloco_2.setObjectName("Bloco_2")
        self.subagrupamento1.addWidget(self.Bloco_2)
        self.CampoBloco_2 = QtWidgets.QLineEdit(self.layoutWidget_8)
        self.CampoBloco_2.setStyleSheet("QLineEdit{\n"
"    background-color: white;\n"
"}")
        self.CampoBloco_2.setObjectName("CampoBloco_2")
        self.subagrupamento1.addWidget(self.CampoBloco_2)
        self.Agrupamento13.addLayout(self.subagrupamento1)
        self.subagrupamento2 = QtWidgets.QHBoxLayout()
        self.subagrupamento2.setObjectName("subagrupamento2")
        self.Sala_2 = QtWidgets.QLabel(self.layoutWidget_8)
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.Sala_2.setFont(font)
        self.Sala_2.setObjectName("Sala_2")
        self.subagrupamento2.addWidget(self.Sala_2)
        self.CampoSala_2 = QtWidgets.QLineEdit(self.layoutWidget_8)
        self.CampoSala_2.setStyleSheet("QLineEdit{\n"
"    background-color: white;\n"
"}")
        self.CampoSala_2.setObjectName("CampoSala_2")
        self.subagrupamento2.addWidget(self.CampoSala_2)
        self.Agrupamento13.addLayout(self.subagrupamento2)
        self.subagrupamento3 = QtWidgets.QHBoxLayout()
        self.subagrupamento3.setObjectName("subagrupamento3")
        self.Dia_2 = QtWidgets.QLabel(self.layoutWidget_8)
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.Dia_2.setFont(font)
        self.Dia_2.setObjectName("Dia_2")
        self.subagrupamento3.addWidget(self.Dia_2)
        self.CampoDia = QtWidgets.QLineEdit(self.layoutWidget_8)
        self.CampoDia.setStyleSheet("QLineEdit{\n"
"    background-color: white;\n"
"}")
        self.CampoDia.setObjectName("CampoDia")
        self.subagrupamento3.addWidget(self.CampoDia)
        self.Agrupamento13.addLayout(self.subagrupamento3)
        self.layoutWidget_9 = QtWidgets.QWidget(self.cancelarreserva)
        self.layoutWidget_9.setGeometry(QtCore.QRect(170, 220, 321, 31))
        self.layoutWidget_9.setObjectName("layoutWidget_9")
        self.subagrupamento3_2 = QtWidgets.QHBoxLayout(self.layoutWidget_9)
        self.subagrupamento3_2.setContentsMargins(0, 0, 0, 0)
        self.subagrupamento3_2.setObjectName("subagrupamento3_2")
        self.horario = QtWidgets.QLabel(self.layoutWidget_9)
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.horario.setFont(font)
        self.horario.setObjectName("horario")
        self.subagrupamento3_2.addWidget(self.horario)
        self.CampoHorario_2 = QtWidgets.QLineEdit(self.layoutWidget_9)
        self.CampoHorario_2.setStyleSheet("QLineEdit{\n"
"    background-color: white;\n"
"}")
        self.CampoHorario_2.setObjectName("CampoHorario_2")
        self.subagrupamento3_2.addWidget(self.CampoHorario_2)
        self.Tabelageral.addTab(self.cancelarreserva, "")
        self.Altrerardados = QtWidgets.QWidget()
        self.Altrerardados.setObjectName("Altrerardados")
        self.fundo_5 = QtWidgets.QLabel(self.Altrerardados)
        self.fundo_5.setGeometry(QtCore.QRect(-10, -10, 931, 401))
        self.fundo_5.setText("")
        self.fundo_5.setPixmap(QtGui.QPixmap("../fundo azul.jpg"))
        self.fundo_5.setObjectName("fundo_5")
        self.SenhaBotao_2 = QtWidgets.QPushButton(self.Altrerardados)
        self.SenhaBotao_2.setGeometry(QtCore.QRect(260, 140, 171, 41))
        self.SenhaBotao_2.setObjectName("SenhaBotao_2")
        self.SenhaBotao = QtWidgets.QPushButton(self.Altrerardados)
        self.SenhaBotao.setGeometry(QtCore.QRect(260, 90, 171, 41))
        self.SenhaBotao.setObjectName("SenhaBotao")
        self.SenhaBotao_3 = QtWidgets.QPushButton(self.Altrerardados)
        self.SenhaBotao_3.setGeometry(QtCore.QRect(260, 190, 171, 41))
        self.SenhaBotao_3.setObjectName("SenhaBotao_3")
        self.Tabelageral.addTab(self.Altrerardados, "")
        self.Informacoes = QtWidgets.QWidget()
        self.Informacoes.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.Informacoes.setAcceptDrops(False)
        self.Informacoes.setAccessibleName("")
        self.Informacoes.setAccessibleDescription("")
        self.Informacoes.setObjectName("Informacoes")
        self.fundo_6 = QtWidgets.QLabel(self.Informacoes)
        self.fundo_6.setEnabled(True)
        self.fundo_6.setGeometry(QtCore.QRect(-150, -10, 1071, 461))
        self.fundo_6.setText("")
        self.fundo_6.setPixmap(QtGui.QPixmap("../fundo azul.jpg"))
        self.fundo_6.setObjectName("fundo_6")
        self.layoutWidget_13 = QtWidgets.QWidget(self.Informacoes)
        self.layoutWidget_13.setGeometry(QtCore.QRect(120, 190, 471, 36))
        self.layoutWidget_13.setObjectName("layoutWidget_13")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.layoutWidget_13)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.email = QtWidgets.QLabel(self.layoutWidget_13)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.email.setFont(font)
        self.email.setObjectName("email")
        self.horizontalLayout_2.addWidget(self.email)
        self.LabeEmail = QtWidgets.QLabel(self.layoutWidget_13)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.LabeEmail.setFont(font)
        self.LabeEmail.setText("")
        self.LabeEmail.setObjectName("LabeEmail")
        self.horizontalLayout_2.addWidget(self.LabeEmail)
        self.layoutWidget_11 = QtWidgets.QWidget(self.Informacoes)
        self.layoutWidget_11.setGeometry(QtCore.QRect(120, 250, 471, 36))
        self.layoutWidget_11.setObjectName("layoutWidget_11")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget_11)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.siape = QtWidgets.QLabel(self.layoutWidget_11)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.siape.setFont(font)
        self.siape.setObjectName("siape")
        self.horizontalLayout.addWidget(self.siape)
        self.LabelSiape = QtWidgets.QLabel(self.layoutWidget_11)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.LabelSiape.setFont(font)
        self.LabelSiape.setText("")
        self.LabelSiape.setObjectName("LabelSiape")
        self.horizontalLayout.addWidget(self.LabelSiape)
        self.layoutWidget_12 = QtWidgets.QWidget(self.Informacoes)
        self.layoutWidget_12.setGeometry(QtCore.QRect(120, 90, 471, 36))
        self.layoutWidget_12.setObjectName("layoutWidget_12")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.layoutWidget_12)
        self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.nome = QtWidgets.QLabel(self.layoutWidget_12)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.nome.setFont(font)
        self.nome.setObjectName("nome")
        self.horizontalLayout_4.addWidget(self.nome)
        self.LabelNome = QtWidgets.QLabel(self.layoutWidget_12)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.LabelNome.setFont(font)
        self.LabelNome.setText("")
        self.LabelNome.setObjectName("LabelNome")
        self.horizontalLayout_4.addWidget(self.LabelNome)
        self.layoutWidget_10 = QtWidgets.QWidget(self.Informacoes)
        self.layoutWidget_10.setGeometry(QtCore.QRect(120, 140, 471, 36))
        self.layoutWidget_10.setObjectName("layoutWidget_10")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.layoutWidget_10)
        self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.telefone = QtWidgets.QLabel(self.layoutWidget_10)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.telefone.setFont(font)
        self.telefone.setObjectName("telefone")
        self.horizontalLayout_3.addWidget(self.telefone)
        self.LabelTelefone = QtWidgets.QLabel(self.layoutWidget_10)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.LabelTelefone.setFont(font)
        self.LabelTelefone.setText("")
        self.LabelTelefone.setObjectName("LabelTelefone")
        self.horizontalLayout_3.addWidget(self.LabelTelefone)
        self.Tabelageral.addTab(self.Informacoes, "")
        MenuCoordenador.setCentralWidget(self.centralwidget)
        self.rodape = QtWidgets.QStatusBar(MenuCoordenador)
        self.rodape.setSizeGripEnabled(True)
        self.rodape.setObjectName("rodape")
        MenuCoordenador.setStatusBar(self.rodape)

        self.retranslateUi(MenuCoordenador)
        self.Tabelageral.setCurrentIndex(5)
        QtCore.QMetaObject.connectSlotsByName(MenuCoordenador)

    def retranslateUi(self, MenuCoordenador):
        _translate = QtCore.QCoreApplication.translate
        MenuCoordenador.setWindowTitle(_translate("MenuCoordenador", "MENU COORDENADOR"))
        self.Tabelageral.setToolTip(_translate("MenuCoordenador", "<html><head/><body><p>dff</p></body></html>"))
        self.cadastrarprofessor.setWhatsThis(_translate("MenuCoordenador", "<html><head/><body><p>h</p></body></html>"))
        self.Cpf.setText(_translate("MenuCoordenador", "CPF               "))
        self.Email.setText(_translate("MenuCoordenador", "EMAIL          "))
        self.Siape.setText(_translate("MenuCoordenador", "SIAPE           "))
        self.Senha.setText(_translate("MenuCoordenador", "SENHA         "))
        self.Telefone.setText(_translate("MenuCoordenador", "TELEFONE   "))
        self.Disciplina.setText(_translate("MenuCoordenador", "DISCIPLINA"))
        self.Nome.setText(_translate("MenuCoordenador", "NOME          "))
        self.Cadastrar.setText(_translate("MenuCoordenador", "CADASTRAR"))
        self.cancelar.setText(_translate("MenuCoordenador", "CANCELAR"))
        self.Tabelageral.setTabText(self.Tabelageral.indexOf(self.cadastrarprofessor), _translate("MenuCoordenador", "Cadastrar Professor"))
        item = self.tabela.verticalHeaderItem(0)
        item.setText(_translate("MenuCoordenador", "8:00 - 10:00"))
        item = self.tabela.verticalHeaderItem(1)
        item.setText(_translate("MenuCoordenador", "10:00 - 12:00"))
        item = self.tabela.verticalHeaderItem(2)
        item.setText(_translate("MenuCoordenador", "12:00 - 14:00"))
        item = self.tabela.verticalHeaderItem(3)
        item.setText(_translate("MenuCoordenador", "14:00 - 16:00"))
        item = self.tabela.verticalHeaderItem(4)
        item.setText(_translate("MenuCoordenador", "16:00 - 18:00"))
        item = self.tabela.verticalHeaderItem(5)
        item.setText(_translate("MenuCoordenador", "18:00- 20:00"))
        item = self.tabela.verticalHeaderItem(6)
        item.setText(_translate("MenuCoordenador", "20:00- 22:00"))
        item = self.tabela.horizontalHeaderItem(0)
        item.setText(_translate("MenuCoordenador", "Segunda"))
        item = self.tabela.horizontalHeaderItem(1)
        item.setText(_translate("MenuCoordenador", "Terça"))
        item = self.tabela.horizontalHeaderItem(2)
        item.setText(_translate("MenuCoordenador", "Quarta"))
        item = self.tabela.horizontalHeaderItem(3)
        item.setText(_translate("MenuCoordenador", "Quinta"))
        item = self.tabela.horizontalHeaderItem(4)
        item.setText(_translate("MenuCoordenador", "Sexta"))
        item = self.tabela.horizontalHeaderItem(5)
        item.setText(_translate("MenuCoordenador", "Sabado"))
        self.Bloco.setText(_translate("MenuCoordenador", "BLOCO"))
        self.Sala.setText(_translate("MenuCoordenador", "SALA    "))
        self.Dia.setText(_translate("MenuCoordenador", "DIA       "))
        self.Horario.setText(_translate("MenuCoordenador", "Horário "))
        self.Listar.setText(_translate("MenuCoordenador", "Listar Horários"))
        self.Reservar.setText(_translate("MenuCoordenador", "Reservar"))
        self.Tabelageral.setTabText(self.Tabelageral.indexOf(self.ReservarSala), _translate("MenuCoordenador", "Reservar Sala"))
        self.Mostrar.setText(_translate("MenuCoordenador", "MOSTRAR"))
        self.GerarPDF.setText(_translate("MenuCoordenador", "GERAR PDF"))
        self.Tabelageral.setTabText(self.Tabelageral.indexOf(self.Verreservas), _translate("MenuCoordenador", "Ver reservas"))
        self.Remover.setText(_translate("MenuCoordenador", "REMOVER"))
        self.Bloco_2.setText(_translate("MenuCoordenador", "BLOCO     "))
        self.Sala_2.setText(_translate("MenuCoordenador", "SALA         "))
        self.Dia_2.setText(_translate("MenuCoordenador", "DIA           "))
        self.horario.setText(_translate("MenuCoordenador", "HORARIO"))
        self.Tabelageral.setTabText(self.Tabelageral.indexOf(self.cancelarreserva), _translate("MenuCoordenador", "Cancelar reserva"))
        self.SenhaBotao_2.setText(_translate("MenuCoordenador", "EMAIL"))
        self.SenhaBotao.setText(_translate("MenuCoordenador", "SENHA"))
        self.SenhaBotao_3.setText(_translate("MenuCoordenador", "TELEFONE"))
        self.Tabelageral.setTabText(self.Tabelageral.indexOf(self.Altrerardados), _translate("MenuCoordenador", "Alterar Dados"))
        self.Informacoes.setToolTip(_translate("MenuCoordenador", "<html><head/><body><p><br/></p></body></html>"))
        self.Informacoes.setWhatsThis(_translate("MenuCoordenador", "<html><head/><body><p>kkkkkkkkkkkkkkkkkk</p></body></html>"))
        self.email.setText(_translate("MenuCoordenador", "EMAIL"))
        self.siape.setText(_translate("MenuCoordenador", "SIAPE"))
        self.nome.setText(_translate("MenuCoordenador", "NOME"))
        self.telefone.setText(_translate("MenuCoordenador", "TELEFONE:"))
        self.Tabelageral.setTabText(self.Tabelageral.indexOf(self.Informacoes), _translate("MenuCoordenador", "Informações"))
        self.funcionalidade()

        
    def mostrar(self):
        self.LabelNome.setText(self.coordenador.getNome())
        self.LabelTelefone.setText(self.coordenador.getTelefone())
        self.LabeEmail.setText(self.coordenador.getEmail())
        self.LabelSiape.setText(str(self.coordenador.getSIAPE()))
        
        """print("Nome",self.coordenador.getNome())
        print("Siape",self.coordenador.getSIAPE())
        print("Cpf",self.coordenador.getCpf())
        print("Senha",self.coordenador.getSenha())
        print("Email:",self.coordenador.getEmail())
        print("Telefone",self.coordenador.getTelefone())
        print("Disciplina",self.coordenador.getCurso())"""
       
        
    def funcionalidade(self):
        self.Cadastrar.clicked.connect(self.cadastrar)
        self.Remover.clicked.connect(self.cancelar_reserva)
        self.Listar.clicked.connect(self.listar_salas)
        self.Reservar.clicked.connect(self.reservar)
        self.Mostrar.clicked.connect(self.mostrar_reservas)
        self.GerarPDF.clicked.connect(self.gera_pdf)
    
        
    def cadastrar(self):
        nome=self.CampoNome.text()
        siape= self.CampoSiape.text()
        telefone= self.CampoTelefone.text()
        email= self.CampoEmail.text()
        senha=self.CampoSenha.text()
        cpf= self.CampoCpf.text()
        disciplina= self.CampoDisciplina.text()

        if verificaEmail(email) and verificaCpf(cpf) and verificaTelefone(telefone) and len(nome)> 0 and verificaMat(siape) and len(senha) >0 and len(disciplina)>0:
            string = 'p'+","+nome+","+siape+","+cpf+","+senha+","+email+","+telefone+","+disciplina
            #print(string)
            c1 = cliente(string)
            string2 = c1.client_socket.recv(1024).decode()
            if(string2=="certo"):
                QtWidgets.QMessageBox.about(None, "Cadastro","Cadastro realizado com sucesso!!!",)
                self.CampoNome.clear()
                self.CampoSiape.clear()
                self.CampoTelefone.clear()
                self.CampoEmail.clear()
                self.CampoSenha.clear()
                self.CampoCpf.clear()
                self.CampoDisciplina.clear()
            else:
                QtWidgets.QMessageBox.about(None, "AVISO","Os seguintos dados já estão cadastrados:\n"+string2[:len(string2)-1:1])
        else:
            QtWidgets.QMessageBox.about(None, "Alguns Valores invalidos","Preencha os campos com valores validos",)

    
    
    def loga_coordenador(self,coordenador):
        self.coordenador = coordenador
        if(not self.r_message):
            QtWidgets.QMessageBox.information(None, "AVISO","Bem vindo coordenador: "+self.coordenador.getNome(),)
            self.r_message = True
        self.mostrar()


    def listar_salas(self):
       
        string = ''
        erros = ''
        if((len(self.CampoBloco.text())==0) or (len(self.CampoSala.text())==0)):
            QtWidgets.QMessageBox.warning(None, "AVISO","PREENCHA CAMPOS BLOCO E SALA PARA PODER VER A TABELA DE RESERVAS",)
        else:
            
            if(len(erros)>0):
               QtWidgets.QMessageBox.warning(None, "AVISO","Dados inválidos nos seguintes campos: "+erros,)
            else:
                string = "Listar"+","+self.CampoBloco.text()+","+self.CampoSala.text()
                c1 = cliente(string)
                str2 = c1.client_socket.recv(1024).decode()
                if(str2=="vazio"):
                    QtWidgets.QMessageBox.warning(None, "AVISO","Bloco ou Sala não cadastrados",)
                else:
                    lista = str2.split(",")
                    lista.pop(len(lista)-1)
                    
                    c = 0
        
                    for j in range(6):
                        for i in range(7):
                            self.tabela.setItem(i,j, QtWidgets.QTableWidgetItem(lista[c]))
                            c+=1


    def reservar(self):
        string = ''
        if((len(self.CampoBloco.text())==0) or (len(self.CampoSala.text())==0) or (len(self.CampoHorario.text())==0) or len(self.CampoDIa.text())==0):
            QtWidgets.QMessageBox.warning(None, "AVISO","PREENCHA TODOS OS CAMPOS PARA RESERVAR UMA SALA",)
        else:
            string = "reservar"+","+self.coordenador.getCpf()+","+self.CampoBloco.text()+","+self.CampoSala.text()+","+self.CampoDIa.text()+","+self.CampoHorario.text()
            c1 = cliente(string)
            string2 = c1.client_socket.recv(1024).decode()
            print("String2",string2)
            if(string2=="certo"):
                QtWidgets.QMessageBox.information(None, "AVISO","Reserva efetuada com sucesso",)
                self.listar_salas()
            else:
               QtWidgets.QMessageBox.warning(None, "AVISO","Não foi possível realizar a reserva!",) 
           
    def mostrar_reservas(self):
        string = 'mostrar'+","+self.coordenador.getCpf()
        c1 = cliente(string)
        string2 = c1.client_socket.recv(1024).decode()
        lista = []
        self.listWidget.clear()
        if("recebido" in string2):
            string2 = c1.client_socket.recv(1024).decode()
            lista = string2.split(",")
            
            self.listWidget.addItem("                                                    SALA                       HORARIO                    DIA")
            print("The lista",lista)
            lista.pop(len(lista)-1)
            cont = 0
            while(cont<len(lista)):
                
                self.listWidget.addItem("                                                     "+lista[cont]+"                            "+lista[cont+1]+"                "+lista[cont+2])                                               
                cont+=3
        else:
            QtWidgets.QMessageBox.information(None, "AVISO","Não há reservas realizadas no momento",) 
    
    def cancelar_reserva(self):
        bloco = self.CampoBloco_2.text()
        sala = self.CampoSala_2.text()
        dia = self.CampoDia.text()
        horario = self.CampoHorario_2.text()
        string = ''
        if(len(dia)== 0 or len(sala) == 0 or len(bloco)==0 or len(horario)==0):
            QtWidgets.QMessageBox.information(None, "AVISO","PREENCHA TODOS OS CAMPOS!",)
        else:
            string = "cancelar_reserva"+","+self.coordenador.getCpf()+","+bloco+","+sala+","+dia+","+horario
            c1 = cliente(string)
            string2 = c1.client_socket.recv(1024).decode()
           
            if(string2=="cancelar"):
                QtWidgets.QMessageBox.information(None, "AVISO","Reserva cancelada com sucesso",)
                self.CampoBloco_2.clear()
                self.CampoSala_2.clear()
                self.CampoDia.clear()
                self.CampoHorario_2.clear()
            else:
                QtWidgets.QMessageBox.warning(None, "AVISO","Não há reservas para serem canceladas",)

    def gera_pdf(self):
        string = 'solicita'+","+self.coordenador.getCpf()+","+self.coordenador.getEmail()
        c1 = cliente(string)
        
        string2 = c1.client_socket.recv(1024).decode()
        
        
        lista = string2.split(",")
        print(lista)
        if(lista[0]!="invalido"):
            g = GeraPDF(self.coordenador,lista[0],lista[1])
            g.cria()
            envia = envia_email(self.coordenador)
            envia.send_an_email()

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MenuCoordenador = QtWidgets.QMainWindow()
    ui = Ui_MenuCoordenador()
    ui.setupUi(MenuCoordenador)
    MenuCoordenador.show()
    sys.exit(app.exec_())

