/**
  * Retorna els centres d'un tipus
  */
 public function getCentres()
 {
     try {
         $tipus = TipusCentre::find(Input::get('tipus'));
     } catch (ModelNotFoundException $e) {
         return Redirect::route('grups.meus');
     }
     return Response::json($tipus->centres);
 }
Example #2
0
	<?php 
echo Form::textarea('descripcio', $grup->getDescripcio(), array('placeholder' => 'DescripciĆ³n grupo', 'class' => 'form-control txtArea', 'rows' => 3, 'maxlength' => '255'));
?>
 
		<br/> 
	<?php 
echo Form::text('aula', $grup->getAula(), array('placeholder' => 'Aula clases', 'class' => 'form-control', 'maxlength' => '25'));
?>
 
		<br/> 
	<?php 
echo Form::label('Info', 'Centro donde se imparten las clases:');
?>
 <br/> <?php 
$opcions = array();
$tcentres = TipusCentre::all();
foreach ($tcentres as $tcentre) {
    $opcions[$tcentre->getNom()] = $tcentre->getNom();
}
$centre = $grup->centre;
$tipus_centre = $centre->tipus;
echo Form::select('tipus_centre', $opcions, $tipus_centre->getNom(), array('class' => 'form-control', 'data-select-tipus-centre' => URL::route('centres.json'), 'style' => 'width:200px; float:left; margin-right:20px;'));
echo Form::select('centre', array(), $centre, array('data-select-centre', 'class' => 'form-control', 'style' => 'width:300px', 'data-centre' => $centre->getNom()));
?>
	<br>
	<?php 
echo Form::submit('Editar grupo', array('class' => 'btn btn-primary btn-sm', 'style' => 'float:right;'));
echo Form::close();
?>
</div>