本文整理汇总了PHP中student::where方法的典型用法代码示例。如果您正苦于以下问题:PHP student::where方法的具体用法?PHP student::where怎么用?PHP student::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类student
的用法示例。
在下文中一共展示了student::where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
$emails = ['mwathibrian7@gmail.com'];
Mail::send('mails.welcome', ['name' => 'Angela Namikoye, Brian Phiri'], function ($message) use($emails) {
$message->to($emails)->from('strath.clearance@gmail.com', 'strath')->subject('This is test email');
});
$user = Auth::user()->regNo;
student::where('studentNo', '=', $user)->update(['state' => 'Activated']);
Session::flash('flash_msg', 'You have initiated the clearance process');
return redirect('/student');
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
$user = Auth::user()->regNo;
$res = DB::table('students')->select('faculty')->where('studentNo', '=', $user)->pluck('faculty');
//Query below gets the email of the specific administrator
$admin = DB::table('departments')->join('administrators', 'departments.administrator', '=', 'administrators.admin_id')->select('administrators.email')->where('departments.department_name', '=', $res)->pluck('email');
Mail::send('mails.welcome', ['name' => 'Angela Namikoye, Brian Phiri'], function ($message) use($admin) {
$message->to($admin)->from('strath.clearance@gmail.com', 'Strathmore University')->subject('Clearance Request');
});
student::where('studentNo', '=', $user)->update(['state' => 'Activated']);
Session::flash('flash_msg', 'You have initiated the clearance process');
return redirect('/student');
}
示例3: studentPdf
public function studentPdf(Request $request)
{
$post = $request->all();
$user = $post['student'];
$std = student::where('studentNo', '=', $user)->first();
$charge = charges::where('students_studentNo', '=', $user)->first();
$serial = Serial::where('students_studentNo', '=', $user)->first();
if ($charge->total == 0) {
$html = PDF::make($std, $serial);
} else {
$html = PDF::create($std, $charge, $serial);
}
$mpdf = new mpdf();
$mpdf->WriteHTML($html);
$mpdf->Output();
}
示例4: index
public function index()
{
Cas::getCurrentUser();
$user = session('cas_user');
$client = new \GuzzleHttp\Client();
// $response = $client->get('http://testserver.strathmore.edu:8082/dataservice/student/getStudent/'.$user);
$responseStudent = file_get_contents('http://testserver.strathmore.edu:8082/dataservice/student/getStudent/' . $user);
$responseStaff = file_get_contents('http://testserver.strathmore.edu:8082/dataservice/staff/getStaff/' . $user);
// check to see if the logged in user is a student
if ($responseStaff == '' && $responseStudent != '') {
$student = json_decode($responseStudent, true);
// check to see if student has already initiated the clearance process
// if student has not requested to be cleared, he/she is taken to the clear request page
$std = student::where('studentNo', '=', $user)->first();
// for testing, delete after test
// if($student['studentNo'] == '78699'){
// return redirect()->intended('/cafeteria');
// }
//If the query has a result ...
if ($std === null) {
return view('clearance.init')->with('student', $student);
} else {
$charge = charges::where('students_studentNo', '=', $user)->first();
$comment = comment::where('students_studentNo', '=', $user)->first();
return view('clearance.index')->with('std', $std)->with('charge', $charge)->with('comment', $comment);
}
} elseif ($responseStaff != '' && $responseStudent == '') {
$staffMember = json_decode($responseStaff, true);
$department_staff_belongs_to = $staffMember['departmentShortName'];
$check_admin = DB::table('administrators')->where('payroll_number', '=', $staffMember['payroll_number'])->get();
if ($check_admin == null) {
return "Not Authorized";
} else {
// redirect the staff member to thier page depending on the school they admin..
$is_auth = DB::table('administrators')->where('payroll_number', '=', $staffMember['payroll_number'])->select('administrators.state')->get();
if ($is_auth != 'Authorised') {
return "Not Authorized";
} else {
if ($department_staff_belongs_to == 'FIT') {
return redirect()->intended('/fit');
} else {
if ($department_staff_belongs_to == "SLS") {
return redirect()->intended('/sls');
} else {
if ($department_staff_belongs_to == "SBS") {
return redirect()->intended('/sbs');
} else {
if ($department_staff_belongs_to == "SFAE") {
return redirect()->intended('/sfae');
} else {
if ($department_staff_belongs_to == "CTH") {
return redirect()->intended('/cth');
} else {
if ($department_staff_belongs_to == "SOA") {
return redirect()->intended('/soa');
} else {
if ($department_staff_belongs_to == "MTI") {
return redirect()->intended('/mti');
} else {
if ($department_staff_belongs_to == "SHSS") {
return redirect()->intended('/shss');
} else {
if ($department_staff_belongs_to == "SMC") {
return redirect()->intended('/smc');
} else {
// if the admin does not admin a school. Query by department name
if ($department_staff_belongs_to == "CAFETERIA") {
return redirect()->intended('/cafeteria');
} else {
if ($department_staff_belongs_to == "LIBRARY") {
return redirect()->intended('/library');
} else {
if ($department_staff_belongs_to == "FINANCE") {
return redirect()->intended('/finance');
} else {
if ($department_staff_belongs_to == "FINANCIAL AID") {
return redirect()->intended('/financialAid');
} else {
if ($department_staff_belongs_to == "GAMES") {
return redirect()->intended('/games');
} else {
if ($department_staff_belongs_to == "EXTRA CURRICULAR ACTIVITIES") {
return redirect()->intended('/extraCurricularActivities');
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
//.........这里部分代码省略.........
示例5: show
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show()
{
$user = Auth::user()->regNo;
$std = student::where('studentNo', '=', $user)->first();
$charge = charges::where('students_studentNo', '=', $user)->first();
if ($charge->total == 0) {
$html = PDF::make($std);
} else {
$html = PDF::create($std, $charge);
}
$mpdf = new mpdf();
$mpdf->WriteHTML($html);
$mpdf->Output();
}