示例#1
0
文件: evento.php 项目: vinik/hplt
 /**
  * Busca as aulas em aberto de um aluno
  *
  * @param int $id_aluno Id do aluno
  * 
  * @return array
  */
 function busca_aulas_em_aberto($id_aluno)
 {
     $lista_aulas = array();
     $this->db->select($this->key . "," . $this->fields);
     $this->db->distinct($this->key);
     $this->db->order_by('inicio', 'asc');
     $this->db->where('deleted', NAO);
     $this->db->where("(id_aluno1='" . $id_aluno . "' AND idpago_aluno1='n') OR (id_aluno2='" . $id_aluno . "' AND idpago_aluno2='n')");
     $query = $this->db->get($this->table_name, MAXIMO_RESULTADOS_BUSCA, 0);
     if ($query->num_rows() > 0) {
         foreach ($query->result_array() as $row) {
             $evento = new Evento();
             $evento->populate($row);
             array_push($lista_aulas, $evento);
         }
     }
     return $lista_aulas;
 }