Breaking out of a foreach within a nested if statement - php

I am having a difficult time figuring out how to break a section out of a an else-statement that is nested within a foreach loop.
The section I want to break out of the foreach loop is :
echo '
<div class="moreEventsContainer">
<div id="moreEventsWrap" class="total-center">
<span class="moreEventsLink">SEE ALL EVENTS</span>
<div class="rightArrow"></div>
</div>
</div>'
;
The thing is that it is part of the else statement, but leaving it in the loop just makes it duplicate itself over and over when I just want it to appear once.
Does anyone see how I can do this?
I tried doing the alternative endforeach nested before the end of the else statement, but it just broke the code.
Any ideas?
foreach ($event_rows as $event_row) {
$event_name = $event_row['event_name'];
$display_date = $event_row['display_date'];
$event_description = $event_row['small_desc'];
$end_date = new DateTime($event_row['end_date']);
$date = new DateTime('now');
if ($date >= $end_date) {
//$noEvents = 'No events are scheduled yet.';
$noEvents = '
<div id="noEvents">
</div>
';
} else {
echo '<div class="eventBlock">';
echo '<div class="total-center eventBlockWrap">';
echo '<span class="displayDate">'. $display_date .'</span>';
echo '<span class="eventName">'. $event_name .'</span>';
echo '<p class="dGsmall margNone">'. $event_description .'</p>';
echo '</div>';
echo '</div>';
echo '<div class="moreEventsContainer">
<div id="moreEventsWrap" class="total-center">
<span class="moreEventsLink">SEE ALL EVENTS</span>
<div class="rightArrow"></div>
</div>
</div>'
;
}
}
if ($noEvents != NULL) {
echo $noEvents;
} else {
}
Update:
foreach ($event_rows as $event_row) {
$event_name = $event_row['event_name'];
$display_date = $event_row['display_date'];
$event_description = $event_row['small_desc'];
$end_date = new DateTime($event_row['end_date']);
$date = new DateTime('now');
if ($date >= $end_date) {
//$noEvents = 'No events are scheduled yet.';
$noEvents = '
<div id="noEvents">
</div>
';
} else {
echo '<div class="eventBlock">';
echo '<div class="total-center eventBlockWrap">';
echo '<span class="displayDate">'. $display_date .'</span>';
echo '<span class="eventName">'. $event_name .'</span>';
echo '<p class="dGsmall margNone">'. $event_description .'</p>';
echo '</div>';
echo '</div>';
break;
echo '<div class="moreEventsContainer">
<div id="moreEventsWrap" class="total-center">
<span class="moreEventsLink">SEE ALL EVENTS</span>
<div class="rightArrow"></div>
</div>
</div>'
;
}
}

According to your update,
I suppose you want this code
echo '<div class="moreEventsContainer">
<div id="moreEventsWrap" class="total-center">
<span class="moreEventsLink">SEE ALL EVENTS</span>
<div class="rightArrow"></div>
</div>
</div>';
to execute once, after all of your records are shown.
So, I suggest using this instead of the break statement
if($i==sizeof($event_rows)){
echo '<div class="moreEventsContainer">
<div id="moreEventsWrap" class="total-center">
<span class="moreEventsLink">SEE ALL EVENTS</span>
<div class="rightArrow"></div>
</div>
</div>';
}
Where $i is initialized to 1 and incremented each time the loop executes.

Related

how do I store quantity from all items in session?

I'm not seeing what goes wrong here? I want to allow my users to up the quantity from an item in their shopping cart. when they press enter I want the quantity to change from 1 to the number the use rput in and I want that it calculates everything correctly. but right now it only wants to update the last item that the user changed the quantity from. how do I fix this? I thought of using a $_SESSION but that doesn't make any difference. this is part of the code
<body>
<!--navbar-->
<a class="back" href="index.php"> <i class="bi bi-arrow-left-circle-fill bi-5x"></i></a>
<?php
include "config.php";
?>
<div class="text-center" style="font-size: 100px;">🛍</div>
<h2 class="text-center">Winkelmandje</h2><br>
<section class="container content-section">
<!-- <h2 class="section-header">CART</h2> -->
<div class="cart-row">
<span class="cart-item cart-header cart-column">ITEM</span>
<span class="cart-item cart-header cart-column">PRICE</span>
<span class="cart-item cart-header cart-column">QUANTITY</span>
<span class="cart-item cart-header cart-column">berekening</span>
<!-- <span class="cart-item cart-header cart-column">Verwijderen</span> -->
</div>
<?php
$broodjes = $_GET['broodjes_ID'];
if (isset($_SESSION['basket'])){
if( in_array( $broodjes ,$_SESSION['basket']) )
{
}else{
$_SESSION['basket'][] = $broodjes;
}
}else{
$_SESSION['basket'][]= $broodjes;
}
$sumtotal = 0;
foreach($_SESSION['basket'] as $key => $value){
//echo "Key = $key; value = $value; <br>";
$sql = "SELECT broodjes_ID, broodnaam, prijs, voorraad FROM broodjes WHERE broodjes_ID=?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $value);
$stmt->execute();
$result = $stmt->get_result();
while($row = $result->fetch_assoc()){
echo '<div class="cart-items">';
echo '<div class="cart-row">';
echo '<div class="cart-item cart-column">';
echo $row['broodnaam'];
echo '</div>';
echo '<div class="cart-item cart-column">';
echo '€ ' . $row['prijs'];
echo '</div>';
//quantity
echo '<div class="cart-item cart-column">';
echo '<form method="POST" action"">';
echo '<div class="col-xs-4">';
echo '<input type="hidden" name="broodnaam" id="broodnaam" value="' . $row['broodnaam'] . '">';
echo '<input type="number" name="quantity" id="quantity" class="form-control input-sm" placeholder="1" min="1" max="100" value="1">';
echo '</div>';
echo '</form>';
echo '</div>';
//session for quantity???'
$_SESSION['quantity'] = $_POST['quantity'];
$quantity = 1;
if (isset($_POST['quantity']) && !empty($_POST['quantity'])){
$_SESSION['quantity'] = $_POST['quantity'];
if (isset($_POST['broodnaam']) && !empty($_POST['broodnaam'])){
if ($_POST['broodnaam'] == $row['broodnaam']){
$quantity = $_POST['quantity'];
}
}
}
echo '<div class="cart-item cart-column">';
$rowtotaal = $row['prijs'] * $quantity;
$sumtotal += $rowtotaal;
echo $rowtotaal;
echo '</div>';
echo '</div>';
echo '</div>';
}
}
?> <br />
<div class="cart-total">
<strong class="cart-total-title">Total</strong>
<span class="cart-total-price"> € <?php echo $sumtotal;?></span>
</div>
<br/>
and this is what it does
now situation:
how do I store the information in a session??

How to insert HTML using foreach() without echo

I have this working code in my view:
<?php
$task_num = 0;
foreach ($curent_day->getTasksList() as $task){
echo '<div class="task">';
echo '<span class="task_id">'.($task_num+1).'.'.'</span>';
echo '<div class="task_time">';
echo '<span class="task_time_start">'.$task->getStartTime().'</span>';
echo '<span class="task_time_finish">'.$task->getFinishTime().'</span>';
echo '</div>';
echo ''.$task->name.'';
echo 'Start';
echo 'Finish';
echo '<div class="status_round '.$task->status.'"></div>';
echo '</div>';
$task_num++;
}
?>
Is there any way to get rid of 'echo'?
P.S. and is the way to insert HTML with HTML helper more correct even if it takes more space?
You can drop echo completely and use native HTML syntax:
<?php $task_num = 0 ?>
<?php foreach ($curent_day->getTasksList() as $task): ?>
<div class='task'>
<span class='task_id'><?= ++$task_num ?></span>
<div class='task_time'>
<span class='task_time_start'><?= $task->getStartTime() ?></span>
<span class='task_time_finish'><?= $task->getFinishTime() ?></span>
</div>
<a href='/' class='task_name'><?= $task->name ?></a>
<a href='/' class='btn task_start btn_disabled'>Start</a>
<a href='/' class='btn task_finish btn_disabled'>Finish</a>
<div class='status_round <?= $task->status ?>'></div>
</div>
<?php endforeach ?>
This will give you better syntax highlighting and autoformatting support in your IDE/editor.
There are several different ways that you can concatenate the string by using single quotes and double quotes, or by using a variable and the ".=" operator to append text onto the end of a string. Just google php strings & concatenation and it will have more than you need to figure this out.
But using you example here is a method:
$task_num = 0;
foreach ($curent_day->getTasksList() as $task){
echo
'<div class="task">' .
'<span class="task_id">' . ($task_num+1) . '.'.'</span>' .
'<div class="task_time">' .
'<span class="task_time_start">' . $task->getStartTime() . '</span>' .
'<span class="task_time_finish">' . $task->getFinishTime() . '</span>' .
'</div>' .
''.$task->name.'' .
'Start' .
'Finish' .
'<div class="status_round '.$task->status.'"></div>' .
'</div>';
$task_num++;
}
You have to echo to output you data to the browser.
You need not use string concatenation or multiple echo statements.
Alternative
$task_num = 0;
foreach ($curent_day->getTasksList() as $task){
$task_num++;
echo
"<div class='task'>
<span class='task_id'>{$task_num}</span>
<div class='task_time'>
<span class='task_time_start'>{$task->getStartTime()}</span>
<span class='task_time_finish'>{$task->getFinishTime()}</span>
</div>
<a href='/' class='task_name'>{$task->name}</a>
<a href='/' class='btn task_start btn_disabled'>Start</a>
<a href='/' class='btn task_finish btn_disabled'>Finish</a>
<div class='status_round {$task->status}'></div>
</div>";
}
You can concatenate your html in one variable and then you can use it with one time echo statement
<?php
$task_num = 0;
$html = '';
foreach ($curent_day->getTasksList() as $task){
$html .= '<div class="task">';
$html .= '<span class="task_id">'.($task_num+1).'.'.'</span>';
$html .= '<div class="task_time">';
$html .= '<span class="task_time_start">'.$task->getStartTime().'</span>';
$html .= '<span class="task_time_finish">'.$task->getFinishTime().'</span>';
$html .= '</div>';
$html .= ''.$task->name.'';
$html .= 'Start';
$html .= 'Finish';
$html .= '<div class="status_round '.$task->status.'"></div>';
$html .= '</div>';
$task_num++;
}?>

Showing records based on topic

I got a problem with showing things when pressing on a topic.
What I want
I want too show the records out of the second database that has the correct topic_id so if you click on a topic it needs to only show the "onderwerpen"(dutch for subjects) that have that topic_id
My code:
<div class="box box-info">
<div class="panel panel-default">
<div class="panel-heading main-color-bg">
<h3 class="panel-title">Topics</h3>
</div>
<div class="panel-body">
<?php
$toppics = $app->get_topics();
foreach($toppics as $topic){
echo '<div class="col-md-6">';
echo '<div class="well dash-box">';
echo '<h3>'.$topic['onderwerp'].'</h3><br>';
echo '' .$topic['omschrijving'].'';
echo '</div>';
echo '</div>';
}
?>
</div>
</div>
</div><!-- /.box -->
Function I use:
public function get_topics(){
$getTopic = $this->database->query("SELECT * FROM topics ORDER BY id DESC");
$topics = $this->database->resultset();
return $topics;
}
The topic database
The onderwerpen database
After clicking on a subject It now shows all the "onderwerpen" out of the database
The code for that:
<?php
$onderrwerp = $app->get_onderwerpen();
foreach($onderrwerp as $onderwerp){
echo '<div class="well well-sm">';
if(file_exists('assets/images/profielfotos/'.$onderwerp['klant_id'])) {
echo '<img class="img-circle" src="/assets/images/profielfotos/'.$onderwerp['klant_id'].'/'.$onderwerp['foto'].'" />';
} else {
echo '<i style="font-size: 2.5em;" class="fas fa-user-circle"></i>';
}
echo '<b> '.$onderwerp['onderwerpnaam'].'</b>';
echo ' - ' . $onderwerp['voornaam'] . ' ' . $onderwerp['achternaam'];
echo '</div>';
}
?>
Get_onderwerpen function:
public function get_onderwerpen(){
$getOnderwerp = $this->database->query("
SELECT onderwerpen.*, klanten.foto, klanten.voornaam, klanten.achternaam FROM onderwerpen
LEFT JOIN klanten ON onderwerpen.klant_id=klanten.id
ORDER BY id ASC");
$onderwerpen = $this->database->resultset();
return $onderwerpen;
}

How to use two variable in one foreach?

Im want to generate the Boostrap Acordion with 2 diferent taxonomies (var). But Im not able to Combine both in one Foreach. Also I look in this Forum and I try some of the anwers but I just get errors.
<?php
$temporada = 'temporada';
$capitulo = 'capitulo';
$tax_temporada = get_terms($temporada);
$tax_capitulo = get_terms($capitulo);
foreach ($tax_temporada as $tax_temporada) {
echo '<div class="panel panel-default">';
echo '<div class="panel-heading" role="tab" id="c'. $tax_capitulo->name.'">';
echo '<h4 class="panel-title">' . '<a data-toggle="collapse" data-parent="#accordion" href="#'. $tax_temporada->name.'" aria-expanded="true" aria-controls="' . $tax_temporada->name.'" >Temporada: ' . $tax_temporada->name.'</a></h4>';
echo '</div>';
echo '<div id="'. $tax_temporada->name.'" class="panel-collapse collapse" role="tabpanel" aria-labelledby="c'. $tax_capitulo->name.'">';
echo '<div class="panel-body">';
echo 'Capitulo '. $tax_capitulo->name.' ';
echo '</div>'.'</div>'.'</div>';
}
?>
The Problem Is I just can get One Var And not Both
This One here fix the Problem but The thing is Im not able to more than 1 $capitulo inside of each $temporada
<?php
$temporada = 'temporada';
$capitulo = 'capitulo';
$tax_temporada = get_terms($temporada);
$tax_capitulo = get_terms($capitulo);
for ($i = 0; $i < count($tax_temporada); $i++) {
echo '<div class="panel panel-default">';
echo '<div class="panel-heading" role="tab" id="c'. $tax_capitulo[$i]->name.'">';
echo '<h4 class="panel-title">' . '<a data-toggle="collapse" data-parent="#accordion" href="#'. $tax_temporada[$i]->name.'" aria-expanded="true" aria-controls="' . $tax_temporada[$i]->name.'" >Temporada: ' . $tax_temporada[$i]->name.'</a></h4>';
echo '</div>';
//Here Start the $capitulos that go inside of every $temporadas
echo '<div id="'. $tax_temporada[$i]->name.'" class="panel-collapse collapse" role="tabpanel" aria-labelledby="c'. $tax_capitulo[$i]->name.'">';
echo '<div class="panel-body">';
echo 'Capitulo '. $tax_capitulo[$i]->name.' ';
echo '</div>'.'</div>'.'</div>';
}
?>
Are both of these going to be arrays of objects, of the same length? If so, you could consider doing a simple for loop, as such:
<?php
$temporada = 'temporada';
$capitulo = 'capitulo';
$tax_temporada = get_terms($temporada);
$tax_capitulo = get_terms($capitulo);
for ($i = 0; $i < count($tax_temporada); $i++) {
echo '<div class="panel panel-default">';
echo '<div class="panel-heading" role="tab" id="c'. $tax_capitulo[$i]->name.'">';
echo '<h4 class="panel-title">' . '<a data-toggle="collapse" data-parent="#accordion" href="#'. $tax_temporada[$i]->name.'" aria-expanded="true" aria-controls="' . $tax_temporada[$i]->name.'" >Temporada: ' . $tax_temporada[$i]->name.'</a></h4>';
echo '</div>';
echo '<div id="'. $tax_temporada[$i]->name.'" class="panel-collapse collapse" role="tabpanel" aria-labelledby="c'. $tax_capitulo[$i]->name.'">';
echo '<div class="panel-body">';
echo 'Capitulo '. $tax_capitulo[$i]->name.' ';
echo '</div>'.'</div>'.'</div>';
}
?>
The MultipleIterator allows you to loop over several arrays at the same time
$tax_temporada = get_terms($temporada);
$tax_capitulo = get_terms($capitulo);
$taxIterator = new MultipleIterator();
$taxIterator->attachIterator(new ArrayIterator($tax_temporada));
$taxIterator->attachIterator(new ArrayIterator($tax_capitulo));
foreach($taxIterator as list($temporada, $capitulo)) {
... do what you want here with $temporada and $capitulo
}
EDIT
Note that unpacking nested arrays with list() requires PHP >= 5.5.0

Dynamic Bootstrap Tabs using PHP/MySQL

So I've been tackling this problem for a while now and I can't seem to get it to work. I have a category table and a link in my database. I'm trying to display the "category" title as the tab and the "link" as my tab content.
Let me share my code and I'll explain the problem:
<ul class="nav nav-tabs" id="lb-tabs">
<?php $sqlCat = $db->query('SELECT `tab_title` FROM `category`'); ?>
<?php
foreach ($sqlCat as $row):
echo '<li><a href="#' . $row['tab_title'] . '" data-toggle="tab">' .
$row['tab_title'] . ' </a></li>';
endforeach;
?>
</ul>
<div class="tab-content">
<?php foreach ($sqlCat as $row2):
$tab = $row2['tab_title'];?>
<div class="tab-pane active" id="<?php $row['tab_title']; ?>">
<div class="links">
<ul class="col">
<?php
$items = $db->prepare('SELECT u_links.title, u_links.link, u_links.tid, category.id, category.tab_title
FROM u_links, category
WHERE category.id = u_links.tid
ORDER BY category.id ');
$items->execute();
while ($r = $items->fetch(PDO::FETCH_ASSOC)) {
echo '<li>' . $r['title'] . '</li>';
}
?>
</ul>
</div>
</div><!-- /tab-pane -->
<?php endforeach; ?>
</div>
This current code is not displaying the content in the "tab-content" div. I've tried different ways like this for example:
$tab = '';
$content = '';
$link = '';
$tab_title = null;
while($row = $items->fetch(PDO::FETCH_ASSOC)) {
$link = '<li>' . $row['title'] . '</li>';
if ($tab_title != $row['tab_title']) {
$tab_title = $row['tab_title'];
$tab .= '<li><a href="#' . $row['tab_title'] . '" data-toggle="tab">' .
$row['tab_title'] . ' </a></li>';
$content .= '<div class="tab-pane active" id="' . $row['tab_title'] . '"><div
class="links"><ul class="col">' . $link . '</ul></div></div><!-- /tab-pane //
support -->';
}
}
With this code I either get as too many tabs(as many items within the category) which I only want one tab for many items(links). Or I'll only get one link per section and doesn't output that row from the database.
If anyone can help me out with this, it will be much appreciated! :) Thank you.
Ok, so I think the issue is how you set your .tab-pane id's. Right now there is but no "echo" so nothing is being output there.
I put together a working demo, I did change some part of your code, but very minor stuff which I tried to comment:
<!-- START OF YOUR CODE -->
<ul class="nav nav-tabs" id="lb-tabs">
<?php
// I just made an array with some data, since I don't have your data source
$sqlCat = array(
array('tab_title'=>'Home'),
array('tab_title'=>'Profile'),
array('tab_title'=>'Messages'),
array('tab_title'=>'Settings')
);
//set the current tab to be the first one in the list.... or whatever one you specify
$current_tab = $sqlCat[0]['tab_title'];
?>
<?php
foreach ($sqlCat as $row):
//set the class to "active" for the active tab.
$tab_class = ($row['tab_title']==$current_tab) ? 'active' : '' ;
echo '<li class="'.$tab_class.'"><a href="#' . urlencode($row['tab_title']) . '" data-toggle="tab">' .
$row['tab_title'] . ' </a></li>';
endforeach;
?>
</ul><!-- /nav-tabs -->
<div class="tab-content">
<?php foreach ($sqlCat as $row2):
$tab = $row2['tab_title'];
//set the class to "active" for the active content.
$content_class = ($tab==$current_tab) ? 'active' : '' ;
?>
<div class="tab-pane <?php echo $content_class;?>" id="<?php echo $tab; //-- this right here is from yoru code, but there was no "echo" ?>">
<div class="links">
<ul class="col">
<?php
// Again, I just made an array with some data, since I don't have your data source
$items = array(
array('title'=>'Home','tab_link'=>'http://home.com'),
array('title'=>'Profile','tab_link'=>'http://profile.com'),
array('title'=>'Messages','tab_link'=>'http://messages.com'),
array('title'=>'Settings','tab_link'=>'http://settings.com'),
array('title'=>'Profile','tab_link'=>'http://profile2.com'),
array('title'=>'Profile','tab_link'=>'http://profile3.com'),
);
// you have a while loop here, my array doesn't have a "fetch" method, so I use a foreach loop here
foreach($items as $item) {
//output the links with the title that matches this content's tab.
if($item['title'] == $tab){
echo '<li>' . $item['title'] . ' - '. $item['tab_link'] .'</li>';
}
}
?>
</ul>
</div>
</div><!-- /tab-pane -->
<?php endforeach; ?>
</div><!-- /tab-content -->
<!-- END OF YOUR CODE -->
This help me a lot. I have two static tabs for content creation which drive the dynamic tabs. It is definitely still a little rough but at least the concept is working.
<ul class="nav nav-tabs">
<li class="active">Clusters</li>
<li>Activities</li>
<?php
$sql = "<insert query here>";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
while( $rowtab = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
$tab_class = ($rowtab['tab_title']==$current_tab) ? 'active' : '' ;
$nospaces = str_replace(' ', '', $rowtab['tab_title']);
echo '<li class="'.$tab_class.'"><a href="#' . urlencode($nospaces) . '" data-toggle="tab">' .
$rowtab['tab_title'] . '</a></li>';
}
?>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
Tab1 Content
</div>
<div class="tab-pane" id="tab2">
Tab2 Content
</div>
<?php
$sql = "<insert query here>";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
while( $rowtab = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
$tab = $rowtab['tab_title'];
$nospaces = str_replace(' ', '', $rowtab['tab_title']);
$content_class = ($tab==$current_tab) ? 'active' : '' ;
echo '<div class="tab-pane'. $content_class.'" id="'.$nospaces.'">';
echo 'You are looking at the '.$tab.' tab. Dynamic content will go here.';
echo '</div><!-- /.tab-pane -->';
}
?>
</div>
foreach ($files as $file):
$filename = preg_replace("/\.html$/i", "", $file);
$title = preg_replace("/\-/i", " ", $filename);
$documentation = 'usage/'.$type.'/'.$file;
$tab1 = 'usage/'.$type.'/'.$file;
echo '<div class="sg-markup sg-section">';
echo '<div class="sg-display">';
echo '<h2 class="sg-h2"><a id="sg-'.$filename.'" class="sg-anchor">'.$title.'</a></h2>';
//TAb Set up
echo '<div class="row"><div class="col-md-12">';
echo '<ul class="nav nav-tabs" role="tablist">';
echo '<li role="presentation" class="active">Visual</li>';
echo '<li role="presentation">Rules</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
//Visual Tab Content
echo '<div class="row"><div class="col-md-12">';
echo '<div class="tab-content">';
echo '<div role="tabpanel" class="tab-pane active" id="Visual">';
echo '<h3 class="sg-h3">Visual</h3>';
include('markup/'.$type.'/'.$file);
//View Source
echo '<div class="sg-markup-controls"><a class="btn btn-primary sg-btn sg-btn--source" href="#">View Source</a> <a class="sg-btn--top" href="#top">Back to Top</a> </div>';
echo '<div class="sg-source sg-animated">';
echo '<a class="btn btn-default sg-btn sg-btn--select" href="#">Copy Source</a>';
echo '<pre class="prettyprint linenums"><code>';
echo htmlspecialchars(file_get_contents('markup/'.$type.'/'.$file));
echo '</code></pre>';
echo '</div><!--/.sg-source-->';
echo '</div>';
//Documentation Tab Content
if (file_exists($documentation)) {
echo '<div role="tabpanel" class="tab-pane" id="Rules">';
echo '<h3 class="sg-h3">Rules</h3>';
include($documentation);
//View Source
echo '<a class="sg-btn--top" href="#top">Back to Top</a>';
echo '</div>';
}
//Documentation Tab1 Content
echo '<div role="tabpanel" class="tab-pane" id="Tab1">';
echo '<h3 class="sg-h3">Tab1</h3>';
include($tab1);
echo '<a class="sg-btn--top" href="#top">Back to Top</a>';
echo '</div>';
//Documentation Tab2 Content
echo '<div role="tabpanel" class="tab-pane" id="Tab2">';
echo '<h3 class="sg-h3">Tab2</h3>';
// include($tab2);
echo '<a class="sg-btn--top" href="#top">Back to Top</a>';
echo '</div>';
echo '</div>'; //End Tab Content
echo '</div>'; //End Column
echo '</div>'; //End Row
//echo '<div class="row"><div class="col-md-12">';
//echo '<h3 class="sg-h3">Example</h3>';
//include('markup/'.$type.'/'.$file);
//echo '</div>';
// if (file_exists($documentation)) {
// echo '<div class="col-md-12"><div class="well sg-doc">';
// echo '<h3 class="sg-h3">Rules</h3>';
// include($documentation);
// echo '</div></div></div>';
// }
echo '</div><!--/.sg-display-->';
//echo '</div><!--/.colmd10-->';
echo '</div><!--/.sg-section-->';
endforeach;
}

Categories