-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprova_obj_mrp.php
275 lines (237 loc) · 6.71 KB
/
prova_obj_mrp.php
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<html>
<head><title>Test mrpRobj</title></head>
<body>
<?php
/*pagina di prova dell'oggetto mrpRobj.php
Autore: Attilio Bongiorni
a.bon6iorni@gmail.com
*/
include ("mrpRobj.php");
define("GET",0);
define("SET",1);
?>
<center> <font color='#ff8c00' size="5"><strong>Test classe mrpRobj</strong><br></font>
<font size="2" face="Arial, Lucida Grande, Verdana, Arial, Sans-Serif" color="black">
Museo della Resistenza Piacentina<br>
rel. 2.0 - agosto 2012
</font></center>
<hr align="center" noshade="" width="90%">
<center>
Questa è una pagina di Test per la programmazione.
</center>
<p>Test dell'oggetto mrpRobj
<?php
// inserire qui codice scheda da testare
// -------------------------------------------------
$code = 6022;//è il Ballonaio
//--------------------------------------------------
$oggettoMrp = new mrpRobj($code);
/*esempio di utilizzo metodo
$numero_immobili = $oggettoIci->nimm();
echo " - Numero immobili dell'oggetto = ".$oggettoIci->nimm();
echo "<br>";
*/
$oggettoMrp->nome(SET, "Gino");
$testNome = $oggettoMrp->nome(GET,"");
echo "Nome: ";
echo $testNome;
echo "<br />";
$oggettoMrp->cognome(SET, "Bongiorni");
$testCognome = $oggettoMrp->cognome(GET, "");
echo "Cognome: ";
echo $testCognome;
echo "<br />";
$oggettoMrp->paternit(SET, "Attilio");
$testPaternit = $oggettoMrp->paternit(GET, "");
echo "Paternit: ";
echo $testPaternit;
echo "<br />";
$oggettoMrp->data_nasc(SET, "1919-10-07");
$testDatanasc = $oggettoMrp->data_nasc(GET, "");
echo "Data nascita: ";
echo $testDatanasc;
echo "<br />";
echo "Timestamp della data di nascita: ";
echo $oggettoMrp->data_nasc_ts();
echo "<br />";
$oggettoMrp->luogonasci(SET, "Nibbiano");
$testLuogonasc = $oggettoMrp->luogonasci(GET, "");
echo "Luogo nascita: ";
echo $testLuogonasc;
echo "<br />";
$oggettoMrp->formazione(SET, "Giustizia e Liberta");
$testFormaz = $oggettoMrp->formazione(GET, "");
echo "Formazione: ";
echo $testFormaz;
echo "<br />";
$oggettoMrp->qualifica(SET, "partigiano");
$testQualif = $oggettoMrp->qualifica(GET, "");
echo "Qualifica: ";
echo $testQualif;
echo "<br />";
$oggettoMrp->grado(SET, "semplice");
$testGrado = $oggettoMrp->grado(GET, "");
echo "Grado: ";
echo $testGrado;
echo "<br />";
$oggettoMrp->inizio_arruol(SET, "1943-09-08");
$testIniarr = $oggettoMrp->inizio_arruol(GET, "");
echo "Inizio arruolamento: ";
echo $testIniarr;
echo "<br />";
echo "Timestamp della data di inizio arruolamento: ";
echo $oggettoMrp->inizio_arruol_ts();
echo "<br />";
$oggettoMrp->fine_arruol(SET, "1945-04-25");
$testFinearr = $oggettoMrp->fine_arruol(GET, "");
echo "Fine arruolamento: ";
echo $testFinearr;
echo "<br />";
echo "Timestamp della data di fine arruolamento: ";
echo $oggettoMrp->fine_arruol_ts();
echo "<br />";
$oggettoMrp->nazionalit(SET, "Italia");
$testNazion = $oggettoMrp->nazionalit(GET, "");
echo "Nazionalita: ";
echo $testNazion;
echo "<br />";
$oggettoMrp->caduto(SET, "no");
$testCaduto = $oggettoMrp->caduto(GET, "");
echo "Caduto: ";
echo $testCaduto;
echo "<br />";
$oggettoMrp->luogomorte(SET, "niente");
$testLuogomor = $oggettoMrp->luogomorte(GET, "");
echo "Luogo morte: ";
echo $testLuogomor;
echo "<br />";
$oggettoMrp->data_morte(SET, "2001-05-03");
$testDatamor = $oggettoMrp->data_morte (GET, "");
echo "Data morte: ";
echo $testDatamor;
echo "<br />";
echo "Timestamp della data di morte: ";
echo $oggettoMrp->data_morte_ts();
echo "<br />";
$oggettoMrp->evento(SET, "test evento");
$testEvento = $oggettoMrp->evento(GET, "");
echo "Evento: ";
echo $testEvento;
echo "<br />";
$oggettoMrp->associato(SET, "si");
$testAssoc = $oggettoMrp->associato(GET, "");
echo "Associato: ";
echo $testAssoc;
echo "<br />";
$oggettoMrp->comitatopr(SET, "si");
$testComit = $oggettoMrp->comitatopr(GET, "");
echo "Comitatopr: ";
echo $testComit;
echo "<br />";
$oggettoMrp->commission(SET, "si");
$testCommiss = $oggettoMrp->commission(GET, "");
echo "Commissione: ";
echo $testCommiss;
echo "<br />";
$oggettoMrp->ferito(SET, "si");
$testFerit = $oggettoMrp->ferito(GET, "");
echo "Ferito: ";
echo $testFerit;
echo "<br />";
$oggettoMrp->mutilato(SET, "no");
$testMutil = $oggettoMrp->mutilato(GET, "");
echo "Mutilato: ";
echo $testMutil;
echo "<br />";
$oggettoMrp->note(SET, "prova ad inserire testo in note");
$testNote = $oggettoMrp->note(GET, "");
echo "Note: ";
echo $testNote;
echo "<br />";
$oggettoMrp->pubblica(SET, "no");
$testPubbl = $oggettoMrp->pubblica(GET, "");
echo "Pubblica: ";
echo $testPubbl;
echo "<br />";
$oggettoMrp->nome_batt(SET, "Luse");
$testNomebatt = $oggettoMrp->nome_batt(GET, "");
echo "Nome battaglia: ";
echo $testNomebatt;
echo "<br />";
$oggettoMrp->tipologia(SET, "test evento");
$testTipo = $oggettoMrp->tipologia(GET, "");
echo "Tipologia: ";
echo $testTipo;
echo "<br />";
$oggettoMrp->retrieve();
echo "Test del medoto retrieve<br />";
echo "==============================<br />";
echo $oggettoMrp->nome(GET, "");
echo $oggettoMrp->cognome(GET, "");
echo "<br>";
echo "test del metodo check()<br />";
//inserimento data incongruente(1)
$oggettoMrp->data_nasc(SET, "2012-01-01");
echo "<br />";
echo "Nuova data di nascita incongruente (test) : ";
echo $oggettoMrp->data_nasc(GET, "");
echo "<br />";
echo "Time stamp della data di nascita incongruente";
echo $oggettoMrp->data_nasc_ts();
echo "<br />";
echo "Data di morte che viene confrontata: ";
echo $oggettoMrp->data_morte(GET, "");
echo "<br />";
echo "Timestamp della data di morte: ";
echo $oggettoMrp->data_morte_ts();
$oggettoMrp->check();
if($oggettoMrp->iserrordata())
{
echo "<br />";
echo "Ci sono errori di congruenza nei dati";
echo "<br />";
}
echo "Numero errori di congruenza: ";
echo $oggettoMrp->nerrordata();
echo "<br />";
echo $oggettoMrp->errordata(0);
//inserimento di nome e cognome in bianco
$oggettoMrp->nome(SET, "");
$oggettoMrp->cognome(SET, "");
$oggettoMrp->check();
echo "<br />";
echo "Prova congruita' nome e cognome";
echo "<br />";
echo "Numero errori di congruita' : ";
echo $oggettoMrp->nerrordata();
echo "<br />";
for($i=0; $i<=$oggettoMrp->nerrordata(); $i++)
{
echo $oggettoMrp->errordata($i);
echo "<br /> ";
}
//prova creazione di un nuovo oggetto vuoto
echo "<br />";
$nuovooggetto = new mrpRobj(0);
$nuovooggetto->check();
echo "Prova congruita' nuovo oggetto in bianco";
echo "<br />";
echo "Numero errori di congruita' : ";
echo $nuovooggetto->nerrordata();
echo "<br />";
for($i=0; $i<=($nuovooggetto->nerrordata()-1); $i++)
{
echo $nuovooggetto->errordata($i);
echo "<br /> ";
}
?>
</font>
<hr align="center" noshade="" width="80%">
<font size="1" face="Arial, Lucida Grande, Verdana, Arial, Sans-Serif" color="black">
<blockquote>
<center><h7>Pagina scritta in Html e <a href="http://www.php.net/">PHP</a> da
<A HREF="mailto:a.bon6iorni@gmail.com">Attilio Bongiorni</a><br>
Classe mrpRobj </h7></font></center>
</blockquote>
</body>
</html>