include $_SERVER['DOCUMENT_ROOT'] . '/functions.php'; ?> <div class="modal-dialog modal-nm"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="myModalLabel"> Delete team </h4> </div> <div class="modal-body"> <form class='form form-horizontal'> <p> Sure you want to delete the team <b><?php echo TeamGetInfoByColumn('name', 'id', $_POST['team_id']); ?> </b>? </p> </form> </div> <div class="modal-footer "> <button type="button" class="btn btn-default" data-dismiss="modal"> Close </button> <button id='delete' type="button" data-dismiss="modal" class="btn btn-danger"> Delete </button> </div> </div> </div>
<div class="modal-body"> <form class='form form-horizontal'> <div class="form-group"> <label class="col-md-4 control-label">Winning team</label> <div class="col-md-8"> <select class="form-control" id="team"> <option></option> <?php include $_SERVER['DOCUMENT_ROOT'] . '/functions.php'; $conn = sql_domain(); $stmt = $conn->prepare('select team_1,team_2 from matches_round_robin where id = :mid'); $stmt->bindParam(':mid', $_POST['match_id']); $stmt->execute(); $teams = $stmt->fetchAll(); echo "<option value='" . $teams[0]['team_1'] . "'>" . TeamGetInfoByColumn('name', 'id', $teams[0]['team_1']) . "</option>"; echo "<option value='" . $teams[0]['team_2'] . "'>" . TeamGetInfoByColumn('name', 'id', $teams[0]['team_2']) . "</option>"; ?> </select> </div> </div> </form> </div> <div class="modal-footer "> <button type="button" class="btn btn-default" data-dismiss="modal"> Close </button> <button id='confirm_winner' data-dismiss="modal" type="button" class="btn btn-success"> Confirm winner </button> </div> </div>
$stmt->execute(); $matches = $stmt->fetchAll(); echo "<table class='table table-striped table-hover'>"; echo "<thead>"; echo "<tr>"; echo "<th>Week</th>"; echo "<th>Team 1</th>"; echo "<th>Team 2</th>"; echo "</tr>"; echo "</thead>"; echo "<tbody>"; foreach ($matches as $m) { echo "<tr>"; echo "<td>Week " . $m['week_id'] . "</td>"; echo "<td>" . TeamGetInfoByColumn('name', 'id', $m['team_1']) . "</td>"; echo "<td>" . TeamGetInfoByColumn('name', 'id', $m['team_2']) . "</td>"; } echo "</tbody></table>"; } ?> </div><!-- /.tab-pane --> <div class="tab-pane" id="tab_2-2"> </div><!-- /.tab-pane --> </div><!-- /.tab-content --> </div><!-- nav-tabs-custom --> </div> </div> </div> <?php } ?>
switch ($key) { case "username": $row[] = "<a href='index?module=user_profile&id=" . $aRow['id'] . "' target='_blank'>" . $aRow["username"] . "</a>"; break; case "email": $row[] = $aRow["email"]; break; case "type": $row[] = GlobalGetAccountType($aRow['type']); break; case "rank": $rank = UserGetStatistics($aRow['id']); $row[] = GlobalGetRank('value', 'id', $rank[0]['rank_solo']); break; case "team": $row[] = TeamGetInfoByColumn('name', 'id', GetTeamOfUser($aRow['id'])); break; case "role": $row[] = GlobalGetRole(GetCurrentRoleOfUser($aRow['id'])); break; case "last_login": if (date('d-m-Y H:i:s', strtotime($aRow['last_login'])) == '01-01-1970 01:00:00') { $row[] = "No data"; } else { $row[] = date('d-m-Y H:i:s', strtotime($aRow['last_login'])); } break; case 'actions': $row[] = ' <button type="button" data-id="' . $aRow['id'] . '" class="btn btn-danger delete"><i class="fa fa-times"></i></button> <button type="button" data-id="' . $aRow['id'] . '" class="btn btn-warning edit"><i class="fa fa-cogs"></i></button>
<th>Captain</th> <th>Status</th> <th>Actions</th> </tr> </thead> <tbody id='tbody_list'> <?php $conn = sql_domain(); $stmt = $conn->prepare('select * from leagues_single_ele_teams where league_id = :l'); $stmt->bindParam(':l', $lid); $stmt->execute(); $result = $stmt->fetchAll(); foreach ($result as $r) { echo "<tr>"; echo "<td>" . TeamGetInfoByColumn('name', 'id', $r['team_id']) . "</td>"; echo "<td>" . UserGetInfoByColumn('username', 'id', TeamGetInfoByColumn('captain_id', 'id', $r['team_id'])) . "</td>"; if ($r['defeated'] == 0) { echo "<td>Active</td>"; } if ($r['defeated'] == 1) { echo "<td>Defeated</td>"; } echo "<td><button type='button' data-id='" . $r['id'] . "' class='btn btn_delete_team btn-danger'><i class='fa fa-times'></i></button></td>"; echo "</tr>"; } ?> </tbody> </table> </div> </div> </div>
?> "> </div> <label for="inputEmail3" class="col-md-2 control-label">Tag</label> <div class="col-md-2"> <input id='tag' type="text" class="form-control" value="<?php echo TeamGetInfoByColumn('tag', 'id', $team_id); ?> "> </div> </div> <div class="form-group "> <label for="inputEmail3" class="col-md-2 control-label">Captain</label> <div class="col-md-4"> <?php echo GetUserSelection('captain', TeamGetInfoByColumn('captain_id', 'id', $team_id)); ?> </div> </div> <?php if ($team_id) { echo "<hr>"; switch ($GLOBALS['package']) { case 1: for ($i = 1; $i < 6; $i++) { echo "<div class='form-group'>"; echo ' <label for="inputEmail3" class="col-md-2 control-label">' . GlobalGetRole($i) . '</label>'; echo '<div class="col-md-5">'; GetUserSelection($i, GetUserForRosterRole($i, $team_id), 'role_selection'); echo "</div>";
} echo '"> <div class="box-body">'; echo "<table class='table'>"; echo "<thead>"; echo "<tr>"; echo "<th>Team 1</th>"; echo "<th>Team 2</th>"; echo "<th>Winning team</th>"; echo "</tr>"; echo "<tbody>"; foreach ($res as $r) { echo "<tr class='matches' data-match='" . $r['id'] . "'>"; echo "<td>" . TeamGetInfoByColumn('name', 'id', $r['team_1']) . "</td>"; echo "<td>" . TeamGetInfoByColumn('name', 'id', $r['team_2']) . "</td>"; echo "<td>" . TeamGetInfoByColumn('name', 'id', $r['winning_team']) . "</td>"; echo "</tr>"; } echo "</tbody>"; echo "</table>"; echo '</div> </div> </div>'; } ?> </div> </div><!-- /.box-body --> </div><!-- /.box --> <script> $('.matches').on('click',function(){ $.ajax({