本文整理汇总了PHP中print_month_option_list函数的典型用法代码示例。如果您正苦于以下问题:PHP print_month_option_list函数的具体用法?PHP print_month_option_list怎么用?PHP print_month_option_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_month_option_list函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_date_selection_set
/**
*
* @param string $p_name
* @param string $p_format
* @param int $p_date
* @param bool $p_default_disable
* @param bool $p_allow_blank
* @param int $p_year_start
* @param int $p_year_end
* @return null
* @access public
*/
function print_date_selection_set($p_name, $p_format, $p_date = 0, $p_default_disable = false, $p_allow_blank = false, $p_year_start = 0, $p_year_end = 0)
{
$t_chars = preg_split('//', $p_format, -1, PREG_SPLIT_NO_EMPTY);
if ($p_date != 0) {
$t_date = preg_split('/-/', date('Y-m-d', $p_date), -1, PREG_SPLIT_NO_EMPTY);
} else {
$t_date = array(0, 0, 0);
}
$t_disable = '';
if ($p_default_disable == true) {
$t_disable = ' disabled="disabled"';
}
$t_blank_line = '';
if ($p_allow_blank == true) {
$t_blank_line = "<option value=\"0\"></option>";
}
foreach ($t_chars as $t_char) {
if (strcmp($t_char, "M") == 0) {
echo "<select ", helper_get_tab_index(), " name=\"" . $p_name . "_month\"{$t_disable}>";
echo $t_blank_line;
print_month_option_list($t_date[1]);
echo "</select>\n";
}
if (strcmp($t_char, "m") == 0) {
echo "<select ", helper_get_tab_index(), " name=\"" . $p_name . "_month\"{$t_disable}>";
echo $t_blank_line;
print_numeric_month_option_list($t_date[1]);
echo "</select>\n";
}
if (strcasecmp($t_char, "D") == 0) {
echo "<select ", helper_get_tab_index(), " name=\"" . $p_name . "_day\"{$t_disable}>";
echo $t_blank_line;
print_day_option_list($t_date[2]);
echo "</select>\n";
}
if (strcasecmp($t_char, "Y") == 0) {
echo "<select ", helper_get_tab_index(), " name=\"" . $p_name . "_year\"{$t_disable}>";
echo $t_blank_line;
print_year_range_option_list($t_date[0], $p_year_start, $p_year_end);
echo "</select>\n";
}
}
}
示例2: print_filter_do_filter_by_date
function print_filter_do_filter_by_date($p_hide_checkbox = false)
{
global $t_filter;
?>
<table cellspacing="0" cellpadding="0">
<?php
if (!$p_hide_checkbox) {
?>
<tr><td colspan="2">
<input type="checkbox" name="do_filter_by_date" <?php
check_checked($t_filter['do_filter_by_date'], 'on');
if (ON == config_get('use_javascript')) {
print "onclick=\"SwitchDateFields();\"";
}
?>
/>
<?php
echo lang_get('use_date_filters');
?>
</td></tr>
<?php
}
$t_menu_disabled = 'on' == $t_filter['do_filter_by_date'] ? '' : ' disabled ';
?>
<!-- Start date -->
<tr>
<td>
<?php
echo lang_get('start_date');
?>
:
</td>
<td nowrap="nowrap">
<?php
$t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
foreach ($t_chars as $t_char) {
if (strcasecmp($t_char, "M") == 0) {
print "<select name=\"start_month\" {$t_menu_disabled}>";
print_month_option_list($t_filter['start_month']);
print "</select>\n";
}
if (strcasecmp($t_char, "D") == 0) {
print "<select name=\"start_day\" {$t_menu_disabled}>";
print_day_option_list($t_filter['start_day']);
print "</select>\n";
}
if (strcasecmp($t_char, "Y") == 0) {
print "<select name=\"start_year\" {$t_menu_disabled}>";
print_year_option_list($t_filter['start_year']);
print "</select>\n";
}
}
?>
</td>
</tr>
<!-- End date -->
<tr>
<td>
<?php
echo lang_get('end_date');
?>
:
</td>
<td>
<?php
$t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
foreach ($t_chars as $t_char) {
if (strcasecmp($t_char, "M") == 0) {
print "<select name=\"end_month\" {$t_menu_disabled}>";
print_month_option_list($t_filter['end_month']);
print "</select>\n";
}
if (strcasecmp($t_char, "D") == 0) {
print "<select name=\"end_day\" {$t_menu_disabled}>";
print_day_option_list($t_filter['end_day']);
print "</select>\n";
}
if (strcasecmp($t_char, "Y") == 0) {
print "<select name=\"end_year\" {$t_menu_disabled}>";
print_year_option_list($t_filter['end_year']);
print "</select>\n";
}
}
?>
</td>
</tr>
</table>
<?php
}
示例3: print_filter_do_filter_by_date
/**
* Print filter by date fields
* @param boolean $p_hide_checkbox Hide data filter checkbox.
* @return void
*/
function print_filter_do_filter_by_date($p_hide_checkbox = false)
{
global $g_filter;
?>
<table cellspacing="0" cellpadding="0">
<?php
$t_menu_disabled = '';
if (!$p_hide_checkbox) {
?>
<tr>
<td colspan="2">
<label>
<input type="checkbox" id="use_date_filters" name="<?php
echo FILTER_PROPERTY_FILTER_BY_DATE;
?>
"<?php
check_checked(gpc_string_to_bool($g_filter[FILTER_PROPERTY_FILTER_BY_DATE]), true);
?>
/>
<?php
echo lang_get('use_date_filters');
?>
</label>
</td>
</tr>
<?php
if ('on' !== $g_filter[FILTER_PROPERTY_FILTER_BY_DATE]) {
$t_menu_disabled = ' disabled="disabled" ';
}
}
?>
<!-- Start date -->
<tr>
<td>
<?php
echo lang_get('start_date_label');
?>
</td>
<td class="nowrap">
<?php
$t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
foreach ($t_chars as $t_char) {
if (strcasecmp($t_char, 'M') == 0) {
echo '<select name="', FILTER_PROPERTY_START_MONTH, '"', $t_menu_disabled, '>';
print_month_option_list($g_filter[FILTER_PROPERTY_START_MONTH]);
print "</select>\n";
}
if (strcasecmp($t_char, 'D') == 0) {
echo '<select name="', FILTER_PROPERTY_START_DAY, '"', $t_menu_disabled, '>';
print_day_option_list($g_filter[FILTER_PROPERTY_START_DAY]);
print "</select>\n";
}
if (strcasecmp($t_char, 'Y') == 0) {
echo '<select name="', FILTER_PROPERTY_START_YEAR, '"', $t_menu_disabled, '>';
print_year_option_list($g_filter[FILTER_PROPERTY_START_YEAR]);
print "</select>\n";
}
}
?>
</td>
</tr>
<!-- End date -->
<tr>
<td>
<?php
echo lang_get('end_date_label');
?>
</td>
<td>
<?php
$t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
foreach ($t_chars as $t_char) {
if (strcasecmp($t_char, 'M') == 0) {
echo '<select name="', FILTER_PROPERTY_END_MONTH, '"', $t_menu_disabled, '>';
print_month_option_list($g_filter[FILTER_PROPERTY_END_MONTH]);
print "</select>\n";
}
if (strcasecmp($t_char, 'D') == 0) {
echo '<select name="', FILTER_PROPERTY_END_DAY, '"', $t_menu_disabled, '>';
print_day_option_list($g_filter[FILTER_PROPERTY_END_DAY]);
print "</select>\n";
}
if (strcasecmp($t_char, 'Y') == 0) {
echo '<select name="', FILTER_PROPERTY_END_YEAR, '"', $t_menu_disabled, '>';
print_year_option_list($g_filter[FILTER_PROPERTY_END_YEAR]);
print "</select>\n";
}
}
?>
</td>
</tr>
</table>
<?php
}
示例4: print_filter_do_filter_by_date
/**
* print filter by date fields with javascript
* @todo Javascript should be removed and added dynamically
* via external script
*/
function print_filter_do_filter_by_date($p_hide_checkbox = false)
{
global $t_filter;
?>
<table cellspacing="0" cellpadding="0">
<?php
if (!$p_hide_checkbox) {
?>
<tr><td colspan="2">
<input type="checkbox" name="<?php
echo FILTER_PROPERTY_FILTER_BY_DATE;
?>
" <?php
check_checked($t_filter[FILTER_PROPERTY_FILTER_BY_DATE], 'on');
if (ON == config_get('use_javascript')) {
print "onclick=\"SwitchDateFields();\"";
}
?>
/>
<?php
echo lang_get('use_date_filters');
?>
</td></tr>
<?php
}
$t_menu_disabled = 'on' == $t_filter[FILTER_PROPERTY_FILTER_BY_DATE] ? '' : ' disabled ';
?>
<!-- Start date -->
<tr>
<td>
<?php
echo lang_get('start_date');
?>
:
</td>
<td nowrap="nowrap">
<?php
$t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
foreach ($t_chars as $t_char) {
if (strcasecmp($t_char, "M") == 0) {
echo '<select name="', FILTER_PROPERTY_START_MONTH, '"', $t_menu_disabled, '>';
print_month_option_list($t_filter[FILTER_PROPERTY_START_MONTH]);
print "</select>\n";
}
if (strcasecmp($t_char, "D") == 0) {
echo '<select name="', FILTER_PROPERTY_START_DAY, '"', $t_menu_disabled, '>';
print_day_option_list($t_filter[FILTER_PROPERTY_START_DAY]);
print "</select>\n";
}
if (strcasecmp($t_char, "Y") == 0) {
echo '<select name="', FILTER_PROPERTY_START_YEAR, '"', $t_menu_disabled, '>';
print_year_option_list($t_filter[FILTER_PROPERTY_START_YEAR]);
print "</select>\n";
}
}
?>
</td>
</tr>
<!-- End date -->
<tr>
<td>
<?php
echo lang_get('end_date');
?>
:
</td>
<td>
<?php
$t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
foreach ($t_chars as $t_char) {
if (strcasecmp($t_char, "M") == 0) {
echo '<select name="', FILTER_PROPERTY_END_MONTH, '"', $t_menu_disabled, '>';
print_month_option_list($t_filter[FILTER_PROPERTY_END_MONTH]);
print "</select>\n";
}
if (strcasecmp($t_char, "D") == 0) {
echo '<select name="', FILTER_PROPERTY_END_DAY, '"', $t_menu_disabled, '>';
print_day_option_list($t_filter[FILTER_PROPERTY_END_DAY]);
print "</select>\n";
}
if (strcasecmp($t_char, "Y") == 0) {
echo '<select name="', FILTER_PROPERTY_END_YEAR, '"', $t_menu_disabled, '>';
print_year_option_list($t_filter[FILTER_PROPERTY_END_YEAR]);
print "</select>\n";
}
}
?>
</td>
</tr>
</table>
<?php
}
示例5: Source_Date_Select
function Source_Date_Select($p_name, $p_selected = null)
{
static $s_min = null, $s_max = null;
if (is_null($s_min) || is_null($s_max)) {
$t_changeset_table = plugin_table('changeset');
$t_query = "SELECT MIN( timestamp ) AS min, MAX( timestamp ) AS max FROM {$t_changeset_table}";
$t_result = db_query_bound($t_query);
$t_row = db_fetch_array($t_result);
$t_row = array_map('Source_Date_StampArray', $t_row);
$s_min = $t_row['min'][0];
$s_max = $t_row['max'][0];
# Handle the case when there are no changesets in the table
if (is_null($s_min)) {
$s_min = $s_max = idate('Y');
}
}
if ($p_selected == 'now') {
$t_selected = array((int) date('Y'), (int) date('m'), (int) date('d'));
echo '<input type="hidden" name="', $p_name, '_default" value="', "{$t_selected['0']}-{$t_selected['1']}-{$t_selected['2']}", '"/>';
} elseif ($p_selected == 'start') {
$t_selected = array($s_min, 1, 1);
echo '<input type="hidden" name="', $p_name, '_default" value="', "{$t_selected['0']}-{$t_selected['1']}-{$t_selected['2']}", '"/>';
} else {
$t_selected = Source_Date_StampArray($p_selected);
}
echo '<select name="', $p_name, '_year">';
for ($t_year = $s_max; $t_year >= $s_min; $t_year--) {
echo '<option value="', $t_year, $t_year === $t_selected[0] ? '" selected="selected"' : '"', '>', $t_year, '</option>';
}
echo '</select> ';
echo '<select name="', $p_name, '_month">';
print_month_option_list($t_selected[1]);
echo '</select> ';
echo '<select name="', $p_name, '_day">';
print_day_option_list($t_selected[2]);
echo '</select> ';
}
示例6: print_date_selection_set
/**
* Print <select> tag for selecting a date
* @param string $p_name Name for html select field attribute.
* @param string $p_format Date format e.g. YmD.
* @param integer $p_date Integer timestamp representing date.
* @param boolean $p_default_disable Whether date selector is disabled.
* @param boolean $p_allow_blank Whether blank/null date is allowed.
* @param integer $p_year_start First year to display in drop down.
* @param integer $p_year_end Last year to display in drop down.
* @return void
* @access public
*/
function print_date_selection_set($p_name, $p_format, $p_date = 0, $p_default_disable = false, $p_allow_blank = false, $p_year_start = 0, $p_year_end = 0)
{
$t_chars = preg_split('//', $p_format, -1, PREG_SPLIT_NO_EMPTY);
if ($p_date != 0) {
$t_date = preg_split('/-/', date('Y-m-d', $p_date), -1, PREG_SPLIT_NO_EMPTY);
} else {
$t_date = array(0, 0, 0);
}
$t_disable = '';
if ($p_default_disable == true) {
$t_disable = ' disabled="disabled"';
}
$t_blank_line = '';
if ($p_allow_blank == true) {
$t_blank_line = '<option value="0"></option>';
}
foreach ($t_chars as $t_char) {
if (strcmp($t_char, 'M') == 0) {
echo '<select ' . helper_get_tab_index() . ' name="' . $p_name . '_month"' . $t_disable . '>';
echo $t_blank_line;
print_month_option_list($t_date[1]);
echo "</select>\n";
}
if (strcmp($t_char, 'm') == 0) {
echo '<select ' . helper_get_tab_index() . ' name="' . $p_name . '_month"' . $t_disable . '>';
echo $t_blank_line;
print_month_option_list($t_date[1]);
echo '</select>' . "\n";
}
if (strcasecmp($t_char, 'D') == 0) {
echo '<select ' . helper_get_tab_index() . ' name="' . $p_name . '_day"' . $t_disable . '>';
echo $t_blank_line;
print_day_option_list($t_date[2]);
echo '</select>' . "\n";
}
if (strcasecmp($t_char, 'Y') == 0) {
echo '<select ' . helper_get_tab_index() . ' name="' . $p_name . '_year"' . $t_disable . '>';
echo $t_blank_line;
print_year_range_option_list($t_date[0], $p_year_start, $p_year_end);
echo '</select>' . "\n";
}
}
}
示例7: view_bug_time
//.........这里部分代码省略.........
if (access_has_bug_level(plugin_config_get('admin_own_threshold'), $p_bug_id)) {
$current_date = explode("-", date("Y-m-d"));
?>
<form name="time_tracking" method="post" action="<?php
echo plugin_page('add_record');
?>
" >
<?php
echo form_security_field('plugin_TimeTracking_add_record');
?>
<input type="hidden" name="bug_id" value="<?php
echo $p_bug_id;
?>
">
<tr <?php
echo helper_alternate_class();
?>
>
<td><?php
echo user_get_name(auth_get_current_user_id());
?>
</td>
<td nowrap>
<div align="center">
<select tabindex="5" name="day"><?php
print_day_option_list($current_date[2]);
?>
</select>
<select tabindex="6" name="month"><?php
print_month_option_list($current_date[1]);
?>
</select>
<select tabindex="7" name="year"><?php
print_year_option_list($current_date[0]);
?>
</select>
</div>
</td>
<td><div align="right"><input type="text" name="time_value" value="00:00" size="5"></div></td>
<td><div align="center"><input type="text" name="time_info"></div></td>
<td> </td>
<td><input name="<?php
echo plugin_lang_get('submit');
?>
" type="submit" value="<?php
echo plugin_lang_get('submit');
?>
"></td>
</tr>
</form>
<?php
}
# END Access Control
for ($i = 0; $i < $num_timerecords; $i++) {
$row = db_fetch_array($result_pull_timerecords);
?>
<tr <?php
echo helper_alternate_class();
?>
示例8: print_filter_do_filter_by_date
/**
* print filter by date fields
*/
function print_filter_do_filter_by_date($p_hide_checkbox = false)
{
global $t_filter;
?>
<table cellspacing="0" cellpadding="0">
<?php
if (!$p_hide_checkbox) {
?>
<tr>
<td colspan="2">
<label><input type="checkbox" id="use_date_filters" name="<?php
echo FILTER_PROPERTY_FILTER_BY_DATE;
?>
"<?php
check_checked($t_filter[FILTER_PROPERTY_FILTER_BY_DATE], 'on');
?>
/><?php
echo lang_get('use_date_filters');
?>
</label>
</td>
</tr>
<?php
}
# Make sure the date selection controls are enabled by default
# if we do not use javascript
$t_menu_disabled = !config_get('use_javascript') || 'on' == $t_filter[FILTER_PROPERTY_FILTER_BY_DATE] ? '' : ' disabled="disabled" ';
?>
<!-- Start date -->
<tr>
<td>
<?php
echo lang_get('start_date_label');
?>
</td>
<td class="nowrap">
<?php
$t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
foreach ($t_chars as $t_char) {
if (strcasecmp($t_char, "M") == 0) {
echo '<select name="', FILTER_PROPERTY_START_MONTH, '"', $t_menu_disabled, '>';
print_month_option_list($t_filter[FILTER_PROPERTY_START_MONTH]);
print "</select>\n";
}
if (strcasecmp($t_char, "D") == 0) {
echo '<select name="', FILTER_PROPERTY_START_DAY, '"', $t_menu_disabled, '>';
print_day_option_list($t_filter[FILTER_PROPERTY_START_DAY]);
print "</select>\n";
}
if (strcasecmp($t_char, "Y") == 0) {
echo '<select name="', FILTER_PROPERTY_START_YEAR, '"', $t_menu_disabled, '>';
print_year_option_list($t_filter[FILTER_PROPERTY_START_YEAR]);
print "</select>\n";
}
}
?>
</td>
</tr>
<!-- End date -->
<tr>
<td>
<?php
echo lang_get('end_date_label');
?>
</td>
<td>
<?php
$t_chars = preg_split('//', config_get('short_date_format'), -1, PREG_SPLIT_NO_EMPTY);
foreach ($t_chars as $t_char) {
if (strcasecmp($t_char, "M") == 0) {
echo '<select name="', FILTER_PROPERTY_END_MONTH, '"', $t_menu_disabled, '>';
print_month_option_list($t_filter[FILTER_PROPERTY_END_MONTH]);
print "</select>\n";
}
if (strcasecmp($t_char, "D") == 0) {
echo '<select name="', FILTER_PROPERTY_END_DAY, '"', $t_menu_disabled, '>';
print_day_option_list($t_filter[FILTER_PROPERTY_END_DAY]);
print "</select>\n";
}
if (strcasecmp($t_char, "Y") == 0) {
echo '<select name="', FILTER_PROPERTY_END_YEAR, '"', $t_menu_disabled, '>';
print_year_option_list($t_filter[FILTER_PROPERTY_END_YEAR]);
print "</select>\n";
}
}
?>
</td>
</tr>
</table>
<?php
}