I am doing tabbed content in PHP & Bootstrap that pulls the data dynamically from the database. So i can successfull pull the number and generate the array from how many data i selected. I chose 3 then 3 tabs will be generated.
My problem is, the content for those 3 are all the same. Please help me what i am doing wrong here. It seems my loops are doing fine logically.
<?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>