| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?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:
- * uid
- * id
- *
- * @return int 0 on success, negative values on error.
- * @category Action
- * @global resource Database connection.
- */
- function action(){
- global $db;
- $player = filter_input(INPUT_POST, 'uid');
- $id = filter_input(INPUT_POST, 'id');
- $statement = $db->prepare('DELETE FROM team WHERE uid = :uid AND id = :id;');
- $statement->bindValue(':uid', $player, SQLITE3_TEXT);
- $statement->bindValue(':id', $id, SQLITE3_TEXT);
- $statement->execute();
- $statement = $db->prepare('DELETE FROM team_unit WHERE team = :id;');
- $statement->bindValue(':uid', $player, SQLITE3_TEXT);
- $statement->bindValue(':id', $id, SQLITE3_TEXT);
- $statement->execute();
- return 0;
- }
- ?>
|