当前位置: 首页>>代码示例>>PHP>>正文


PHP student::where方法代码示例

本文整理汇总了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');
 }
开发者ID:BrianPhiri,项目名称:su-clearance,代码行数:16,代码来源:MailsController.php

示例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');
 }
开发者ID:bryan-mwas,项目名称:Clearance101,代码行数:18,代码来源:MailsController.php

示例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();
 }
开发者ID:bryan-mwas,项目名称:Clearance101,代码行数:16,代码来源:ViewsController.php

示例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');
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
//.........这里部分代码省略.........
开发者ID:bryan-mwas,项目名称:Clearance101,代码行数:101,代码来源:RedirectController.php

示例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();
 }
开发者ID:leloulight,项目名称:Clearance101,代码行数:20,代码来源:ViewsController.php


注:本文中的student::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。