public function destroy($id) { $cursos = Curso::find($id); $cursos->delete(); Session::flash('message', 'El curso de la seccion ' . $cursos->seccion . ' fue eliminado'); return redirect()->route('Encargado.cursos.index'); }
/** * Updates an existing Aluno model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); $arraycursos = Curso::find()->all(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('update', ['model' => $model]); } }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Curso::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id]); $query->andFilterWhere(['like', 'sigla', $this->sigla])->andFilterWhere(['like', 'nome', $this->nome]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Curso::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id_curso' => $this->id_curso, 'nivel' => $this->nivel]); $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'deescripcion', $this->deescripcion])->andFilterWhere(['like', 'lugar', $this->lugar]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Curso::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['idCurso' => $this->idCurso, 'FechaInicio' => $this->FechaInicio, 'FechaFin' => $this->FechaFin, 'Horas' => $this->Horas]); $query->andFilterWhere(['like', 'Nombre', $this->Nombre])->andFilterWhere(['like', 'Descripcion', $this->Descripcion]); return $dataProvider; }
public function show($id) { $cursos = Curso::find($id); //dd($Campus); if ($cursos) { $data = array(array('semestre', 'anio', 'seccion', 'asignatura_id', 'docente_id'), array($cursos->semestre, $cursos->anio, $cursos->seccion, $cursos->asignaturas->nombre, $cursos->docentes->nombres)); Excel::create('Cursos' . $cursos->seccion, function ($excel) use($data) { $excel->sheet('Sheetname', function ($sheet) use($data) { $sheet->fromArray($data); }); })->download('csv'); } else { abort('404'); } }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Curso::find(); // add conditions that should always apply here $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'max_horas' => $this->max_horas]); $query->andFilterWhere(['like', 'codigo', $this->codigo])->andFilterWhere(['like', 'nome', $this->nome]); return $dataProvider; }
<!-- <?php echo $form->errorSummary($model); ?> --> <?php echo $form->field($model, 'idDisciplina')->dropDownList($arrayDisciplinas, ['prompt' => 'Selecione uma disciplina', 'style' => 'width:600px']); ?> <?php echo $form->field($model, 'codTurma')->textInput(['maxlength' => true, 'style' => 'width:130px']); ?> <?php echo $form->field($model, 'idCurso')->dropDownList(ArrayHelper::map(Curso::find()->orderBy('nome')->asArray()->all(), 'id', 'nome'), ['prompt' => 'Selecione um curso', 'style' => 'width:300px']); ?> <?php echo $form->field($model, 'idProfessor')->dropDownList(ArrayHelper::map(Usuario::find()->where(['perfil' => 'Professor'])->orderBy('name')->asArray()->all(), 'id', 'name'), ['prompt' => 'Selecione o professor', 'style' => 'width:600px']); ?> <?php echo $form->field($model, 'nomeUnidade')->textInput(['maxlength' => true, 'style' => 'width:600px']); ?> <?php echo $form->field($model, 'numPeriodo')->textInput(['style' => 'width:130px']); ?> <?php
<div class="col-md-4"> <?php echo $form->field($model, 'codigo')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'nome')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'max_horas')->textInput(); ?> <?php echo $form->field($model, 'curso_id')->dropDownList(ArrayHelper::map(Curso::find()->all(), 'id', 'nome'), ['prompt' => 'Selecione']); ?> <?php echo $form->field($model, 'grupo_id')->dropDownList(ArrayHelper::map(Grupo::find()->all(), 'id', 'nome'), ['prompt' => 'Selecione']); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Salvar' : 'Atualizar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> </div> <?php
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $curso = Curso::find($id); $curso->delete(); return redirect()->back(); }
?> <?php echo $form->field($model, 'matricula')->textInput(); ?> <?php echo $form->field($model, 'nome')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'sexo')->dropDownList(['M' => 'Masculino', 'F' => 'Feminino']); ?> <?php echo $form->field($model, 'id_curso')->dropDownList(ArrayHelper::map(Curso::find()->all(), 'id', 'nome')); ?> <?php echo $form->field($model, 'ano_ingresso')->textInput(); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?>
public function actionGerarquadrogeral() { $modelPeriodo = DisciplinaPeriodo::find()->orderBy(['anoPeriodo' => SORT_DESC, 'numPeriodo' => SORT_DESC])->one(); $periodoletivo = $modelPeriodo->anoPeriodo . '/' . $modelPeriodo->numPeriodo; $dadosCabecalho = Periodo::find()->where(['codigo' => $periodoletivo])->one(); if ($dadosCabecalho != null) { $cssfile = file_get_contents('../web/css/estilo3.css'); $mpdf = new mPDF('utf-8', 'A4-L'); $mpdf->title = '3. Quadro Geral'; $mpdf->WriteHTML($cssfile, 1); //$mpdf->Image('../web/img/cabecalho.png', 20, 5, 900, 80); // Cabeçalho + primeira tabela do documento $mpdf->WriteHTML(' <img src="../web/img/cabecalho3.png" alt="Universidade Federal do Amazonas...." width="950" height="85"> <p style = "text-align: center;"> <b style = "font-size: small;"> QUADRO GERAL DE MONITORES BOLSISTAS E NÃO BOLSISTAS - 03 <br> </b> (<b style = "background-color: yellow;">Encaminhar também em formato .DOC -word- para o email monitoriaufam@outlook.com</b>) </p> <table id="cabecalho_1_QuadroGeral" width="99%" height="100%"> <tr> <td bgcolor="#e6e6e6"> <b>SETOR RESPONSÁVEL (Coord.Dept/Outros)</b> </td> <td width="30%">Coordenação Acadêmica</td> <td bgcolor="#e6e6e6"><b>UNIDADE</b></td> <td width="30%">Instituto de Computação - IComp</td> </tr> </table> <table id = "cabecalho_2_QuadroGeral" width="40%" height="100%"> <tr> <td bgcolor="#e6e6e6" width="29%"><b>PERÍODO LETIVO</b></td> <td width="20px">' . $modelPeriodo->anoPeriodo . '/' . $modelPeriodo->numPeriodo . ' </td> </tr> </table> '); // Tabela do meio do documento $mpdf->WriteHTML(' <br> <table id="quadro_geral" width="99%"> <tr> <td id="n" value="0" bgcolor="#e6e6e6" width="3%" rowspan=2><b>Nº</b></td> <td id="aluno" value="0" bgcolor="#e6e6e6" width="25%" rowspan=2><b>ALUNO</b><br>(nome completo, sem abreviações)</td> <td id="mat" value="0" bgcolor="#e6e6e6" width="6%" rowspan=2><b>Nº <br>MATR.</b></td> <td id="cpf" value="0" bgcolor="#e6e6e6" width="8%" rowspan=2><b>CPF</b></td> <td id="cat" value="0" bgcolor="#e6e6e6" colspan=2 width="6%" colspan=2><b>CATEG.</b></td> <td id="curso" value="0" bgcolor="#e6e6e6" width="13%" rowspan=2><b>CURSO</b></td> <td id="disc" value="0" bgcolor="#e6e6e6" width="14%" rowspan=2><b>DISCIPLINAS</b><br> (código e título, sem abreviações)</td> <td id="prof" value="0" bgcolor="#e6e6e6" width="25%" rowspan=2><b>PROFESSOR ORIENTADOR</b><br> (nome completo, sem abreviações)</td> </tr> <tr> <td bgcolor="#e6e6e6" width="3%">B</tr> <td bgcolor="#e6e6e6" width="3%">NB</tr> </tr> </table> '); $aM = AlunoMonitoria::find()->where(['periodo' => $periodoletivo])->andFilterWhere(['or', ['like', 'status', 'Selecionado com bolsa'], ['like', 'status', 'Selecionado sem bolsa']])->orderBy(['aluno' => SORT_DESC])->all(); $count = count($aM); $n = 1; $id = 0; foreach ($aM as $monitor) { $disc = DisciplinaMonitoria::find()->where(['id' => $monitor->id_disciplina])->one(); $codCurso = Curso::find()->where(['nome' => $monitor->nomeCurso])->one(); if ($monitor->bolsa == 0) { $mpdf->WriteHTML(' <table id="quadro_geral" width="99%"> <tr> <td width="3%">' . $n . '</td> <td width="25%">' . $monitor->aluno . '</td> <td width="6%">' . $monitor->matricula . '</td> <td width="8%">' . $monitor->cpf . '</td> <td width="3%"></td> <td width="3%">X</td> <td width="13%">' . $codCurso->codigo . ' - ' . $monitor->nomeCurso . '</td> <td width="14%">' . $disc->codDisciplina . ' - ' . $monitor->nomeDisciplina . '</td> <td width="25%">' . $monitor->professor . '</td> </tr> </table> '); } elseif ($monitor->bolsa == 1) { // Row para alunos bolsistas $mpdf->WriteHTML(' <table id="quadro_geral" width="99%"> <tr> <td width="3%">' . $n . '</td> <td width="25%">' . $monitor->aluno . '</td> <td width="6%">' . $monitor->matricula . '</td> <td width="8%">' . $monitor->cpf . '</td> <td width="3%">X</td> <td width="3%"></td> <td width="13%">' . $codCurso->codigo . ' - ' . $monitor->nomeCurso . '</td> <td width="14%">' . $disc->codDisciplina . ' - ' . $monitor->nomeDisciplina . '</td> <td width="25%">' . $monitor->professor . '</td> </tr> </table> '); } $count--; $n++; $id = $monitor->id; } // Footer do documento $mpdf->WriteHTML(' <footer> <p> <b>(*)</b> Relacionar todos os monitores de todas as disciplinas do departamento neste mesmo quadro, observando a quantidade total de vagas aprovadas pela Comissão de Monitoria do Programa.<br> <b>(*) B</b> = Bolsista<br> <b>NB</b> = Não Bolsista<br> OBS.: Encaminhar cópia deste quadro à DPA/PROEG para nomeação em portaria. Manaus, ' . date('d') . ' / ' . date('m') . ' / ' . date('Y') . '. _________________________________________________________ <br> Chefe do Depto (com carimbo). </p> </footer> '); $mpdf->Output(); exit; } else { return $this->render('gerarquadrogeral'); } }
public function afterFind() { switch ($this->bolsa) { case 0: $this->traducao_bolsa = 'Não'; break; case 1: $this->traducao_bolsa = 'Sim'; break; } switch ($this->status) { case 0: $this->traducao_status = 'Aguardando Avaliação'; break; case 1: $this->traducao_status = 'Selecionado com bolsa'; break; case 2: $this->traducao_status = 'Selecionado sem bolsa'; break; case 3: $this->traducao_status = 'Não selecionado'; break; case 4: $this->traducao_status = 'Indeferido - Nota < 7'; break; case 5: $this->traducao_status = 'Indeferido - Coeficiente < 5'; break; case 6: $this->traducao_status = 'Indeferido - Não cursou a disciplina'; break; } $periodo = PeriodoInscricaoMonitoria::findOne(['id' => $this->IDperiodoinscr]); $this->IDperiodoinscr = $periodo->ano . '/' . $periodo->periodo; $disciplinaPeriodo = DisciplinaPeriodo::findOne($this->IDDisc); $disciplina = Disciplina::find()->where(['id' => $disciplinaPeriodo->idDisciplina])->one(); $this->nomeDisciplina = $disciplina->nomeDisciplina; $curso = Curso::find()->where(['id' => $disciplinaPeriodo->idCurso])->one(); $this->nomeCurso = $curso->nome; }