From a567d4445c932c489030f48913d8c621ebb4780e Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sun, 30 Jul 2017 20:47:56 +0800 Subject: [PATCH] Added ancestry counts --- resources/views/users/tree.blade.php | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/resources/views/users/tree.blade.php b/resources/views/users/tree.blade.php index 69bfdae..3a21673 100644 --- a/resources/views/users/tree.blade.php +++ b/resources/views/users/tree.blade.php @@ -9,30 +9,42 @@ {{ $user->name }} Pohon Keluarga +
{{ link_to_route('users.tree', $user->name, [$user->id], ['title' => $user->name.' ('.$user->gender.')']) }} @if ($childsCount = $user->childs->count()) +
@foreach($user->childs as $child)
{{ link_to_route('users.tree', $child->name, [$child->id], ['title' => $child->name.' ('.$child->gender.')']) }} @if ($grandsCount = $child->childs->count()) +
@foreach($child->childs as $grand)
{{ link_to_route('users.tree', $grand->name, [$grand->id], ['title' => $grand->name.' ('.$grand->gender.')']) }} @if ($ggCount = $grand->childs->count()) +
@foreach($grand->childs as $gg)
{{ link_to_route('users.tree', $gg->name, [$gg->id], ['title' => $gg->name.' ('.$gg->gender.')']) }} @if ($ggcCount = $gg->childs->count()) +
@foreach($gg->childs as $ggc)
{{ link_to_route('users.tree', $ggc->name, [$ggc->id], ['title' => $ggc->name.' ('.$ggc->gender.')']) }} @if ($ggccCount = $ggc->childs->count()) +
@foreach($ggc->childs as $ggcc)
@@ -59,6 +71,32 @@ @endif
+
+
+
+
 
+ @if ($childsTotal) +
Jumlah Anak
+
{{ $childsTotal }}
+ @endif + @if ($grandChildsTotal) +
Jumlah Cucu
+
{{ $grandChildsTotal }}
+ @endif + @if ($ggTotal) +
Jumlah Cicit
+
{{ $ggTotal }}
+ @endif + @if ($ggcTotal) +
Jumlah Canggah
+
{{ $ggcTotal }}
+ @endif + @if ($ggccTotal) +
Jumlah Wareng
+
{{ $ggccTotal }}
+ @endif +
 
+
@endsection @section ('ext_css')