echo function write_one_players team PHP_EOL заполнение списка игроков

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
echo 'function write_one_players(team)'.PHP_EOL;//заполнение списка игроков
echo '{'.PHP_EOL;
echo 'document.getElementById(\'th_1\').innerHTML=\'игрок\';'.PHP_EOL;
echo 'var s;'.PHP_EOL;
echo 'if (team==id_team1)'.PHP_EOL;
echo 'for (i=1;i<=count_t1_in;i++)'.PHP_EOL;
echo 's=s+\'<option \'+\'value="\'+numbers_t1_in[i]+\'">\'+players_t1_in[i]+\'</option>\';'.PHP_EOL;
echo 'else'.PHP_EOL;
echo 'for (i=1;i<=count_t2_in;i++)'.PHP_EOL;
echo 's=s+\'<option \'+\'value="\'+numbers_t2_in[i]+\'">\'+players_t2_in[i]+\'</option>\';'.PHP_EOL;
echo 'document.getElementById(\'td_1\').innerHTML=\'<select name="player1" id="player1">\'+s+\'</select>\';'.PHP_EOL;
echo '}'.PHP_EOL.PHP_EOL;
echo 'function write_players2(team)'.PHP_EOL;//заполнение списка замены
echo '{'.PHP_EOL;
echo 'document.getElementById(\'th_2\').innerHTML=\'замена\';'.PHP_EOL;
echo 'var s;'.PHP_EOL;
echo 'if (team==id_team1)'.PHP_EOL;
echo 'for (i=1;i<=count_t1_out;i++)'.PHP_EOL;
echo 'if (document.getElementById(\'player1\').value!=numbers_t1_out[i]) s=s+\'<option \'+\'value="\'+numbers_t1_out[i]+\'">\'+players_t1_out[i]+\'</option>\';'.PHP_EOL;
echo 'if (team==id_team2)'.PHP_EOL;
echo 'for (i=1;i<=count_t2_out;i++)'.PHP_EOL;
echo 'if (document.getElementById(\'player1\').value!=numbers_t2_out[i]) s=s+\'<option \'+\'value="\'+numbers_t2_out[i]+\'">\'+players_t2_out[i]+\'</option>\';'.PHP_EOL;
echo 'document.getElementById(\'td_2\').innerHTML=\'<select name="player2" id="player2">\'+s+\'</select>\';'.PHP_EOL;
echo '}'.PHP_EOL.PHP_EOL;