source: trunk/admin/modules/Elezioni/funzionidata.php@ 45

Last change on this file since 45 was 36, checked in by roby, 15 years ago

rivista la funzione di importazione liste da altri siti, per la definizione delle affluenze limitate le date ai giorni previsti per la consultazione

File size: 2.6 KB
RevLine 
[2]1<?php
2// *****************************************************************************************************************************
3// Funzioni formattazione data e altro
4// *****************************************************************************************************************************
5
6
[36]7function giorno($min,$max)
[2]8{
9$giorno='';
[36]10if(!$min) $min='01';
11if(!$max) $max='31';
12$giorni=array();
13for($x=$min;$x<=$max;$x++) $giorni[]=$x;
14#$giorni= array('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31');
[2]15foreach($giorni as $gi)
16 $giorno .= "<option value=$gi>$gi</option>";
17$giorno .= "</select>";
18echo "$giorno";
19}
20
21
22function mese()
23{
24$mese='';
25$mesi= array('01','02','03','04','05','06','07','08','09','10','11','12');
26foreach($mesi as $me)
27 $mese .= "<option value=$me>$me </option>";
28$mese .= "</select>";
29echo "$mese";
30}
31
32function anno()
33{
34$anno ='';
35$curr=date("Y",time());
36$curr++;
37$anni=array($curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--);
38foreach($anni as $an)
39 $anno .= "<option value=$an>$an</option>";
40$anno .= "</select>";
41echo "$anno";
42}
43
[36]44function ore($min,$max)
[2]45{
46$ora='';
47$ore= array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24');
48foreach($ore as $ori)
49 $ora .= "<option value=$ori>$ori</option>";
50$ora .= "</select>";
51echo "$ora";
52}
53
54
55function minuti()
56{
57$minuto='';
58$minuti= array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14',
59'15', '16', '17', '18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33',
60'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50',
61'51','52','53','54','55','56','57','58','59');
62foreach($minuti as $minu)
63 $minuto .= "<option value=$minu>$minu </option>";
64$minuto .= "</select>";
65echo "$minuto";
66}
67
68function secondi()
69{
70$secondo='';
71$secondi= array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14',
72'15', '16', '17', '18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33',
73'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50',
74'51','52','53','54','55','56','57','58','59');
75foreach($secondi as $sec)
76 $secondo .= "<option value=$sec>$sec</option>";
77$secondo .= "</select>";
78echo "$secondo";
79}
80
81
82
83function form_data($data)
84
85 {
86 list($anno,$mese,$giorno) = explode("-", $data) ;
87 if ($giorno>0)
88 return("$giorno-$mese-$anno");
89 else
90 return("&nbsp; ");
91 }
92
93
94
95?>
Note: See TracBrowser for help on using the repository browser.