03-13-2012, 06:31 PM
|
#6 (permalink)
|
|
The Acquainted
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
|
I got this figured out. Where is what I did...
PHP Code:
<select name="start">
<option value="">-Select One-</option>
<?php
$query = "SELECT " . $tab['timesheet'] . ".stop FROM " . $tab['timesheet'] . " WHERE user = " . $user['id'] . " ORDER BY timesheets.stop DESC LIMIT 1";
$result = mysql_fetch_array(mysql_query($query));
$lastTime = date("g:i A", strtotime("01/27/2012 " . $result['stop']));
$start = date('G', strtotime("01/27/2012"));
$minutes = 0;
for ($i = 0; $i < 96; $i++) {
$start = date("g:i A", strtotime("01/27/2012 + " . $minutes . " minutes"));
?>
<option value="<?php
echo "$start";
?>" <?php
echo ($start == $lastTime) ? "selected" : "";
?> >
<?php
echo $start;
?>
</option>
<?php
$minutes += 15;
$start = date("G", strtotime("01/27/2012 + " . $minutes . " minutes"));
} //$i = 0; $i < 96; $i++
?>
</select>
|
|
|
|