-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIndexPage.php
162 lines (129 loc) · 3.8 KB
/
IndexPage.php
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
// Business tier class that manages customer accounts functionality
class IndexPage
{
private $_Page = array();
public function __construct()
{
if(isset($_SESSION['input']))
{
$this->_Page = $_SESSION['input'];
}
}
public function __get($key)
{
if (array_key_exists($key, $this->_Page))
echo $this->_Page[$key];
}
public function __set($key, $value)
{
$this->_Page[$key] = $value;
}
public function show_months( $m = '' )
{
$months = array("January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");
if( !empty( $m ) )
$selected = $m;
echo '<select name="mm"><option value="0">--Month--</option>';
for($i = 0; $i<12; $i++)
{
if( isset($selected) && $selected == $i+1 )
echo '<option value="'. ($i+1) .'" selected="selected">' . $months[$i] . '</option>';
else echo '<option value="' . ($i+1) . '">' . $months[$i] . '</option>';
}
echo '</select>';
}
public function show_days( $d = '' )
{
if( !empty( $d ) )
$selected = $d;
echo '<select name="dd"><option value="0">--Day--</option>';
for($i = 1; $i<32; $i++)
{
if( isset($selected) && $selected == $i )
echo '<option value="'. $i .'" selected="selected">' . $i . '</option>';
else echo '<option value="' . $i . '">' . $i . '</option>';
}
echo '</select>';
}
public function show_hour( $hour = '' )
{
if( !empty( $hour ) )
$selected = $hour;
echo '<select name="hh"><option value="-1">--Hour--</option>';
for($i = 0; $i<12; $i++)
{
if( isset($selected) && $selected == $i )
echo '<option value="'. $i .'" selected="selected">' . $i . '</option>';
else echo '<option value="' . $i . '">' . $i . '</option>';
}
echo '</select>';
}
public function show_am_pm( $ampm = '' )
{
if( !empty( $ampm ) )
$selected = $ampm;
echo '<select name="amORpm">';
if( isset($selected) && $selected == 'am' )
echo '<option value="am" selected="selected">AM</option>';
else echo '<option value="am">AM</option>';
if( isset($selected) && $selected == 'pm' )
echo '<option value="pm" selected="selected">PM</option>';
else echo '<option value="pm">PM</option>';
echo '</select>';
}
public function show_minutes( $m = '' )
{
if( !empty( $m ) )
$selected = $m;
echo '<select name="min"><option value="-1">--Minutes--</option>';
for($i = 0; $i<60; $i++)
{
if( isset($selected) && $selected == $i )
echo '<option value="'. $i .'" selected="selected">' . $i . '</option>';
else echo '<option value="' . $i . '">' . $i . '</option>';
}
echo '</select>';
}
public function show_country( $country = '' )
{
$countries = Atlas::GetCountries();
if( !empty( $country ) )
$selected = $country;
else $selected = Atlas::GetCountryByIp();
echo '<select name="country">';
foreach($countries as $country)
{
if($country['country_code'] == $selected)
echo '<option value="'. $country['country_code'] .'" selected="selected">' . $country['country_name'] . '</option>';
else echo '<option value="'. $country['country_code'] .'">' . $country['country_name'] . '</option>';
}
echo '</select>';
}
public function show_country_in_profile( $name, $country = '' )
{
$countries = Atlas::GetCountries();
if( !empty( $country ) )
$selected = $country;
else $selected = Atlas::GetCountryByIp();
echo '<select name="' . $name . '" id="' . $name . '">';
foreach($countries as $country)
{
if($country['country_code'] == $selected)
echo '<option value="'. $country['country_code'] .'" selected="selected">' . $country['country_name'] . '</option>';
else echo '<option value="'. $country['country_code'] .'">' . $country['country_name'] . '</option>';
}
echo '</select>';
}
}?>