public function create($course_id) { $course = Course::with('placements')->find($course_id); $subjects = Subject::all(); $menu = 'academic'; return View::make('masteries.create', compact('course', 'subjects', 'menu')); }
public function edit($id) { $quiz = Quiz::find($id); $subjects = Subject::all(); $employees = Employee::where('teach_salary', '>', 0.0)->get(); $menu = 'academic'; return View::make('quizzes.edit', compact('quiz', 'subjects', 'employees', 'menu')); }
public function edit($id) { $teach = Teach::find($id); $employees = Employee::where('teach_salary', '>', 0.0)->get(); $subjects = Subject::all(); $hours = Hour::all(); $menu = 'employee'; return View::make('teaches.edit', compact('teach', 'employees', 'subjects', 'hours', 'menu')); }
public function selectSubjects() { $user_id = $_SESSION['user_id']; $city_id = Volunteer::find($user_id)->city_id; $selected_subjects = City::find($city_id)->subject()->get(); $selected_subjects_id = array(); foreach ($selected_subjects as $sub) { $selected_subjects_id[] = $sub->id; } $all_subjects = Subject::all(); return View::make('settings/select-subjects')->with('selected_subjects_id', $selected_subjects_id)->with('all_subjects', $all_subjects); }
public function index() { $subjects = Subject::all(); $menu = 'project'; return View::make('subjects.index', compact('subjects', 'menu')); }
<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="H4"> Adding Exam Type.......</h4> </div> <div class="modal-body"> <form action="{{URL::to('exams/exam-type')}}" method="post"> <div class="form-group"> <label>Pick Exam Type</label> <select name="name" {{ (Input:: old('name'))? ' value="'.Input::old('name').'"' : ''}}> <option value="">----Select exam type---</option> <?php $subjects = Subject::all(); ?> @foreach($subjects as $subject) <option value="{{$subject->name}}">{{$subject->name}} </option> @endforeach </select> @if($errors->has('name')) <span class="label label-danger">{{ $errors->first('name') }} </span> @endif </div> <div class="form-group"> <label>Description</label> <textarea class="form-control" name="description"
/** * Display a listing of the resource. * * @return Response */ public function index() { $classes = ClassModel::select('code', 'name')->orderby('code', 'asc')->get(); $subjects = Subject::all(); return View::Make('app.markCreate', compact('classes', 'subjects')); }
<?php if ($errors->first()) { echo "<div class='alert alert-error alert-block fade in'>"; echo '<button type="button" class="close" data-dismiss="alert">×</button>'; echo $errors->first(); echo "</div>"; } echo Form::open(array('url' => '/exam/edit/' . $id . '', 'method' => 'post', 'class' => 'form-horizontal')); echo "<fieldset>"; echo Form::label('id', 'id', array('class' => 'pull-left', 'style' => 'clear:left;padding:15px;')); echo Form::text('id', $id, array('disabled' => '', 'class' => 'disabled pull-right', 'style' => 'margin:10px;')); echo Form::label('title', 'Title', array('class' => 'pull-left', 'style' => 'clear:left;margin:15px;')); echo Form::text("title", Input::old('title', ''), array('placeholder' => 'Title of the Tutorial', 'class' => 'pull-right', 'style' => 'clear:right;margin:10px;')); echo Form::label('subject', 'Subject', array('class' => 'pull-left', 'style' => 'clear:left;margin:15px;')); $subjectsmodel = Subject::all(); function checkSubject($subjects, $subject) { foreach ($subjects as $s) { if ($s == $subject) { return 1; } } return 0; } $usere = Sentry::getUser(); $usergroup = $usere->getGroups(); $usergroupe = json_decode($usergroup, true); $usergroupe[0]['pivot']['group_id']; $group = Sentry::findGroupById($usergroupe[0]['pivot']['group_id']); $groupname = $group->name;
public function update() { $id = Input::get('id'); $tabla = Input::get('tabla'); switch ($tabla) { case '0': $clave = Input::get('clave'); $appat = Input::get('ap_pat'); $apmat = Input::get('ap_mat'); $nombre = Input::get('nombre'); $segnombre = Input::get('seg_nombre'); $tipo = Input::get('tipo'); $grado = Input::get('grado'); $tutorias = Input::get('tutorias'); $gestion = Input::get('gestion'); $investigacion = Input::get('investigacion'); $dependencias = Input::get('dependencias'); $edit = Professor::find($id); $edit->clave = $clave; $edit->ap_pat = $appat; $edit->ap_mat = $apmat; $edit->nombre = $nombre; $edit->seg_nombre = $segnombre; $edit->tipo = $tipo; $edit->id_grado = $grado; $edit->tutorias = $tutorias; $edit->gestion = $gestion; $edit->investigacion = $investigacion; $edit->dependencias = $dependencias; $edit->save(); return View::make('crud.crudMaestros')->with('professors', Professor::all()); break; case '1': $nombre = Input::get('nombre'); $semestre = Input::get('semestre'); $plan = Input::get('idPlan'); $edit = Subject::find($id); $edit->nombre = $nombre; $edit->semestre = $semestre; $edit->id_plan = $plan; $edit->save(); return View::make('crud.crudMaterias')->with('subjects', Subject::all()); break; case '2': $nombre = Input::get('nombre'); $edit = Aula::find($id); $edit->nombre = $nombre; $edit->save(); return View::make('crud.crudAulas')->with('aulas', Aula::all()); break; case '3': $nombre = Input::get('nombre'); $edit = Plan::find($id); $edit->nombre = $nombre; $edit->save(); return View::make('crud.crudPlanes')->with('plans', Plan::all()); break; default: //aqui me redirecciona a una pagina vacia solo con un mensaje 404 return View::make('landing'); break; } }