function __construct($alu_id, $db) { $this->db = $db; //$this->db->_DEBUG = 1; $this->db->executa($this->db->getJoinRecord("alunos(=)movalunos|alu_movid=mov_id\n\t\t (+)procedencias|alu_procedid=pro_id\n\t\t (+)ruas|alu_ruaid=rua_id\n\t\t (+)bairros|alu_baiid=bai_id\n\t\t (+)instituicoes|ins_id=mov_insid\n\t\t (+)turmas|tur_id=mov_turid", "alu_id={$alu_id}", "", 0), true, "aluno"); $rscam = $this->db->getAttTable("alunos"); while ($ln = $this->db->fetch_array($rscam)) { $this->{$ln}["attname"] = $this->db->aluno[$ln["attname"]]; } $rsmov = $this->db->getAttTable("movalunos"); while ($ln = $this->db->fetch_array($rsmov)) { $this->{$ln}["attname"] = $this->db->aluno[$ln["attname"]]; } $this->pro_nome = $this->db->aluno["pro_nome"]; $this->bai_descr = $this->db->aluno["bai_descr"]; $this->rua_nome = $this->db->aluno["rua_nome"]; $this->alu_dtnasc = strformat($this->alu_dtnasc, "dtbr"); $this->mov_dtentrada = strformat($this->mov_dtentrada, "dtbr"); $this->ins_nome = $this->db->aluno["ins_nome"]; $this->tur_nome = $this->db->aluno["tur_nome"]; if ($this->mov_turid != null) { if (class_exists(turma)) { $turma = new turma($this->mov_turid, $this->db); } else { require "../libs/classes/classe_turmas.php"; $turma = new turma($this->mov_turid, $this->db); } $this->tur_nome .= " " . $turma->descturma(); $this->tur_tipo = $turma->tur_tipo; } if ($this->alu_id != null) { $this->db->executa($this->db->getAll("histserie", "hse_aluid = " . $this->alu_id, "hse_ano desc limit 1", 0), true, "hse"); } $this->hse_resfim = $this->db->hse["hse_resfim"]; $this->hse_ano = $this->db->hse["hse_ano"]; $this->hse_serie = $this->db->hse["hse_serie"]; }
function sitAluno($alu_id) { global $db; $sql = "select tur_nome,\n\t alu_nome,\n\t tur_id,\n\t tur_modalidade,\n\t to_char(mov_dtentrada,'dd/mm/yyyy') as mov_dtentrada,\n\t to_char(mov_dtsaida,'dd/mm/yyyy') as mov_dtsaida,\n\t to_char(alu_dtnasc,'dd/mm/yyyy') as alu_dtnasc,\n\t date_part('YEAR', age(current_date,alu_dtnasc)) as ano,\n\t date_part('MONTH',age(current_date,alu_dtnasc)) as mes,\n\t stp_descr,\n\t mov_serie \n\t from alunos left outer join movalunos on alu_movid = mov_id\n\t inner join turmas on tur_id = mov_turid \n\t left outer join sittipos on stp_id = \n\t (case when mov_tiposaida is not null then mov_tiposaida\n\t else mov_tipoentrada end) \n\t where alu_id = {$alu_id}"; $rs = pg_query($sql); $cturma = new turma(@pg_result($rs, 0, "tur_id"), $db); $serie = ''; if (@pg_result($rs, 0, "tur_modalidade") == 2) { $serie = @pg_result($rs, 0, "mov_serie") . "ª "; } echo "\n <tr>\n <td> </td><td><br>\n <Table>\n <tr>\n <td><b>Turma:<b></td><td bgcolor='white'>" . @pg_result($rs, 0, "tur_nome") . " {$serie} " . $cturma->descturma() . "</td> \n </tr>\n <tr>\n <td><b>Data Matrícula:</b></td><td id='infmovdtentrada' style='background-color:white'>" . @pg_result($rs, 0, "mov_dtentrada") . "</td>\n <td> <b>Data Nasc:</b></td><td style='background-color:white'>" . @pg_result($rs, 0, "alu_dtnasc") . " - " . @pg_result($rs, 0, "ano") . " anos\n </tr>\n <tr>\n <td> <b>Data Alteração:</b></td><td id='infmovdtsaida' style='background-color:white'>" . @pg_result($rs, 0, "mov_dtsaida") . "</td>\n <td> <b>Situação:</b></td><td style='background-color:white'>" . @pg_result($rs, 0, "stp_descr") . "</td>\n </tr>\n <tr>\n <td><br></td> \n </table>\n </td>"; }