<?php 
/*
* Template Name: Advisor
*/
get_header();
$new_result = $wpdb->get_results("SELECT * FROM mr_download_form WHERE status =1 AND type='advisor' order by ordering");
?>
<div id="full-content" class="about-page">
    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
        <section style="background-image: url('<?php echo home_url(); ?>/wp-content/uploads/2018/11/about-banner-bg.jpg');"  class="about-banner-bg">
            <div class="container">
                <h1 class="page-title-cus">Advisory</h1>
            </div>
        </section>
        <div class="container mt-5 ">
          <div class="rightColumnContainer bg-white p-5">
                    <h1>Download Forms</h1>
                    <div class="right linkz">
                       <a id="expand-all-overview" href="javascript:void(0);" class="expand-all0">Expand All</a><a id="close-all-overview" href="javascript:void(0);" class="close-all0">Close All</a>
                    </div>
                    <div class="answers-content close-all0" id="expand-all0">
                       <?php 
                       $type_array = array();
                       $count = 0;
                       foreach($new_result as $print) {
                            $type_of_account = $print->type_of_account;
                            $div_close =0;
                            if(!in_array($print->type_of_form, $type_array)){
                             $type_array[] = $type_of_form = $print->type_of_form;
                             $div_close =1; 
                        ?>
                       <?php 
                       if($div_close==1 && $count > 0){?>
                       </div>
                       <?php } ?> 
                       <div class="answers-article accordian clearfix close">
                          <a id="<?php echo $type_of_form;?>-<?php echo $count;?>" name="<?php echo $type_of_form;?>-<?php echo $count;?>" class="accoropen"></a>
                          <h2>
                             <span><?php echo $type_of_form;?></span><i class="icon-angle-up"></i><i class="icon-angle-down"></i>
                          </h2>
                          <hr>
                          <?php 
                          $count++;
                          } ?>
                          <div class="main-contentz">
                             <ul>
                                 <li><a href="<?php echo $print->slug?>" target="_blank"><?php echo $type_of_account;?></a></li>
                             </ul>
                          </div>
                       <?php 
                       } ?>
                    </div>
                 </div>
               </div>  
                <div class="row">
                  <div class="col-lg-12 col-md-12 mt-5 mb-5">
                    <h3 class="text-uppercase text-center section-title">Address</h3>
                    <p class="text-center">Marcellus Investment Managers <br>929, DBS Business Centre, Kanakia Wall Street<br>Andheri-Kurla Road, Andheri – East, Mumbai - 400 093 </p>
                  </div>
                </div>
           </div>
         </div>
       

    <?php endwhile; endif; ?>
</div>
<script type="text/javascript">
  (function ($) {
    $('#expand-all-overview').on('click', function(e){
        e.preventDefault();
        $('.answers-content').find('.answers-article').removeClass('close');
    });

    $('#close-all-overview').on('click', function(e){
        e.preventDefault();
        $('.answers-content').find('.answers-article').addClass('close');
    });

    $('.answers-article h2').on('click', function(){
        $(this).parents('.answers-article').toggleClass('close');
    });

})(jQuery);
</script>
<?php get_footer(); ?>
