| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- /**
- * File for the team creation action.
- *
- * Implements an action function to be called from the {@see Controller}.
- *
- * @category Action
- */
- /**
- * Deletes a team.
- *
- * Reads the POST parameters looking for the following KEYS:
- * player
- * id
- *
- * @return int 0 on success, negative values on error.
- * @category Action
- */
- function action(){
- $player = filter_input(INPUT_POST, 'player');
- $id = filter_input(INPUT_POST, 'id');
- $statement = get_context()->get_db()->prepare('DELETE FROM team WHERE player = :player AND id = :id;');
- $statement->bindValue(':player', $player, SQLITE3_TEXT);
- $statement->bindValue(':id', $id, SQLITE3_TEXT);
- $statement->execute();
- $statement = get_context()->get_db()->prepare('DELETE FROM team_unit WHERE team = :id;');
- $statement->bindValue(':id', $id, SQLITE3_TEXT);
- $statement->execute();
- return 0;
- }
- ?>
|