/** * 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); }
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()]); }
/** * 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); }
/** * 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); }
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]); }
public function index() { $students = Student::all(); return $this->createSuccessResponse($students, 200); }
public function create() { //load all student data from the database $students = Student::all(); return view('admin.find', compact('students')); }
|-------------------------------------------------------------------------- | 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]);
/** * 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]); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $students = Student::all()->sortByDesc('nazwisko'); return View('students.index', ['students' => $students]); }
public function mstudent() { $students = Student::all(); return view('admin.manageStudent', compact('students')); }
public function index() { $students = Student::all(); return view('student.index', ['students' => $students]); }
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', '新增成功!'); }
/** * 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]); }
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'); } }
<?php /* |-------------------------------------------------------------------------- | 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. | */ Route::get('/', function () { return view('welcome'); }); Route::get('/movies', function () { return \App\Movie::all(); }); Route::get('/students', function () { //$students= \App\Student::where('first_name','=','Nancy')->get(); //return $students; $students = \App\Student::all(); return view('students', ['students' => $students]); //return \App\Student::all(); });
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return view('students.index', ['students' => Student::all(), 'states' => State::lists('name', 'id'), 'sections' => Section::lists('name', 'id')]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $students = Student::all(); return view('students.index', compact('students')); }
public function index() { $students = Student::take($this->setRecord)->get(); $records = Student::all()->count(); return view('student/index', array('students' => $students, 'records' => $records)); }
public function index() { return Student::all(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Show a listing of students. $students = Student::all(); return view('students.index')->with('students', $students); }
public function show() { $students = Student::all(); // dd($students); return view('student.index', compact('students')); }
*/ Route::get('/', function () { return view('welcome'); }); Route::get('/students/seed', function () { $faker = Faker\Factory::create(); DB::table('students')->truncate(); for ($i = 1; $i < 25; $i++) { $student = new \App\Student(); $student->name = $faker->name; $student->address = $faker->address; $student->save(); } }); Route::get('/students', function () { return \App\Student::all(); }); Route::post('/device', function () { $all = Request::json()->all(); var_dump($all); }); /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | This route group applies the "web" middleware group to every route | it contains. The "web" middleware group is defined in your HTTP | kernel and includes session state, CSRF protection, and more. | */
/** * Display a listing of the resource. * * @return Response */ public function index() { $students = Student::all(); return view('dashboard.admin.student.index', ['student' => $students]); }