Advertisement
munsking

php time options

Jul 19th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. /*
  2.  *  select options for a list of time, values in seconds, first hour is separated into 1/4 hours, rest in 1/2
  3.  */
  4.  
  5. <?
  6.     for($i=0;$i<4;$i++){?>
  7.         <option <?=($status->countdown==$i?"selected":"")?> value="<?=($i*15)*60?>">00:<?=str_pad($i*15,2,0)?></option>
  8.     <?}
  9. ?>
  10. <?
  11.     for($i=4;$i<27;$i++){?>
  12.         <option <?=($status->countdown==$i?"selected":"")?> value="<?=(($i-2)*30)*60?>"><?=str_pad(round(($i-3)/2),2,0,STR_PAD_LEFT)?>:<?=($i%2==0?"00":"30")?></option>
  13.     <?}
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement