我不知道为什么表单teste
只出现在foreach
.
笔记:
<?php echo $this->Form->create(null, array(
'url' => array('controller' => 'menus', 'action' => 'reprovar', $procuracao['Attorney']['id'])
)); ?>`
这出现在foreach
.
only的标签<FORM>
出现<?php echo $this->Form->create('teste'); ?>
在第一个结果中。
在每个元素中,都会出现文本区域和按钮。
完整代码:
<?php foreach ($procuracoes as $procuracao): ?>
<td><?php echo $procuracao['Attorney']['nome']; ?></td>
<td><?php echo $procuracao['Attorney']['estadocivil']; ?></td>
<td><?php echo $procuracao['Attorney']['identidade'].'/'.$procuracao['Attorney']['expedidor']; ?></td>
<td><?php echo $procuracao['Attorney']['cpf']; ?></td>
<td><?php echo $procuracao['Attorney']['status']; ?></td>
<td><ul>
<?php foreach ($procuracao['Power'] as $power): ?>
<li> <?php echo $power['resumo'] ?> </li>
<?php endforeach ?>
</ul></td>
<td>
<?php if($this->Session->read('Auth.User.id') == $procuracao['Attorney']['aprovador'] AND $procuracao['Attorney']['fluxo'] == 0 OR $this->Session->read('Auth.User.nivel') == 'administrador') : ?>
<div id="botoes-small">
<ul>
<input type="button" value="Aprovar" class="btn btn-success aprovar">
<div class="formaprovar">
<?php echo $this->Form->create('teste'); ?>
<?php echo $this->Form->textarea('testerrr', array('placeholder' => 'teste')); ?>
<?php echo $this->Form->submit('Ok', array('class' =>'btn btn-success', 'div' => false)); ?>
</div>
<input type="button" value="Reprovar" class="btn btn-danger reprovar">
<div class="formreprovar">
<?php echo $this->Form->create(null, array(
'url' => array('controller' => 'menus', 'action' => 'reprovar', $procuracao['Attorney']['id'])
)); ?>
<?php echo $this->Form->textarea('motivo', array('placeholder' => 'Motivo')); ?>
<?php echo $this->Form->submit('Ok', array('class' =>'btn btn-success pull-left', 'div' => false)); ?>
</div>
<?php endif; ?>
</ul>
</div>
<?php if($this->Session->read('Auth.User.id') == $procuracao['Attorney']['aprovador'] AND $procuracao['Attorney']['fluxo'] == 1): ?>
<div class="alert alert-success">
<b>Aprovado</b>
</div>
<?php endif; ?>
<?php if($this->Session->read('Auth.User.id') == $procuracao['Attorney']['aprovador'] AND $procuracao['Attorney']['fluxo'] == 3): ?>
<div class="alert alert-error">
<b>Recusado</b>
</div>
<?php endif; ?>
</td>
</tr>
<?php endforeach ?>