Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>SISGE - Prototipo Matricula</title>
- <link rel="stylesheet" type="text/css" href="estilo.css" />
- <script type="text/javascript" src="javascript.js"/>
- </script>
- </head>
- <body>
- <div id="header">
- <img src="i/logo.jpg"/>
- <iframe name="frameConteudo" class="frameConteudo" src="listaAluno.html" scrolling="no"></iframe>
- </div>
- </body>
- </html>
- // JAVASCRIPT CRIADO POR RENOIR FARIA //
- var cpfResponsavel;
- var cepResponsavel;
- var form;
- function Aluno(cpf,nome,dtNasc,nomeMae,turno,escola) {
- this.cpf = cpf;
- this.nome = nome;
- this.dtNasc = dtNasc;
- this.nomeMae = nomeMae;
- this.turno = turno;
- this.escola = escola;
- }
- var aluno = new Array();
- aluno[0] = new Aluno ("111","Estagiario","11/02/1994","Hayley de Paula");
- aluno[1] = new Aluno ("04050816180","Beta","11/02/1994","TIM");
- function consiste(op,form) {
- switch (op) {
- case "continuar":
- if (form.CPF.value === "") {
- alert("CAMPO CPF VAZIO");
- form.CPF.focus();
- return false;
- }
- if (form.CEP.value === "") {
- alert("CAMPO CEP VAZIO");
- return false;
- }
- break;
- }
- return true;
- }
- function ehAlunoNovo(cpf) {
- var result = true;
- for (i = 0; i < aluno.length; i++) {
- if (aluno[i].cpf === cpf) {
- result = false;
- }
- }
- return result;
- }
- function continuar(form) {
- form = form;
- if (consiste("continuar",form)) {
- cpfResponsavel = form.CPF.value;
- cepResponsavel = form.CEP.value;
- if (ehAlunoNovo(cpfResponsavel)) {
- frameConteudo.location = 'alunoNovo.html';
- }
- else {
- frameConteudo.location = 'listaAluno.html';
- }
- }
- }
- function listaAluno () {
- var criarLista = "<button ";
- for (i = 0; i < aluno.length; i++) {
- if (aluno[i].cpf == cpfResponsavel) {
- criarLista += "onclick="selecAluno("+i+")">" + aluno[i].nome;
- }
- }
- criarLista += "</button>";
- }
- <!DOCTYPE html>
- <html>
- <head>
- <title>Lista Aluno</title>
- <link rel="stylesheet" type="text/css" href="estilo.css" />
- <script type="text/javascript" src="javascript.js"/>
- </head>
- <body onload="listaAluno();">
- <div id="divLista">
- </div>
- </body>
- </html>
- <iframe name="frameConteudo" id="frameConteudo" class="frameConteudo" src="listaAluno.html" scrolling="no"></iframe>
- document.getElementById('frameConteudo').contentWindow.document.getElementById('divLista')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement