switch($trafiony) { case $trafiony == 1: switch ($cel) { case $cel == 1: $smarty -> assign ("Error", "<center>1 </center>"); $smarty -> display ('error.tpl'); break; case $cel == 2: $smarty -> assign ("Error", "<center> 2 </center>"); $smarty -> display ('error.tpl'); break; case $cel == 3: $smarty -> assign ("Error", "<center> 3 </center>"); $smarty -> display ('error.tpl'); break; case $cel == 4: $smarty -> assign ("Error", "<center> 4 </center>"); $smarty -> display ('error.tpl'); break; case $cel == 5: $smarty -> assign ("Error", "<center> 5 </center>"); $smarty -> display ('error.tpl'); break; } break; case $trafiony <= $a && $trafiony < 100: If ($un > $unk) { $smarty -> assign ("Error", "<center> Zle </center>"); $smarty -> display ('error.tpl'); } else { $smarty -> assign ("Error", "<center> Dobrze </center>"); $smarty -> display ('error.tpl'); } break; case $trafiony > $a && $trafiony < 100: $smarty -> assign ("Error", "<center> PUDŁO</center>"); $smarty -> display ('error.tpl'); break; case $trafiony == 100: switch ($odp) { case $odp <= $b && $odp < 100: $smarty -> assign ("Error", "<center> Udało się</center>"); $smarty -> display ('error.tpl'); break; case $odp == 100: $smarty -> assign ("Error", "<center> Nie udalo sie</center>"); $smarty -> display ('error.tpl'); break; } break; }
Cały kod hula jak trzeba. Każdy warian odpowiednio wyswietla w zależności od zmiennych.
Prolbem zaczyna się gdy trafiony == 100 i odp == 100 Wtedy nie wyswietla tekstu który powinien być wyswietlony.
Warunek dla trafiony 100, odp <= od b i od <100 działa poprawnie.
Kod testowałem wiele razy,a nawet bardzo wiele, dlatego bezwzglednie wykluczam możliwośc że nie wylosowało mi trafiony 100 odp 100.
Włosy sobie wyrywam z głowy bo za cholerę nie moge dojść do tego czemu skrypt sypie się w tym miejscu