Php 按类名为多行调用函数
我有一个功能,可以在单击按钮时更新多个表行。它应该将所选的Php 按类名为多行调用函数,php,codeigniter,Php,Codeigniter,我有一个功能,可以在单击按钮时更新多个表行。它应该将所选的类添加到行中 <button class=\"btn btn-flat\" onclick=\"if(confirm('Deseja realmente excluir o registro?')) window.location.href='".base_url("adm/pedidos/excluir/".$registro->id)."';\"> <span class=\"awe-remove\"&
类添加到行中
<button class=\"btn btn-flat\" onclick=\"if(confirm('Deseja realmente excluir o registro?')) window.location.href='".base_url("adm/pedidos/excluir/".$registro->id)."';\">
<span class=\"awe-remove\"></span>
</button>";
<table class="datatable table table-bordered" id="example">
<thead>
<tr>
<th class="t-center">Pedido</th>
<th class="t-center">Data</th>
<th>Cliente</th>
<th class="t-center">Frete</th>
<th class="t-center">Valor Total</th>
<th class="t-center">Status</th>
<th class="t-center">Pagamento</th>
<th class="t-center">Ação</th>
</tr>
</thead>
<tbody>
<?php
foreach($registros as $registro)
{
echo "<tr class=\"".situacaoClasse($registro->situacao)."\">";
echo '<td class="t-center">'.$registro->id.'</td>';
echo "<td><span style='display:none;'>".$registro->data."</span>".converteDataHora($registro->data)."</td>";
echo '<td class="pedidonome">'.strtolower($registro->nome ? $registro->nome : $registro->razao_social).' ('.$registro->uf.')</td>';
echo '<td class="t-center">R$ '.ConverteReal($registro->frete).' ('.getTipoFrete($registro->tipo_frete).') <br> '.($registro->frete_prazo ? '<small>'.$registro->frete_prazo.' dia(s) - '.ConverteData($registro->frete_prazo_data).'</small>' : '').'</td>';
echo '<td class="t-center">R$ '.ConverteReal($registro->valor_pedido).'</td>';
echo '<td class="t-center">'.$registro->situacao.'</td>';
echo '<td class="t-center">'.getPagamento($registro->pagamento).'</td>';
echo "<td class=\"toolbar\">
<div class=\"btn-group\">
<a class=\"btn btn-flat\" href=\"".base_url("adm/pedidos/alterar/".$registro->id)."\">
<span class=\"awe-wrench\"></span>
</a>
";
if ($this->session->userdata('usuario_tipo') == 'adm')
{
echo "
<button class=\"btn btn-flat\" onclick=\"if(confirm('Deseja realmente excluir o registro?')) window.location.href='".base_url("adm/pedidos/excluir/".$registro->id)."';\">
<span class=\"awe-remove\"></span>
</button>";
}
echo "
</div>
</td>";
echo "</tr>";
}
?>
</tbody>
</table>
id)。“;\”>
";
佩蒂多
资料
客户
弗雷特
英勇
地位
帕加门托
Aç;ã;o
对我来说,这是一个有趣的问题!没有表单和输入的更新?我不知道如何使用表单进行更新,因为我的函数名为byt$id,来自td Selected抱歉!我不理解codeigniter,请参阅本教程。如果您发布其余代码(调用其他两个URL),我们可能会找到它不更新的原因。