本文整理汇总了PHP中input_select函数的典型用法代码示例。如果您正苦于以下问题:PHP input_select函数的具体用法?PHP input_select怎么用?PHP input_select使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了input_select函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_form
function show_form($errors = '')
{
global $months, $days, $years;
// If the form is submitted, get defaults from submitted variables
if ($_POST['_submit_check']) {
$defaults = $_POST;
} else {
// Otherwise, set our own defaults: one month from now
$default_timestamp = strtotime('+1 month');
$defaults = array('month' => date('n', $default_timestamp), 'day' => date('j', $default_timestamp), 'year' => date('Y', $default_timestamp));
}
// If errors were passed in, put them in $error_text (with HTML markup)
if ($errors) {
print 'You need to correct the following errors: <ul><li>';
print implode('</li><li>', $errors);
print '</li></ul>';
}
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
print 'Enter a date and time:';
input_select('month', $defaults, $months);
print ' ';
input_select('day', $defaults, $days);
print ' ';
input_select('year', $defaults, $years);
print '<br/>';
input_submit('submit', 'Find Tuesdays');
print '<input type="hidden" name="_submit_check" value="1"/>';
print '</form>';
}
示例2: show_form
function show_form($errors = '')
{
if ($errors) {
print 'You need to correct the following errors: <ul><li>';
print implode('</li><li>', $errors);
print '</li></ul>';
}
// the beginning of the form
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
print '<table>';
// the first address
print '<tr><th colspan="2">From</th></tr>';
print '<td>Name:</td><td>';
input_text('name_1', $_POST);
print '</td></tr>';
print '<tr><td>Street Address:</td><td>';
input_text('address_1', $_POST);
print '</td></tr>';
print '<tr><td>City, State, Zip:</td><td>';
input_text('city_1', $_POST);
print ', ';
input_select('state_1', $_POST, $GLOBALS['us_states']);
input_text('zip_1', $_POST);
print '</td></tr>';
// the second address
print '<tr><th colspan="2">To</th></tr>';
print '<td>Name:</td><td>';
input_text('name_2', $_POST);
print '</td></tr>';
print '<tr><td>Street Address:</td><td>';
input_text('address_2', $_POST);
print '</td></tr>';
print '<tr><td>City, State, Zip:</td><td>';
input_text('city_2', $_POST);
print ', ';
input_select('state_2', $_POST, $GLOBALS['us_states']);
input_text('zip_2', $_POST);
print '</td></tr>';
// Package Info
print '<tr><th colspan="2">Package</th></tr>';
print '<tr><td>Height:</td><td>';
input_text('height', $_POST);
print '</td></tr>';
print '<tr><td>Width:</td><td>';
input_text('width', $_POST);
print '</td></tr>';
print '<tr><td>Length:</td><td>';
input_text('length', $_POST);
print '</td></tr>';
print '<tr><td>Weight:</td><td>';
input_text('weight', $_POST);
print '</td></tr>';
// form end
print '<tr><td colspan="2"><input type="submit" value="Ship Package"></td></tr>';
print '</table>';
print '<input type="hidden" name="_submit_check" value="1"/>';
print '</form>';
}
示例3: render_valores_padrao_meta_box
/**
* Render Meta Box content.
* @param WP_Post $post The post object.
*/
public function render_valores_padrao_meta_box($post)
{
$postId = $post->ID;
// Organizador
$organizadores = Organizadores::getInstance()->getAll();
$organizadores = Plib::array_to_key_value(Plib::object_to_array($organizadores), 'id', 'titulo');
$organizadores[''] = "";
echo input_select($postId, 'valor_id_organizador', 'Organizador:', $organizadores);
// Confirmação
echo input_select($postId, 'valor_confirmacao', 'Confirmação da Inscrição:', array('' => '', 'preinscricao' => 'Pré-inscrição', 'imediata' => 'Imediata', 'pagamento' => 'Após Confirmação do Pagamento', 'posterior' => 'Posteriormente pelo Organizador'));
// Tipo de inscrição
//echo input_select($postId, 'pago', 'Tipo de Inscrição:', array(''=>'','pago' => 'Paga', 'gratuito' => 'Gratuita'));
// Add an nonce field so we can check for it later.
wp_nonce_field('myplugin_inner_custom_box', 'myplugin_inner_custom_box_nonce');
}
示例4: show_form
function show_form($errors = '')
{
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
if ($errors) {
print '<ul><li>';
print implode('</li><li>', $errors);
print '</li></ul>';
}
// Since we're not supplying any defaults of our own, it's OK
// to pass $_POST as the defaults array to input_select and
// input_text so that any user-entered values are preserved
print 'Color: ';
input_select('color', $_POST, $GLOBALS['colors']);
print '<br/>';
input_submit('submit', 'Select Color');
print '<input type="hidden" name="_submit_check" value="1"/>';
print '</form>';
}
示例5: show_form
function show_form($errors = '')
{
if ($errors) {
print 'You need to correct the following errors: <ul><li>';
print implode('</li><li>', $errors);
print '</li></ul>';
}
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
print 'Expiration Date: ';
input_select('month', $_POST, $GLOBALS['months']);
print ' ';
input_select('year', $_POST, $GLOBALS['years']);
print '<br/>';
input_submit('submit', 'Check Expiration');
// the hidden _submit_check variable and the end of the form
print '<input type="hidden" name="_submit_check" value="1"/>';
print '</form>';
}
示例6: show_form
function show_form($errors = '')
{
global $hours, $minutes, $months, $days, $years;
// If the form is submitted, get defaults from submitted variables
if ($_POST['_submit_check']) {
$defaults = $_POST;
} else {
// Otherwise, set our own defaults: the current time and date parts
$defaults = array('hour' => date('g'), 'ampm' => date('a'), 'month' => date('n'), 'day' => date('j'), 'year' => date('Y'));
// Because the choices in the minute menu are in five-minute increments,
// if the current minute isn't a multiple of five, we need to make it
// into one.
$this_minute = date('i');
$minute_mod_five = $this_minute % 5;
if ($minute_mod_five != 0) {
$this_minute -= $minute_mod_five;
}
$defaults['minute'] = sprintf('%02d', $this_minute);
}
// If errors were passed in, put them in $error_text (with HTML markup)
if ($errors) {
print 'You need to correct the following errors: <ul><li>';
print implode('</li><li>', $errors);
print '</li></ul>';
}
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
print 'Enter a date and time:';
input_select('hour', $defaults, $hours);
print ':';
input_select('minute', $defaults, $minutes);
input_select('ampm', $defaults, array('am' => 'am', 'pm' => 'pm'));
input_select('month', $defaults, $months);
print ' ';
input_select('day', $defaults, $days);
print ' ';
input_select('year', $defaults, $years);
print '<br/>';
input_submit('submit', 'Find Meeting');
print '<input type="hidden" name="_submit_check" value="1"/>';
print '</form>';
}
示例7: show_form
function show_form($errors = '')
{
global $db;
if ($errors) {
print 'You need to correct the following errors: <ul><li>';
print implode('</li><li>', $errors);
print '</li></ul>';
}
// the beginning of the form
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
print '<table>';
// dish select menu
print '<tr><td>Dish:</td><td>';
input_select('dish_name', $_POST, $GLOBALS['dish_names']);
print '</td></tr>';
// form end
print '<tr><td colspan="2"><input type="submit" value="Search Dishes"></td></tr>';
print '</table>';
print '<input type="hidden" name="_submit_check" value="1"/>';
print '</form>';
}
示例8: show_form
function show_form($errors = '')
{
global $months, $years, $this_year;
// If the form is submitted, get defaults from submitted variables
if ($_POST['_submit_check']) {
$defaults = $_POST;
} else {
// Otherwise, set our own defaults: the current month and year
$defaults = array('year' => date('Y'), 'month' => date('n'));
}
if ($errors) {
print 'You need to correct the following errors: <ul><li>';
print implode('</li><li>', $errors);
print '</li></ul>';
}
print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
input_select('month', $defaults, $months);
input_select('year', $defaults, $years);
input_submit('submit', 'Show Calendar');
print '<input type="hidden" name="_submit_check" value="1"/>';
print '</form>';
}
示例9: show_form
function show_form($errors = '')
{
print '<form method="POST" action="' . $_SERVER['SCRIPT_NAME'] . '">';
if ($errors) {
print '<ul><li>';
print implode('</li><li>', $errors);
print '</li></ul>';
}
// Since we're not supplying any defaults of our own, it's OK
// to pass $_POST as the defaults array to input_select and
// input_text so that any user-entered values are preserved
print 'Dish: ';
input_select('dish', $_POST, $GLOBALS['main_dishes']);
print '<br/>';
print 'Quantity: ';
if (!array_key_exists('quantity', $_POST)) {
$_POST['quantity'] = '';
}
input_text('quantity', $_POST);
print '<br/>';
input_submit('submit', 'Order');
print '<input type="hidden" name="_submit_check" value="1"/>';
print '</form>';
}
示例10: array
<?php
require '../chap6/formhelpers.php';
$months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
$days = array();
for ($i = 1; $i <= 31; $i++) {
$days[$i] = $i;
}
$years = array();
for ($year = date('Y') - 1, $max_year = date('Y') + 5; $year < $max_year; $year++) {
$years[$year] = $year;
}
input_select('month', $_POST, $months);
print ' ';
input_select('day', $_POST, $days);
print ' ';
input_select('year', $_POST, $years);
示例11: show_form
function show_form($errors = '')
{
// If the form is submitted, get defaults from submitted parameters
if (array_key_exists('_submit_check', $_POST)) {
$defaults = $_POST;
} else {
// Otherwise, set our own defaults
$defaults = array('dish_name' => '', 'min_price' => '5.00', 'max_price' => '25.00', 'is_spicy' => 'no');
}
// If errors were passed in, put them in $error_text (with HTML markup)
if (is_array($errors)) {
$error_text = '<tr><td>You need to correct the following errors:';
$error_text .= '</td><td><ul><li>';
$error_text .= implode('</li><li>', $errors);
$error_text .= '</li></ul></td></tr>';
} else {
// No errors? Then $error_text is blank
$error_text = '';
}
// Jump out of PHP mode to make displaying all the HTML tags easier
?>
<form method="POST" action="<?php
print $_SERVER['PHP_SELF'];
?>
">
<table>
<?php
print $error_text;
?>
<tr><td>Dish Name:</td>
<td><?php
input_text('dish_name', $defaults);
?>
</td></tr>
<tr><td>Minimum Price:</td>
<td><?php
input_text('min_price', $defaults);
?>
</td></tr>
<tr><td>Maximum Price:</td>
<td><?php
input_text('max_price', $defaults);
?>
</td></tr>
<tr><td>Spicy:</td>
<td><?php
input_select('is_spicy', $defaults, $GLOBALS['spicy_choices']);
?>
</td></tr>
<tr><td colspan="2" align="center"><?php
input_submit('search', 'Search');
?>
</td></tr>
</table>
<input type="hidden" name="_submit_check" value="1"/>
</form>
<?php
}
示例12: display_form
function display_form($defaults)
{
global $subject_options;
?>
<form action="<?php
echo $_SERVER['PHP_SELF'];
?>
" method="post">
<table>
<tr><td>
Subject
</td>
<td>
<?php
input_select('subject', $defaults, $subject_options);
?>
</td>
</tr>
<tr>
<td>Your email
</td>
<td> <input type="text" name="email" size="30" value="<?php
echo htmlspecialchars($defaults['email']);
?>
"/>
</td>
</tr>
<tr>
<td>Your name
</td>
<td> <input type="text" name="name" size="30" value="<?php
echo htmlspecialchars($defaults['name']);
?>
"/>
</td>
</tr>
<tr>
<td valign="top">Comments
</td>
<td><textarea name="comments" cols="40" rows="5"><?php
echo htmlspecialchars($defaults['comments']);
?>
</textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit Comments" /></td>
</tr>
</table>
</form>
<?php
}
示例13: _
"><label for="name"><?php
echo _("Name or location of the ballot");
?>
</label><span class="input"><input type="text" name="name" id="name" value="<?php
echo h($ballot->name);
?>
"></span></div>
<div class="input <?php
echo stripes();
?>
"><label for="ngroup"><?php
echo _("Group of location");
?>
</label><span class="input">
<?
input_select("ngroup", Ngroup::options($period->ngroup()->parent), $ballot->ngroup, 'id="ngroup"');
?>
</span></div>
<div class="input <?php
echo stripes();
?>
"><label for="opening_hour"><?php
echo _("Opening hours");
?>
</label><span class="input">
<select name="opening_hour" id="opening_hour">
<?
if ($ballot->opening) {
list($hour, $minute, $second) = explode(":", $ballot->opening);
} else {
$hour = 0;
示例14: display_edit_period
/**
* admins select a voting period
*
* @return boolean true if the period may be changed
*/
private function display_edit_period() {
$options =& $this->available_periods();
if (!$options) return false;
if (@$_GET['edit_period']==$this->id) {
form(URI::strip(['edit_period'])."#issue".$this->id);
input_select("period", $options, $this->period);
?><br><?
input_hidden("issue", $this->id);
input_hidden("action", "select_period");
?>
<input type="submit" value="<?=_("apply")?>">
<?
form_end();
} else {
if ($this->period) {
?><a href="periods.php?ngroup=<?=$this->area()->ngroup?>&hl=<?=$this->period?>"><?=$this->period?></a><?
}
?><a href="<?=URI::append(['edit_period'=>$this->id])?>#issue<?=$this->id?>" class="iconlink"><img src="img/edit.png" width="16" height="16" alt="<?=_("edit")?>" title="<?=_("select voting period")?>"></a><?
}
return true;
}
示例15: mktime
<?php
require '../chap6/formhelpers.php';
$midnight_today = mktime(0, 0, 0);
$choices = array();
for ($i = 0; $i < 7; $i++) {
$timestamp = strtotime("+{$i} day", $midnight_today);
//キー
$display_date = strftime('%A, %B %d, %Y', $timestamp);
//値
$choices[$timestamp] = $display_date;
//配列に格納
}
input_select('date', $_POST, $choices);
//selectの表示