本文整理汇总了PHP中form_dropdown函数的典型用法代码示例。如果您正苦于以下问题:PHP form_dropdown函数的具体用法?PHP form_dropdown怎么用?PHP form_dropdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_dropdown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editar
public function editar($accion, $codigo = "")
{
$lista = new stdClass();
if ($accion == "e") {
$filter = new stdClass();
$filter->tipoestudiociclo = $codigo;
$tiposeestudiociclo = $this->tipoestudiociclo_model->obtener($filter);
$lista->codigo = $tiposeestudiociclo->TIPCICLOP_Codigo;
$lista->observacion = $tiposeestudiociclo->TIPCICLOC_Observacion;
$lista->ciclo = $tiposeestudiociclo->CICLOP_Codigo;
$lista->estado = $tiposeestudiociclo->TIPCICLOC_FlagEstado;
$lista->tipoestudio = $tiposeestudiociclo->TIPP_Codigo;
} elseif ($accion == "n") {
$lista->codigo = "";
$lista->observacion = "";
$lista->ciclo = "";
$lista->estado = 1;
$lista->tipoestudio = "";
}
$arrEstado = array("0" => "::Seleccione::", "1" => "ACTIVO", "2" => "INACTIVO");
$data['titulo'] = $accion == "e" ? "Editar Tipo de Estudio por ciclo" : "Crear Tipo de Estudio por ciclo";
$data['form_open'] = form_open('', array("name" => "frmPersona", "id" => "frmPersona", "onsubmit" => "return valida_guiain();"));
$data['form_close'] = form_close();
$data['lista'] = $lista;
$data['selestado'] = form_dropdown('estado', $arrEstado, $lista->estado, "id='estado' class='comboMedio'");
$data['selciclo'] = form_dropdown('ciclo', $this->ciclo_model->seleccionar('0'), $lista->ciclo, "id='ciclo' class='comboMedio'");
$data['seltipoestudio'] = form_dropdown('tipoestudio', $this->tipoestudio_model->seleccionar('0'), $lista->tipoestudio, "id='tipoestudio' class='comboMedio'");
$data['oculto'] = form_hidden(array("accion" => $accion, "codigo_padre" => $codigo, "codigo" => $lista->codigo));
$this->load->view("maestros/tipoestudiociclo_nuevo", $data);
}
示例2: test_form_dropdown
public function test_form_dropdown()
{
$expected = '<select name="shirts">
<option value="small">Small Shirt</option>
<option value="med">Medium Shirt</option>
<option value="large" selected="selected">Large Shirt</option>
<option value="xlarge">Extra Large Shirt</option>
</select>';
$options = array('small' => 'Small Shirt', 'med' => 'Medium Shirt', 'large' => 'Large Shirt', 'xlarge' => 'Extra Large Shirt');
$this->assertEquals($expected, form_dropdown('shirts', $options, 'large'));
$expected = '<select name="shirts" multiple="multiple">
<option value="small" selected="selected">Small Shirt</option>
<option value="med">Medium Shirt</option>
<option value="large" selected="selected">Large Shirt</option>
<option value="xlarge">Extra Large Shirt</option>
</select>';
$shirts_on_sale = array('small', 'large');
$this->assertEquals($expected, form_dropdown('shirts', $options, $shirts_on_sale));
$options = array('Swedish Cars' => array('volvo' => 'Volvo', 'saab' => 'Saab'), 'German Cars' => array('mercedes' => 'Mercedes', 'audi' => 'Audi'));
$expected = '<select name="cars" multiple="multiple">
<optgroup label="Swedish Cars">
<option value="volvo" selected="selected">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi" selected="selected">Audi</option>
</optgroup>
</select>';
$this->assertEquals($expected, form_dropdown('cars', $options, array('volvo', 'audi')));
}
示例3: index
public function index()
{
$this->load_auth();
if (!$this->module_auth->read) {
$this->session->set_flashdata('msg_warning', $this->module_auth->msg_read);
redirect('info');
}
$select_data = $this->load->model('usaha_model')->get_without();
$options = array();
if ($select_data) {
foreach ($select_data as $row) {
$options[$row->id] = $row->nama;
}
}
$js = 'id="usaha_id" class="input-medium"';
$options[999] = 'SEMUA PAJAK';
$select = form_dropdown('usaha_id', $options, 999, $js);
$select = preg_replace("/[\r\n]+/", "", $select);
$data['select_usaha'] = $select;
$options = array('1' => 'BELUM PROSES', '2' => 'SUDAH PROSES');
$js = 'id="proses_id" class="input-medium"';
$select = form_dropdown('proses_id', $options, 1, $js);
$select = preg_replace("/[\r\n]+/", "", $select);
$data['select_proses_id'] = $select;
$data['current'] = $this->module;
$data['controller'] = $this->controller;
$data['apps'] = $this->apps_model->get_active_only();
if ($this->controller != 'skpdj') {
$data['judul'] = "PENDATAAN - DAFTAR SPTPD BELUM MASUK (MASA PAJAK " . strtoupper($this->bulan(date('m') - 1)) . ")";
} else {
$data['judul'] = "PENETAPAN - SKPD JABATAN (MASA PAJAK " . strtoupper($this->bulan(date('m') - 1)) . ")";
}
$this->load->view('vsptpd_tegur', $data);
}
示例4: foundation_form_input
function foundation_form_input($name, $args = array())
{
$isValid = form_error($name) ? false : true;
if (!empty($args['default_value'])) {
$default_value = $args['default_value'];
} else {
$default_value = null;
}
$class = !empty($args['class']) ? $args['class'] : '';
$node = "<label>" . humanize($name);
if (!empty($args['as'])) {
switch ($args['as']) {
case 'collection':
if (!empty($args['collection'])) {
if ($args['allow_blank']) {
$args['collection'] = array_merge(array(" " => " "), $args['collection']);
}
$node .= form_dropdown($name, $args['collection'], set_value($name));
}
break;
case 'text':
$node .= form_textarea($name, set_value($name, $default_value));
break;
default:
# ...
break;
}
} else {
$node .= form_input($name, set_value($name, $default_value));
}
$node .= form_error($name, '<div class="error">', '</div>');
$node .= "</label>";
return $node;
}
示例5: index
/**
* 列表页
*
*
* @param
*/
public function index()
{
//分类 select options
$cats = $this->category_model->lists();
$this->tree->init($cats);
if (!isset($this->current['catid'])) {
$this->current['catid'] = '';
}
$this->data['categories'] = $this->tree->get_tree_select(0, "<option value=\$id \$selected>\$spacer\$name</option>", $this->current['catid']);
if (!isset($this->current['position'])) {
$this->current['position'] = '';
}
$options = $this->config->item('position', 'position');
$options = array('' => '推荐位管理') + $options;
$this->data['positions'] = form_dropdown('position', $options, $this->current['position'], 'class="input input-auto"');
$data = $this->model->lists($this->current);
if (!$data) {
$data = array('lists' => '', 'pages' => '');
}
$data['name'] = $this->data['name'];
$data['categories'] = $this->data['categories'];
//分类select
$data['categories_lists'] = $this->category_model->categories;
$this->data['body'] = $this->load->view('content/list', $data, true);
Displayview::display('content/content', $this->data);
}
示例6: display
/**
* Displays a Player based on an post request of the dropdown menu.
*/
public function display()
{
$this->data['transactions'] = $this->transactions->getAllTransactions();
$this->data['players'] = $this->players->getAllPlayers();
$this->load->helper('form');
$code = $this->input->post('player');
$this->data['Playername'] = $code;
$this->data['title'] = "Stock Ticker";
$this->data['left-panel-content'] = 'player/players';
$this->data['right-panel-content'] = 'player/transactions';
$this->data['player_code'] = $code;
$form = form_open('player/display');
$player_cash = array();
$player_names = array();
$players = $this->players->getAllPlayers();
foreach ($players as $item) {
array_push($player_names, $item->Player);
array_push($player_cash, $item->Cash);
}
$players = array_combine($player_names, $player_names);
$select = form_dropdown('player', $players, $code, "class = 'form-control'" . "onchange = 'this.form.submit()'");
$this->data['form'] = $form;
$this->data['select'] = $select;
$this->data['ptrans'] = $this->transactions->getPlayerTransactions($code);
$this->data['holdings'] = $this->transactions->getCurrentHoldings($code);
$this->render();
}
示例7: form_per_page
function form_per_page($name = null, $options = null, $selected = null, $extra_attributes = null, $min = null, $max = null)
{
$ci = get_instance();
if (empty($options) || !is_array($options)) {
$options = array(5, 10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 1000);
}
$min = (int) $min;
if ($min <= 0) {
$min = $options[0];
}
$all = $max == 'all';
$max = (int) $max;
if ($max <= 0) {
$max = $options[count($options) - 1];
}
if ($max < $min) {
$max = $min;
}
$result_options = array();
foreach ($options as $option) {
if ($option >= $min && $option <= $max) {
$result_options[(string) $option] = $ci->lang->line('ui_per_page', $option);
}
}
if ($all) {
$result_options['all'] = '-- ' . $ci->lang->line('ui_all') . ' --';
}
return form_dropdown($name, $result_options, $selected, $extra_attributes);
}
示例8: display_settings
/**
* Display settings sub-form for this variable type
*
* @param mixed $var_id The id of the variable: 'new' or numeric
* @param array $var_settings The settings of the variable
* @return array
*/
function display_settings($var_id, $var_settings)
{
// -------------------------------------
// Init return value
// -------------------------------------
$r = array();
// -------------------------------------
// Check current value from settings
// -------------------------------------
$maxlength = $this->get_setting('maxlength', $var_settings);
$size = $this->get_setting('size', $var_settings);
$pattern = $this->get_setting('pattern', $var_settings);
$text_direction = $this->get_setting('text_direction', $var_settings);
// -------------------------------------
// Build rows for values
// -------------------------------------
$r[] = array($this->setting_label(lang('variable_maxlength')), form_input(array('name' => $this->input_name('maxlength'), 'value' => $maxlength, 'size' => '4', 'maxlength' => '4', 'class' => 'x-small')));
$r[] = array($this->setting_label(lang('variable_size')), form_dropdown($this->input_name('size'), array('large' => lang('large'), 'medium' => lang('medium'), 'small' => lang('small'), 'x-small' => lang('x-small')), $size));
$r[] = array($this->setting_label(lang('variable_pattern'), lang('variable_pattern_help')), form_input(array('name' => $this->input_name('pattern'), 'value' => $pattern, 'class' => 'medium')));
// -------------------------------------
// Build settings text_direction
// -------------------------------------
$dir_options = '';
foreach (array('ltr', 'rtl') as $dir) {
$dir_options .= '<label class="low-radio">' . form_radio($this->input_name('text_direction'), $dir, $this->get_setting('text_direction', $var_settings) == $dir) . ' ' . lang("text_direction_{$dir}") . '</label>';
}
$r[] = array($this->setting_label(lang('text_direction')), $dir_options);
// -------------------------------------
// Return output
// -------------------------------------
return $r;
}
示例9: display
/**
* Displays the details of the requested stock.
*/
public function display()
{
$this->load->helper('form');
if (!empty($this->input->post('stock'))) {
$code = $this->input->post('stock');
$this->data['src'] = "../assets/js/stock-history.js";
} else {
$code = $this->uri->segment(3);
$this->data['src'] = "../../assets/js/stock-history.js";
}
$this->data['title'] = "Stocks ~ {$code}";
$this->data['left-panel-content'] = 'stock/index';
$this->data['right-panel-content'] = 'stock/sales';
$this->data['stock_code'] = $code;
$this->data['trans'] = $this->transactions->getSalesTransactions($code);
$form = form_open('stock/display');
$stock_codes = array();
$stock_names = array();
$stocks = $this->stocks->getAllStocks();
$stock = $this->stocks->get($code);
foreach ($stocks as $item) {
array_push($stock_codes, $item->Code);
array_push($stock_names, $item->Name);
}
$stocks = array_combine($stock_codes, $stock_names);
$select = form_dropdown('stock', $stocks, $code, "class = 'form-control'" . "onchange = 'this.form.submit()'");
$this->data['Name'] = $stock->Name;
$this->data['Code'] = $stock->Code;
$this->data['Category'] = $stock->Category;
$this->data['Value'] = money_format("\$%i", $stock->Value);
$this->data['form'] = $form;
$this->data['select'] = $select;
$this->render();
}
示例10: display_field
function display_field($data)
{
$text_direction = $this->settings['field_text_direction'] == 'rtl' ? 'rtl' : 'ltr';
$member_list = array();
$deleted_user_message = '';
$this->EE->db->select('group_title, member_id, screen_name');
$this->EE->db->from('exp_members');
$this->EE->db->join('exp_member_groups', 'exp_members.group_id = exp_member_groups.group_id');
$this->EE->db->order_by('exp_member_groups.group_id asc, exp_members.screen_name');
if ($this->settings[CKI_MBLIST_KEY]['group_ids']) {
$this->EE->db->where_in('exp_members.group_id', explode('|', $this->settings[CKI_MBLIST_KEY]['group_ids']));
}
$q = $this->EE->db->get();
//Create a blank option
$member_list[''] = "None";
//Setup the member list array to send to the form_dropdown function
foreach ($q->result_array() as $member) {
$member_list[$member['group_title']][$member['member_id']] = $member['screen_name'];
$member_id_array[$member['member_id']] = $member['screen_name'];
}
//Quickly check to see (if on the EDIT page) that the previously selected member still exists
if (!array_key_exists($data, $member_id_array) && $data != '') {
//If not, append a warning message
$deleted_user_message = " <span class='notice'>Selected member no longer exists.</span>";
}
return form_dropdown($this->field_name, $member_list, $data, 'dir="' . $text_direction . '" id="' . $this->field_id . '"') . $deleted_user_message;
}
示例11: display_configuration
function display_configuration($field_name, $field_label, $field_type, $data)
{
$config = array();
$config["label"] = form_label($field_label);
$config["value"] = "<p>" . form_dropdown($field_name, $data["data_fields"], isset($data["default_settings"]["cf"][$field_name]) ? $data["default_settings"]["cf"][$field_name] : '') . "</p><p>Field to match: " . NBS . form_dropdown($field_name . "_relationship_field", $data["all_fields"], (isset($data["default_settings"]["cf"][$field_name . "_relationship_field"]) ? $data["default_settings"]["cf"][$field_name . "_relationship_field"] : '') . "</p>");
return $config;
}
示例12: display_configuration
function display_configuration($field_name, $field_label, $field_type, $data)
{
$config = array();
$config["label"] = form_label($field_label) . NBS . anchor("http://brandnewbox.co.uk/support/details/importing_into_playa_fields_with_datagrab", "(?)", 'class="help"');
$config["value"] = "<p>" . form_dropdown($field_name, $data["data_fields"], isset($data["default_settings"]["cf"][$field_name]) ? $data["default_settings"]["cf"][$field_name] : '') . "</p><p>Field to match: " . NBS . form_dropdown($field_name . "_playa_field", $data["all_fields"], (isset($data["default_settings"]["cf"][$field_name . "_playa_field"]) ? $data["default_settings"]["cf"][$field_name . "_playa_field"] : '') . "</p>");
return $config;
}
示例13: index
public function index()
{
$this->load->helper('form');
$this->load->helper('url');
$aOptions = array('none' => '', 'hourly' => 'hourly', 'daily' => 'daily');
$sAttributes = 'id="select_type"';
$data['select_type'] = form_label("Select either hourly or daily predictions:", 'select_type') . form_dropdown('select_type', $aOptions, '', $sAttributes);
for ($i = 0; $i < 36; $i++) {
$aOptionsHour[$i] = $i;
if ($i < 10) {
$aOptionsDay[$i] = $i;
// Get at days while I'm at it.
$aOptionsPop[$i * 10] = $i * 10;
}
}
$sAttributesPop = 'id = "select_pop"';
$sAttributesDay = 'id="select_day"';
$sAttributesHour = 'id="select_hour"';
$data['sel_hour'] = form_label("Select how many hours ahead:", 'select_hour') . form_dropdown('sel_hour', $aOptionsHour, '', $sAttributesHour);
$data['sel_day'] = form_label("Select how many days ahead:", 'select_day') . form_dropdown('sel_day', $aOptionsDay, '', $sAttributesDay);
$data['sel_pop'] = form_label("Select percent of percipitation:", 'select_pop') . form_dropdown('sel_pop', $aOptionsPop, '', $sAttributesPop);
$sAttributesData = 'id="select_data"';
$aOptionsData = array('Temperature' => 'temp', 'Precipitation' => 'pop');
$data['sel_data'] = form_label("Select details on either POP or Temperature:", 'select_data') . form_dropdown('sel_data', $aOptionsData, '', $sAttributesData);
$this->load->view('header_view');
$this->load->view('weather_view', $data);
$this->load->view('footer_view');
}
示例14: display_configuration
/**
* Generate the form elements to configure this field
*
* @param string $field_name the field's name
* @param string $field_label the field's label
* @param string $field_type the field's type
* @param string $data array of data that can be used to select from
* @return array containing form's label and elements
* @author Andrew Weaver
*/
function display_configuration($field_name, $field_label, $field_type, $data)
{
$config = array();
$config["label"] = form_label($field_label);
$config["value"] = form_dropdown($field_name, $data["data_fields"], isset($data["default_settings"]["cf"][$field_name]) ? $data["default_settings"]["cf"][$field_name] : '');
return $config;
}
示例15: editar
public function editar($accion, $codigo = "")
{
$lista = new stdClass();
if ($accion == "e") {
$filter = new stdClass();
$filter->ciclo = $codigo;
$ciclos = $this->ciclo_model->obtener($filter);
$lista->finicio = date_sql(substr($ciclos->CICC_FECHA_INICIO, 0, 10));
$lista->ffin = date_sql(substr($ciclos->CICC_FECHA_FIN, 0, 10));
$lista->descripcion = $ciclos->CICC_DESCRIPCION;
$lista->codigo = $ciclos->CICLOP_Codigo;
$lista->nombre = $ciclos->COMPC_Nombre;
$lista->tipociclo = $ciclos->TIPOCICLOP_Codigo;
} elseif ($accion == "n") {
$lista->finicio = "";
$lista->ffin = "";
$lista->descripcion = "";
$lista->codigo = "";
$lista->nombre = "";
$lista->tipociclo = "";
}
$arrTipociclo = array("0" => "::Seleccione::", "1" => "Ciclo 1", "2" => "Ciclo 2");
$data['titulo'] = $accion == "e" ? "Editar Ciclo" : "Crear Ciclo";
$data['form_open'] = form_open('', array("name" => "frmPersona", "id" => "frmPersona", "onsubmit" => "return valida_guiain();"));
$data['form_close'] = form_close();
$data['lista'] = $lista;
$data['seltipociclo'] = form_dropdown('tipociclo', $arrTipociclo, $lista->tipociclo, "id='tipociclo' class='comboMedio'");
$data['oculto'] = form_hidden(array("accion" => $accion, "codigo_padre" => $codigo, "codigo" => $lista->codigo));
$this->load->view("maestros/ciclo_nuevo", $data);
}