public function get_filtros()
 {
     $duracion = $this->input->get("duracion");
     $es_hd = $this->input->get("es_hd") !== NULL ? (int) $this->input->get("es_hd") : -1;
     $where = " 1 = 1 ";
     if ((int) $es_hd >= 0) {
         $where .= " AND ele.es_hd = {$es_hd}";
     }
     if (!empty($duracion)) {
         $duracion = $this->db->escape_str($duracion);
         $where .= " AND ele.duracion = '{$duracion}'";
     }
     //Genéricos
     $fecha_subida = $this->input->get("fecha_subida");
     $texto_libre = $this->db->escape_str($this->input->get("texto"));
     if (!empty($texto_libre)) {
         $where .= " AND a.titulo LIKE '%{$texto_libre}%'";
     }
     $fecha_subida_mysql = human_to_mysql_date($fecha_subida);
     if (!empty($fecha_subida) and es_fecha_valida($fecha_subida_mysql)) {
         $where .= " AND DATE_FORMAT(a.fecha_subida, '%Y-%m-%d') = '{$fecha_subida_mysql}'";
     }
     return $where;
 }
 public function get_filtros()
 {
     $autor = $this->input->get("autor");
     $where = " 1 = 1 ";
     if (!empty($autor)) {
         $autor = $this->db->escape_like_str($autor);
         $where .= " AND ele.autor = '{$autor}'";
     }
     //Genéricos
     $fecha_subida = $this->input->get("fecha_subida");
     $texto_libre = $this->db->escape_str($this->input->get("texto"));
     if (!empty($texto_libre)) {
         $where .= " AND a.titulo LIKE '%{$texto_libre}%'";
     }
     $fecha_subida_mysql = human_to_mysql_date($fecha_subida);
     if (!empty($fecha_subida) and es_fecha_valida($fecha_subida_mysql)) {
         $where .= " AND DATE_FORMAT(a.fecha_subida, '%Y-%m-%d') = '{$fecha_subida_mysql}'";
     }
     return $where;
 }
 /**
  * Convierte la hora de formato humano (argentina) a MySQL
  * 26-03-2014
  * @author Diego Olmedo
  * @access	public
  * @param	string Fecha y hora en formato dd-mm-yyyy hh:ii:ss ó dd/mm/yyyy hh:ii:ss
  * @return	string la fecha en formato yyyy-mm-dd hh:ii:ss
  */
 function human_to_mysql_datetime($fechaHora)
 {
     if (empty($fechaHora)) {
         return FALSE;
     }
     $fechaHora = explode(" ", trim($fechaHora));
     $fecha = human_to_mysql_date($fechaHora[0]);
     $hora = human_to_mysql_time($fechaHora[1]);
     return $fecha . " " . $hora;
 }
 public function get_filtros()
 {
     $fecha_subida = $this->input->get("fecha_subida");
     $texto_libre = $this->input->get("texto");
     $ancho = (int) $this->input->get("ancho");
     $alto = (int) $this->input->get("alto");
     $id_categoria = (int) $this->input->get("categoria");
     $where = " 1 = 1 ";
     if ((int) $id_categoria > 0) {
         $where .= " AND ac.id_mm_categoria = {$id_categoria}";
     }
     if ((int) $ancho > 0) {
         $where .= " AND f.ancho = {$ancho}";
     }
     if ((int) $alto > 0) {
         $where .= " AND f.alto = {$alto}";
     }
     //Genéricos
     $fecha_subida = $this->input->get("fecha_subida");
     $texto_libre = $this->db->escape_str($this->input->get("texto"));
     if (!empty($texto_libre)) {
         $where .= " AND a.titulo LIKE '%{$texto_libre}%'";
     }
     $fecha_subida_mysql = human_to_mysql_date($fecha_subida);
     if (!empty($fecha_subida) and es_fecha_valida($fecha_subida_mysql)) {
         $where .= " AND DATE_FORMAT(a.fecha_subida, '%Y-%m-%d') = '{$fecha_subida_mysql}'";
     }
     return $where;
 }