hardcoded election_id on all kehadiran pages
This commit is contained in:
@@ -15,17 +15,26 @@ class KehadiranController extends Controller
|
||||
*/
|
||||
public function index($id)
|
||||
{
|
||||
//
|
||||
$kehadiranAll = $this->getKehadiranAll($id);
|
||||
$totalkehadiranAll = Voter::where('kehadiran','!=', 0)->count();
|
||||
$votes = Voter::where('election_id', $id)->count();
|
||||
$voters = \App\Voter::where('election_id', $id)->get();
|
||||
|
||||
|
||||
$electionId = 8; // fixed election ID
|
||||
|
||||
$totalkehadiranAll = Voter::where('election_id', $electionId)
|
||||
->whereIn('kehadiran', [1, 2])
|
||||
->count();
|
||||
|
||||
$votes = Voter::where('election_id', $electionId)->count();
|
||||
|
||||
$voters = Voter::where('election_id', $electionId)->get();
|
||||
|
||||
$pdf = App::make('dompdf.wrapper');
|
||||
$pdf->loadView('report.kehadiran-pdf', compact('voters', 'kehadiranAll', 'totalkehadiranAll', 'votes'));
|
||||
$pdf->loadView('report.kehadiran-pdf', compact(
|
||||
'voters',
|
||||
'totalkehadiranAll',
|
||||
'votes'
|
||||
));
|
||||
return $pdf->stream();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function getKehadiranAll($id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user