<div class="col-md-12 banner">
    <h1>PRODUCTS</h1>
    <h4 style="color:#fff;">From Right Technology to Increase Efficiency and Productivity</h4>
</div>

<!--<div class="arrow-down"></div>-->

<div class="col-md-12 content-box">
    <div class="container-fluid">
        <div class="col-md-12">
            <?php
            if(!empty($product_category)){
            ?>
            <div class="row form-group">
                <?php
                foreach($product_category as $key=>$value){
                ?>
                <div align="center" class="col-md-12">
                    <h3 class="title"><span><?php echo $value->title;?></span></h3>
                    <?php echo $value->summary;?>
                </div>
                
                <div class="col-md-12 form-group">
                    <div class="row">
                <?php
                if(!empty($value->child)){
                    $accordion = 0;
                    $count = 0;
                    foreach($value->child as $k=>$v){
                        if($count%2 === 0){ echo "<div class='col-md-12'><div class='row'>";}
                ?>
                        <div align="center" class="col-md-6">
                            <h3 class="title"><span><?php echo $v->title;?></span></h3>
                            <?php echo $v->summary;?>
                <?php
                if(!empty($v->products)){
                ?>            
                            <div class="panel-group" id="accordion<?php echo $accordion;?>" role="tablist" aria-multiselectable="true">
                <?php
                            $panel = 0;
                            foreach($v->products as $ky =>$vl){
                ?>
                                <div class="panel panel-default<?php echo $panel;?>">
                                    <div align="left" class="panel-heading" role="tab" id="heading<?php echo $ky;?>">
                                        <h4 class="panel-title">
                                            <a role="button" data-toggle="collapse" data-parent="#accordion<?php echo $accordion;?>" href="#collapse<?php echo $ky;?>-accordion<?php echo $accordion;?>" aria-expanded="true" aria-controls="collapse<?php echo $ky;?>">
                                                <?php echo $vl->title;?>
                                            </a>
                                            <a role="button" class="pull-right" data-toggle="collapse" data-parent="#accordion<?php echo $accordion;?>" href="#collapse<?php echo $ky;?>-accordion<?php echo $accordion;?>" aria-expanded="true" aria-controls="collapse<?php echo $ky;?>">
                                                <i class="glyphicon glyphicon-chevron-down"></i>
                                            </a>
                                        </h4>
                                    </div>
                                    <div id="collapse<?php echo $ky;?>-accordion<?php echo $accordion;?>" class="panel-collapse collapse <?php if($ky===0){echo "in";}?>" role="tabpanel" aria-labelledby="heading<?php echo $ky;?>">
                                        <div align="justify" class="panel-body">
                                          <?php echo $vl->description;?>
                                        </div>
                                    </div>
                                </div>
                    
                <?php
                                $panel++;
                            }
                ?>
                            </div>
                <?php
                    }
                    else{
                ?>
                            <div class="col-md-12" align="center">
                                <p>No data available.</p>
                            </div>
                <?php
                    }
                ?>
                        </div>
                <?php
                        if($count%2 !== 0){ echo "</div></div>";}
                        $count++;
                        $accordion++;
                    }
                }
                elseif(!empty($value->products)){
                    
                    $counter = 0;
                    foreach($value->products as $ky =>$vl){
                        if($counter%2 === 0){ echo "<div class='col-md-12'><div class='row'>";}
                ?>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <div class="item-header"><h4 style="font-weight:bold;"><?php echo $vl->title;?></h4></div>
                            <div class="item-content"><?php echo $vl->description;?></div>
                        </div>
                    
                <?php
                        if($counter%2 !== 0){ echo "</div></div>";}
                        $counter++;
                        }
                }
                else{
                ?>
                        <div class="col-md-12" align="center">
                            <p>No data available.</p>
                        </div>
                <?php
                }
                ?>
                    </div>
                </div>
                <?php
                }
                ?>
            </div>
            <?php
            }
            else{
            ?>
            <div class="row form-group">
                <div class='col-md-12' align='center'>
                    <p>No Data Available</p>
                </div>
            </div>
            <?php
            }
            ?>
        </div>
    </div>
</div>
</div>
</div>