Javascript - Passar Parâmetros para uma Função.
Caros amigos, saudações.
Estou com uma pequena dúvida se é possível ser realizado.
Preciso passar 2 IDs para o Sistema executar a função, estou utilizando desta forma e gostaria de saber como faço via JS para passar os parâmetro que preciso.
Observação:
Dentro da TABELA utilizei 2 Forms, para passar os IDS que preciso, funcionou conforme código abaixo.
<div class="card-body">
<table id="tab_clie" class="table table-bordered table-hover">
<thead>
<tr>
<th style="text-align:center; width:10%;">Pedido Nº</th>
<th style="text-align:center; width:10%;">Data Pedido</th>
<th style="text-align:center; width:32%;">Fornecedor</th>
<th style="text-align:center; width:10%;">Status</th>
<th style="text-align:center; width:5%;">Ação</th>
</tr>
</thead>
<tbody>
<?php foreach ($results as $r) {
$dta_ped = date(('d/m/Y'), strtotime($r->dataPedido));
switch ($r->pd_status) {
case '1':
$status = ' Aberto ';
$txt = '#FFFFFF'; //Cor: Branco
$cor = '#000000'; //Cor: Preta
break;
case '2':
$status = 'Atendido Total';
$txt = '#FFFFFF'; //Cor: Branco
$cor = '#086108'; //Cor: Verde
break;
case '3':
$status = 'Atendido Parcial';
$txt = '#000000'; //Cor: Branco
$cor = '#FEA118'; //Cor: Amarelo
break;
default:
$status = 'Cancelado';
$txt = '#FFFFFF'; //Cor: Branco
$cor = '#D20101'; //Cor: Vermelho
break;
}
echo '<tr>';
echo '<td width="10%" height="10" style="text-align:center;">'.$r->pd_numero.'</td>';
echo '<td width="10%" height="10" style="text-align:center;">'.$dta_ped.'</td>';
echo '<td width="32%" height="10" style="text-align:left;">'.$r->nome.'</td>';
echo '<td width="10%" height="10" style="text-align:left;"><span class="badge" style="color:'.$txt.'; background-color:'.$cor.'; border-color:'.$cor.'">'.$status.'</span></td>';
echo '<td width="5%" style="text-align:center;">'; ?>
<div class="row">
<?php if($this->permission->checkPermission($this->session->userdata('permissao'), 'vPedido')){ ?>
<form action="<?= base_url() ?>compras/pedidos/visualizar" method="POST" >
<input type="hidden" name="idPedido" value="<?php echo $r->idPedidos; ?>">
<input type="hidden" name="nrPedido" value="<?php echo $r->pd_numero; ?>">
<button class="btn btn-warning" title="Visualizar" style="margin-left:50%; padding: 1px 3px;"><i class="fa fa-search icon-white"></i></button>
</form>
<?php }
if($this->permission->checkPermission($this->session->userdata('permissao'), 'ePedido')){ ?>
<form action="<?= base_url() ?>compras/pedidos/editar" method="POST" >
<input type="hidden" name="idPedido" value="<?php echo $r->idPedidos; ?>">
<input type="hidden" name="nrPedido" value="<?php echo $r->pd_numero; ?>">
<button class="btn btn-primary" title="Editar" style="margin-left:50%; padding: 1px 3px;"><i class="fa fa-edit icon-white"></i></button>
</form>
<?php } ?>
</div>
<?php
echo '</td>';
echo '</tr>';
} ?>
</tbody>
</table>
</div>
Grato,
Cesar.Discussão (1)
Carregando comentários...