Adding Form at the end of dynamic menus

Codes here !

Moderators: egami, macek, gesf

Post Reply
anurudee
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Nov 06, 2017 5:13 am

Mon Nov 06, 2017 5:40 am

Hi Team,

I am trying to add a form when my decision tree ends.
Let me show a html preview
HTML Preview.PNG
HTML Preview.PNG (60.05 KiB) Viewed 287 times
and sample php code I have.

<?php
$items = $rows;
$id = '';
echo "<ul id='myUL' class='accordion'>";
foreach($items as $item){
if($item["parent_id"] == 0) {
echo "<li><a href='#' class='toggle'>".$item['menu']."</a>";
$id = $item['id'];
sub($items, $id);
echo"</li>";
}
}
echo "</ul>";

function sub($items, $id){
echo "<ul class='inner' style='display: none;'>";
foreach($items as $item){
if($item['parent_id'] == $id){
echo "<li><a href='#' class='toggle'>".$item['menu']."</a>";
sub($items, $item['id']);
echo "</li>";
}
}
echo "</ul>";

}
?>


The menus gets pulled from my DB but I want form to be added in the end points of those menus.

Please help me on this - Thank you :)


DB Sample
DB Preview.PNG
DB Preview.PNG (239.71 KiB) Viewed 287 times

Post Reply