[2] | 1 | <?php
|
---|
| 2 | // *****************************************************************************************************************************
|
---|
| 3 | // Funzioni formattazione data e altro
|
---|
| 4 | // *****************************************************************************************************************************
|
---|
| 5 |
|
---|
| 6 |
|
---|
[36] | 7 | function giorno($min,$max)
|
---|
[2] | 8 | {
|
---|
| 9 | $giorno='';
|
---|
[79] | 10 | if(!$min) $min='1';
|
---|
[36] | 11 | if(!$max) $max='31';
|
---|
| 12 | $giorni=array();
|
---|
| 13 | for($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] | 15 | foreach($giorni as $gi)
|
---|
| 16 | $giorno .= "<option value=$gi>$gi</option>";
|
---|
| 17 | $giorno .= "</select>";
|
---|
| 18 | echo "$giorno";
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | function mese()
|
---|
| 23 | {
|
---|
| 24 | $mese='';
|
---|
| 25 | $mesi= array('01','02','03','04','05','06','07','08','09','10','11','12');
|
---|
| 26 | foreach($mesi as $me)
|
---|
| 27 | $mese .= "<option value=$me>$me </option>";
|
---|
| 28 | $mese .= "</select>";
|
---|
| 29 | echo "$mese";
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | function 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] | 38 | foreach($anni as $an)
|
---|
| 39 | $anno .= "<option value=$an>$an</option>";
|
---|
| 40 | $anno .= "</select>";
|
---|
| 41 | echo "$anno";
|
---|
| 42 | }
|
---|
| 43 |
|
---|
[254] | 44 | function ore()
|
---|
[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');
|
---|
| 48 | foreach($ore as $ori)
|
---|
| 49 | $ora .= "<option value=$ori>$ori</option>";
|
---|
| 50 | $ora .= "</select>";
|
---|
| 51 | echo "$ora";
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 |
|
---|
| 55 | function 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');
|
---|
| 62 | foreach($minuti as $minu)
|
---|
| 63 | $minuto .= "<option value=$minu>$minu </option>";
|
---|
| 64 | $minuto .= "</select>";
|
---|
| 65 | echo "$minuto";
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 | function 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');
|
---|
| 75 | foreach($secondi as $sec)
|
---|
| 76 | $secondo .= "<option value=$sec>$sec</option>";
|
---|
| 77 | $secondo .= "</select>";
|
---|
| 78 | echo "$secondo";
|
---|
| 79 | }
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 |
|
---|
| 83 | function 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(" ");
|
---|
| 91 | }
|
---|
| 92 |
|
---|
[139] | 93 | function isdisgiunto()
|
---|
| 94 | {
|
---|
[188] | 95 | global $prefix,$dbi,$id_cons,$limite,$id_comune,$ops;
|
---|
| 96 | $sqlcomu="select fascia from ".$prefix."_ele_comuni where id_comune='$id_comune'";
|
---|
| 97 | $res = mysql_query($sqlcomu);
|
---|
| 98 | list($fascia)=mysql_fetch_row($res);
|
---|
[139] | 99 | #voti di lista e di gruppo completamente disgiunti
|
---|
| 100 | $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);
|
---|
| 101 | $glsep='';
|
---|
| 102 | if ($result) {
|
---|
| 103 | list($infdis,$supdis)=mysql_fetch_row($result);
|
---|
[188] | 104 | if((($fascia>$limite and $supdis) or ($fascia<=$limite and $infdis)))
|
---|
[139] | 105 | $glsep='_lista';
|
---|
| 106 | }
|
---|
| 107 | return $glsep;
|
---|
| 108 | }
|
---|
[2] | 109 |
|
---|
[189] | 110 |
|
---|
| 111 |
|
---|
[192] | 112 |
|
---|
[189] | 113 | #########################################
|
---|
| 114 |
|
---|
| 115 | ?>
|
---|