[2] | 1 | <?php
|
---|
| 2 | // *****************************************************************************************************************************
|
---|
| 3 | // Funzioni formattazione data e altro
|
---|
| 4 | // *****************************************************************************************************************************
|
---|
| 5 |
|
---|
| 6 |
|
---|
| 7 | function 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');
|
---|
| 11 | foreach($giorni as $gi)
|
---|
| 12 | $giorno .= "<option value=$gi>$gi</option>";
|
---|
| 13 | $giorno .= "</select>";
|
---|
| 14 | echo "$giorno";
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 |
|
---|
| 18 | function mese()
|
---|
| 19 | {
|
---|
| 20 | $mese='';
|
---|
| 21 | $mesi= array('01','02','03','04','05','06','07','08','09','10','11','12');
|
---|
| 22 | foreach($mesi as $me)
|
---|
| 23 | $mese .= "<option value=$me>$me </option>";
|
---|
| 24 | $mese .= "</select>";
|
---|
| 25 | echo "$mese";
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | function anno()
|
---|
| 29 | {
|
---|
| 30 | $anno ='';
|
---|
| 31 | $curr=date("Y",time());
|
---|
| 32 | $curr++;
|
---|
| 33 | $anni=array($curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--,$curr--);
|
---|
| 34 | foreach($anni as $an)
|
---|
| 35 | $anno .= "<option value=$an>$an</option>";
|
---|
| 36 | $anno .= "</select>";
|
---|
| 37 | echo "$anno";
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | function 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');
|
---|
| 44 | foreach($ore as $ori)
|
---|
| 45 | $ora .= "<option value=$ori>$ori</option>";
|
---|
| 46 | $ora .= "</select>";
|
---|
| 47 | echo "$ora";
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | function 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');
|
---|
| 58 | foreach($minuti as $minu)
|
---|
| 59 | $minuto .= "<option value=$minu>$minu </option>";
|
---|
| 60 | $minuto .= "</select>";
|
---|
| 61 | echo "$minuto";
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | function 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');
|
---|
| 71 | foreach($secondi as $sec)
|
---|
| 72 | $secondo .= "<option value=$sec>$sec</option>";
|
---|
| 73 | $secondo .= "</select>";
|
---|
| 74 | echo "$secondo";
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 | function 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(" ");
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 |
|
---|
| 90 |
|
---|
| 91 | ?>
|
---|