-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisciplina.html
137 lines (110 loc) · 4 KB
/
disciplina.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>studule</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/global.js"></script>
<script src="js/disciplina.js"></script>
<script src="js/horario.js"></script>
<script src="js/semana.js"></script>
<script src="js/controller.js"></script>
<script src="js/3rdparty/js.cookie.js"></script>
<link rel="stylesheet" href="default.css">
</head>
<script>
global.open();
var disc_num = window.disciplinas.length;
/*Quando tudo estiver pronto carrega disciplinas */
$(document).ready(function() {
discs = describeAllDisc();
if (discs.length > 0) {
obj = document.getElementById("disc_container");
obj.innerHTML = "";
for (var i = 0; i < discs.length; i++)
obj.appendChild(discs[i]);
}
});
/*Funções de controlador especificas da pagina*/
function addDisc() {
var name = document.getElementsByName('disciplina')[0].value;
var abrev = document.getElementsByName('abrev')[0].value;
var prior = document.getElementsByName('prioridade')[0].value;
var tempo = document.getElementsByName('tempo')[0].value;
if (!name || !abrev || !prior || !tempo) {
alert("Preencha todos os campos adequadamente");
return;
}
newdisc = new Disciplina(name, abrev, prior, tempo);
obj = document.getElementById("disc_container");
if (disc_num == 0) {
obj.innerHTML = "";
}
obj.appendChild(describeDisc(newdisc));
window.disciplinas.push(newdisc);
disc_num++;
global.save();
}
function removeDisc(name) {
/*chama model*/
deleteDisc(name);
/*atualiza*/
location.reload();
}
</script>
<body>
<div class="jumbotron bg-1 text-center">
<h1>studule</h1>
<h4> seu horário de estudos </h4>
</div>
<nav class="navbar bg-1 navbar-default">
<center>
<ul class="nav navbar-nav">
<li><a href="index.html"> studule </a></li>
<li class="active"><a href="index.html"> Adicionar Disciplina </a></li>
<li><a href="semana.html"> Horário </a></li>
</ul>
</center>
</div>
</nav>
<center>
<div class="container bg-1">
<div class="row">
<div class="col-sm-6">
<form id="myform">
<h3>Nova Disciplina</h3>
<p class='form_title'>Nome da disciplina:</p>
<input bg-2 type="text" name="disciplina" value=" ">
<p class='form_title'>Código/Abreviatura:</p>
<input bg-2 type="text" name="abrev" value=" ">
<p class='form_title'>Prioridade (1 a 5): </p>
<input type="number" min='1' max='5' name="prioridade" value=" ">
<p class='form_title'>Tempo necessário:</p>
<input type="text" name="tempo" value=" ">
<p> (durante a semana) </p>
<button onclick="addDisc()" type="button" class="btn btn-default newdisc_but">Enviar</button>
</form>
</div>
<div class="col-sm-6">
<h3> Disciplinas cadastradas </h3>
<div id='disc_container'>
Ops! Nenhuma disciplina aqui ainda
</div>
</div>
</div>
</div>
</div>
</center>
</body>
<div class="container bg-2">
<footer>
<center>
<h3>studule<h3>
<h4>2016</h4>
</center>
</footer>
</div>
</html>