public function updateProgramArea($programId) { $program = new Program(); $areas = $program->getAllProgramAreas(); $programArea = $program->getProgramAreaByProgramId($programId); $programData = $program->getProgramById($programId); $data = array('areas' => $areas, 'currentArea' => $programArea, 'programData' => $programData); loadTemplateSafelyByGroup($this->COORDINATOR_GROUP, "coordinator/edit_program_area", $data); }
<?php require_once APPPATH . 'controllers/program.php'; $programName = array("name" => "program_name", "id" => "program_name", "type" => "text", "class" => "form-campo", "class" => "form-control", "maxlength" => "40"); $programAcronym = array("name" => "program_acronym", "id" => "program_acronym", "type" => "text", "class" => "form-campo", "class" => "form-control", "maxlength" => "6"); $submitBtn = array("id" => "sregister_new_program", "class" => "btn bg-olive btn-block", "content" => "Cadastrar programa", "type" => "submit"); $program = new Program(); $programArea = $program->getAllProgramAreas(); if ($programArea === FALSE) { $programArea = array("Nenhuma área cadastrada."); } $openingYear = array(); $currentYear = getCurrentYear(); if ($currentYear !== FALSE) { for ($i = 1990; $i <= $currentYear + 2; $i++) { $openingYear[$i] = $i; } } else { $openingYear[] = "Ocorreu um erro ao ler o ano do banco de dados"; $submitBtn['disabled'] = TRUE; } ?> <div class="form-box" id="login-box"> <div class="header">Cadastrar um novo Programa</div> <?php echo form_open("program/newProgram"); ?> <div class="body bg-gray"> <div class="form-group"> <?php