예제 #1
0
                        <th>Leaderboard </br>regenerate</th>
                        <th>Active/Inactive</th>
                        <th class="tr_wid_button1" align="center"><span class="txt_view">Participant</span></th>
                        <th class="tr_wid_button1" align="center"><span class="txt_edit">Edit</span></th>
                        <th class="tr_wid_edit"><span class="txt_delete">Delete<span></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <?php 
if ($usercontestlist != '') {
    $usercontestlist = contestModel::where('createdby', $usercontestlist)->get();
} else {
    if ($searchkey != '') {
        $usercontestlist = contestModel::where('contest_name', 'like', '%' . $searchkey . '%')->get();
    } else {
        $usercontestlist = contestModel::get();
    }
}
for ($i = 0; $i < count($usercontestlist); $i++) {
    $createdowner = User::select('firstname', 'lastname', 'username')->where('ID', $usercontestlist[$i]['createdby'])->get();
    ?>
                                            <tr>
                                                <td>{{ $i+1; }} </td>
                                                <td class="tr_wid_id"><a href="{{ URL::to('contest_info/'.$usercontestlist[$i]['ID']) }}" style="text-decoration:none;">{{ $usercontestlist[$i]['contest_name'] }}</a></td>
                                               <td><?php 
    if ($createdowner[0]['firstname'] != '') {
        echo $createdowner[0]['firstname'] . ' ' . $createdowner[0]['lastname'];
    } else {
        echo $createdowner[0]['username'];
    }
    ?>