?> </td> <td><?php echo $result_row->user_name; ?> </td> <td><?php echo $result_row->first_name; ?> </td> <td><?php echo $result_row->last_name; ?> </td> <td><?php echo $result_row->user_type != 4 ? get_teams($result_row->user_id, $team_array) : "--"; ?> </td> <td><?php echo $user_type[$result_row->user_type]; ?> </td> <td> <?php if ($result_row->user_status == 1) { ?> Activated <a onclick="change_status('<?php echo $result_row->user_id; ?> ',0);">Disable?</a> <?php
$result = query($sql); if ($row = mysql_fetch_array($result)) { $service = $row['fi_service']; $team = $row['fi_team']; $advisory = $row['advisory']; $exploit = $row['exploit']; $patch = $row['patch']; $time = $row['submittime']; $time = date("H:i d.m.Y", $row["submittime"]); $score = $row['score']; $judge = $row['judge']; $comment = $row['judgecomment']; } else { die("did not set variable id, or id='{$id}' is no valid advisory"); } $teams = get_teams(); $services = get_services(); $services[0] = "(General Fault)"; if (!$service) { $service = 0; } myhead('Review Advisory'); ?> <p><a href='advisories.php'>Back</a> to the list.</p> <?php echo $message; ?> <form method="post" /> <input type=hidden name=id value="<?php echo $id;
function teams_switch_status($gid, $uid) { global $db; $db->setMode(0); $aktiv = $db->result(DB_PRE . 'ecp_members', 'aktiv', 'userID = ' . $uid . ' AND teamID = ' . $gid); if ($aktiv == 0) { $aktiv = 1; } else { $aktiv = 0; } if ($db->query('UPDATE ' . DB_PRE . 'ecp_members SET aktiv = ' . $aktiv . ' WHERE userID = ' . $uid . ' AND teamID = ' . $gid)) { $_GET['ajax'] = 1; get_teams(); } }
function search($params) { $list = array(); $tried = false; if (strlen($params->keywords)) { $kw = BoincDb::escape_string($params->keywords); $name_lc = strtolower($kw); $list2 = get_teams("name='{$name_lc}'", $params->active); merge_lists($list2, $list, 20); $name_lc = escape_pattern($name_lc); $list2 = get_teams("name like '" . $name_lc . "%'", $params->active); merge_lists($list2, $list, 5); $list2 = get_teams("match(name) against ('{$kw}')", $params->active); merge_lists($list2, $list, 5); $list2 = get_teams("match(name, description) against ('{$kw}')", $params->active); //echo "<br>keyword matches: ",sizeof($list2); merge_lists($list2, $list, 3); $tried = true; } if (strlen($params->country) && $params->country != 'None') { $country = BoincDb::escape_string($params->country); $list2 = get_teams("country = '{$country}'", $params->active); //echo "<br>country matches: ",sizeof($list2); merge_lists($list2, $list, 1); $tried = true; } if ($params->type and $params->type > 1) { $list2 = get_teams("type={$params->type}", $params->active); //echo "<br>type matches: ",sizeof($list2); merge_lists($list2, $list, 2); $tried = true; } if (!$tried) { $list = get_teams("id>0", $params->active); } return $list; }
function search($params) { $list = array(); $tried = false; if (strlen($params->keywords)) { $kw = BoincDb::escape_string($params->keywords); $name_lc = strtolower($kw); $name_lc = escape_pattern($name_lc); $list2 = get_teams("name='{$name_lc}'", $params->active); merge_lists($list2, $list, 20); $list2 = get_teams("name like '" . $name_lc . "%'", $params->active); merge_lists($list2, $list, 5); $list2 = get_teams("match(name) against ('{$kw}')", $params->active); merge_lists($list2, $list, 5); $list2 = get_teams("match(name, description) against ('{$kw}')", $params->active); //echo "<br>keyword matches: ",sizeof($list2); merge_lists($list2, $list, 3); $tried = true; } if (strlen($params->country) && $params->country != 'None') { $list2 = get_teams("country = '{$params->country}'", $params->active); //echo "<br>country matches: ",sizeof($list2); merge_lists($list2, $list, 1); $tried = true; } if ($params->type and $params->type > 1) { $list2 = get_teams("type={$params->type}", $params->active); //echo "<br>type matches: ",sizeof($list2); merge_lists($list2, $list, 2); $tried = true; } if (!$tried) { $list = get_teams("id>0", $params->active); } if (sizeof($list) == 0) { echo 'No teams were found matching your criteria. Try another search. <p>Or you can <a href="team_create_form.php">create a new team</a>.</p> <p>'; team_search_form($params); } else { echo "The following teams match one or more of your search criteria.\n\t\t\tTo join a team, click its name to go to the team page, then click <strong>Join this team</strong>.</p>\n\t\t\t<p>"; sort_list($list); show_list($list); echo "<h2>Change your search</h2>"; team_search_form($params); } }
} function get_match_id($team1, $team2) { $result = DB::query("SELECT * FROM matchups WHERE (team1 = %s AND team2 = %s) OR (team1 = %s AND team2 = %s)", $team1, $team2, $team2, $team1); if (count($result) == 1) { $matchup = $result[0]; } $match_id = $matchup['id']; return $match_id; } $returned_teams = get_teams(); $returned_match = get_match_id($returned_teams[0]['name'], $returned_teams[1]['name']); $result = DB::query("SELECT * FROM votes WHERE mid=%i AND user=%s", $returned_match, $user_id); print $returned_match . ' '; while (count($result) > 0) { $returned_teams = get_teams(); $returned_match = get_match_id($returned_teams[0]['name'], $returned_teams[1]['name']); $result = DB::query("SELECT * FROM votes WHERE mid=%i AND user=%s", $returned_match, $user_id); print $returned_match; } $team1 = $returned_teams[0]['name']; $team2 = $returned_teams[1]['name']; $team1_pic = $returned_teams[0]['image']; $team2_pic = $returned_teams[1]['image']; // Select statement ... get a random match from teams // Check to see if it has been voted on // If they have, get another // If they havent, then use it // Once clicked on make an ajax call to update the database // Insert statement that will add vote to votes table // this needs the MID and the team