Forum Moderators: coopster
switch ($it) {
case "1":
return "<div style=\"width: 100px; height: 84px; text-align: center; float: left;\"><img src=\"images/pokemon_sprites/001.png\" width=\"100\" height=\"100\" /></div><div style=\"overflow: hidden; width: 100px; float: left; padding-top: 32px; line-height: normal;\"><strong>Bulbasaur</strong><br><span class=\"smallVerdana\">Level 1<br /><div class=\"clear\"><img src=\"battle_files/spacer.gif\" alt=\"sp\"></div>
<div style=\"width: 100px; text-align: left;\">
<div class=\"hpBar\" style=\"width: 100%;\"><img src=\"battle_files/spacer.gif\" alt=\"sp\" style=\"height: 12px;\"></div>45/45 Hit Points<br /><div class=\"clear\"><img src=\"battle_files/spacer.gif\" alt=\"sp\"></div></div>";
break;
case "2":
return "<p><div style=\"width: 100px; height: 84px; text-align: center; float: left;\"><img src=\"images/pokemon_sprites/002.png\" width=\"100\" height=\"100\" /></div><div style=\"overflow: hidden; width: 100px; float: left; padding-top: 32px; line-height: normal;\"><strong>Ivysaur</strong><br><span class=\"smallVerdana\">Level 1<br /><div class=\"clear\"><img src=\"battle_files/spacer.gif\" alt=\"sp\"></div>
<div style=\"width: 100px; text-align: left;\">
<div class=\"hpBar\" style=\"width: 100%;\"><img src=\"battle_files/spacer.gif\" alt=\"sp\" style=\"height: 12px;\"></div>60/60 Hit Points<br /><div class=\"clear\"><img src=\"battle_files/spacer.gif\" alt=\"sp\"></div></div>";
break;
case "3":
return "<p><div style=\"width: 100px; height: 84px; text-align: center; float: left;\"><img src=\"images/pokemon_sprites/003.png\" width=\"100\" height=\"100\" /></div><div style=\"overflow: hidden; width: 100px; float: left; padding-top: 32px; line-height: normal;\"><strong>Venasaur</strong><br><span class=\"smallVerdana\">Level 1<br /><div class=\"clear\"><img src=\"battle_files/spacer.gif\" alt=\"sp\"></div>
<div style=\"width: 100px; text-align: left;\">
<div class=\"hpBar\" style=\"width: 100%;\"><img src=\"battle_files/spacer.gif\" alt=\"sp\" style=\"height: 12px;\"></div>80/80 Hit Points<br /><div class=\"clear\"><img src=\"battle_files/spacer.gif\" alt=\"sp\"></div></div>";
break;
}
how many Pokemon the user has and the picture, name, level and hp will be pulled from the database, so the cases will max at 6 but could be any number between 1-6.
So any help with this would be amazing.
Thanks in advance
Also, it seems from what I can put together that a switch statement is not exactly what you are looking for here. Perhaps once we find out what you are trying to do we can come up with the best possible solution for this.