I'm having a problem right now where my data exceeds 12 columns and it's looking distorted.
I tried to fiddle around with my foreach position and add clearfix but it doesn't work. How do I make sure that it will not exceed 12? Is it because there's 2 foreach in a row?
<div class="row">
<?php $count=0; foreach($model['organizations']['approve'] as $organization): ?>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-primary pull-right">Manage</span>
<h3 class=""><?php echo $organization->title ?></h3>
</div>
<div class="ibox-content">
<?php /*echo Html::image(ImageHelper::thumb(64, 64, $organization->image_logo), Yii::t('app', 'Logo Image'), array('class'=>"img-circle m-t-xs img-responsive"));*/ ?>
<span class="label label-primary pull-right">Visit</span>
<h6 class="no-margins">Website</h6>
</div>
<!-- <div class="btn-group btn-group-xs btn-group-justified">
Manage
Website
</div> -->
</div>
</div>
<?php $count++; endforeach; ?>
<div class="clearfix"></div>
<?php $count=0; foreach($model['organizations']['pending'] as $organization): ?>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-primary pull-right badge badge-warning" ">Pending</span>
<!-- <?php echo Html::image(ImageHelper::thumb(50, 50, $organization->image_logo), Yii::t('app', 'Logo Image'), array('class'=>"img-circle m-t-xs img-responsive")); ?>
-->
<h3 class="no-margins"><?php echo $organization->title ?></h3>
<!-- <small><?php echo $organization->text_oneliner ?></small>
-->
</div>
<div class="ibox-content">
<?php /*echo Html::image(ImageHelper::thumb(64, 64, $organization->image_logo), Yii::t('app', 'Logo Image'), array('class'=>"img-circle m-t-xs img-responsive"));*/ ?>
<span class="label label-primary pull-right">Visit</span>
<h6 class="no-margins">Website</h6>
</div>
<!-- <div class="btn-group btn-group-xs btn-group-justified">
Manage
Website
</div> -->
</div>
</div>
<?php $count++; endforeach; ?>
<div class="col-lg-4">
<div class="contact-box full-width light-green-bg">
<div class="col-xs-12">
<div class="center-block text-center margin-top-lg text-muted">
<i class="fa fa-plus-circle fa-2x"></i><br />Add
</div>
</div>
</div>
</div>
</div>
Any help would be greatly appreciated!
Hey try put this code before <div class="clearfix"></div>:
<?php
$count = 1;
foreach ($model['organizations']['approve'] as $organization) {
if ($count == 1 || $count % 3 == 1) {
?>
<div class="row">
<?php
}
?>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-primary pull-right">Manage</span>
<h3 class=""><?php echo $organization->title ?></h3>
</div>
<div class="ibox-content">
<?php /*echo Html::image(ImageHelper::thumb(64, 64, $organization->image_logo), Yii::t('app', 'Logo Image'), array('class'=>"img-circle m-t-xs img-responsive"));*/ ?>
<span class="label label-primary pull-right"><a
href="<?php echo $organization->url_website ?>"
class=" <?php echo empty($organization->url_website) ? 'disabled' : '' ?>"
target="_blank">Visit</a></span>
<h6 class="no-margins">Website</h6>
</div>
<!-- <div class="btn-group btn-group-xs btn-group-justified">
Manage
Website
</div> -->
</div>
</div>
<?php
if ($count % 3 == 0) {
?>
</div>
<?php }
$count++;
}
?>
<?php if ($count % 3 != 0) echo "</div>"; ?>
You can try our this. I just modified #Sador's answer. I hope it helps.
<div class="row">
<?php
$count = 1;
foreach ($model['organizations']['approve'] as $organization):
?>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-primary pull-right">Manage</span>
<h3 class=""><?php echo $organization->title ?></h3>
</div>
<div class="ibox-content">
<?php /* echo Html::image(ImageHelper::thumb(64, 64, $organization->image_logo), Yii::t('app', 'Logo Image'), array('class'=>"img-circle m-t-xs img-responsive")); */ ?>
<span class="label label-primary pull-right">
Visit
</span>
<h6 class="no-margins">Website</h6>
</div>
<!-- <div class="btn-group btn-group-xs btn-group-justified">
Manage
Website
</div> -->
</div>
</div>
<?php if ($count % 3 == 0) { ?>
</div>
<div class="row">
<?php
}
$count++;
endforeach;
?>
Related
Following is my code I am displaying details as 3 columns per row using Bootstrap class row.
I tried like changing div and some condition
<div class="container">
<?php
if($lclResult->rowCount() > 0){
while($row = $lclResult->fetch(PDO::FETCH_ASSOC)) {
# code...
$lclUserName = $row['us_business_name'];
$lclImage1 = $row['us_image1'];
$lclCategory = $row['us_category'];
$lclArea = $row['us_area'];
?>
<div class="row">
<div class="col-sm-4">
<div class="card">
<img class="card-img-top " src="<?php echo $lclImage1 ?>" alt="Card image" style="width:100%; height: 158px;">
<div class="card-body">
<h4 class="card-title"><?php echo $lclUserName?></h4>
<p class="card-text" style="font-size: 25px;"><?php echo $lclCategory?></p>
<hr>
<i class="fa fa-map-marker" style="font-size: 23px;"><span> </span><?php echo $lclArea?></i>
<!-- See Profile -->
</div>
</div>
<?php
}
?>
</div>
<?php
} else {
?>
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1> NO RESULT FOUND...</h1>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
I want to display 3 columns per row to display data. If anyone knows Please guide me with the above code.
Change your code like this
<div class="container">
<div class="row">
<?php
if($lclResult->rowCount() > 0){
while($row = $lclResult->fetch(PDO::FETCH_ASSOC)) {
# code...
$lclUserName = $row['us_business_name'];
$lclImage1 = $row['us_image1'];
$lclCategory = $row['us_category'];
$lclArea = $row['us_area'];
?>
<div class="col-sm-4">
<div class="card">
<img class="card-img-top " src="<?php echo $lclImage1 ?>" alt="Card image" style="width:100%; height: 158px;">
<div class="card-body">
<h4 class="card-title">
<?php echo $lclUserName?>
</h4>
<p class="card-text" style="font-size: 25px;">
<?php echo $lclCategory?>
</p>
<hr>
<i class="fa fa-map-marker" style="font-size: 23px;">
<span>
</span>
<?php echo $lclArea?>
</i>
<!-- See Profile -->
</div>
</div>
</div>
<?php
}
?>
<?php
} else {
?>
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1> NO RESULT FOUND...
</h1>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
My issue is owl carousel clone the item
i started with getting Reviews
<?php
if($total_num_of_rev > 0) { ?>
<div class="row">
<?php
$numOfCols = 6;
$rowCount = 0;
foreach($review_list_data as $key => $review_data) { ?>
and i put them in html code as following:
<div class="row">
<?php
if($total_num_of_rev > 0) { ?>
<div class="row">
<?php
$numOfCols = 6;
$rowCount = 0;
foreach($review_list_data as $key => $review_data) { ?>
<div class="col-md-12">
<div class="owl-carousel-3col" data-dots="false">
<div class="item">
<div class="testimonial style1">
<div class="comment bg-theme-colored">
<p class="font-15 pl-0 text-white"><?=$review_data['content']?></p>
</div>
<div class="thumb content mt-10 mb-10">
<?php
if($review_data['photo']) { ?>
<img class="img-circle" alt="" src="<?=SITE_URL.'images/review/'.$review_data['photo']?>">
<?php
} else { ?>
<img src="images/placeholder_avatar.jpg">
<?php
} ?>
</div>
<h4 class="author text-white mt-0 mb-0"><?=$review_data['name'].$i?></h4>
<h6 class="title text-white mt-0 mb-15">Designer</h6>
</div>
</div>
</div>
<div class="row"></div>
</div>
<?php
$rowCount++;
} ?>
<?php
} ?>
</div>
A screenshot of the issue
<section class="divide" data-bg-img="images/bg/bg8.jpg" style="background: 50% 97px rgb(17, 17, 17);">
<div class="container pt-60 pb-60">
<div class="section-title text-center">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 class="text-uppercase text-white line-bottom-center mt-0">What Claint's <span class="text-theme-colored2">Say</span></h2>
<div class="title-flaticon">
<i class="flaticon-charity-alms"></i>
</div>
<p class="text-white">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem autem<br> voluptatem obcaecati!</p>
</div>
</div>
</div>
<div class="row">
<?php
if($total_num_of_rev > 0) { ?>
<div class="row">
<?php
$numOfCols = 6;
$rowCount = 0;
foreach($review_list_data as $key => $review_data) { ?>
<div class="col-md-12">
<div class="owl-carousel-3col" data-dots="false">
<div class="item">
<div class="testimonial style1">
<div class="comment bg-theme-colored">
<p class="font-15 pl-0 text-white"><?=$review_data['content']?></p>
</div>
<div class="thumb content mt-10 mb-10">
<?php
if($review_data['photo']) { ?>
<img class="img-circle" alt="" src="<?=SITE_URL.'images/review/'.$review_data['photo']?>">
<?php
} else { ?>
<img src="images/placeholder_avatar.jpg">
<?php
} ?>
</div>
<h4 class="author text-white mt-0 mb-0"><?=$review_data['name'].$i?></h4>
<h6 class="title text-white mt-0 mb-15">Designer</h6>
</div>
</div>
</div>
<div class="row"></div>
</div>
</div>
<h4 class="author text-white mt-0 mb-0"><?=$review_data['name'].$i?></h4>
<h6 class="title text-white mt-0 mb-15">Designer</h6>
</div>
</div>
</div>
<div class="row"></div>
</div>
<?php
$rowCount++;
} ?>
<?php
} ?>
</div>
</section>
I think i have mistake in javascript but not sure :
var $owl_carousel_3col = $('.owl-carousel-3col');
if ( $owl_carousel_3col.length > 0 ) {
if(!$owl_carousel_3col.hasClass("owl-carousel")){
$owl_carousel_3col.addClass("owl-carousel owl-theme");
}
$owl_carousel_3col.each(function() {
var data_dots = ( $(this).data("dots") === undefined ) ? false: $(this).data("dots");
var data_nav = ( $(this).data("nav")=== undefined ) ? false: $(this).data("nav");
var data_duration = ( $(this).data("duration") === undefined ) ? 4000: $(this).data("duration");
$(this).owlCarousel({
rtl: THEMEMASCOT.isRTL.check(),
autoplay: true,
autoplayTimeout: data_duration,
loop: false,
rewind: true,
items: 6,
margin: 15,
dots: data_dots,
nav: data_nav,
navText: [
'<i class="fa fa-chevron-left"></i>',
'<i class="fa fa-chevron-right"></i>'
],
responsive: {
0: {
items: 1,
center: false
},
480: {
items: 1,
center: false
},
600: {
items: 1,
center: false
},
750: {
items: 2,
center: false
},
960: {
items: 2
},
1170: {
items: 3
},
1300: {
items: 3
}
}
});
});
}
Your problem seems to be the position of your foreach loop. You want to loop the item, not the whole column.
Basically you are creating an carousel for each of your reviews and owl fills the whole width of your container with clones of the item.
Put your foreach loop around
<div class="item">
and try again.
i put foreach before item
one the following code :
<div class="row">
<div class="col-md-12">
<div class="owl-carousel-5col" data-dots="false">
<?php
if($total_num_of_rev > 0) { ?>
<div class="row">
<?php
$numOfCols = 6;
$rowCount = 0;
foreach($review_list_data as $key => $review_data) { ?>
<div class="item">
<div class="testimonial style1">
<div class="comment bg-theme-colored">
<p class="font-15 pl-0 text-white"><?=$review_data['content']?></p>
</div>
<div class="thumb content mt-10 mb-10">
<?php
if($review_data['photo']) { ?>
<img class="img-circle" alt="" src="<?=SITE_URL.'images/review/'.$review_data['photo']?>">
<?php
} else { ?>
<img src="images/placeholder_avatar.jpg">
<?php
} ?>
</div>
<h4 class="author text-white mt-0 mb-0"><?=$review_data['name'].$i?></h4>
<h6 class="title text-white mt-0 mb-15">Designer</h6>
</div>
</div>
</div>
<?php
$rowCount++;
} ?>
<?php
} ?>
</div>
</div>
</div>
but still an issue there
screenshot
i manage to fix the issue
To fix it i needed to put a div inside the loop
but it seems there is an empty item between every loop finish
<section class="divide" data-bg-img="images/bg/bg8.jpg" style="background: 50% 97px rgb(17, 17, 17);">
<div class="container pt-60 pb-60">
<div class="section-title text-center">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 class="text-uppercase text-white line-bottom-center mt-0">What Claint's <span class="text-theme-colored2">Say</span></h2>
<div class="title-flaticon">
<i class="flaticon-charity-alms"></i>
</div>
<p class="text-white">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem autem<br> voluptatem obcaecati!</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="owl-carousel-3col" data-dots="">
<?php
if($total_num_of_rev > 0) { ?>
<div class="">
<?php
$numOfCols = 3;
$rowCount = 0;
foreach($review_list_data as $key => $review_data) { ?>
<div class="item">
<div class="testimonial style1">
<div class="comment bg-theme-colored">
<p class="font-15 pl-0 text-white"><?=$review_data['content']?></p>
</div>
<div class="thumb content mt-10 mb-10">
<?php
if($review_data['photo']) { ?>
<img class="img-circle" alt="" src="<?=SITE_URL.'images/review/'.$review_data['photo']?>">
<?php
} else { ?>
<img src="images/placeholder_avatar.jpg">
<?php
} ?>
</div>
<h4 class="author text-white mt-0 mb-0"><?=$review_data['name'].$i?></h4>
<h6 class="title text-white mt-0 mb-15">Designer</h6>
</div>
</div>
</div>
<div class="">
<?php
$rowCount++;
} ?>
<?php
} ?>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
this is how it look
Screenshot 1
screenshot 2
any help?
Have a website in three languages. The porducts select from a mysql database and showed wiht a do-while-loop.
<!-- Shop Page Area Start-->
<div class="shoppage-area">
<div class="container">
<div class="about-desc">
<h2>
<?php echo $page['subtitle']; ?>
</h2>
<?php echo $page['content']; ?>
</div>
<div class="row">
<?php
do {
?>
<!--Product Start-->
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="sngle-product">
<div class="product-thumb">
<img src="<?php echo $product['img']; ?>" alt=""/>
<h2>
<a href="#">
<?php echo $product['name']; ?>
</a>
</h2>
</div>
<h3>
<?php echo $product['desc']; ?>
</h3>
<span><?php echo $product['size']; ?></span> <span class="price"><?php echo $product['price']; ?> LE</span>
<div class="product-overlay">
<ul>
<li>
<div class="product-quantity">
<div class="input-number">
<input type="text" value="1" name="quantity">
</div>
</div>
</li>
<li><a class="orderbtn" href="#" data-uid="<?php echo $product['uniqueid']; ?>">ORDER</a></li>
</ul>
</div>
</div>
</div>
<!-- Product End -->
<?php
} while ($product = $res->fetch_assoc()) ?>
</div>
<!-- end Row -->
</div>
</div>
The problem is that in one language showed correctly and in the other i get a lot spaces between the products. See the image
enter image description here
How i can solve this
Add an additional class flex-row to the product wrapping row element. And try applying the following styles.
.flex-row{
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
You can divide your column like this
<div class="shoppage-area">
<div class="container">
<div class="about-desc">
</div>
<div class="row">
<?php $i=1;
do {
?>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="sngle-product">
<div class="product-thumb">
<img src="<?php echo "test"; ?>" alt=""/>
<h2><?php echo "test"; ?> </h2>
</div>
<h3><?php echo ($i==2)? " testtesttesttesttesttest testtesttesttest test": "test"; ?></h3>
<span><?php echo "test"; ?></span> <span class="price"><?php echo 12321; ?> LE</span>
<div class="product-overlay">
<ul>
<li>
<div class="product-quantity">
<div class="input-number">
<input type="text" value="1" name="quantity">
</div>
</div>
</li>
<li><a class="orderbtn" href="#" data-uid="<?php echo "1231"; ?>">ORDER</a></li>
</ul>
</div>
</div>
</div>
<?php
echo $i%4;
if($i%4== 0 && $i > 1) {
echo '</div><div class="row">';
}
$i++;
} while ($i<=10) ?>
</div>
</div>
</div>
i using slider fetch MYSQL records i using while function i need only active class in first item only. i need only active class in loop first element.how to solve this problem. i using this code but can't change the item.
mycode
<?php
$qry = MYSQL_QUERY("SELECT * FROM `post` WHERE `post_type`='events' AND `post_event_start_date` <= CURDATE() ORDER BY `post_event_start_date`");
?>
<?php while( $row = MYSQL_FETCH_OBJECT($qry) ){ ?>
<div class="item <?php if($i==0) { ?> active<?php } ?>">
<ul class="thumbnails">
<li class="col-xs-12 col-lg-12 col-md-12 col-sm-12">
<div class="fff">
<div class="thumbnail">
<img src="administrator/slide_name/large/slide_1.jpg" alt="">
</div>
<div class="col-lg-12 well">
<div class="form-group">
<h3><?php print_r($row->post_title); ?></h3>
</div>
<div class="form-group">
<h4><?php print_r($row->post_url); ?></h4>
<h5></h5>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<center><p>Start Date & Time</p><?php print_r($row->post_event_start_date); ?></center>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<center><p>Start End & Time</p><?php print_r($row->post_event_end_date); ?></center>
</div>
</div>
</div>
<div class="form-group">
<p>Location:</p>
<p><?php print_r($row->post_maplocation); ?></p>
</div>
<div class="form-group">
<p>Description: </p>
<p><?php print_r($row->post_desc); ?></p>
</div>
<div class="row pull-right">
<a class="btn btn-mini" href="#">» Read More</a>
<a class="btn btn-mini" href="#">» Share it</a>
</div>
</div>
</div>
</li>
</ul>
</div>
<?php } ?>
Replace
<?php while( $row = MYSQL_FETCH_OBJECT($qry) ){ ?>
<div class="item <?php if($i==0) { ?> active<?php } ?>">
With
<?php
$i=0;
while( $row = MYSQL_FETCH_OBJECT($qry) ){ ?>
<div class="item <?php if($i==0) {
$i=1;
echo 'active'; } ?>">
Try this.
$qry = MYSQL_QUERY("SELECT * FROM 'post' WHERE 'post_type'='events' AND 'post_event_start_date' <= CURDATE() ORDER BY 'post_event_start_date'");
$first_item = true;?>
<?php while( $row = MYSQL_FETCH_OBJECT($qry) ){ ?>
<div class="item <?php echo $first_item? 'active': ''; ?>"><?php $first_item = false; ?>
<ul class="thumbnails">
<li class="col-xs-12 col-lg-12 col-md-12 col-sm-12">
<div class="fff">
<div class="thumbnail">
<img src="administrator/slide_name/large/slide_1.jpg" alt="">
</div>
<div class="col-lg-12 well">
<div class="form-group">
<h3><?php print_r($row->post_title); ?></h3>
</div>
<div class="form-group">
<h4><?php print_r($row->post_url); ?></h4>
<h5></h5>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<center><p>Start Date & Time</p><?php print_r($row->post_event_start_date); ?></center>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<center><p>Start End & Time</p><?php print_r($row->post_event_end_date); ?></center>
</div>
</div>
</div>
<div class="form-group">
<p>Location:</p>
<p><?php print_r($row->post_maplocation); ?></p>
</div>
<div class="form-group">
<p>Description: </p>
<p><?php print_r($row->post_desc); ?></p>
</div>
<div class="row pull-right">
<a class="btn btn-mini" href="#">» Read More</a>
<a class="btn btn-mini" href="#">» Share it</a>
</div>
</div>
</div>
</li>
</ul>
</div>
<?php } ?>`
Define $i = 0 and make it $i++
Try below code
<?php
$qry = MYSQL_QUERY("SELECT * FROM `post` WHERE `post_type`='events' AND `post_event_start_date` <= CURDATE() ORDER BY `post_event_start_date`");
?>
<?php
$i = 0;
while( $row = MYSQL_FETCH_OBJECT($qry) ){ ?>
<div class="item <?php if($i==0) { ?> active<?php } ?>">
<ul class="thumbnails">
<li class="col-xs-12 col-lg-12 col-md-12 col-sm-12">
<div class="fff">
<div class="thumbnail">
<img src="administrator/slide_name/large/slide_1.jpg" alt="">
</div>
<div class="col-lg-12 well">
<div class="form-group">
<h3><?php print_r($row->post_title); ?></h3>
</div>
<div class="form-group">
<h4><?php print_r($row->post_url); ?></h4>
<h5></h5>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<center><p>Start Date & Time</p><?php print_r($row->post_event_start_date); ?></center>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<center><p>Start End & Time</p><?php print_r($row->post_event_end_date); ?></center>
</div>
</div>
</div>
<div class="form-group">
<p>Location:</p>
<p><?php print_r($row->post_maplocation); ?></p>
</div>
<div class="form-group">
<p>Description: </p>
<p><?php print_r($row->post_desc); ?></p>
</div>
<div class="row pull-right">
<a class="btn btn-mini" href="#">» Read More</a>
<a class="btn btn-mini" href="#">» Share it</a>
</div>
</div>
</div>
</li>
</ul>
</div>
<?php
$i++;
} ?>
<?php $i = 0 ;
$qry = MYSQL_QUERY("SELECT * FROM `post` WHERE `post_type`='events' AND `post_event_start_date` <= CURDATE() ORDER BY `post_event_start_date`");
?>
<?php while( $row = MYSQL_FETCH_OBJECT($qry) ){ ?>
<div class="item <?php if($i==0) { ?> active<?php } ?>">
Your other code
php $i++; } ?>
I don't know what to do loop and active tab on php.Active only one tab at a time.
My tab
<div class="container content">
<div class="row tab-v3">
<div class="col-sm-3">
<?php do { ?>
<ul class="nav nav-pills nav-stacked">
<li><i></i><?php echo $row_menulist['mlname']; ?></li>
</ul>
<?php } while ($row_menulist = mysql_fetch_assoc($menulist)); ?>
</div>
<div class="col-sm-9">
<div class="tab-content">
<div class="tab-pane fade in active" id="<?php echo $row_menulist['mlname']; ?>">
<?php do { ?>
<h4><?php echo $row_info['mlname']; ?></h4>
<p><?php echo $row_info['detail']; ?></p>
<?php } while ($row_info = mysql_fetch_assoc($info)); ?>
</div>
</div>
</div>
</div>
</div>
remove active class,i assume that change in loop not affect in design.
<div class="container content">
<div class="row tab-v3">
<div class="col-sm-3">
<?php do { ?>
<ul class="nav nav-pills nav-stacked">
<li><i></i><?php echo $row_menulist['mlname']; ?></li>
</ul>
<?php } while ($row_menulist = mysql_fetch_assoc($menulist)); ?>
</div>
<div class="col-sm-9">
<div class="tab-content">
<?php $count = 1; do { ?>
<div class="tab-pane fade in <?php if($count == '1') { echo 'active'; } ?>" id="<?php echo $row_menulist['mlname']; ?>">
<h4><?php echo $row_info['mlname']; ?></h4>
<p><?php echo $row_info['detail']; ?></p>
</div>
<?php $count++; } while ($row_info = mysql_fetch_assoc($info)); ?>
</div>
</div>
</div>
</div>
It's working!
I even use the same logic into a CMS PHP Based (SPIP).
<div class="row">
<div class="col-xs-12 col-sm-3">
<div class="w-100 srvc-tab">
<ul class="nav nav-tab">
<?php $count = 1; ?>
<BOUCLE_getServiceTitle (ARTICLES){id_rubrique=#ID_RUBRIQUE}{par id_article}{tous}>
<li class="<?php if($count == '1') { echo 'active'; } ?>">
<a href="#service-#COMPTEUR_BOUCLE" data-toggle="tab">
[(#TITRE)]
</a>
</li>
<?php $count++; ?>
</BOUCLE_getServiceTitle>
</ul>
</div>
</div>
<div class="col-xs-12 col-sm-9">
<div class="w-100 tab-content">
<?php $count = 1; ?>
<BOUCLE_getServiceContent (ARTICLES){id_rubrique=#ID_RUBRIQUE}{tous}>
<div id="service-#COMPTEUR_BOUCLE" class="col-xs-12 tab-pane fade in <?php if($count == '1') { echo 'active'; } ?>">
<div class="w-100 mb-15 pb-15">
<h3 class="mb-0 text-capitalize fw-600">
[(#TITRE)]
<span class="d-inline-block stroke"></span>
</h3>
</div>
<div class="w-100">
[(#TEXTE)]
</div>
</div>
<?php $count++; ?>
</BOUCLE_getServiceContent>
</div>
</div>
<div class="clearfix"></div>
</div>