error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); session_start(); require 'db.class.php'; require 'conf.class.php'; require 'fecha.php'; $bd=Db::getInstance(); setlocale(LC_ALL,"es_ES@euro","es_ES","esp"); date_default_timezone_set('America/Mexico_City'); //Para utilizar la función, se le manda una fecha como parámetro, por ejemplo, si se quisiera imprimir la fecha actual, utilizaríamos el siguiente código: $dia= strftime("%d"); $mes= strftime("%B"); $calen=$_GET["datepicker"]; if (!empty($calen)){ $dia=$calen[8].$calen[9]; // $mes=$calen[5].$calen[6]; } $elmenu=2; $toy=2; $aid=$_SESSION['aid']; $anombre=$_SESSION['anombre']; $atiene=$_SESSION['permisoUA']; $secc=$_GET['secc']; if ($secc!=''){ $_SESSION['lasecces']=$secc; } $secc=$_SESSION['lasecces']; $secc1=$_GET['secc1']; if ($secc1>0){ $cad=' and id='.$secc1.' '; } $abcd=array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","Ñ","O","P","Q","R","S","T","U","V","W","X","Y","Z"); $id=$_GET['id']; function cmes($mes) { if ($mes==0) { $mletra='GENERAL'; } if ($mes==1) { $mletra='ENERO'; } if ($mes==2) { $mletra='FEBRERO'; } if ($mes==3) { $mletra='MARZO'; } if ($mes==4) { $mletra='ABRIL'; } if ($mes==5) { $mletra='MAYO'; } if ($mes==6) { $mletra='JUNIO'; } if ($mes==7) { $mletra='JULIO'; } if ($mes==8) { $mletra='AGOSTO'; } if ($mes==9) { $mletra='SEPTIEMBRE'; } if ($mes==10) { $mletra='OCTUBRE'; } if ($mes==11) { $mletra='NOVIEMBRE'; } if ($mes==12) { $mletra='DICIEMBRE'; } return ($mletra); } $fecha=$_POST['fecha']; if ($fecha==''){ $fecha='2012-G'; } $fechaw=explode("-",$fecha); $elano=$fechaw[0]; $elmes=$fechaw[1]; if ($fecha!=''){ if ($elmes=="G"){ $bax=$bd->ejecutar("select * from fracc_contenido where fracc=$id and mes='0' order by id desc"); } else if ($elmes=="T"){ $bax=$bd->ejecutar("select * from fracc_contenido where fracc=$id and ano=$elano order by ano desc, mes asc"); } else { $bax=$bd->ejecutar("select * from fracc_contenido where fracc=$id and ano=$elano and mes=$elmes order by ano desc, mes asc"); } } else { $baxx=$bd->ejecutar("select * from fracc_contenido where fracc=$id order by ano desc, mes asc limit 1"); $kba=$bd->obtener_fila($baxx,0); $elano=$kba['ano']; $elmes='T'; $bax=$bd->ejecutar("select * from fracc_contenido where fracc=$id and ano=$elano order by ano desc, mes asc"); } ?>