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

Last change on this file since 2 was 2, checked in by root, 15 years ago

importo il progetto

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