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

Last change on this file since 161 was 139, checked in by roby, 12 years ago

Modifiche per gestione Legge regione Sicilia 2011

File size: 3.2 KB
RevLine 
[2]1<?php
2// *****************************************************************************************************************************
3// Funzioni formattazione data e altro
4// *****************************************************************************************************************************
5
6
[36]7function giorno($min,$max)
[2]8{
9$giorno='';
[79]10if(!$min) $min='1';
[36]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++;
[97]37$anni=array($curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--);
[2]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
[139]93function isdisgiunto()
94{
95global $prefix,$dbi,$id_cons,$limite,$fascia,$ops;
96 #voti di lista e di gruppo completamente disgiunti
97 $result = mysql_query("select infdisgiunto, supdisgiunto from ".$prefix."_ele_conf as t2 left join ".$prefix."_ele_cons_comune as t1 on t1.id_conf=t2.id_conf where id_cons = '$id_cons' ", $dbi);
98 $glsep='';
99 if ($result) {
100 list($infdis,$supdis)=mysql_fetch_row($result);
101 if((($fascia>$limite and $supdis) or ($fascia<$limite and $infdis)))
102 $glsep='_lista';
103 }
104return $glsep;
105}
[2]106
107?>
Note: See TracBrowser for help on using the repository browser.