Gestion des heures et minutes dans select_date()
This commit is contained in:
parent
43869a2437
commit
00c395daf8
@ -73,7 +73,7 @@ class Form {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Function select_date($set_time='')
|
Function select_date($set_time='', $h = 0, $m = 0)
|
||||||
{
|
{
|
||||||
if (! $set_time)
|
if (! $set_time)
|
||||||
{
|
{
|
||||||
@ -98,6 +98,8 @@ class Form {
|
|||||||
$cday = date("d", $set_time);
|
$cday = date("d", $set_time);
|
||||||
$cmonth = date("n", $set_time);
|
$cmonth = date("n", $set_time);
|
||||||
$syear = date("Y", $set_time);
|
$syear = date("Y", $set_time);
|
||||||
|
$shour = date("H", $set_time);
|
||||||
|
$smin = date("i", $set_time);
|
||||||
|
|
||||||
print "<select name=\"reday\">";
|
print "<select name=\"reday\">";
|
||||||
|
|
||||||
@ -130,7 +132,7 @@ class Form {
|
|||||||
}
|
}
|
||||||
print "</select>";
|
print "</select>";
|
||||||
|
|
||||||
print "<select name=\"reyear\">";
|
print '<select name="reyear">';
|
||||||
|
|
||||||
for ($year = $syear - 2; $year < $syear + 5 ; $year++)
|
for ($year = $syear - 2; $year < $syear + 5 ; $year++)
|
||||||
{
|
{
|
||||||
@ -145,6 +147,50 @@ class Form {
|
|||||||
}
|
}
|
||||||
print "</select>\n";
|
print "</select>\n";
|
||||||
|
|
||||||
|
if ($h)
|
||||||
|
{
|
||||||
|
print '<select name="rehour">';
|
||||||
|
|
||||||
|
for ($hour = 0; $hour < 24 ; $hour++)
|
||||||
|
{
|
||||||
|
if (strlen($hour) < 2)
|
||||||
|
{
|
||||||
|
$hour = "0" . $hour;
|
||||||
|
}
|
||||||
|
if ($hour == $shour)
|
||||||
|
{
|
||||||
|
print "<option value=\"$hour\" SELECTED>$hour";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<option value=\"$hour\">$hour";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</select>H\n";
|
||||||
|
|
||||||
|
if ($m)
|
||||||
|
{
|
||||||
|
print '<select name="remin">';
|
||||||
|
|
||||||
|
for ($min = 0; $min < 60 ; $min++)
|
||||||
|
{
|
||||||
|
if (strlen($min) < 2)
|
||||||
|
{
|
||||||
|
$min = "0" . $min;
|
||||||
|
}
|
||||||
|
if ($min == $smin)
|
||||||
|
{
|
||||||
|
print "<option value=\"$min\" SELECTED>$min";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<option value=\"$min\">$min";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</select>M\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user