Day, Month, Year Inputs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
$inventory_options['sold_day']               = $_POST['day'];
$inventory_options['sold_month']             = $_POST['month'];
$inventory_options['sold_year']              = $_POST['year'];
 
$inventory_options['sold_date']              = $_POST['day']."-".$_POST['month']."-".$_POST['year'];
$inventory_options['sold_time']              = strtotime($inventory_options['sold_date']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
             
            <div class="listing_detail_wrap">
                <? $current_sold_time =   (int)htmlspecialchars($inventory_options['sold_time']); ?>                         
                <? $post_month   = date("m", $current_sold_time); ?>                        
                <? $post_year    = date("Y", $current_sold_time); ?>   
                <? $post_day     = date("d", $current_sold_time); ?> 
                <? $post_hour    = date("h", $current_sold_time); ?> 
                <? $post_minute  = date("i", $current_sold_time); ?>               
                 
                <label>Sold Date</label>
                 
                <span>Day</span>
                  <select id="day" name="day" /> 
                    <? for ($x = 0; $x <= 31; $x++) { ?>
                        <? if (empty($post_day)) { $post_day = "01"; } ?>
                        <option value="<? echo $x; ?>" <? if($post_day == "$x") { echo "selected"; } ?> ><? echo $x; ?></option>
                    <? } ?>                
                  </select>
                 
                 
                               
                <span>Month</span>
                <select id="month" name="month">
                            <option value="01" <? if ($post_month == "01") { echo "selected"; } ?>>01-Jan</option>
                            <option value="02" <? if ($post_month == "02") { echo "selected"; } ?>>02-Feb</option>
                            <option value="03" <? if ($post_month == "03") { echo "selected"; } ?>>03-Mar</option>
                            <option value="04" <? if ($post_month == "04") { echo "selected"; } ?>>04-Apr</option>
                            <option value="05" <? if ($post_month == "05") { echo "selected"; } ?>>05-May</option>
                            <option value="06" <? if ($post_month == "06") { echo "selected"; } ?>>06-Jun</option>
                            <option value="07" <? if ($post_month == "07") { echo "selected"; } ?>>07-Jul</option>
                            <option value="08" <? if ($post_month == "08") { echo "selected"; } ?>>08-Aug</option>
                            <option value="09" <? if ($post_month == "09") { echo "selected"; } ?>>09-Sep</option>
                            <option value="10" <? if ($post_month == "10") { echo "selected"; } ?>>10-Oct</option>
                            <option value="11" <? if ($post_month == "11") { echo "selected"; } ?>>11-Nov</option>
                            <option value="12" <? if ($post_month == "12") { echo "selected"; } ?>>12-Dec</option>
                </select>
                 
                 
                <span>Year</span>
                  <select id="year" name="year" />   
                  <? $current_year = date('Y'); ?>
                    <? for ($x = 1940; $x <= $current_year; $x++) { ?>
 
                        <option value="<? echo $x; ?>" <? if($post_year == "$x") { echo "selected"; } ?> ><? echo $x; ?></option>
                    <? } ?>                
                  </select>      
            </div>
Comments
studio2108
molo