2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
|
|
|
|
2003-08-22 05:36:25 +00:00
|
|
|
require_once("db.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
require_once("util.inc");
|
|
|
|
require_once("team.inc");
|
|
|
|
|
|
|
|
db_init();
|
2003-03-19 21:01:32 +00:00
|
|
|
$user = get_logged_in_user();
|
2003-03-21 04:38:55 +00:00
|
|
|
$teamid = $_POST["teamid"];
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2003-03-21 04:38:55 +00:00
|
|
|
$query = "select * from team where id = $teamid";
|
2002-08-07 18:56:55 +00:00
|
|
|
$result = mysql_query($query);
|
2002-12-16 21:41:41 +00:00
|
|
|
if ($result) {
|
|
|
|
$team = mysql_fetch_object($result);
|
|
|
|
mysql_free_result($result);
|
|
|
|
}
|
|
|
|
require_founder_login($user, $team);
|
|
|
|
|
2003-03-21 04:38:55 +00:00
|
|
|
$team_url = ereg_replace("\"", "'", $_POST["url"]);
|
2003-02-24 21:25:16 +00:00
|
|
|
$x = strstr($team_url, "http://");
|
|
|
|
if ($x) {
|
|
|
|
$team_url = substr($team_url, 7);
|
2002-12-16 21:41:41 +00:00
|
|
|
}
|
2003-03-21 04:38:55 +00:00
|
|
|
$team_name = ereg_replace("\"", "'", $_POST["name"]);
|
|
|
|
$team_name_html = ereg_replace("\"", "'", $_POST["name_html"]);
|
|
|
|
$team_description = ereg_replace("\"", "'", $_POST["description"]);
|
2002-12-16 21:41:41 +00:00
|
|
|
|
2003-02-24 21:25:16 +00:00
|
|
|
$query_team_table = sprintf(
|
|
|
|
"update team set name = '%s',
|
|
|
|
name_html = '%s',
|
|
|
|
url = '%s',
|
|
|
|
description = '%s',
|
2003-03-21 04:38:55 +00:00
|
|
|
type = %d,
|
|
|
|
country='%s'
|
2003-02-24 21:25:16 +00:00
|
|
|
where id = %d",
|
|
|
|
$team_name,
|
|
|
|
$team_name_html,
|
|
|
|
$team_url,
|
|
|
|
$team_description,
|
2003-03-21 04:38:55 +00:00
|
|
|
$_POST["type"],
|
|
|
|
$_POST["country"],
|
2003-02-24 21:25:16 +00:00
|
|
|
$team->id
|
|
|
|
);
|
2003-03-21 04:38:55 +00:00
|
|
|
$result = mysql_query($query_team_table);
|
|
|
|
if ($result) {
|
|
|
|
Header("Location: team_display.php?teamid=$team->id");
|
2003-02-24 21:25:16 +00:00
|
|
|
} else {
|
|
|
|
page_head("Error");
|
2003-03-21 04:38:55 +00:00
|
|
|
echo "Couldn't update team - please try later.\n";
|
|
|
|
page_tail();
|
2003-02-24 21:25:16 +00:00
|
|
|
}
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
?>
|