E ovako, imam jedno pitanje, posto treba podesiti da se narudzba, tj taj deo o istoj, promeni boja pozadine ako je recimo vise od 18 h, pitanje je kako to da uradim ako sam prethodno definisao da ce biti crnim, odn default. Nije problem kada je <18h onda je zuta pozadina i sve oke, ali preko 18h pozadina je crna i taj tekst je crn. Evo kod i rezultat.
<?php
$sat=Date(H);
if ($sat<18)
{
$boja="yellow";
$poruka="Good Afternoon!";
$bojaslova="black";
}
else
{
$boja="black";
$poruka="Good Evening!";
$bojaslova="white";
}
echo"<body style=\"background-color:$boja;\">";
echo"<p style=\"color:$bojaslova\">$poruka</p>";
if($ticketnumber>1)
echo "<span class='ticket'>The tickets were successfully purchased</span><br />\n";
?>
<?php
$time = date("F j, Y, g:i a");
echo "Purchase time: <span class='ticket'>$time</span><br />\n";
echo "Your name: <span class='ticket'>$name</span><br />\n";
echo "Born: <span class='ticket'>$dayz.$month.$birth_year.</span><br />\n";
echo "Number of tickets: <span class='ticket'>$ticketnumber</span><br />\n";
echo "Ticket type: ";
switch($price){
case "2":echo "<span class='ticket'>football</span><br />\n"; break;
case "3":echo "<span class='ticket'>basketball</span><br />\n"; break;
case "4":echo "<span class='ticket'>voleyball</span><br />\n"; break;}
echo "Payment: <span class='ticket'>$payment</span><br />\n";
echo "Total: <span class='ticket'>$final €</span>\n"
?>
i CSS deo
.ticket{
color:#0f0;
font-size:12px;
}
.podaci{
font-size:12px;
}
|