<?php foreach($renewals as $row) { ?>
<tr >
<td style="width:50%;"><?php echo $row['renew_year']; ?></td>
<td style="width:40%;"><?php echo $row['total']; ?></td>
<td><a href="<?php $options['id'] = 18; echo $this->url("admin",$options); ?>?renew_year=<?php echo $row['renew_year']?>">View</a>
</td>
<td>
<input type="button" name="exportXLSRvt" id="exportXLSRvt" class="button exportIcon" title="Export XLS">
<form id="frmExportRvt" name="frmExport" method="post"
action="<?php echo $this->url("admin", array("controller" => "members", "action" => "indexExport", "id" => 18)); ?>?renew_year=<?php echo $row['renew_year'] ?>"
style="display: none;">
<input type="hidden" name="hdn_export_type" id="hdn_export_type" value="xls"/>
</form>
</td>
</tr>
<?php } ?>以上代码是导出数据到xls我已经创建了多个表单.....取决于数据,但我们曾经点击过图像,它发布了相同的数据,所以如果有人有替代的解决方案,请帮助我]
发布于 2014-07-03 22:44:32
如果,无论你点击什么图像,你总是得到相同的数据,这仅仅意味着你在每个表单下都有相同的动作。
所以我将重点放在这一行上
action="<?php echo $this->url("admin", array("controller" => "members",
"action" => "indexExport", "id" => 18)); ?>
?renew_year=<?php echo $row['renew_year'] ?>"也许你必须转换成这样的东西:
action="<?php echo $this->url("admin", array("controller" => "members",
"action" => "indexExport", "id" => 18, "renew_year" => $row['renew_year'])); ?>"你应该能够从你的控制器调用$_GET‘’renew_year‘并加载正确的数据。
https://stackoverflow.com/questions/24556624
复制相似问题