
I seems that this happens certain days - other days session logs are sorted. Today is 1st of month. Any idea? Conversion from UNIX_TIMESTAMP issue?
Moderator: Thorsten

Code: Select all
<?php
$dir = opendir(PMF_ROOT_DIR."/data");
while ($dat = readdir($dir)) {
if ($dat != "." && $dat != ".." && strlen($dat) == 16 && !is_dir($dat)) {
print "<option value=\"".FileToDate($dat)."\"";
if (date("d.m.Y", FileToDate($dat)) == strftime("%d.%m.%Y", time())) {
print " selected=\"selected\"";
}
print ">";
print date("d.m.Y", FileToDate($dat));
print "</option>\n";
}
}
closedir($dir);
?>readdir()Returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem.
Code: Select all
$dir = opendir(PMF_ROOT_DIR."/data");
$trackingDates = array();
while (false !== ($dat = readdir($dir))) {
if ($dat != "." && $dat != ".." && strlen($dat) == 16 && !is_dir($dat)) {
$trackingDates[] = filemtime('../data/' . $dat);
}
}
closedir($dir);
?>
<label class="left"><?php print $PMF_LANG["ad_stat_browse"]; ?>:</label>
<select name="day" size="1">
<?php
foreach ($trackingDates as $trackingDate) {
printf('<option value="%s"', date("Y-m-d", $trackingDate));
if (date("Y-m-d", $trackingDate) == strftime('%Y-%m-%d', time())) {
print ' selected="selected"';
}
print '>';
print date('Y-m-d', $trackingDate);
print "</option>\n";
}
?>Code: Select all
$trackingDates[] = filemtime('../data/' . $dat);Code: Select all
$trackingDates[] = FileToDate($dat);Code: Select all
<?php
$dir = opendir(PMF_ROOT_DIR."/data");
$trackingDates = array();
while (false !== ($dat = readdir($dir))) {
if ($dat != "." && $dat != ".." && strlen($dat) == 16 && !is_dir($dat)) {
$trackingDates[] = FileToDate($dat);
}
}
closedir($dir);
?>
<label class="left"><?php print $PMF_LANG["ad_stat_browse"]; ?>:</label>
<select name="day" size="1">
<?php
foreach ($trackingDates as $trackingDate) {
printf('<option value="%s"', date("Y-m-d", $trackingDate));
if (date("Y-m-d", $trackingDate) == strftime('%Y-%m-%d', time())) {
print ' selected="selected"';
}
print '>';
print date('Y-m-d', $trackingDate);
print "</option>\n";
}
?>