| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- /**
- * File for the team creation action.
- *
- * Implements an action function to be called from the {@see Controller}.
- *
- * @category Action
- */
- /**
- * Logs the user out and redirects to the login page.
- *
- * Reads the POST parameters looking for the following KEYS:
- * uid
- * area_type
- * area
- * stage
- * difficulty
- * ids
- * name
- * description
- * Validates the data and creates the team in the database.
- *
- * @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);
- $statement->bindValue(':id', $id);
- $res = $statement->execute();
- $statement = $db->prepare('DELETE FROM team_unit WHERE team = :id;');
- $statement->bindValue(':uid', $player);
- $statement->bindValue(':id', $id);
- $res = $statement->execute();
- return 0;
- }
- ?>
|