I have soccer page and i need adjustment for the following code
I tried many time but unfortunately i failed to make it
- Modefied code
<?php
// Show the score unless the game has not been played yet
print '<font color="#800000">';
if ($scores['winortie'] != 3) { print $scores['rf'] . ' : ' . $scores['ra'];
if ($scores['ef'] != 0 && $scores['ea']!= 0) {
print '<b><font size="3"><font color=red > (Fulltime)';
}
if ($scores['winortie'] == 2 || $scores['winortie'] == 5) {
print '<b><font size="3"><font color="black"> (Forfiet)';
}
print '<br><font color="#000080">';
if ($scores['ef'] != 0 && $scores['ea']!= 0) { print $scores['ef'] . ' : ' . $scores['ea']; {
print '<b><font size="3"><font color=#800080" > (Extra time)';
}
print '<br><font color="#008000">';
if (($scores['ef'] == $scores['ea']) && ($scores['pf'] != 0 && $scores['pa']!= 0)) { print $scores['pf'] . ' : ' . $scores['pa']; {
print '<b><font size="3"><font color=blue > (Penalty)';
}
print '<br><font color="#008000">';
if (($scores['rf'] == $scores['ra']) && ($scores['pf'] && $scores['pa']!= 0) && ! ($scores['ef'] && $scores['ea'])) { print $scores['pf'] . ' : ' . $scores['pa']; {
print '<b><font size="3"><font color=red > (Penalty)';
}
}
}
}
print '</td>';
}
- the original code :
<?php } ?>
<td><?php print $scores['rf'] . ' - ' . $scores['ra'];
if ($scores['winortie'] == 2 || $scores['winortie'] == 5) {
print ' (ff)';
}
print '</td>';
?>
some abbreviations before start my inqury:
rf = Runs for
ra = Runs against
ef = Extra time for
ea = Extra time against
pf = penalty for
pa = penalty against
$scores[‘winortie’] = 3 mean play
$scores[‘winortie’] == 2 mean Beat (by forfeit)
$scores[‘winortie’] == 5 mean Lost to (by forfeit)
$scores[‘winortie’] == 0 mean ties
print $scores[‘rf’] . ’ : ’ . $scores[‘ra’]; ====> for main time
print $scores[‘ef’] . ’ : ’ . $scores[‘ea’]; ===> for extra time
{ print $scores[‘pf’] . ’ : ’ . $scores[‘pa’]; =====> for penalty
as you know in cup soccer matches
– games ended in fulltime
-
games ended after extra time
-
games go after extra time to penalty
-
some matched when did not ended in fulltime go directly to penalty without extratime
-
my request to modify the code as
– if the game ended in full time - I will get the result of full time result ( without mention full time word) -
if the game ended after extra time - I will get the result of game ( both full time and extra time ) with mention that the game has extra time , I do not need to mention full time as well
-
if the game goes after extra time to penalty : I will get the (full time result + Extra time result + penalty result ) and mention that the game has extra time and penalty
-
if the game when did not ended in fulltime and went directly to penalty kick without extratime : i will get (full time result + penalty result) and mention only penalty word
from my modified code (which I used some information from this page) :
- I got the result of games that ended in the full time ( without extra time or penalty)
and also the games that ended by Beat (by forfeit) or Lost to (by forfeit) and I also got ==> print ’ (forfeit)’;
this part of code is ok
- if the game ended in extra time : i got the full time result , extra time result and print ’ (Extra time)’;
which is ok
- if the game did not ended after extra time and extended to penalty kick
I got the full time result + Extra time result + penalty result (+) (print extra result & print penalty) in front of each result
which is ok as well
but if the games not ended in the full time ( for example ties by any result ) and the match went directly to penalty without extra time
the code display the full time and does not showed the penalty result and showing print ’ (penalty)’;
I want any way to adjust the last part or even the whole code to give me what I want
is there any idea how can correct the code,