Wie ich zwei verschiedene Zeilenfarben in eine neue Tabelle bekomme, weiß ich, aber ich komme hier in dem schon vorhandenen Script nicht weiter.
Ich mag, dass jede zweite Zeile eine andere Farbe hat.
Kann mir das jemand mal zeigen bzw. anpassen?
Ich mag, dass jede zweite Zeile eine andere Farbe hat.
Kann mir das jemand mal zeigen bzw. anpassen?
PHP:
<?php
$handle = opendir($ordner);
if(!isset($_GET['file'])){
?>
<table>
<tr>
<th>Titel</th>
<th>Release</th>
<th></th>
</tr>
<?php
while(($file = readdir($handle)) !== FALSE){
if($file != '.' && $file !='..'){
$sql = mysql_query("SELECT * FROM `".$tabelle."` WHERE `titel`='".mysql_real_escape_string($file)."'");
if(mysql_num_rows($sql)<1){
$file_temp = preg_replace("/(\')+/", "\'",$file);
$entry = mysql_query("INSERT INTO `".$tabelle."` ( `id` , `titel` , `datum` , `clicks`, `zeit`, `filesize`)VALUES (NULL , '".$file_temp."', '".date ("Y.m.d", filemtime($ordner."/".$file))."' , '0', '".date("H:i:s", filemtime($ordner."/".$file))."','".filesize($ordner."/".$file)."') ")
or die("Momentan besteht ein Fehler in der Datenbank, bitte haben sie einen Moment Geduld, es wird daran gearbeitet.");
}
}
}
//Datum und Zeit
$sql2 = mysql_query("SELECT * FROM `".$tabelle."` ORDER BY `datum` DESC ,`zeit` DESC");
while($row = mysql_fetch_assoc($sql2) ){
$an = 0;
$file = $row['titel'];
$file = preg_replace("/(\\\'){1}+/","'",$file);
if(!file_exists($ordner."/".$file)){
;
$del = mysql_query("DELETE FROM `".$tabelle."` WHERE `titel`='".mysql_real_escape_string($file)."'");
$an = 1;
}
if($an!=1){
$yahr = substr($row['datum'],0,4);
$monat = substr($row['datum'],5,2);
$tag = substr($row['datum'],8,2);
$titel = $row['titel'];
$titel = preg_replace("/(\ß)+/","%DF",$titel);
?>
<tr align="center" class="middle">
<td align="left"><?php echo $titel; ?></td>
<td><?php
//Datum ermitteln bzw. anzeigen
if( $tag == "00" && $monat == "00" && $yahr == "0000"){
echo "unbekannt";
}elseif( $tag == "00" && $monat == "00" && $yahr != "0000"){
echo $yahr;
} else {
echo $tag.".".$monat.".".$yahr; }?>
</td>
<td>Irgendwas</td>
<td>anderer Inhalt</td>
</tr>
<?php //Klammer schließen
}
}
?>
</table>
<br>
<?php
} else {
// und so weiter
?>