我在PHP&中做标签内容从数据库动态提取数据的Bootstrap。所以我可以成功地从我选择的数据中提取数字并生成数组。我选择3然后将生成3个选项卡。
我的问题是,这3个人的内容都是一样的。请帮助我,我在这里做错了什么。看来我的循环在逻辑上做得很好。
<?php
$date = $_POST['handinDate'];
$baseId = $_POST['base'];
$deviceNum = $_POST['device'];
$flightsCount = $_POST['flights'];
$newDate = date("Y/m/d", strtotime($date));
?>
<div class="col-md-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs pull-right">
<?php
for ($i = 0; $i < count($flightsCount); $i++){
if ($i == 0){
echo "<li class='active'><a href='content$flightsCount[$i]' data-toggle='tab'>GA $flightsCount[$i]</a></li>";
} else {
echo "<li><a href='content$flightsCount[$i]' data-toggle='tab'>GA $flightsCount[$i]</a></li>";
}
}
?>
<li class="pull-left header"><i class="fa fa-th"></i> SALES RECORD # ~ <b><?php echo $newDate.'/SR-SOB-'.$deviceNum.'-1'; ?></b></li>
</ul>
<div class="tab-content">
<!-- GENERATING TAB CONETENT HERE -->
<?php
for ($i = 0; $i < count($flightsCount); $i++){
if ($i == 0){
echo "<div class='tab-pane active' id='content$flightsCount[$i]'>";
echo "<b>SALES ORDER # = $date~$flightsCount[$i]</b>";
echo "</div>";
} else {
echo "<div class='tab-pane' id='content$flightsCount[$i]'>";
echo "<b>SALES ORDER # = $date~$flightsCount[$i]</b>";
echo "</div>";
}
}
?>
</div><!-- /.tab-content -->
</div><!-- nav-tabs-custom -->
</div>