本文整理汇总了PHP中app\Student::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::all方法的具体用法?PHP Student::all怎么用?PHP Student::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Student
的用法示例。
在下文中一共展示了Student::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$students = Student::all();
$data = array();
$data['students'] = $students;
return view('students/index', $data);
}
示例2: time
public function time()
{
$client = new Client(['base_uri' => config('bootysys.base_url'), 'timeout' => 2.0]);
$professor = Student::all();
$req = $client->request('POST', '/receive', ['json' => ['professors' => $professor]]);
return collect(['body' => $req->getBody()->getContents()]);
}
示例3: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$data['title'] = 'Students';
$data['students_menu'] = 1;
$data['students'] = Student::all();
return view('admin.students.index', $data);
}
示例4: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$learners = \App\Student::all();
$staff = Staff::all();
$subjects = \App\Subject::all();
$streams = \App\Stream::all();
$classes = \App\Grade::all();
return view('admin.index')->with('title', 'SMS|Dashboard')->with('learners', $learners)->with('staff', $staff)->with('subjects', $subjects)->with('streams', $streams)->with('classes', $classes);
}
示例5: index
function index()
{
return "success";
//$students = \App\Student::where('first_name','=','Jin')->get();
//return $students;
//$student= new App\Student();
//$student->first_name='Varaly';
//$student->last_name='Cario';
//$student->save();
$students = \App\Student::all();
return view('students', ['students' => $students]);
}
示例6: index
public function index()
{
$students = Student::all();
return $this->createSuccessResponse($students, 200);
}
示例7: create
public function create()
{
//load all student data from the database
$students = Student::all();
return view('admin.find', compact('students'));
}
示例8: function
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use App\Student;
use App\Image;
Route::get('/', function () {
return view('home');
});
Route::get('/students', function () {
$student = Student::all();
return response()->json($student);
});
Route::get('/students/{card}', function ($card) {
$student = Student::where('card', $card)->first();
return response()->json($student);
});
Route::post('images', function () {
$image_encoded = Request::input('base64image');
$image = new Image();
$image->image_url = Image::saveImage($image_encoded);
if ($image->image_url != false) {
$image->save();
return response()->json(["image_saved" => true]);
} else {
return response()->json(["image_saved" => false]);
示例9: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
$students = Student::all();
return view('contacts.index', ['title' => 'All Students', 'contacts' => $students]);
}
示例10: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$students = Student::all()->sortByDesc('nazwisko');
return View('students.index', ['students' => $students]);
}
示例11: mstudent
public function mstudent()
{
$students = Student::all();
return view('admin.manageStudent', compact('students'));
}
示例12: index
public function index()
{
$students = Student::all();
return view('student.index', ['students' => $students]);
}
示例13: getBackupdatabase
public function getBackupdatabase(Request $request)
{
$arr = array();
$arr['name'] = $request->has('name') ? $request->get('name') : null;
$arr['note'] = $request->has('note') ? $request->get('note') : null;
$table = 'students_' . date("Ymd_His");
Schema::dropIfExists($table);
Schema::create($table, function (Blueprint $table) {
$table->char('id', 20)->primary();
$table->enum('stu_type', ['在校生', '新生', '休学', '毕业结业', '退学转学', '未报到'])->default('在校生')->index();
$table->string('type')->nullable()->default(null)->index();
$table->string('nationality')->nullable()->default(null)->index();
$table->string('name_cn')->nullable()->default(null)->index();
$table->string('name_en')->nullable()->default(null)->index();
$table->string('csc_no')->nullable()->default(null)->index();
$table->string('passport_id')->nullable()->default(null)->index();
$table->string('gender')->nullable()->default(null)->index();
$table->string('birthday')->nullable()->default(null)->index();
$table->string('school')->nullable()->default(null)->index();
$table->string('major')->nullable()->default(null)->index();
$table->string('admission_date')->nullable()->default(null)->index();
$table->string('old_class')->nullable()->default(null)->index();
$table->string('new_class')->nullable()->default(null)->index();
$table->string('language')->nullable()->default(null)->index();
$table->string('fee_type')->nullable()->default(null)->index();
$table->string('inschool_address')->nullable()->default(null)->index();
$table->string('telephone')->nullable()->default(null)->index();
$table->string('email')->nullable()->default(null)->index();
$table->string('tutor')->nullable()->default(null)->index();
$table->string('inschool_note1')->nullable()->default(null)->index();
$table->string('inschool_note2')->nullable()->default(null)->index();
$table->string('suspend_date')->nullable()->default(null)->index();
$table->string('suspend_note')->nullable()->default(null)->index();
$table->string('suspend_note1')->nullable()->default(null)->index();
$table->string('graduate_date')->nullable()->default(null)->index();
$table->string('certificate_date')->nullable()->default(null)->index();
$table->string('certificate_type')->nullable()->default(null)->index();
$table->string('graduation_certificate')->nullable()->default(null)->index();
$table->string('degree_certificate')->nullable()->default(null)->index();
$table->string('further_certificate')->nullable()->default(null)->index();
$table->string('learn_certificate')->nullable()->default(null)->index();
$table->string('graduated_address')->nullable()->default(null)->index();
$table->string('graduated_note')->nullable()->default(null)->index();
$table->string('leave_date')->nullable()->default(null)->index();
$table->string('leave_to')->nullable()->default(null)->index();
$table->string('leave_note')->nullable()->default(null)->index();
$table->integer('suspend_years')->default(0)->index();
$table->timestamps();
});
$stu = Student::all();
foreach ($stu as $item) {
DB::table($table)->insert($item->toArray());
}
$arr['table_name'] = $table;
$arr['created_by'] = Auth::user()->name . '(' . Auth::user()->email . ')';
Generatedtable::create($arr);
return Redirect::back()->with('Tips', '新增成功!');
}
示例14: manageStudents
/**
* Show the currently registered students
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function manageStudents()
{
$studentArr = Student::all();
return view('admin.manage.students', ['students' => $studentArr, 'count' => 0]);
}
示例15: pay_invoice
public function pay_invoice(Request $request)
{
// dd($request->all());
$data['title'] = 'Pay School Fees';
$data['fees'] = 1;
$class_id = $request->class_id;
$student_id = $request->student_id;
$fee_schedule_code = strval($class_id) . session()->get('current_session') . strval(session()->get('current_term'));
$session = session()->get('current_session');
$term = session()->get('current_term');
$data['transaction_modes'] = TransactionMode::lists('transaction_mode', 'id')->prepend('Please Select');
//current session invoice table
$table = 'invoices_' . $session . '_' . $term;
$data['student_fee_elements'] = [];
//==============get previous sessions fees not yet paid+++++++++++++
$sessions = CurrentTerm::orderBy('created_at', 'desc')->where('session', '!=', session()->get('current_session'))->orWhere('term', '!=', session()->get('current_term'))->take(9)->groupby('session')->get();
// dd($sessions);
$outstandings = [];
$invoices_amt = 0;
$payment_amt = 0;
// foreach ($sessions as $session) {
$invoices = Invoice::where('session', '!=', session()->get('current_session'))->orWhere('term', '!=', session()->get('current_term'))->get();
// dd($invoices);
//get all payments associated with an invoice
foreach ($invoices as $invoice) {
$payment_amt = 0;
$student_invoice = DB::table($invoice->table_name)->where(['student_id' => $student_id])->first();
//for every invoice, get payment associated with that invoice
if ($student_invoice !== null) {
$sch_fee_payment = SchoolFeesPayment::where(['session' => $invoice->session, 'term' => $invoice->term])->first();
$paid_amt = DB::table($sch_fee_payment->table_name)->where(['student_id' => $student_id])->sum('amount');
//get class id from fee schedule code
$outstanding_class_id = substr($student_invoice->fee_schedule_code, 0, 1);
//get oustanding amount
$outstanding_balance = $student_invoice->total - $paid_amt;
//if outstanding amt is not greater than zero then student has paid fully for that invoice therefore dont show on page
if ($outstanding_balance > 0) {
$session_fees = ['session' => $invoice->session, 'term' => $invoice->term, 'outstanding_balance' => $outstanding_balance, 'sch_fee_payment_table_name' => $sch_fee_payment->table_name, 'outstanding_fee_schedule_code' => $student_invoice->fee_schedule_code, 'outstanding_class_id' => $outstanding_class_id];
array_push($outstandings, $session_fees);
}
}
}
// }
if ($outstandings == []) {
$outstandings = null;
}
$data['outstandings'] = $outstandings;
//===========GET THIS SESSIONS FEES++++++++++++++++++
//get fee schedule elements for current session
$fee_sch_table = 'fee_sch_' . session()->get('current_session') . '_' . session()->get('current_term');
//get student invoice including exmepted fee elements
$data['student_invoice'] = \DB::table($table)->where(['student_id' => $student_id, 'fee_schedule_code' => $fee_schedule_code])->first();
// dd($data['student_invoice'] );
//
//check if invoice has been generated for this student
if ($data['student_invoice'] !== null) {
$already_paid = [];
$paid_amount = 0;
$data['exempted_elements'] = json_decode($data['student_invoice']->exempted_fee_elements);
if ($data['exempted_elements'] == null) {
$data['exempted_elements'] = [];
}
$sch_fee_payment = SchoolFeesPayment::where(['session' => session()->get('current_session'), 'term' => session()->get('current_term')])->first();
$payment_histories = DB::table($sch_fee_payment->table_name)->where(['student_id' => $student_id])->get();
// dd($payment_histories);
foreach ($payment_histories as $payment_history) {
$already_paid[] = json_decode($payment_history->elements_paid_for);
$paid_amount += $payment_history->amount;
}
$already_paid = array_flatten($already_paid);
// dd($already_paid);
if ($already_paid !== null) {
$data['already_paid'] = $already_paid;
} else {
$data['already_paid'] = [];
}
//get oustanding amount
$outstanding_balance = $data['student_invoice']->total - $paid_amount;
if ($outstanding_balance > 0) {
$data['student_fee_elements'] = DB::table($fee_sch_table)->where(['fee_schedule_code' => $fee_schedule_code])->join('fee_elements', 'fee_elements.id', '=', $fee_sch_table . '.fee_element_id')->get();
}
} else {
session()->flash('flash_message', 'An invoice has not been generated for this term for this student.');
}
if ($data['outstandings'] !== null || $data['student_invoice'] !== null) {
$sch_fee_payments = SchoolFeesPayment::all();
foreach ($sch_fee_payments as $sch_fee_payment) {
$term_payments = DB::table($sch_fee_payment->table_name)->where('student_id', $student_id)->orderBy('created_at', 'desc')->get();
$payments[] = $term_payments;
}
// dd(array_flatten($payments));
$data['payments'] = array_flatten($payments);
$data['student_info'] = Student::find($student_id);
$data['classes'] = studentClass::lists('name', 'id')->prepend('Please Select');
$data['students'] = Student::all();
return view('payments.payments', $data);
} else {
session()->flash('flash_message', 'An invoice has not been generated for this student.');
return redirect()->route('accounts.payments.index');
}
//.........这里部分代码省略.........