function getTeamInfo() { global $contest; global $team; global $type; global $teamid; global $avail; $teamid = $_GET['id']; if (!checkTeam($teamid)) { error("You can't edit this team"); } if ($avail["teamen"]) { assertPost("teamen"); } if ($avail["teamcn"]) { assertPost("teamcn"); } $_SESSION["teamen"] = $_POST["teamen"]; $team["enname"] = $_POST["teamen"]; $_SESSION["teamcn"] = $_POST["teamcn"]; $team["cnname"] = $_POST["teamcn"]; // $team["date"] = "NOW()"; $type["date"] = 1; $team["cid"] = $contest["cid"]; return true; }
<?php require_once "include/global.php"; require_once "include/db.php"; session_start(); $y = date("Y"); $month = date("m"); if ($month >= 9) { $y++; } $id = $_GET["id"]; if (!$id) { error("Bad Team ID"); } if (!checkTeam($id)) { error("You can't edit this team"); } $fields = array("firstname", "lastname", "cnname", "title", "location", "country", "email", "phone", "gender", "institution", "degree", "major", "majorcn", "admitdate", "graduatedate", "birthday", "grade", "class", "tshirt", "title"); $sql = "SELECT * FROM team WHERE tid = '{$id}'"; $result = mysql_query($sql); if (mysql_num_rows($result) == 0) { error("Bad Team ID"); } $team = mysql_fetch_array($result, MYSQL_ASSOC); if ($team["status"] && !checkAdmin()) { error("Your team is approved. Contact administrator if you want to modify your team infomation."); } ?> <html> <head> <title>Register</title>
<td rowspan="3" align="center"><a href="reg_app.php?id=<?php echo $id; ?> &type=<?php echo $type; ?> ">Approve</a></td> <td rowspan="3" align="center"><a href="password.php?id=<?php echo $id; ?> ">Reset password</a></td> <?php } ?> <?php if (checkTeam($id)) { ?> <td rowspan="3" align="center"><a href="reg_edit.php?id=<?php echo $id; ?> ">Edit</a></td> <td rowspan="3" align="center"><a href="reg_del.php?id=<?php echo $id; ?> &type=<?php echo $type; ?> " onClick="return confirm('Are you sure to delete team <?php print $name; ?> ?')">Delete</a></td>
?> </td> </tr> <?php } } ?> <tr> <td colspan="2" align="center"><a href="reg_status.php#<?php print $id; ?> ">Status</a> <?php if (checkAdmin()) { print '<a href="reg_app.php?id=' . $id . '">Approve</a>'; } if (checkTeam($_GET["id"])) { print '<a href="reg_edit.php?id=' . $id . '">Edit</a> <a href="reg_del.php?id=' . $id . '" onclick="return confirm(\'Are you sure to delete this team?\');">Delete</a>'; } ?> </td> </tr> </table> </div> <?php require "footer.php"; ?> </table> </body> </html>