GridView com CheckBox que adiciona registros
Primeiro vou mostrar as tabelas:
CREATE TABLE funcionario (idfuncionario int(11) NOT NULL AUTO_INCREMENT,nomefuncionario varchar(45) DEFAULT NULL,rgfuncionario varchar(10) DEFAULT NULL,telefonefuncionario varchar(45) DEFAULT NULL,emailfuncionario varchar(45) DEFAULT NULL,cpf varchar(45) DEFAULT NULL,pis varchar(45) DEFAULT NULL,profissao varchar(45) DEFAULT NULL,enderecofuncionario varchar(100) NOT NULL,bairrofuncionario varchar(40) NOT NULL,cidadefuncionario varchar(40) NOT NULL,pontuacao_idpontuacao int(11) DEFAULT NULL,gerente_idgerente int(11) DEFAULT NULL,
PRIMARY KEY (idfuncionario),
KEY fk_funcionario_pontuacao (pontuacao_idpontuacao),
KEY fk_funcionario_gerente (gerente_idgerente),
CONSTRAINT `fk_funcionario_gerente` FOREIGN KEY (`gerente_idgerente`) REFERENCES `gerente` (`idgerente`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_funcionario_pontuacao` FOREIGN KEY (`pontuacao_idpontuacao`) REFERENCES `pontuacao` (`idpontuacao`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
CREATE TABLE festa (idfesta int(11) NOT NULL AUTO_INCREMENT,datafesta date DEFAULT NULL,horafesta time NOT NULL,tipofesta varchar(45) DEFAULT NULL,valor float DEFAULT NULL,nconvidadosfesta int(11) NOT NULL,precopessoafesta float NOT NULL,duracaofesta tinyint(4) NOT NULL,decoracaofesta tinyint(1) NOT NULL,mesafriosfesta tinyint(1) NOT NULL,mesasaidafesta tinyint(1) NOT NULL,bolofesta tinyint(1) NOT NULL,docesfesta tinyint(1) NOT NULL,djfesta tinyint(1) NOT NULL,bebalcoolfesta tinyint(1) NOT NULL,comentariosfesta text NOT NULL,cliente_idcliente int(11) DEFAULT NULL,checklist_idchecklist int(11) DEFAULT NULL,gerente_idgerente int(11) DEFAULT NULL,
PRIMARY KEY (idfesta),
KEY fk_festa_checklist (checklist_idchecklist),
KEY fk_festa_gerente (gerente_idgerente),
CONSTRAINT `fk_festa_checklist` FOREIGN KEY (`checklist_idchecklist`) REFERENCES `checklist` (`idchecklist`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_festa_gerente` FOREIGN KEY (`gerente_idgerente`) REFERENCES `gerente` (`idgerente`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=latin1
CREATE TABLE recibo (idrecibo int(11) NOT NULL AUTO_INCREMENT,festa_idfesta int(11) NOT NULL,funcionario_idfuncionario int(11) NOT NULL,assinadorecibo tinyint(1) NOT NULL,escaladorecibo tinyint(1) NOT NULL,
PRIMARY KEY (idrecibo)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
Preciso mostrar uma listagem de todos os funcionáios com uma CheckBox do lado para indicar se aquele profissional está escalado ou não.
No entanto, não posso garantir que os registros da tabela 'recibo' já foram criados para poder marcar o CheckBox em um GridView.
Esta listagem é acessada por um link específico para cada festa. Pensei em criar todos os 'recibos' de cada festa no momento em que o evento é cadastrado, não sei se isso é uma boa solução.
Resumindo.. Gostaria de criar uma listagem (de aparencia parecida ou igual ao de uma GridView) de todos os profissionais com um checkbox ao lado para que ao marcar ou desmarcar os devidos 'recibos' fossem criados/alterados.
Tenho certeza que não fui muito claro, se n entenderem o problema eu tento explicar outra vez.
Desde já meu muito obrigado.
Discussão (6)
Carregando comentários...