本文整理汇总了PHP中dropdown函数的典型用法代码示例。如果您正苦于以下问题:PHP dropdown函数的具体用法?PHP dropdown怎么用?PHP dropdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dropdown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html_dropdown
function html_dropdown($items, $selected = null, $addons = null, $add_empty = false, $as_value = null, $as_text = null, $grouped = false)
{
$select = empty($grouped) ? '<select' . (!empty($addons['#']) ? ' ' . $addons['#'] : '') . '>' : '';
// Add empty option
if (!empty($add_empty)) {
$value = key($add_empty);
$select .= '<option value="' . set_input_value($value) . '"';
if (!empty($addons[$value])) {
$select .= ' ' . $addons[$value];
}
if (is_array($selected) && in_array($value, $selected) || $selected == $value) {
$select .= ' selected="selected"';
}
$select .= '>' . reset($add_empty) . '</option>';
}
// Loop through options
foreach ($items as $value => $text) {
// If grouped dropdown
if (is_array($text)) {
$select .= '<optgroup label="' . $value . '">';
$select .= dropdown($text, $selected, $addons, false, $as_value, $as_text, true);
$select .= '</optgroup>';
continue;
}
$value = empty($as_value) ? $value : $text->{$as_value};
$text = empty($as_text) ? $text : $text->{$as_text};
$select .= '<option value="' . set_input_value($value) . '"';
if (!empty($addons[$value])) {
$select .= ' ' . $addons[$value];
}
if (is_array($selected) && in_array($value, $selected) || $selected == $value) {
$select .= ' selected="selected"';
}
$select .= '>' . $text . '</option>';
}
if (empty($grouped)) {
$select .= '</select>';
}
return $select;
}
示例2: info
$index = info(_clankasse_deleted, "../clankasse/");
} elseif ($_GET['do'] == "update" && $_POST['id']) {
if (!$_POST['datum']) {
$index = error(_error_clankasse_empty_datum, 1);
} elseif (!$_POST['betrag']) {
$index = error(_error_clankasse_empty_betrag, 1);
} elseif (!$_POST['transaktion']) {
$index = error(_error_clankasse_empty_transaktion, 1);
} else {
$res = db("UPDATE " . $db['clankasse'] . "\n SET `datum` = '" . (int) $_POST['datum'] . "',\n `transaktion` = '" . up($_POST['transaktion']) . "',\n `pm` = '" . (int) $_POST['pm'] . "',\n `betrag` = '" . up($_POST['betrag']) . "'\n WHERE id = " . intval($_POST['id']));
$index = info(_clankasse_edited, "../clankasse/");
}
} elseif ($_GET['do'] == "edit") {
$qry = db("SELECT * FROM " . $db['clankasse'] . "\n WHERE id = '" . intval($_GET['id']) . "'");
$get = _fetch($qry);
$dropdown_date = show(_dropdown_date, array("day" => dropdown("day", date("d", $get['datum'])), "month" => dropdown("month", date("m", $get['datum'])), "year" => dropdown("year", date("Y", $get['datum']))));
if ($get['pm'] == "0") {
$psel = "selected=\"selected\"";
} else {
$msel = "selected=\"selected\"";
}
$qryk = db("SELECT * FROM " . $db['c_kats'] . "");
while ($getk = _fetch($qryk)) {
if ($getk['kat'] == $get['transaktion']) {
$sel = "selected=\"selected\"";
} else {
$sel = "";
}
$trans .= show(_select_field, array("value" => re($getk['kat']), "sel" => $sel, "what" => re($getk['kat'])));
}
$index = show($dir . "/edit", array("newhead" => _clankasse_head_edit, "betrag" => _clankasse_cbetrag, "datum" => _datum, "vonan" => _clankasse_for, "dropdown_date" => $dropdown_date, "id" => $_GET['id'], "psel" => $psel, "msel" => $msel, "value" => _button_value_edit, "bsel" => $bsel, "misel" => $misel, "ssel" => $ssel, "spsel" => $spsel, "trans" => $trans, "evonan" => re($get['member']), "sum" => re($get['betrag']), "beitrag" => _clankasse_sbeitrag, "miete" => _clankasse_smiete, "ssonstiges" => _clankasse_ssonstiges, "einzahlung" => _clankasse_einzahlung, "auszahlung" => _clankasse_auszahlung, "sponsor" => _clankasse_ssponsor, "sonstiges" => _clankasse_sonstiges, "member" => _member, "transaktion" => _clankasse_ctransaktion, "minus" => _clankasse_admin_minus, "post" => time()));
示例3: dropdown
</label>
<div class="controls">
<?php
echo dropdown($sheetData, 'deleted');
?>
</div>
</div>
<div class="control-group">
<label class="control-label" for="focusedInput"><?php
echo lang('last_modify_date');
?>
</label>
<div class="controls">
<?php
echo dropdown($sheetData, 'last_modify_date');
?>
</div>
</div>
<?php
} else {
?>
<div class="control-group">
<label class="control-label" for="focusedInput"><?php
echo lang('ecxel_file');
?>
示例4: dropdown
</label>
<div class="controls">
<?php
echo dropdown($sheetData, 'page_id');
?>
</div>
</div>
<div class="control-group">
<label class="control-label" for="focusedInput"><?php
echo lang('page_category_id');
?>
</label>
<div class="controls">
<?php
echo dropdown($sheetData, 'page_category_id');
?>
</div>
</div>
<?php
} else {
?>
<div class="control-group">
<label class="control-label" for="focusedInput"><?php
echo lang('ecxel_file');
?>
</label>
示例5: dropdown
<script language="javascript">
/* $(document).ready(function(e) {
$('input:first').focus().select();
$('#levelid').html("<?php
dropdown('user_level', 'idlevel', 'nmlevel');
?>
");
});*/
</script>
<div class='contents'>
<div class="j_panel judul">Add New User</div>
<div class="pn_content">
<hr>
<?php
/*
echo "<form id='frm1' name='frm1' action='' method='post'>";
$zb=new zetro_frmBuilder('asset/bin/form.cfg');
$zb->BuildForm('Adduser',true,'80%');*/
hapus_table('user_level', "where idlevel='" . @$_GET['id'] . "'");
?>
</div>
</div>
示例6: form_error
<div class="panel panel-inverse" data-sortable-id="table-basic-2">
<div class="panel-heading">
<div class="panel-heading-btn">
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
</div>
<h4 class="panel-title">Customer list <?php echo $button ?></h4>
</div>
<div class="panel-body">
<form action="<?php echo $action; ?>" method="post">
<div class="form-group">
<label for="int">CUSTOMERID <?php echo form_error('customerID') ?></label>
<?php echo dropdown('customerID', 'customer', 'customer_fullname', 'id','','',array('-- PILIH CUSTOMER --'=>$customerID))?>
</div>
<div class="form-group">
<label for="date">TANGGAL <?php echo form_error('tanggal') ?></label>
<input type="text" class="form-control" id="datepicker-autoClose" name="tanggal" placeholder="tanggal" value="<?php echo $tanggal;?>"/>
</div>
<div class="form-group">
<label for="keterangan">KETERANGAN <?php echo form_error('keterangan') ?></label>
<textarea class="form-control" rows="3" name="keterangan" id="keterangan" placeholder="keterangan"><?php echo $keterangan; ?></textarea>
</div>
<div class="form-group">
<label for="enum">STATUS DATA <?php echo form_error('status_data') ?></label>
<select name="status_data" id="status_data" class="form-control selectpicker" data-size="10" data-live-search="true" data-style="btn-white">
<option value="<?php echo $status_data; ?>">-- SET STATUS DATA --</option>
<option value="approved">APPROVED</option>
<option value="pending">PENDING</option>
<option value="cancel">CANCEL</option>
</select>
示例7: CurrencyConvert
// *** This is for the dropdown
if (isset($_POST['convertFrom'])) {
$toKey = $_POST['convertFrom'];
}
// *** This is for the dropdown
if (isset($_POST['convertTo'])) {
$fromKey = $_POST['convertTo'];
}
}
}
$convertObj = new CurrencyConvert();
$result = $convertObj->currencyConvert($amount, $from, $to);
}
// *** Make dropdowns
$fromSelect = dropdown($selectArray, $fromKey);
$toSelect = dropdown($selectArray, $toKey);
function dropdown($assocArray, $selectedId = 0, $addBlank = false)
{
$HTMLOptions = '';
if ($assocArray) {
if ($addBlank) {
$HTMLOptions = '<option></option>';
}
foreach ($assocArray as $id => $name) {
$selected = '';
if ($selectedId == $id && $selectedId != '') {
$selected = 'selected="selected"';
}
$HTMLOptions .= '<option value="' . $id . '" ' . $selected . '>' . $name . '</option>';
}
} else {
示例8: plugin_barcode_MassiveActionsFieldsDisplay
function plugin_barcode_MassiveActionsFieldsDisplay($options = array())
{
$table = $options['options']['table'];
$field = $options['options']['field'];
$linkfield = $options['options']['linkfield'];
if ($table == getTableForItemType($options['itemtype'])) {
// Table fields
switch ($table . "." . $field) {
case 'glpi_plugin_example.serial':
echo "Not really specific - Just for example ";
Html::autocompletionTextField($linkfield, $table, $field);
// Need to return true if specific display
return true;
}
} else {
// Linked Fields
switch ($table . "." . $field) {
case "glpi_plugin_example_dropdowns.name":
echo "Not really specific - Just for example ";
dropdown($table, $linkfield, 1, $_SESSION["glpiactive_entity"]);
// Need to return true if specific display
return true;
}
}
// Need to return false on non display item
return false;
}
示例9: form_error
<div class="form-group">
<label for="int">SUPIR <?php
echo form_error('sopir_id');
?>
</label>
<?php
echo dropdown('sopir_id', 'sopir', 'sopir_nama', 'sopir_id', 4, '', $sopir_id);
?>
</div>
<div class="form-group">
<label for="int">PILIH KENDARAAN <?php
echo form_error('kendaraan_id');
?>
</label>
<?php
echo dropdown('kendaraan_id', 'kendaraan', 'kendaraan_platnomor', 'kendaraan_id', 5, '', $kendaraan_id);
?>
</div>
<!-- <div class="form-group">
<label for="date">TANGGAL MULAI <?php
echo form_error('transaksi_tglmulai');
?>
</label>
<input type="text" class="form-control" name="transaksi_tglmulai" id="transaksi_tglmulai" placeholder="transaksi_tglmulai" value="<?php
echo $transaksi_tglmulai;
?>
" />
</div> -->
<div class="form-group">
<label for="date">TANGGAL SELESAI <?php
echo form_error('transaksi_tglselesai');
示例10: dropdown_usr
function dropdown_usr()
{
echo dropdown('users', 'userid', 'username', "where idlevel<>'1' order by username", $this->session->userdata('userid'));
}
示例11: dropdown
$field_dropdown = '';
if ($_SESSION['permission'] == 'admin') {
$sql = "select id,title from files where uId=" . $opt['uId'];
} else {
$sql = "select id,title from files where uId=" . $_SESSION['userId'];
}
$stmt = $pdo->query($sql);
if ($stmt->rowCount()) {
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
$file_dropdown = dropdown($rows, 'file', 'title', 'id', $opt['file']);
}
$sql = "select id,title from field";
$stmt = $pdo->query($sql);
if ($stmt->rowCount()) {
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
$field_dropdown = dropdown($rows, 'field', 'title', 'id');
}
if ($_GET['lang'] == 'fa') {
$class = 'fa_article_add';
$title = 'ثبت مقاله جدید';
$article_title = 'عنوان مقاله';
$article_title_desc = '(فقط می تواند شامل حروف و عدد و فاصله باشد)';
$abstract = 'چکیده مقاله';
$more_authors = 'سایر نویسندگان';
$more_authors_desc = '(درصورت گروهی بودن مقاله نام سایر نویسندگان را وارد نمایید)';
$keywords = 'کلمات کلیدی';
$keywords_desc = '(میتوانید کلمات مختلف را با - از هم جدا نمایید، حداکثر پنج کلمه)';
$article_file = 'فایل مقاله';
$article_file_desc = '(فایل مربوط به مقاله را که قبلا آپلود کردید را انتخاب نمایید)';
$field = 'رشته';
$field_desc = '(رشته های مربوط به مقاله خود را انتخاب نمایید)';
示例12: active_semesters
function active_semesters($memberID)
{
global $CHOIR;
if (!$CHOIR) {
die("Choir is not set");
}
$table = "<style>table.semesters { width: auto; } table.semesters td { padding: 2px 10px; } select.section { margin-bottom: 0px; width: 10em; }</style><table class='semesters'><tr><th>Semester</th><th>Status</th><th>Section</th><th>Score</th></tr>";
$query = mysql_query("select `semester` from `semester` order by `beginning` asc");
while ($result = mysql_fetch_array($query)) {
$activebtn = 0;
$semester = $result['semester'];
$query1 = mysql_query("select `enrollment` from `activeSemester` where `member` = '{$memberID}' and `semester` = '{$semester}' and `choir` = '{$CHOIR}'");
$active = mysql_num_rows($query1);
if ($active) {
$result1 = mysql_fetch_array($query1);
$enrollment = $result1['enrollment'];
if ($enrollment == "club") {
$activebtn = 1;
} else {
if ($enrollment == "class") {
$activebtn = 2;
} else {
die("Invalid enrollment state");
}
}
}
$table .= "<tr data-semester='{$semester}'><td>{$semester}</td><td><div class='btn-group' data-toggle='buttons-radio'>" . "<button class='btn btn-small semesterbutton" . ($activebtn == 0 ? ' active' : '') . "' data-val='0'>Inactive</button>" . "<button class='btn btn-small semesterbutton" . ($activebtn == 1 ? ' active' : '') . "' data-val='1'>Club</button>" . "<button class='btn btn-small semesterbutton" . ($activebtn == 2 ? ' active' : '') . "' data-val='2'>Class</button>" . "</div></td><td>" . dropdown(sections(), "section", $active ? sectionFromEmail($memberID, false, $semester) : 0, !$active) . "</td>" . "<td>" . ($active ? "<span>" : "<span style='color: gray'>") . attendance($memberID, 0, $semester) . "</span></td></tr>";
}
$table .= "</table>";
return $table;
}
示例13: show
$show = show($dir . "/form_cw", array("head" => _cw_admin_head, "datum" => _datum, "gegner" => _cw_head_gegner, "xonx" => _cw_head_xonx, "liga" => _cw_head_liga, "screen_info" => _cw_screens_info, "nothing" => "", "preview" => _preview, "screenshot1" => _cw_screenshot . " 1", "screenshot2" => _cw_screenshot . " 2", "screenshot3" => _cw_screenshot . " 3", "screenshot4" => _cw_screenshot . " 4", "screens" => _cw_screens, "gametype" => _cw_head_gametype, "url" => _url, "clantag" => _cw_admin_clantag, "lineup_info" => _cw_admin_lineup_info, "bericht" => _cw_bericht, "result" => _cw_head_result, "info" => _cw_admin_info, "gegnerstuff" => _cw_admin_gegnerstuff, "warstuff" => _cw_admin_warstuff, "maps" => _cw_admin_maps, "serverip" => _cw_admin_serverip, "servername" => _server_name, "serverpwd" => _server_password, "match_admins" => _cw_head_admin, "lineup" => _cw_head_lineup, "glineup" => _cw_head_glineup, "do" => "add", "what" => _button_value_add, "cw_clantag" => "", "cw_gegner" => "", "cw_url" => "", "logo" => _cw_logo, "cw_xonx1" => "", "cw_xonx2" => "", "cw_maps" => "", "cw_servername" => "", "cw_serverip" => "", "cw_serverpwd" => "", "cw_punkte" => "", "cw_gpunkte" => "", "cw_matchadmins" => "", "cw_lineup" => "", "cw_glineup" => "", "cw_bericht" => "", "dropdown_date" => $dropdown_date, "dropdown_time" => $dropdown_time, "hour" => "", "minute" => "", "name" => _member_admin_squad, "squad_info" => _cw_admin_head_squads, "game" => _member_admin_game, "squads" => $squads, "cw_liga" => "", "country" => _cw_admin_head_country, "countrys" => show_countrys(), "cw_gametype" => ""));
} elseif ($_GET['do'] == "edit") {
$qry = db("SELECT * FROM " . $db['cw'] . "\n WHERE id = '" . intval($_GET['id']) . "'");
$get = _fetch($qry);
list($xonx1, $xonx2) = explode('on', $get['xonx']);
$qrym = db("SELECT * FROM " . $db['squads'] . "\n WHERE status = '1'\n ORDER BY game");
while ($gets = _fetch($qrym)) {
if ($get['squad_id'] == $gets['id']) {
$sel = "selected=\"selected\"";
} else {
$sel = "";
}
$squads .= show(_cw_edit_select_field_squads, array("id" => $gets['id'], "name" => re($gets['name']), "game" => re($gets['game']), "sel" => $sel, "icon" => $gets['icon']));
}
$dropdown_date = show(_dropdown_date, array("day" => dropdown("day", date("d", $get['datum'])), "month" => dropdown("month", date("m", $get['datum'])), "year" => dropdown("year", date("Y", $get['datum']))));
$dropdown_time = show(_dropdown_time, array("hour" => dropdown("hour", date("H", $get['datum'])), "minute" => dropdown("minute", date("i", $get['datum'])), "uhr" => _uhr));
$show = show($dir . "/form_cw", array("head" => _cw_admin_head_edit, "datum" => _datum, "gegner" => _cw_head_gegner, "xonx" => _cw_head_xonx, "preview" => _preview, "nothing" => _cw_nothing, "screenshot1" => _cw_new . " " . _cw_screenshot . " 1", "screenshot2" => _cw_new . " " . _cw_screenshot . " 2", "screenshot3" => _cw_new . " " . _cw_screenshot . " 3", "screenshot4" => _cw_new . " " . _cw_screenshot . " 4", "screens" => _cw_screens, "liga" => _cw_head_liga, "screen_info" => _cw_screens_info, "gametype" => _cw_head_gametype, "url" => _url, "clantag" => _cw_admin_clantag, "bericht" => _cw_bericht, "result" => _cw_head_result, "info" => _cw_admin_info, "gegnerstuff" => _cw_admin_gegnerstuff, "warstuff" => _cw_admin_warstuff, "maps" => _cw_admin_maps, "match_admins" => _cw_head_admin, "lineup" => _cw_head_lineup, "glineup" => _cw_head_glineup, "serverip" => _cw_admin_serverip, "lineup_info" => _cw_admin_lineup_info, "servername" => _server_name, "serverpwd" => _server_password, "do" => "editcw&id=" . $_GET['id'] . "", "what" => _button_value_edit, "cw_clantag" => re($get['clantag']), "cw_gegner" => re($get['gegner']), "cw_url" => $get['url'], "cw_xonx1" => $xonx1, "logo" => _cw_logo, "cw_xonx2" => $xonx2, "cw_maps" => re($get['maps']), "cw_matchadmins" => re($get['matchadmins']), "cw_lineup" => re($get['lineup']), "cw_glineup" => re($get['glineup']), "cw_servername" => re($get['servername']), "cw_serverip" => $get['serverip'], "cw_serverpwd" => re($get['serverpwd']), "cw_punkte" => $get['punkte'], "cw_gpunkte" => $get['gpunkte'], "cw_bericht" => re_bbcode($get['bericht']), "day" => date("d", $get['datum']), "dropdown_date" => $dropdown_date, "dropdown_time" => $dropdown_time, "month" => date("m", $get['datum']), "year" => date("Y", $get['datum']), "hour" => date("H", $get['datum']), "minute" => date("i", $get['datum']), "name" => _member_admin_squad, "countrys" => show_countrys($get['gcountry']), "squad_info" => _cw_admin_head_squads, "game" => _member_admin_game, "squads" => $squads, "cw_liga" => re($get['liga']), "country" => _cw_admin_head_country, "cw_gametype" => re($get['gametype'])));
} elseif ($_GET['do'] == "add") {
if (empty($_POST['gegner']) || empty($_POST['clantag']) || empty($_POST['t'])) {
if (empty($_POST['gegner'])) {
$show = error(_cw_admin_empty_gegner, 1);
} elseif (empty($_POST['clantag'])) {
$show = error(_cw_admin_empty_clantag, 1);
} elseif (empty($_POST['t'])) {
$show = error(_empty_datum, 1);
}
} else {
if (empty($_POST['xonx1']) && empty($_POST['xonx2'])) {
$xonx = "";
} else {
$xonx = "`xonx` = '" . $_POST['xonx1'] . "on" . $_POST['xonx2'] . "',";
示例14: no_auth
$zlb->Header('100%');
$zlb->icon();
echo "</tbody></table>";
} else {
no_auth();
}
panel_multi_end();
loading_ajax();
popup_full();
terbilang();
?>
<input type='hidden' id='ordby' value='' class='w100'/>
<input type='hidden' id='totdata' value='<?php
echo !empty($list) ? count($list) : 0;
?>
' />
<input type='hidden' id='otor' value='<?php
echo $all_member__member_list;
?>
' />
<script language="javascript">
$(document).ready(function(e) {
$('#dept').html("<option value='all'>Semua</option>");
$('#dept').append("<?php
dropdown('mst_departemen', 'id', 'departemen', "order by Kode");
?>
")
$('#dept').val('').select();
});
</script>
示例15: form_error
<div class='col-lg-12'>
<h2 style="margin-top:0px">Tarif <?php
echo $button;
?>
</h2>
<form action="<?php
echo $action;
?>
" method="post">
<div class="form-group">
<label for="int">KENDARAAN <?php
echo form_error('kendaraan_id');
?>
</label>
<?php
echo dropdown('kendaraan_id', 'kendaraan', 'kendaraan_platnomor', 'kendaraan_id', 12);
?>
</div>
<div class="form-group">
<label for="int">TARIF PERHARI <?php
echo form_error('tarif_perhari');
?>
</label>
<input type="text" class="form-control" name="tarif_perhari" id="tarif_perhari" placeholder="TARIF PERHARI" value="<?php
echo $tarif_perhari;
?>
" />
</div>
<div class="form-group">
<label for="int">TARIF OVERTIME <?php
echo form_error('tarif_overtime');