コード例 #1
0
ファイル: asignar-jda.blade.php プロジェクト: SEODiaz/SIGA-4
@section('styles')
@parent
{{ HTML::style('/css/jquery.dataTables.min.css') }}
@show 

@section('body')
	<div class="container">
        <div class="form-group">
            <div class="col-sm-7 col-xs-12 text-center">
                {{ Form::open(array('id'=>'formAJDA', 'role'=>'form')) }}
                <span class="mensajeError alert-danger"></span>
                <div class="form-group row">
                {{ Form::label('asignatura_id', 'Selecciona la asignatura', array('class' => 'col-sm-5'))}}
                <?php 
$collection = Asignatura::whereNull('profesores_id')->get()->toArray();
$collection = array_values(array_sort($collection, function ($value) {
    return $value['nombre'];
}));
$arreglo = array();
foreach ($collection as $clave => $valor) {
    $arreglo[$valor['id']] = $valor['nombre'];
}
?>
                {{ Form::select('asignatura_id', $arreglo, null, array('class' => 'col-sm-5')) }}
                </div>
                <div class="form-group row">
                {{ Form::label('profesor_id', 'Selecciona al profesor', array('class' => 'col-sm-5'))}}
                <?php 
$collection = DB::table('datos_profesor')->join('profesores', 'profesores.id', '=', 'datos_profesor.profesor_id')->where('profesores.rol', '=', 'profesor')->where('profesores.id', '<>', Auth::user()->id)->select('profesores.id', DB::raw('CONCAT(datos_profesor.nombre, " ", datos_profesor.apellido_paterno, " ", datos_profesor.apellido_materno) as nombre'))->orderBy('datos_profesor.nombre')->get();
$arreglo = array();