public static function editar() { $sala = new Sala(); $sala->selecionarPorId($_GET['id']); $evento = new Evento(); $evento->selecionarPorId($sala->fkEvento); if (!empty($_POST)) { $sala = new Sala(); foreach ($_POST as $pKey => $p) { $sala->{$pKey} = $p; } $idSala = $sala->salvar(); $evento = new Evento(); $evento->selecionarPorId($_POST['fkEvento']); self::redirecionar(Configuracao::$baseUrl . self::$viewController . '/listar/' . $evento->id . '-' . Funcao::prepararLink($evento->nome) . Configuracao::$extensaoPadrao); } self::$corpo = "editar"; self::$variaveis = array('sala' => $sala); self::renderizar(self::$viewController); }
<thead> <tr> <th width="10%" >ID</th> <th width="1%" >Dia</th> <th width="1%" >Sala</th> <th width="1%" >Início</th> <th width="1%" >Fim</th> <th width="70%" >Texto</th> <th width="20%" class="td-actions"></th> </tr> </thead> <tbody> <?php foreach ($lista as $l) { $sala = new Sala(); $sala->selecionarPorId($l->fkSala); ?> <tr> <td><?php echo $l->id; ?> </td> <td><?php echo Funcao::dateFormat($l->dia); ?> </td> <td><?php echo $sala->nome_pt; ?> </td> <td><?php