<table class="display" cellspacing="0" width="100%" id="dd_group_list"> <thead> <tr> <th>Action taken</th> <th>Reported data</th> <th>Contest name</th> <th>Reported by</th> <th>Posted by</th> <th>Media</th> <th>View</th> </tr> </thead> <tbody> <?php $reportdetails = reportflagModel::select('reportflag.contest_id', 'contestparticipant.dropbox_path', 'contestparticipant.uploadtopic', 'contestparticipant.user_id as participantuserid', 'contest.contesttype', 'reportflag.report_userid', 'contest.ID as contestid', 'reportflag.contest_participant_id', 'reportflag.ID as reportflagprimaryid', 'reportflag.action_taken', 'reportflag.postedby_userid', 'reportflag.report_description', 'contestparticipant.ID as contestpartipantid', 'contestparticipant.uploadfile')->LeftJoin('contestparticipant', 'contestparticipant.ID', '=', 'reportflag.contest_participant_id')->LeftJoin('contest', 'contest.ID', '=', 'contestparticipant.contest_id')->get(); for ($i = 0; $i < count($reportdetails); $i++) { $participantdetails = ProfileModel::select('firstname', 'lastname', 'username')->where('ID', $reportdetails[$i]['postedby_userid'])->get()->first(); $reporteduserdetails = ProfileModel::select('firstname', 'lastname', 'username')->where('ID', $reportdetails[$i]['report_userid'])->get()->first(); $contestname = contestModel::select('contest_name')->where('ID', $reportdetails[$i]['contest_id'])->first(); ?> <tr> <td><input type="checkbox" id="action_<?php echo $reportdetails[$i]['contest_participant_id']; ?> " name="action" onclick="action('<?php echo $reportdetails[$i]['contest_participant_id']; ?> ', '<?php echo $reportdetails[$i]['reportflagprimaryid']; ?>