 |
|
คือผมต้องการเขียนเว็บแอปตรวจสอบกล้องวงจรปิดรายวัน
อยากจะให้ส่งค่าจากหน้าข้อมูล NVR เพื่อเช็คกล้องรายวันครับ

พอคลิกที่ ปุ้ม check จะแสดงหน้าจอตรวจสอบกล้อง
มัน error code แบบนี้อะครับ ไม่แน่ใจว่าผมเขียนอะไรผิดรึเปล่า

โค้ดครับ nvr/view
Code
<tbody>
@foreach($nvr as $key => $value)
<tr>
<td>{{ $value->nvr_id }}</td>
<td>{{ $value->n_name }}</td>
<td>{{ $value->n_ip }}</td>
<!-- we will also add show, edit, and delete buttons -->
<td>
<a class="btn btn-small btn-success" href="{{ route('check.create','nvr_id='.$value->nvr_id) }}">Check</a>
<!-- delete the nerd (uses the destroy method DESTROY /nerds/{id} -->
<!-- we will add this later since its a little more complicated than the other two buttons -->
<!-- show the nerd (uses the show method found at GET /nerds/{id} -->
<a class="btn btn-small btn-success" href="{{ route('nvr.show',$value->nvr_id) }}">Show</a>
<!-- edit this nerd (uses the edit method found at GET /nerds/{id}/edit -->
<a class="btn btn-small btn-info" href="{{ route('nvr.edit',$value->nvr_id) }}">Edit</a>
{!! Form::open(['method' => 'DELETE','route' => ['nvr.destroy',$value->nvr_id],'style'=>'display:inline']) !!}
{!! Form::submit('Delete',['class'=>'btn btn-danger']) !!}
{!! Form::close() !!}
</td>
</tr>
@endforeach
</tbody>
โค้ดส่วน controller/checkcontroller
Code
public function create($nvr_id)
{
$item = Nvr::where('nvr_id','=',$nvr_id)
->get();
//$item = Nvr::find($nvr_id);
//$nvr = DB::table('nvrs')->select('n_ip','nvr_id')->get();
return view('check.create',compact('item '));
}
public function store(Request $request, $nvr_id)
{
$check = new check_detail();
$nametest = $check->nvr_id = Input::get('nvr_id');
$check->status_record = Input::get('status_record');
$check->status_hdd = Input::get('status_hdd');
$check->status_camera = Input::get('status_camera');
$check->issue_id = Input::get('issue_id');
$check->comment = Input::get('comment');
$check->check_date = Input::get('check_date');
$file = $check->pic = Input::file('pic');
$imageName = $nametest . '.' .rand(1111, 9999) . '.' .
$file->getClientOriginalName();
$file->move(
base_path() . '/public/img/upload/', $imageName);
$check->save();
return redirect()->route('check.index')
->with('success','Check Create successfully');
}
ช่วยแนะนำวิธีแก้โค้ดหน่อยครับ
หรือผมควรจะศึกษาอะไรเพิ่มครับ
Tag : PHP, MySQL, Laravel Framework
|
|
 |
 |
 |
 |
Date :
2017-08-21 15:48:29 |
By :
kittipan |
View :
1374 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |