Laravel5 student score management system-07-Add Sidebar
You may see the right column in the image above. let's finish it first and then implement its functions one by one. replace read2 with ** read2 => @ include ('admin. right_bar ') ** _ admin/index. blade. php _ "@ extends ('Master') {-- inherits the master template -- }}@ section ('title') administrator @ stop @ section ('content ')
@ Include ('errors. list') student information table
Student ID |
Name |
Gender |
Mobile phone |
Class |
Email |
Operation |
@ If (count ($ users) @ foreach ($ users as $ user)
{$ User-> id }} |
{$ User-> name }} |
{$ User-> sex }} |
{{$ User-> phone }} |
{{$ User-> pro_class }} |
{$ User-> email }} |
Update score |
Read1 @ endforeach @ else no student list, ask the administrator to add @ endif
{-- Pagination --}}}
Render ();?>
Read2
@ Stop "! [Enter picture description] (http://img2.ph.126.net/eC6f0VCiWj85AnBCZh_U_g==/3355744672446850589.jpg "enter picture title here") "@ include ('admin. right_bar ')" then create ** Admin/right_bar.blade.php **:"
Total: {$ count }}Student list
Add student
Score Ranking
Download List
Export score
"Student list -- return to student list, that is, http: // localhost: 8000/admin add student -- add student page, that is, http: // localhost: 8000/admin/create Score Ranking-view the score list, that is, http: // localhost: 8000/admin/grade download list -- download student information Excel export score -- download student score Excel add student, corresponding to the create method in AdminController: "public function create () {$ result = User:: where ('is _ admin', 0); $ count = $ result-> count (); return view ('admin. create ', compact ('count');} "then create Admin/create. blade. php: "@ extends ('Master') {-- inherits the master template -- }}@ section ('title') to add students @ stop @ section ('content ')
Add student
@ Include ('errors. list ')
{!! Form: model ($ user = new \ App \ UsersInfo, ['URL' => 'admin/', 'class' => 'form-horizontal'])!}
{!! Form: label ('id', 'Student id: ', ['class' => 'control-label col-md-1'])!}
{!! Form: text ('id', old ('id'), ['class' => 'form-control'])!}
{!! Form: label ('name', 'Name: ', ['class' => 'control-label col-md-1'])!}
{!! Form: text ('name', old ('name'), ['class' => 'form-control', 'required'])!}
{!! Form: submit ('finished, create', ['class' => 'btn btn-success form-control'])!}
{!! Form: close ()!!}
@ Include ('admin. right_bar ')
@ Stop "click" add student :! [Enter picture description] (http://img2.ph.126.net/X-coZOxhAC6V5qYOaQTPGg==/6599300675750906321.jpg "enter picture title here") here we ** Form: model (obj, [options]) **, input a new object $ user. here you can view/vendor/illuminate/html/FormBuilder. in php, the model method, Form automatically fills in the Form for you. here, because it is new and the Form is empty, you will understand it later. next, let's look at our url, http: // localhost: 8000/admin, corresponding to the store method in the controller,