7 /*****************************/
8 function Combobox_catorcenas($nombre="catorcena", $default=NULL, $cuantas = 26) {
9 global $MesInicio, $DiaInicio, $AnioInicio;
10 if ( !$default ) { $default=time(); }
11 $inicio=Obtener_catorcena_cercana($default);
12 $s='<select name="'.$nombre.'">';
13 for ($i=0; $i<$cuantas; $i++
){
14 $catorcena = strtotime("+13 day",$inicio);
15 if ( $default && $inicio == $default ) { $selected = ' selected="selected"'; } else { $selected = ""; }
16 $s.='<option value="'.$inicio.'"'.$selected.'>'."Del " . date('d-m-Y',$inicio) . ' al ' . date('d-m-Y',$catorcena) .'</option>';
17 $inicio = strtotime("+1 day",$catorcena);
23 function Obtener_catorcena_cercana ($referencia = NULL ) {
24 global $MesInicio, $DiaInicio, $AnioInicio;
25 if ( !$referencia ) { $referencia = time(); }
26 $inicio=mktime(0,0,0,$MesInicio,$DiaInicio,$AnioInicio);
27 if ($referencia < $inicio ) { return NULL;}
29 $catorcena = strtotime("+13 day",$inicio);
30 if (($referencia >= $inicio) && ($referencia <= $catorcena)) { return $inicio; }
31 $inicio = strtotime("+1 day",$catorcena);