/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $department = Department::findOrFail($id); $faculty = Faculty::where('id', '=', $department->faculty_id)->firstOrFail(); $department['faculty_name'] = $faculty->name; return view('department.show', compact('department')); }
$regid = $v->colg->abbr . "S" . str_pad($_POST['regid'], 3, '0', STR_PAD_LEFT); $name = $_POST['name']; $mail->setHTMLBody("Hi {$name},<br/>You have successfully registered for C-SCAN 2016. Your registration ID is " . $regid . ". The confirmation regarding the same will be done via email on or before 1st February.<br/>For more details and updates, please visit our <a href='http://www.cscan.org.in'>website</a>.<br/><br/>Thank you.<br/><br/>Yours Sincerely,<br/>Organising Team,<br/>C-SCAN 2016."); $mailer->send($mail); } else { $error = ERROR_DB; } } else { $error = ERROR_INVALID; } } else { if ($_POST['type'] == "faculty") { $rules = array('college' => 'required|integer', 'name' => 'required', 'email' => 'required|email', 'phone' => 'required|numeric|digits_between:10,15', 'designation' => 'required', 'interest' => 'required', 'gender' => 'required', 'food' => 'required'); $validator = $factory->make($_POST, $rules, $messages); if ($validator->passes()) { $num = Faculty::where('college', $_POST['college'])->count(); $_POST['regid'] = $num + 1; if ($v = Faculty::create($_POST)) { $regid = $v->colg->abbr . "F" . str_pad($_POST['regid'], 3, '0', STR_PAD_LEFT); $name = $_POST['name']; $mail->setHTMLBody("Hi {$name},<br/>You have successfully registered for C-SCAN 2016. Your registration id is " . $regid . ". The confirmation regarding the same will be done via email on or before 1st February.<br/>For more details and updates, please visit our <a href='http://www.cscan.org.in'>website</a>.<br/><br/>Thank you.<br/>Yours Sincerely,<br/>Organising Team,<br/>C-SCAN 2016."); $mailer->send($mail); } else { $error = ERROR_DB; } } else { $error = ERROR_INVALID; } } } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $faculties = Faculty::where('faculty_code', $id)->delete(); Session::flash('message', 'You have successfully deleted faculty'); return Redirect::to('dashboard/admin/faculties'); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $faculties = Faculty::where('department_id', $this->_query_connect, $this->_query_value)->get(); return view('faculties.index', compact('faculties')); }