PHP alapú naptár probléma
Sziasztok!
Találtam, majd egy kicsit javítottam a következő PHP alapú naptáron:A következő a probléma: ha az esemény és a mai nap egy napon van, akkor nem lesz más színű a szöveg, hogy ma van, hanem csak az adott naphoz rendelt eseményt jeleníti meg! van rá valami megoldás?! Remélem nem voltam túl bonyolult!
Előre is köszönöm!
Üdvözlettel: Juhász Balázs - Jusztinn
■ Találtam, majd egy kicsit javítottam a következő PHP alapú naptáron:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <style>
- .table {
- width: 152px;
- height: auto;
- margin: 0px;
- padding: 0px;
- text-align: center;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11px;
- font-style: normal;
- line-height: normal;
- color: #CCC;
- text-decoration: none;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- }
- .honap_nev {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
- font-style: normal;
- line-height: normal;
- font-weight: bolder;
- font-variant: normal;
- text-transform: none;
- color: #CCC;
- text-decoration: none;
- }
- .napok {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11px;
- font-style: normal;
- line-height: normal;
- color: #CCC;
- text-decoration: none;
- font-weight: bolder;
- font-variant: normal;
- text-transform: none;
- text-align: center;
- }
- .esemény
- {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11px;
- font-style: normal;
- line-height: normal;
- font-weight: bolder;
- font-variant: normal;
- text-transform: none;
- color: #F00;
- text-decoration: none;
- text-align: center;
- padding: 0px;
- }
- .ma {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11px;
- font-style: normal;
- line-height: normal;
- color: #CCC;
- text-decoration: none;
- font-weight: bolder;
- font-variant: normal;
- text-transform: none;
- padding-top: 0px;
- padding-right: 0px;
- padding-bottom: 0px;
- padding-left: 0px;
- border: thin solid #CCC;
- }
- a span {
- display: none;
- }
- a:hover {
- position: relative;
- }
- a:hover span {
- display: block;
- position: absolute;
- }
- a:hover span {
- top: 10px;
- center: 0;
- color: #CCCCCC;
- text-decoration: none;
- border: 2px solid #CCC;
- background-color: #1a1a1a;
- height: auto;
- width: 180px;
- padding: 3px;
- text-align: center;
- font-family: Arial, Helvetica, sans-serif;
- }
- .vonal {
- background-color: #FFF;
- width: 148px;
- height: 1px;
- margin-right: auto;
- margin-left: auto;
- margin-top: 3px;
- margin-bottom: 3px;
- }
- a {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 11px;
- font-style: normal;
- line-height: normal;
- text-decoration: none;
- color: #F00;
- font-weight: bolder;
- font-variant: normal;
- text-transform: none;
- }
- .res {
- height: 2px;
- width: auto;
- background-color: #1a1a1a;
- }
- </style>
- </head>
- <body class="body">
- <?php
- $honapok = array(1 => 'Január', 2 => 'Február', 3 => 'Március', 4 => 'Április', 5 => 'Május', 6 => 'Június', 7 => 'Július', 8 => 'Augusztus', 9 => 'Szeptember', 10 => 'Október', 11 => 'November', 12 => 'December');
- $esemeny[2][18] = '<strong>WRST Admin</strong><div class="res"></div>Teljes mértékben használható lett az eseménynaptár!<div class="vonal"></div>';
- $esemeny[2][19] = '<strong>WRST Admin</strong><div class="res"></div>Teljes mértékben használható lett az eseménynaptár!<div class="vonal"></div>';
- $ma = getdate();
- $elsoNap = getdate(mktime(0,0,0,$ma['mon'],1,$ma['year']));
- $utolsoNap = getdate(mktime(0,0,0,$ma['mon']+1,0,$ma['year']));
- $honap = $ma['mon'];
- $nap = $ma['mday'];
- $utolso = $utolsoNap['mday'];
- $elso = $elsoNap['wday'];
- $elso--;
- ?>
- <center>
- <table widht="152" height="auto" border="0" align="center" class="table">
- <caption class="honap_nev"><?php echo $honapok[$honap]; ?></caption>
- <tr class="napok"> <td> <div align="center">H</div></td><td> <div align="center">K</div></td><td> <div align="center">Sz</div></td><td> <div align="center">Cs</div></td><td> <div align="center">P</div></td><td> <div align="center">Sz</div></td><td> <div align="center">V</div></td> </tr>
- <tr style= align="center">
- <?php
- if( $elso == 6 ) {
- for($i=1; $i < 7; $i++) {
- echo '<td>'.' '.'</td>';
- $tor = 6;
- }
- }
- else {
- for($i=0; $i < $elso; $i++) {
- echo '<td> </td>';
- }
- $tor = $i;
- }
- $tor = $i;
- for($i=1;$i<=$utolso;$i++) {
- if( isset( $esemeny[$honap][$i] ) )
- echo '<td class="esemény" align="center" color="F00" font-weight="bolder"><a href="#">'.$i.'<span>'.$esemeny[$honap][$i].'</span></a></td>';
- else echo $nap == $i ? '<td class="ma" align="center" border="thin solid #CCC">'.$i.'</td>' : '<td>'.$i.'</td>';
- $tor++;
- if( $tor % 7 == 0 ) echo '</tr><tr>';
- }
- ?>
- </tr>
- </table>
- </center>
- </body>
- </html>
Előre is köszönöm!
Üdvözlettel: Juhász Balázs - Jusztinn
ma
Probléma...
Üdvözlettel: Juhász Balázs - Jusztinn
Nem értem a problémát
Egyébként valószínűleg Poetro megoldása lesz a nyerő.
Köszönöm...
Üdvözlettel: Juhász Balázs - Jusztinn