-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexemplo03.html
More file actions
184 lines (163 loc) · 5.05 KB
/
Copy pathexemplo03.html
File metadata and controls
184 lines (163 loc) · 5.05 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE html>
<html ng-app="aluguelCarro">
<head>
<meta http-equiv="Content-Type" content="text/html;" charset="UTF-8" />
<title>Aluguel de Carro - Versão 3</title>
<link rel="stylesheet" type="text/css" href="bootstrap.css">
<script src="./Js/angular.min.js"></script>
<script>
var alugaCarro = angular.module("aluguelCarro", []);
alugaCarro.controller("alugarCarroController", function ($scope) {
$scope.nomeAplicacao = "Aluguel de Carros - Versão 3";
$scope.carros = [
{
marca: "Chevrolet", modelo: "Onix", tipo: "Hatch", cor: "Preta",
anoModelo: "2018", combustivel: "Flex"
},
{
marca: "Chevrolet", modelo: "Blazer", tipo: "SUV", cor: "Prata",
anoModelo: "2016", combustivel: "Diesel"
},
{
marca: "Ford", modelo: "Fiesta", tipo: "Hatch", cor: "Branca",
anoModelo: "2016", combustivel: "Flex"
},
{
marca: "Fiat", modelo: "Argo", tipo: "Hatch", cor: "Cinza",
anoModelo: "2018", combustivel: "Flex"
},
{
marca: "Honda", modelo: "City", tipo: "Sedã", cor: "Preta",
anoModelo: "2017", combustivel: "Flex"
},
{
marca: "Toyota", modelo: "Corolla", tipo: "Sedã", cor: "Cinza",
anoModelo: "2016", combustivel: "Flex"
},
{
marca: "Toyota", modelo: "Hilux", tipo: "Picape", cor: "Prata",
anoModelo: "2018", combustivel: "Diesel"
}
];
$scope.marcas = ["Chevrolet", "Ford", "Fiat", "Honda", "Toyota", "Volkswagen", "Audi"];
$scope.cores = ["Branca", "Preta", "Cinza", "Azul", "Vermelha", "Amarela", "Prata"];
$scope.tipos = ["Hatch", "Cupê", "Sedã", "Perua", "Picape", "Van", "Minivan", "SUV"];
$scope.combustiveis = ["Gasolina", "Álcool", "Disel", "Gás/GLP", "Flexível"];
$scope.adicionarCarro = function (carro) {
$scope.carros.push(carro);
delete $scope.carro;
};
});
</script>
<style>
.table {
margin-left: auto;
margin-right: auto;
width: 90%;
text-align: center;
}
.form-control {
margin-left: auto;
margin-right: auto;
padding-left: 5%;
padding-right: 5%;
background-color: beige;
}
.tituloAplicacao {
background-color: #fcdd7a;
border-radius: 5px;
text-align: center;
width: 700px;
padding: 10px;
margin-left: auto;
margin-right: auto;
margin-top: 10px;
margin-bottom: 20px;
}
.legendaCarro {
background-color: #fff9a4;
border-radius: 8px;
text-align: center;
padding: 10px;
margin-top: 10px;
margin-bottom: 20px;
}
.label {
margin-left: 12%;
align-items: center;
width: 15%;
}
.selectField {
margin-right: 10px;
width: 15%;
height: 33px;
}
.selectInout {
margin-right: 10px;
width: 15%;
}
.btn {
margin-left: 45%;
margin-bottom: 20px;
padding-left: 30px;
padding-right: 30px;
font-weight: 600;
}
</style>
</head>
<body ng-controller="alugarCarroController">
<div class="tituloAplicacao">
<h3 ng-bind="nomeAplicacao"></h3>
</div>
<table class="table">
<tr>
<th>Marca</th>
<th>Modelo</th>
<th>Tipo</th>
<th>Cor</th>
<th>Ano Modelo</th>
<th>Combustível</th>
</tr>
<tr ng-repeat="carro in carros">
<th>{{carro.marca}}</th>
<th>{{carro.modelo}}</th>
<th>{{carro.tipo}}</th>
<th>{{carro.cor}}</th>
<th>{{carro.anoModelo}}</th>
<th>{{carro.combustivel}}</th>
</tr>
</table>
<hr>
<div class="form-control">
<legend class="legendaCarro">Adicione o carro desejado</legend>
<p>
<label class="label">Selecione a marca: </label>
<select class="selectField" ng-model="carro.marca" ng-options="marca for marca in marcas">
<option value="">Selecione a marca </option>
</select>
<label class="label">Selecione o modelo:</label>
<input class="selectInout" type="text" ng-model="carro.modelo">
</p>
<p>
<label class="label">Selecione o tipo: </label>
<select class="selectField" ng-model="carro.tipo" ng-options="tipo for tipo in tipos">
<option value="">Selecione o tipo </option>
</select>
<label class="label">Selecione a cor: </label>
<select class="selectField" ng-model="carro.cor" ng-options="cor for cor in cores">
<option value="">Selecione a cor </option>
</select>
</p>
<p>
<label class="label">Selecione Ano/Modelo: </label>
<input class="selectInout" type="text" ng-model="carro.anoModelo">
<label class="label">Selecione o combustível: </label>
<select class="selectField" ng-model="carro.combustivel" ng-options="combustivel for combustivel in combustiveis">
<option value="">Selecione o combustível </option>
</select>
</p>
<br>
<button class="btn btn-primary" ng-click="adicionarCarro(carro)">Adicionar</button>
</div>
</body>
</html>