<?php
global $onetone_animated, $onetone_section_id, $allowedposttags;
 $i                   = $onetone_section_id ;
 $section_title       = onetone_option( 'section_title_'.$i );
 $section_menu        = onetone_option( 'menu_title_'.$i);
 $section_content     = onetone_option( 'section_content_'.$i );

 $content_model       = onetone_option( 'section_content_model_'.$i);
 $section_subtitle    = onetone_option( 'section_subtitle_'.$i);

  if( !isset($section_content) || $section_content=="" ) 
	  $section_content = onetone_option( 'sction_content_'.$i );
?>


		<?php
		if( $content_model == '0' || $content_model == ''  ):
		?>
        
         <?php if( $section_title != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
       <?php  
		   $section_title_class = '';
		   if( $section_subtitle == '' && !(function_exists('is_customize_preview') && is_customize_preview()))
		   $section_title_class = 'no-subtitle';
		?>
       <h2 class="section-title <?php echo $section_title_class; ?> <?php echo 'section_title_'.$i;?>"><?php echo wp_kses($section_title, $allowedposttags);?></h2>
        <?php endif;?>
        <?php if( $section_subtitle != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
        <div class="section-subtitle <?php echo 'section_subtitle_'.$i;?>"><?php echo do_shortcode(wp_kses($section_subtitle, $allowedposttags));?></div>
         <?php endif;?>
         <div class="home-section-content">
        
        
        <div class="<?php echo $onetone_animated;?>" data-animationduration="1.2" data-animationtype="bounceIn" data-imageanimation="no">
    <div class="magee-pricing-table row  no-margin 4_columns section_pricing_<?php echo $i; ?>">
    <?php
	
	$section_pricing  = onetone_option( 'section_pricing_'.$i );
	
	$num = count($section_pricing);
	$col = '3';
	if( $num == 3 )
		$col = '4';

	if (is_array($section_pricing) && !empty($section_pricing) ){
		foreach($section_pricing as $pricing ){
		  $featured      = $pricing['featured'];
		  $icon          = $pricing['icon'];
		  $image         = $pricing['image'];
		  $currency      = $pricing['currency'];
		  $price         = $pricing['price'];
		  $unit          = $pricing['unit'];
		  $title         = $pricing['title'];
		  $features      = $pricing['features'];
		  $button_text   = $pricing['button_text'];
		  $button_link   = $pricing['button_link'];
		  $button_target = $pricing['button_target'];
		  
		  if (is_numeric($image)) {
			  $image_attributes = wp_get_attachment_image_src($image, 'full');
			  $image       = $image_attributes[0];
			}
		
	?>
<div class="magee-pricing-box-wrap  col-md-<?php echo $col ;?> no-padding">
    <div class="panel panel-default text-center  magee-pricing-box <?php echo ($featured=='1' || $featured=='on') ?'featured':'';?>">
        <div class="panel-heading">
            <div class="pricing-top-icon">
            <?php if( $image !="" ):?>
            <img src="<?php echo $image ;?>" alt="<?php echo $title ;?>"/>
            <?php else:?>
                <i class="fa fa-<?php echo $icon ;?>"></i>
                <?php endif;?>
            </div>
            <h3 class="panel-title prcing-title"><?php echo $title ;?></h3>
        </div>
        <div class="panel-body">
            <div class="pricing-tag">
                <span class="currency"><?php echo $currency ;?></span>
                <span class="price"><?php echo $price ;?></span>
                <span class="unit"><?php echo $unit?'/ '.$unit:'' ;?></span>
            </div>
            <ul class="pricing-list">
            <?php
            if( $features ){

                  $features = explode("\n",$features);
                  foreach( $features as $feature ){
                      if( $feature != '' ){
                            echo '<li>'.$feature.'</li>';
                          }
                      }
                  
                  }
                  ?>
            </ul>
        </div>
        <div class="panel-footer">
            <a href="<?php echo $button_link ;?>" target="<?php echo $button_target ;?>" class="magee-btn-normal"><i class="fa fa-shopping-cart"></i> <?php echo $button_text ;?></a>
        </div>
    </div>
</div>
<?php }}?>
</div></div>
        
        
          </div>
            <?php
		else:
		?>
        <?php if( $section_title != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
        <div class="section-title <?php echo 'section_title_'.$i;?>"><?php echo esc_attr($section_title);?></div>
        <?php endif;?>
            <div class="home-section-content <?php echo 'section_content_'.$i;?>">
            <?php 
			if(function_exists('Form_maker_fornt_end_main'))
             {
                 $section_content = Form_maker_fornt_end_main($section_content);
              }
			 echo do_shortcode(wp_kses($section_content, $allowedposttags));
			?>
            </div>
<?php 
		endif;
		?>
