Commit 2f293d6e authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

add listagens de colunas

parent c6f51e2f
...@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Dimensao; ...@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Dimensao;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Curso; use App\Models\Curso;
use App\Models\Tabelas\Ensino\EnsinoAula;
use App\Queries\CursoQuery; use App\Queries\CursoQuery;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
...@@ -23,10 +24,15 @@ class EnsinoController extends Controller ...@@ -23,10 +24,15 @@ class EnsinoController extends Controller
$user = Auth::user(); $user = Auth::user();
$cursos = (new CursoQuery())->getQuery()->get(); $cursos = (new CursoQuery())->getQuery()->get();
$niveis = EnsinoAula::listNivel();
$modalidades = EnsinoAula::listModalidade();
return view('pad.dimensao.ensino', [ return view('pad.dimensao.ensino', [
'index_menu' => self::MENU_PAD, 'pad_id' => 1,
'cursos' => $cursos, 'cursos' => $cursos,
'pad_id' => 1 'niveis' => $niveis,
'modalidades' => $modalidades,
'index_menu' => self::MENU_PAD,
]); ]);
} }
} }
...@@ -42,7 +42,7 @@ class EnsinoAula extends Model ...@@ -42,7 +42,7 @@ class EnsinoAula extends Model
/** /**
* @return array|string * @return array|string
*/ */
public function listNivel($value = null) { public static function listNivel($value = null) {
$values = [ $values = [
self::NIVEL_GRADUACAO => 'Graduação', self::NIVEL_GRADUACAO => 'Graduação',
self::NIVEL_POS_GRADUACAO_LATO_SENSU => 'Pós-graduação Stricto Sensu', self::NIVEL_POS_GRADUACAO_LATO_SENSU => 'Pós-graduação Stricto Sensu',
...@@ -56,7 +56,7 @@ class EnsinoAula extends Model ...@@ -56,7 +56,7 @@ class EnsinoAula extends Model
/** /**
* @return array|string * @return array|string
*/ */
public function listModalidade($value = null) { public static function listModalidade($value = null) {
$values = [ $values = [
self::MODALIDADE_EAD => 'EAD', self::MODALIDADE_EAD => 'EAD',
self::MODALIDADE_PRESENCIAL => 'Presencial', self::MODALIDADE_PRESENCIAL => 'Presencial',
......
<script type="text/javascript"> <script type="text/javascript">
$('#curso_id').change(() => { $(document).ready(() => {
const curso_id = $('#curso_id').val() if( $('#curso_id').val() === '0' ) {
$('#componente_curricular').prop('disabled', true)
}
const endpoint = "{{ route('get_disciplina_by_curso', 'curso_id') }}" })
const url = endpoint.replace('curso_id', curso_id)
$('#curso_id').change(() => {
$('#componente_curricular').children('option').remove();
const _curso_id = $('#curso_id').val()
const _endpoint = "{{ route('get_disciplina_by_curso', 'curso_id') }}"
const _url = _endpoint.replace('curso_id', _curso_id)
if( $('#curso_id').val() === '0' ) {
$('#componente_curricular').prop('disabled', true)
} else {
$('#componente_curricular').prop('disabled', false)
}
$.ajax({
type: "get",
url: _url,
success: (disciplinas) => {
$('#componente_curricular').append(`<option value='0' selected> Selecionar Disciplina </option>`)
disciplinas.forEach( (disciplina) => {
$('#componente_curricular').append(`<option value=${disciplina.id}> ${disciplina.name} </option>`)
})
},
});
}) })
</script> </script>
...@@ -93,30 +93,33 @@ ...@@ -93,30 +93,33 @@
<form class="form-add-new-dimencao"> <form class="form-add-new-dimencao">
<div class="form-group"> <div class="form-group">
<label for="inputNameProfessor">CÓDIGO ATIVIDADE</label> <label for="inputNameProfessor">CÓDIGO ATIVIDADE</label>
<input type="text" name="cod_atividade" class="form-control" disable id="cod_atividade" placeholder="Nome"> <input type="text" name="cod_atividade" class="form-control" disable id="cod_atividade" placeholder="Nome" disabled>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="selectCurso">CURSO</label> <label for="selectCurso">CURSO</label>
<select name="curso_id" class="custom-select mr-sm-2" id="curso_id" aria-label="Default select example"> <select name="curso_id" class="custom-select mr-sm-2" id="curso_id" aria-label="Default select example">
<option selected>Selecionar Curso</option> <option value="0" selected>Selecionar Curso</option>
@foreach ($cursos as $curso) @foreach ($cursos as $curso)
<option value="{{ $curso->id }}"> {{ $curso->name }}</option> <option value="{{ $curso->id }}"> {{ $curso->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="selectCurso">COMPONENTE CURRICULAR (NOME DO COMPONENTE)</label> <label for="selectCurso">COMPONENTE CURRICULAR</label>
<select class="custom-select mr-sm-2" name="componente_curricular" id="componente_curricular" <select name="componente_curricular" class="custom-select mr-sm-2" id="componente_curricular" aria-label="Default select example">
aria-label="Default select example">
<option selected>Selecionar</option>
</select> </select>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="selectCurso">NÍVEL</label> <label for="selectCurso">NÍVEL</label>
<select class="custom-select mr-sm-2" name="nivel" id="nivel" <select class="custom-select mr-sm-2" name="nivel" id="nivel"
aria-label="Default select example"> aria-label="Default select example">
<option selected>Selecionar</option>
<option value="0" selected>Selecionar Nível</option>
@foreach ($niveis as $key => $nivel)
<option value="{{ $key }}"> {{ $nivel }}</option>
@endforeach
</select> </select>
</div> </div>
...@@ -124,25 +127,21 @@ ...@@ -124,25 +127,21 @@
<label for="selectCurso">Modalidade</label> <label for="selectCurso">Modalidade</label>
<select class="custom-select mr-sm-2" name="modalidade" id="modalidade" <select class="custom-select mr-sm-2" name="modalidade" id="modalidade"
aria-label="Default select example"> aria-label="Default select example">
<option selected>Selecionar</option>
<option value="0" selected>Selecionar Modalidade</option>
@foreach ($modalidades as $key => $modalidade)
<option value="{{ $key }}"> {{ $modalidade }}</option>
@endforeach
</select> </select>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="selectCurso">CARGA HORÁRIA SEMANAL</label> <label for="selectCurso">CARGA HORÁRIA SEMANAL</label>
<select class="custom-select mr-sm-2" name="ch_semanal" id="ch_semanal" <input type="number" name="ch_semanal" id="ch_semanal">
aria-label="Default select example">
<option selected>Selecionar</option>
</select>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="selectCurso">CARGA HORÁRIA TOTAL</label> <label for="selectCurso">CARGA HORÁRIA TOTAL</label>
<select class="custom-select mr-sm-2" name="ch_total" id="ch_total" <input type="number" name="ch_total" id="ch_semanal">
aria-label="Default select example">
<option selected>Selecionar</option>
</select>
</div> </div>
<input type="hidden" value="{{ $pad_id }}"> <input type="hidden" value="{{ $pad_id }}">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment