Registro de Personal
Registro de Personal
Martes, 16-Octubre-2018 15:25:44
PortadaMunicipioEconomíaCulturaOcioNoticias Usuario
Usuario 
Clave 
 
0) { $semana=1; $daysweek=","; $i=$primer_dia_mes; for ($j=1;$i<$dias_mes+$primer_dia_mes;$i++,$j++) { if (!(($i-1)%7)&&$j>1) { // salto de semana $semana++; } if ($week==$semana) { $daysweek.=$j.","; } } } $TMP_cont=0; while($row=sql_fetch_array($result,$RAD_dbi)) { $TMP_cont++; $calendaryear=substr($row[fecha],0,4); $xcalendarmes=substr($row[fecha],5,2); $calendarmes=$xcalendarmes*1; $xcalendardia=substr($row[fecha],8,2); $calendardia=$xcalendardia*1; if ($FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}!="") $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="
\n"; if ( ((eregi($calendardia.",", $daysweek))&&($month==$calendarmes)&&($year==$calendaryear)&&($week>0)) || (($day=="" || $day==$calendardia)&&($month=="0" || $month==$calendarmes)&&($year==$calendaryear)&&($week=="")) ) { if ($row[realizado]==0) { $calendar.="*"; if ($FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}!="") $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="
    "; $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}="*"; } else { $calendar.=" "; if ($FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}!="") $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="
    "; $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}=" "; } if (is_admin() || ($row[usuario]!="" && ($row[autor]==$row[usuario] || $row[autor]==$user))) { $calendar.="
"; $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="
"; } else { $calendar.="
"; $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="
"; } $calendar.="".$row[fecha]." ".$row[hora]." ".$row[literal]."\n"; $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="".substr($row[hora],0,5)." ".substr($row[literal],0,30)."\n"; // if($row[autor]!=$row[usuario] && $row[autor]!="") { // $calendar.="[".$row[autor]."]"; // $FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="[".$row[autor]."]"; // } $calendar.="
\n"; $FECHASHORA{$xcalendardia.$xcalendarmes.$calendaryear.substr($row[hora],0,2)}.=$FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}; } } if($day>0) { $dias=array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"); $numdiasemana=date("w",mktime (0,0,0,$month,$day,$year)); $nombredia=$dias[$numdiasemana]; if (strlen($month)=="1") $month="0".$month; $nameMonth="_DEF_NLSMonth".$month; if (defined("$nameMonth")) $xmes=constant("$nameMonth"); else $xmes="00"; $TMP_result=imprimeDia($year,$month*1,$day*1,$URLROI); $fechaHoy=$nombredia.", ".$day." ".$xmes." ".$year; } else if($month>0) { if (strlen($month)=="1") $month="0".$month; $nameMonth="_DEF_NLSMonth".$month; if (defined("$nameMonth")) $xmes=constant("$nameMonth"); else $xmes="00"; $TMP_result=imprimeMes($year,$month*1,$week,$URLROI); $fechaHoy=$xmes." ".$year; } else { $TMP_result=imprimeAno($year,$URLROI); $fechaHoy=$year; } $TMP_contenido=""; $TMP_contenido.="
AGENDA de $TMP_id. Fecha: $fechaHoy
$TMP_result
\n"; if ($func!="print") { if (is_user() && $TMP_id==base64_decode($HTTP_SESSION_VARS["SESSION_user"])) $TMP_contenido.="
Nuevo | "; $TMP_contenido.=" Imprimir      "; if ($TMP_cont>0) { if ($showpending=="") $TMP_contenido.="Muestra solo pendientes"; else $TMP_contenido.="Muestra todo"; } } return $TMP_contenido; } //---------------------------------------------------------------------------------------- function imprimeAno($ano,$ROI) { global $PHP_SELF, $V_dir, $V_mod, $SESSION_SID; if($ano == 0 || $ano == "") { $ano = date("Y"); } $prev_ano = $ano-1; $next_ano = $ano+1; $TMP_result.="
\n"; $TMP_result.=" < $prev_ano"; $TMP_result.="$next_ano > "; $TMP_result.="
\n"; $TMP_result.=imprimeMes($ano, 1, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 2, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 3, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 4, "", $ROI); $TMP_result.="
\n"; $TMP_result.=imprimeMes($ano, 5, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 6, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 7, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 8, "", $ROI); $TMP_result.="
\n"; $TMP_result.=imprimeMes($ano, 9, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 10, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 11, "", $ROI); $TMP_result.="\n"; $TMP_result.=imprimeMes($ano, 12, "", $ROI); $TMP_result.="
\n"; return $TMP_result; } //---------------------------------------------------------------------------------------- function imprimeMes($ano,$mes,$week,$ROI) { global $PHP_SELF, $V_dir, $V_mod, $FECHASHORA; $xmes=$mes; if (strlen($xmes)<2) $xmes="0".$xmes; if (strlen($xmes)<2) $xmes="0".$xmes; if (!(isset($ano))||($ano=="")) $ano=date("Y",mktime (0,0,0,date ("n"),1,date("Y"))); if (!(isset($mes))||($mes=="")) $mes=date("n",mktime (0,0,0,date ("n"),1,date("Y"))); if ($mes<1 || $mes>12) $mes=1; if ($mes=="1") { $mespost=$mes+1; $anopost=$ano; $mesprev=12; $anoprev=$ano-1; } else if ($mes=="12") { $mespost=1; $anopost=$ano+1; $mesprev=$mes-1; $anoprev=$ano; } else { $mespost=$mes+1; $anopost=$ano; $mesprev=$mes-1; $anoprev=$ano; } $primer_dia_mes=date("w",mktime (0,0,0,$mes,1,$ano)); if ($primer_dia_mes==0) {$primer_dia_mes=7;} // porque empieza en domingo $dias_mes=date("d",mktime (0,0,0,$mes+1,0,$ano)); $meses=array("",_DEF_NLSMonth01,_DEF_NLSMonth02,_DEF_NLSMonth03,_DEF_NLSMonth04,_DEF_NLSMonth05,_DEF_NLSMonth06,_DEF_NLSMonth07,_DEF_NLSMonth08,_DEF_NLSMonth09,_DEF_NLSMonth10,_DEF_NLSMonth11,_DEF_NLSMonth12); $nummes=$mes*1; $semana=1; $TMP_result.=""; if ($week>0) { if ($week==$semana) { $TMP_result.=""; } } else { $TMP_result.=""; } for ($i=1;$i<$primer_dia_mes;$i++) { if ($week>0) { if ($week==$semana) $TMP_result.=""; } else $TMP_result.=""; } for ($j=1;$i<$dias_mes+$primer_dia_mes;$i++,$j++) { // salto de semana $xdia=$j; if (strlen($xdia)<2) $xdia="0".$xdia; if (strlen($xdia)<2) $xdia="0".$xdia; if (!(($i-1)%7)&&$j>1) { $semana++; if ($week>0) { if ($week==$semana) { $TMP_result.=""; } } else { $TMP_result.=""; } } if ($week>0) { if ($week==$semana) { $TMP_result.=""; } } else { $TMP_result.=""; } } while (($i-1)%7) { // restantes casillas if ($week>0) { if ($week==$semana) $TMP_result.=""; } else $TMP_result.=""; $i++; } $TMP_result.="
 "; $TMP_result.=" ".$meses[$nummes]." ".$ano."
  L M X J V S D
 
   
 
 ".$j."
"; for ($jj=0;$jj<24;$jj++) { $xhora=$jj; if (strlen($xhora)<2) $xhora="0".$xhora; $TMP_result.=""; // $TMP_result.=""; } $TMP_result.=""; $TMP_result.="
".$FECHASHORA{$xdia.$xmes.$ano.$xhora}."
".$xhora." ".$FECHASHORA{$xdia.$xmes.$ano.$xhora}." 
".$FECHASHORA{$xdia.$xmes.$ano."24"}."
".$j."
"; for ($jj=0;$jj<24;$jj++) { $xhora=$jj; if (strlen($xhora)<2) $xhora="0".$xhora; $TMP_result.=""; // $TMP_result.=""; } $TMP_result.=""; $TMP_result.="
".$FECHASHORA{$xdia.$xmes.$ano.$xhora}."
".$xhora." ".$FECHASHORA{$xdia.$xmes.$ano.$xhora}." 
".$FECHASHORA{$xdia.$xmes.$ano."24"}."
  
"; return $TMP_result; } //---------------------------------------------------------------------------------------- function imprimeDia($ano,$mes,$dia,$ROI) { global $PHP_SELF, $V_dir, $V_mod, $FECHASHORA; $xmes=$mes; if (strlen($xmes)<2) $xmes="0".$xmes; if (strlen($xmes)<2) $xmes="0".$xmes; $xdia=$dia; if (strlen($xdia)<2) $xdia="0".$xdia; if (strlen($xdia)<2) $xdia="0".$xdia; if (!(isset($ano))||($ano=="")) $ano=date("Y",mktime (0,0,0,date ("n"),1,date("Y"))); if (!(isset($mes))||($mes=="")) $mes=date("n",mktime (0,0,0,date ("n"),1,date("Y"))); if (!(isset($dia))||($dia=="")) $dia=date("d",mktime (0,0,0,date ("n"),1,date("Y"))); if ($mes<1 || $mes>12) $mes=1; $hoy=mktime(0,0,0,$mes,$dia,$ano); $ayer=$hoy-86400; $manana=$hoy+86400; $anopost=date("Y",$manana); $mespost=date("n",$manana); $diapost=date("d",$manana); $anoprev=date("Y",$ayer); $mesprev=date("n",$ayer); $diaprev=date("d",$ayer); $primer_dia_mes=date("w",mktime (0,0,0,$mes,1,$ano)); if ($primer_dia_mes==0) {$primer_dia_mes=7;} // porque empieza en domingo $dias_mes=date("d",mktime (0,0,0,$mes+1,0,$ano)); $meses=array("","Enero","Feb.","Marzo","Abril","Mayo","Junio","Julio","Ago.","Sept.","Oct.","Nov.","Dic."); $nummes=$mes*1; $TMP_result.=""; for ($j=0;$j<24;$j++) { $hora=$j; if (strlen($hora)<2) $hora="0".$hora; $TMP_result.=""; } $TMP_result.=""; $TMP_result.="
"; $TMP_result.=" ".$dia." ".$meses[$nummes]." ".$ano."
".$hora." ".$FECHASHORA{$xdia.$xmes.$ano.$hora}." 
".$FECHASHORA{$xdia.$xmes.$ano."24"}." 
"; return $TMP_result; } //---------------------------------------------------------------------------------------- function misUserNoticias() { global $PHP_SELF, $RAD_dbi, $SESSION_SID, $V_dir, $V_mod, $year, $week, $month, $day, $showpending, $HTTP_SESSION_VARS, $user, $FECHASHORA; $TMP_cont=0; $TMP_condition=""; $resultn = sql_query("SELECT * FROM categorias WHERE categoria='news'",$RAD_dbi); while($TMP_row = sql_fetch_array($resultn, $RAD_dbi)) { if ($TMP_cont==0) $TMP_condition="AND ( idcat='".$TMP_row[id]."' OR idcat LIKE '%,".$TMP_row[id].",%'"; else $TMP_condition=$TMP_condition." OR idcat='".$TMP_row[id]."' OR idcat LIKE '%,".$TMP_row[id].",%'"; $TMP_cont++; } if ($TMP_cont>0) $TMP_condition.=")"; $fechaini=strtotime("$year-01-01 00:00:00")-1; $fechafin=strtotime("$year-12-31 23:59:59")+1; if (is_user()) $resultn = sql_query("SELECT * FROM contenidos WHERE fechacalendario<$fechafin AND fechacalendario>$fechaini AND activo!='0' $TMP_condition ORDER BY fechacalendario",$RAD_dbi); else $resultn = sql_query("SELECT * FROM contenidos WHERE fechacalendario<$fechafin AND fechacalendario>$fechaini AND activo!='0' AND publico!='0' $TMP_condition ORDER BY fechacalendario",$RAD_dbi); while($TMP_row = sql_fetch_array($resultn, $RAD_dbi)) { $xdia=date("d",$TMP_row[fechacalendario]); $xmes=date("m",$TMP_row[fechacalendario]); $ano=date("Y",$TMP_row[fechacalendario]); $xhora=date("H",$TMP_row[fechacalendario]); $xmin=date("i",$TMP_row[fechacalendario]); if ($FECHASHORA{$xdia.$xmes.$ano.$xhora}!="") $FECHASHORA{$xdia.$xmes.$ano.$xhora}.="
    "; $FECHASHORA{$xdia.$xmes.$ano.$xhora}.="".$xhora.":".$xmin." ".substr($TMP_row[tema],0,35)."\n"; } } //---------------------------------------------------------------------------------------- function misUserMedidas() { global $PHP_SELF, $RAD_dbi, $SESSION_SID, $V_dir, $V_mod, $year, $week, $month, $day, $showpending, $HTTP_SESSION_VARS, $user, $FECHASHORA; $TMP_cont=0; $TMP_condition=""; $fechaini=strtotime("$year-01-01 00:00:00")-1; $fechafin=strtotime("$year-12-31 23:59:59")+1; if (is_user()) $resultn = sql_query("SELECT * FROM GIE_recursosmedidas WHERE fechasgtemedida<$fechafin AND fechasgtemedida>$fechaini $TMP_condition ORDER BY fechasgtemedida",$RAD_dbi); else $resultn = sql_query("SELECT * FROM GIE_recursosmedidas WHERE fechasgtemedida<$fechafin AND fechasgtemedida>$fechaini $TMP_condition ORDER BY fechasgtemedida",$RAD_dbi); while($TMP_row = sql_fetch_array($resultn, $RAD_dbi)) { $resultn2 = sql_query("SELECT * FROM GIE_recursos WHERE idrecurso='".$TMP_row[idrecurso]."'",$RAD_dbi); $TMP_rowrecurso = sql_fetch_array($resultn2, $RAD_dbi); $resultn2 = sql_query("SELECT * FROM GIE_recursosparametros WHERE idparametro='".$TMP_row[idparametro]."'",$RAD_dbi); $TMP_rowparametro = sql_fetch_array($resultn2, $RAD_dbi); $xdia=date("d",$TMP_row[fechasgtemedida]); $xmes=date("m",$TMP_row[fechasgtemedida]); $ano=date("Y",$TMP_row[fechasgtemedida]); $xhora=date("H",$TMP_row[fechasgtemedida]); $xmin=date("i",$TMP_row[fechasgtemedida]); if ($FECHASHORA{$xdia.$xmes.$ano."24"}!="") $FECHASHORA{$xdia.$xmes.$ano."24"}.="
    "; $FECHASHORA{$xdia.$xmes.$ano."24"}.="".$xhora.":".$xmin." medir:".substr($TMP_rowrecurso[recurso],0,25)."-".$TMP_rowparametro[parametro]."\n"; } } //---------------------------------------------------------------------------------------- function misUserTareas($TMP_id) { global $PHP_SELF, $RAD_dbi, $SESSION_SID, $V_dir, $V_mod, $year, $week, $month, $day, $showpending, $HTTP_SESSION_VARS, $user, $FECHASHORA; if($month == "") { $month = date("m"); } if($year == 0 || $year == "") { $year = date("Y"); } $cmdSQL="SELECT * FROM modulos WHERE fichero='mistareas'"; $result=sql_query($cmdSQL, $RAD_dbi); $row=sql_fetch_array($result,$RAD_dbi); $TMP_dir=$row[directorio]; $cmdSQL="SELECT * FROM GIE_personal WHERE usuario='$TMP_id'"; $result=sql_query($cmdSQL, $RAD_dbi); $row=sql_fetch_array($result,$RAD_dbi); $TMP_idpersona=$row[idpersona]; if ($showpending!="") $cmdSQL="SELECT * FROM GIE_tareas WHERE (idpersona='$TMP_idpersona' OR idpersona LIKE '%,$TMP_idpersona,%') AND porcentajeocupacion!='100' ORDER BY fecha_inicio,hora_inicio"; else $cmdSQL="SELECT * FROM GIE_tareas WHERE (idpersona='$TMP_idpersona' OR idpersona LIKE '%,$TMP_idpersona,%') ORDER BY fecha_inicio,hora_inicio"; $result=sql_query($cmdSQL, $RAD_dbi); $cont=0; $primer_dia_mes=date("w",mktime (0,0,0,$month,1,$year)); if ($primer_dia_mes==0) { $primer_dia_mes=7; } $dias_mes=date("d",mktime (0,0,0,$month+1,0,$year)); if ($week>0) { $semana=1; $daysweek=","; $i=$primer_dia_mes; for ($j=1;$i<$dias_mes+$primer_dia_mes;$i++,$j++) { if (!(($i-1)%7)&&$j>1) { // salto de semana $semana++; } if ($week==$semana) { $daysweek.=$j.","; } } } while($row=sql_fetch_array($result,$RAD_dbi)) { $fecha=$row[fecha_inicio]; $fechafin=$row[fecha_fin]; $fechaG=RAD_GregorianToJD (substr($fecha,5,2),substr($fecha,8,2),substr($fecha,0,4)); $fechaGfin=RAD_GregorianToJD (substr($fechafin,5,2),substr($fechafin,8,2),substr($fechafin,0,4)); $numdias=$fechaGfin-$fechaG; if ($numdias<1) $numdias=1; for ($j=0;$j<$numdias;$j++) { $gregorian = RAD_JDToGregorian ($j+$fechaG); $TMP_arr = explode ("/", $gregorian); $calendaryear=$TMP_arr[2]; $xcalendarmes=$TMP_arr[0]; if (strlen($xcalendarmes)<2) $xcalendarmes="0".$xcalendarmes; if (strlen($xcalendarmes)<2) $xcalendarmes="0".$xcalendarmes; $calendarmes=$xcalendarmes*1; $nameMonth="_DEF_NLSMonth".$xcalendarmes; if (defined("$nameMonth")) $xmes=constant("$nameMonth"); else $xmes="00"; $xcalendardia=$TMP_arr[1]; if (strlen($xcalendardia)<2) $xcalendardia="0".$xcalendardia; if (strlen($xcalendardia)<2) $xcalendardia="0".$xcalendardia; $calendardia=$xcalendardia*1; $fecha=$calendaryear."-".$xcalendarmes."-".$xcalendardia; if ($FECHASHORA{$xcalendardia.$xcalendarmes.$calendaryear."24"}!="") $FECHASHORA{$xcalendardia.$xcalendarmes.$calendaryear."24"}.="
\n"; if ( ((eregi($calendardia.",", $daysweek))&&($month==$calendarmes)&&($year==$calendaryear)&&($week>0)) || (($day=="" || $day==$calendardia)&&($month=="0" || $month==$calendarmes)&&($year==$calendaryear)&&($week=="")) ) { if ($row[porcentajeocupacion]==100) { $calendar.=" "; $TMP_FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}=" "; } else { $calendar.="*"; $TMP_FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}="*"; } $calendar.="
"; $TMP_FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="
"; $calendar.=$fecha." ".$row[descripcion]."\n"; $calendar.="
\n"; $TMP_FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}.="[".$row[porcentajeocupacion]."%] ".substr($row[descripcion],0,25)."\n"; if ($FECHASHORA{$xcalendardia.$xcalendarmes.$calendaryear."24"}!="") $FECHASHORA{$xcalendardia.$xcalendarmes.$calendaryear."24"}.="
    "; $FECHASHORA{$xcalendardia.$xcalendarmes.$calendaryear."24"}.=$TMP_FECHAS{$xcalendardia.$xcalendarmes.$calendaryear}; } } } } ?>