Commit 5f3d8a31 by Novan Bagus Setiawan

update kelompok filter with tahun

parent 7b6e6291
...@@ -31,6 +31,9 @@ class KelompokController extends Controller ...@@ -31,6 +31,9 @@ class KelompokController extends Controller
$status = $request->get('status'); $status = $request->get('status');
$tahun= $request->get('tahun'); $tahun= $request->get('tahun');
if($tahun == '0')
$tahun = date('Y');
## Read value ## Read value
$draw = $request->get('draw'); $draw = $request->get('draw');
$start = $request->get("start"); $start = $request->get("start");
...@@ -58,7 +61,7 @@ class KelompokController extends Controller ...@@ -58,7 +61,7 @@ class KelompokController extends Controller
if($tahun != "0") if($tahun != "0")
{ {
$statementGlobal .= " AND TO_CHAR(CREATED_AT, 'YYYY') = '".$tahun."'"; $statementGlobal .= " AND TO_CHAR(KELOMPOK.CREATED_AT, 'YYYY') = '".$tahun."'";
} }
$totalRecords = Kelompok::select('count(1) as allcount')->whereRaw($statementGlobal)->count(); $totalRecords = Kelompok::select('count(1) as allcount')->whereRaw($statementGlobal)->count();
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<select class="form-select" name="reqTahun" id="reqTahun"> <select class="form-select" name="reqTahun" id="reqTahun">
<option value="0">Semua</option> <option value="0">Semua</option>
@foreach ($periode as $res) @foreach ($periode as $res)
<option value="{{ $res->nama }}">{{ $res->nama }}</option> <option value="{{ $res->nama }}" @php if($res->nama == date('Y')) echo 'selected'; @endphp>{{ $res->nama }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment