Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
/vendor/
*~
*.swp
src/replicado_queries
composer.lock
.phpunit.result.cache

.idea

# index.php used for test
index.php
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
/public/vendor/

# test
test.php
log.log
credentials.php
# pasta onde guardo coisas que ando testando
/teste/

# netbeans
nbproject/
# init lando
.lando.yml
# lando dockerfile php extensions
Dockerfile.custom
# lando php.ini
php.ini

# phpdoc
docs/phpdoc-cache*

sandbox/
# vim bkp
*~
*.swp

test*.php
# Curso graduação x Habilitação x Setor
/storage/curhabset.json

/docs/
# DDEV
/.ddev
core.*
43 changes: 38 additions & 5 deletions src/Graduacao.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public static function verifica($codpes, $codundclgi)
) {
return true;
}

}
}
return false;
Expand Down Expand Up @@ -176,15 +175,15 @@ public static function nomeHabilitacao($codhab, $codcur)
return $result;
}

public static function obterCursosHabilitacoes($codundclgi)
public static function obterCursosHabilitacoes($codundclg)
{
$query = " SELECT CURSOGR.*, HABILITACAOGR.* FROM CURSOGR, HABILITACAOGR";
$query .= " WHERE (CURSOGR.codclg = convert(int, :codundclgi)) AND (CURSOGR.codcur = HABILITACAOGR.codcur)";
$query .= " WHERE (CURSOGR.codclg IN (:codundclgi)) AND (CURSOGR.codcur = HABILITACAOGR.codcur)";
$query .= " AND ( (CURSOGR.dtaatvcur IS NOT NULL) AND (CURSOGR.dtadtvcur IS NULL) )";
$query .= " AND ( (HABILITACAOGR.dtaatvhab IS NOT NULL) AND (HABILITACAOGR.dtadtvhab IS NULL) )";
$query .= " ORDER BY CURSOGR.nomcur, HABILITACAOGR.nomhab ASC";
$param = [
'codundclgi' => $codundclgi,
'codundclg' => $codundclg,
];
return DB::fetchAll($query, $param);
}
Expand Down Expand Up @@ -373,6 +372,39 @@ public static function disciplinasEquivalentesCurriculo($codcur, $codhab)
return DB::fetchAll($query, $param);
}

/**
* Retorna o setor de um aluno
* É igual ao método setorAluno, mas chama o método obterCursoAtivo, que permite mais de um codundclg
*
* @param Int $codpes
* @param $codundclg
* @return Array(nomabvset)
*/
public static function obterSetorAluno($codpes, $codundclg)
{

$codundclg = $codundclg ?: getenv('REPLICADO_CODUNDCLGS');
$codundclg = $codundclg ?: getenv('REPLICADO_CODUNDCLG');

$codcur = self::obterCursoAtivo($codpes)['codcur'];
$codhab = self::obterCursoAtivo($codpes)['codhab'];
$query = " SELECT TOP 1 L.nomabvset FROM CURSOGRCOORDENADOR AS C
INNER JOIN LOCALIZAPESSOA AS L ON C.codpesdct = L.codpes
WHERE C.codcur = CONVERT(INT, :codcur) AND C.codhab = CONVERT(INT, :codhab)";
$param = [
'codcur' => $codcur,
'codhab' => $codhab,
];
$result = DB::fetch($query, $param);
// Nota: Situação a se tratar com log de ocorrências
// Se o departamento de ensino do alguno de graduação não foi encontrado
if ($result == false) {
// Será retornado 'DEPARTAMENTO NÃO ENCONTRADO' a fim de se detectar as situações ATÍPICAS em que isso ocorre
$result = ['nomabvset' => 'DEPARTAMENTO NÃO ENCONTRADO'];
}
return $result;
}

/**
* Departamento de Ensino do Aluno de Graduação
*
Expand Down Expand Up @@ -772,7 +804,8 @@ public static function listarDisciplinasAlunoAnoSemestre(int $codpes, int $anoSe
* @return Array
* @author Kawan Santana, em 19/03/2024
*/
public static function listarDepartamentosDeEnsino(){
public static function listarDepartamentosDeEnsino()
{
$query = DB::getQuery('Graduacao.listarDepartamentosDeEnsino.sql');
return DB::fetchAll($query);
}
Expand Down
1 change: 0 additions & 1 deletion src/Pessoa.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public static function email($codpes)
if (trim($row['stamtr']) == 'S') {
return $row['codema'];
}

}
return false;
}
Expand Down