本文整理汇总了PHP中BD::SetComboSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::SetComboSelect方法的具体用法?PHP BD::SetComboSelect怎么用?PHP BD::SetComboSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BD
的用法示例。
在下文中一共展示了BD::SetComboSelect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<div class="col-md-4">
<label for="">Nome do produto</label>
<input type="text" id="nome_produto" name="nome_produto" class="form-control"
value="<?php
echo $nome_produto;
?>
">
</div>
<div class="col-md-3">
<label for="">Linha</label>
<?php
$consulta = "SELECT codigo, descricao FROM linhas";
$nome = "linha";
$itemPadrao = $cod_linha;
$css = "form-control";
echo $bd->SetComboSelect($consulta, $nome, $itemPadrao, $css);
?>
</div>
<div class="col-md-3">
<label for="">Família</label>
<?php
$consulta = "SELECT codigo, nome FROM familia where ativo='true'";
$nome = "nome";
$itemPadrao = $cod_familia;
$css = "form-control";
echo $bd->SetComboSelect($consulta, $nome, $itemPadrao, $css);
?>
</div>
示例2: BD
<?php
/**
* Created by PhpStorm.
* User: rodrigo.martins
* Date: 22/01/2016
* Time: 09:53
*/
include_once "first_all.php";
$bd = new BD();
$sql = "SELECT codigo,nome FROM veiculos WHERE cod_fabricante={$_GET['cod_fabricante']}";
echo $bd->SetComboSelect($sql, 'cod_veiculo', '', 'form-control');
示例3:
<!--criterios-->
<div class="row">
<div class="panel panel-primary">
<div class="panel-heading">Pesquisa por critérios</div>
<div class="panel-body">
<div class="row">
<div class="col-md-3">
<label for="">Fabricante</label>
<?php
$consulta = "select 0 codigo,'Todos' fabricante union all select codigo,nome fabricante from fabricantes";
$nome = "fabricante";
$itemPadrao = 0;
$css = "form-control";
echo $bd->SetComboSelect($consulta, $nome, $itemPadrao, $css);
?>
</div>
<div class="col-md-5">
<label for="">Veículo</label>
<?php
$consulta = "select 0 codigo,'Todos' veiculo union all select codigo,nome veiculo from veiculos";
$nome = "veiculo";
$itemPadrao = 0;
$css = "form-control";
echo $bd->SetComboSelect($consulta, $nome, $itemPadrao, $css);
?>
</div>
<div class="col-md-2">
示例4:
<form action="../backend/update_veiculo.php" method="post" enctype="multipart/form-data">
<br>
<div class="row">
<div class="panel panel-primary">
<div class="panel-heading">Veículos</div>
<div class="panel-body">
<div class="row">
<input name="id" type="hidden" value="<?php
echo $_GET['codigo'];
?>
">
<div class="col-md-4">
<label for="">Fabricante</label>
<?php
$sql = "SELECT codigo , nome FROM fabricantes WHERE ativo='true'";
echo $bd->SetComboSelect($sql, "cod_fabricante", $cod_fabricante, "form-control");
?>
</div>
<div class="col-md-8">
<label for="">Veículo</label>
<input type="text" value="<?php
echo $nome;
?>
" name="nome" class="form-control">
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<button type="submit" class="btn btn-lg btn-primary pull-right">Salvar</button>
<button type="button" onclick="excluir_veiculo(<?php