@extends('layouts.app_main') @section('content')
Children
{{ csrf_field() }} @forelse(Auth::user()->children as $child) @empty @endforelse
Name Sex Date of Birth Satus  
{{$child->name}} {{$child->sex}} {{$child->dob}} {{$child->status}} Edit
Enter child's details below.
@if ($errors->has('name')) {{ $errors->first('name') }} @endif @if ($errors->has('sex')) {{ $errors->first('sex') }} @endif
@if ($errors->has('dob')) {{ $errors->first('dob') }} @endif
@if ($errors->has('status')) {{ $errors->first('status') }} @endif
@endsection @section('javascript') $(function (){ $('#datetimepicker1').datepicker({ format: 'yyyy-mm-dd', zIndexOffset: '1001', }); $('.edit').on('click',function(event){ event.preventDefault(); $('.noedit').hide(); $('#id').val($(this).closest('.child_id').attr('detail_data')); $('#name').val($(this).closest('.child_id').siblings('.child_name').attr('detail_data')); $('#sex').val($(this).closest('.child_id').siblings('.child_sex').attr('detail_data')); $('#dob').val($(this).closest('.child_id').siblings('.child_dob').attr('detail_data')); $('#status').val($(this).closest('.child_id').siblings('.child_status').attr('detail_data')); }) }); @endsection