Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>SISGE - Prototipo Matricula</title>
  6. <link rel="stylesheet" type="text/css" href="estilo.css" />
  7. <script type="text/javascript" src="javascript.js"/>
  8.  
  9. </script>
  10. </head>
  11. <body>
  12. <div id="header">
  13. <img src="i/logo.jpg"/>
  14. <iframe name="frameConteudo" class="frameConteudo" src="listaAluno.html" scrolling="no"></iframe>
  15. </div>
  16.  
  17. </body>
  18. </html>
  19.  
  20. // JAVASCRIPT CRIADO POR RENOIR FARIA //
  21. var cpfResponsavel;
  22. var cepResponsavel;
  23. var form;
  24. function Aluno(cpf,nome,dtNasc,nomeMae,turno,escola) {
  25. this.cpf = cpf;
  26. this.nome = nome;
  27. this.dtNasc = dtNasc;
  28. this.nomeMae = nomeMae;
  29. this.turno = turno;
  30. this.escola = escola;
  31. }
  32. var aluno = new Array();
  33. aluno[0] = new Aluno ("111","Estagiario","11/02/1994","Hayley de Paula");
  34. aluno[1] = new Aluno ("04050816180","Beta","11/02/1994","TIM");
  35.  
  36. function consiste(op,form) {
  37. switch (op) {
  38. case "continuar":
  39. if (form.CPF.value === "") {
  40. alert("CAMPO CPF VAZIO");
  41. form.CPF.focus();
  42. return false;
  43. }
  44. if (form.CEP.value === "") {
  45. alert("CAMPO CEP VAZIO");
  46. return false;
  47. }
  48. break;
  49. }
  50. return true;
  51. }
  52.  
  53. function ehAlunoNovo(cpf) {
  54. var result = true;
  55. for (i = 0; i < aluno.length; i++) {
  56. if (aluno[i].cpf === cpf) {
  57. result = false;
  58. }
  59. }
  60. return result;
  61. }
  62.  
  63. function continuar(form) {
  64. form = form;
  65. if (consiste("continuar",form)) {
  66. cpfResponsavel = form.CPF.value;
  67. cepResponsavel = form.CEP.value;
  68. if (ehAlunoNovo(cpfResponsavel)) {
  69. frameConteudo.location = 'alunoNovo.html';
  70. }
  71. else {
  72. frameConteudo.location = 'listaAluno.html';
  73. }
  74. }
  75.  
  76. }
  77.  
  78. function listaAluno () {
  79. var criarLista = "<button ";
  80. for (i = 0; i < aluno.length; i++) {
  81. if (aluno[i].cpf == cpfResponsavel) {
  82. criarLista += "onclick="selecAluno("+i+")">" + aluno[i].nome;
  83. }
  84. }
  85. criarLista += "</button>";
  86.  
  87. }
  88.  
  89. <!DOCTYPE html>
  90. <html>
  91. <head>
  92. <title>Lista Aluno</title>
  93. <link rel="stylesheet" type="text/css" href="estilo.css" />
  94. <script type="text/javascript" src="javascript.js"/>
  95. </head>
  96. <body onload="listaAluno();">
  97. <div id="divLista">
  98. </div>
  99. </body>
  100. </html>
  101.  
  102. <iframe name="frameConteudo" id="frameConteudo" class="frameConteudo" src="listaAluno.html" scrolling="no"></iframe>
  103.  
  104. document.getElementById('frameConteudo').contentWindow.document.getElementById('divLista')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement