last question today! promise!
Posted: Mon Oct 30, 2006 4:11 pm
I have the following function that expects and array called $data. How do I get the following form posts into the array that will be used when I call this function? I did not write these functions. Though I have a programming background, its not PHP, so any help is appreciated. I promise you wont have to explain it more than once!
$found = false;
$client = $_POST['client_' . $val];
$home = $_POST['home_' . $val];
$away = $_POST['away_' . $val];
$sport_id = $_POST['sportid'];
$teamname = '';
$team_id = -1;
$true = true;
$false = false;
$found = false;
$client = $_POST['client_' . $val];
$home = $_POST['home_' . $val];
$away = $_POST['away_' . $val];
$sport_id = $_POST['sportid'];
$teamname = '';
$team_id = -1;
$true = true;
$false = false;
Code: Select all
/********************************************************
void AddTeam($data);
Description:
This will add a Team for $this->employer_id
********************************************************/
function AddTeam($data)
{
$retval = false;
if($this->EmployerExists($this->employer_id))
{
if(!$this->GetTeamLink($data['team_id']) )
{
$sqlstr = <<< SQL
INSERT INTO
businesses.employer_team (employer_id, team_id, home, away)
VALUES ($this->employer_id, $data[team_id], $data[home], $data[away])
SQL;
}
else if(!$this->TeamState($data))
{
$sqlstr = <<< SQL
UPDATE
businesses.employer_team
SET
status_id = 1,
home = $data[home],
away = $data[away]
WHERE
employer_id = $this->employer_id AND
team_id = $data[team_id]
SQL;
}
if($this->Load($sqlstr))
{
$retval = true;
}
}
return $retval;
} // AddTeam()