/admin_players_youth.php
PHP | 120 lines | 73 code | 23 blank | 24 comment | 5 complexity | a76f41b7c7b8bc5ea86f194b2f58c292 MD5 | raw file
- <?php
- //*******************************************************
- //
- // File: admin_players.php
- // Author: Gavin Uttley
- // Date: 02-AUG-2004
- // Purpose: provide admin function adding players
- //
- // Revisions: 02-AUG-2004 - Initial
- //
- //
- //
- //*******************************************************
-
-
- if(defined("__DEBUG__")) {
- print_r($_POST);
- }
-
- //
- // make sure it dosnt exit prematurly coz of processing limit
- //
- set_time_limit(0);
-
- echo "<form name=\"players_add\" method=\"post\" >";
- table_open("35%");
-
- table_row_open();
- table_data("Players to add:", "left");
- table_data("<input type=\"textbox\" name=\"count\">", "center");
- table_data("Position:", "left");
- table_data(position_select($position), "center");
- table_row_close();
-
- table_row_open();
- table_data("<input type=\"submit\" value=\"Submit\">","right", 4);
- table_row_close();
-
- table_close();
-
- echo "</form>";
-
- if(isset($_POST['position']) & is_numeric($_POST['count'])) {
-
- table_open("75%");
-
- table_row_open();
- table_header("Name" ,"center");
- table_header("Age" ,"center");
- table_header("Side" ,"center");
- table_header("Position" ,"center");
- table_header("Speed" ,"center");
- table_header("Agility" ,"center");
- table_header("Awareness" ,"center");
- table_header("Heading" ,"center");
- table_header("Tackling" ,"center");
- table_header("Passing" ,"center");
- table_header("Shooting" ,"center");
- table_header("Aggression" ,"center");
- table_header("Flair" ,"center");
- table_row_close();
-
-
- for( $i=0; $i<$_POST['count']; $i++) {
-
- table_row_open();
- //
- // Generate the data
- //
- $name = random_name();
- $age = mt_rand(16,19);
- $side = mt_rand(1,3);
-
- if($_POST['position']==0) {
- $position = mt_rand(1,4);
- } else {
- $position = $_POST['position'];
- }
-
- $speed = mt_rand(1,4);
- $agility = mt_rand(1,3);
- $awareness = mt_rand(1,4);
- $heading = mt_rand(1,3);
- $tackling = mt_rand(1,3);
- $passing = mt_rand(1,3);
- $shooting = mt_rand(1,3);
- $aggression = mt_rand(1,6);
- $flair = mt_rand(1,6);
- //
- // Add the player to the db
- //
- player_add($name, $age, $side, $position, $speed, $agility, $awareness, $heading, $tackling, $passing, $shooting, $aggression, $flair, 1, 0);
- //
- // Print the data
- //
- table_data($name, "center");
- table_data($age, "center");
- table_data(foot_name($side), "center");
- table_data(position_name($position), "center");
- table_data($speed, "center");
- table_data($agility, "center");
- table_data($awareness, "center");
- table_data($heading, "center");
- table_data($tackling, "center");
- table_data($passing, "center");
- table_data($shooting, "center");
- table_data($aggression, "center");
- table_data($flair, "center");
-
- table_row_close();
-
- }
-
- table_close();
-
- }
-
-
-
- ?>