<?php
/**
 * The Template for displaying single handyman posts.
 *
 * @package hardware-dealer-pro
 */
// Top banner image start
if (!defined('ABSPATH')) {
   exit; // Exit if accessed directly
}

get_header();

?>
<?php if ( is_singular( 'handyman' ) )  { ?>
<!-- Image With Text Section Start -->
<section class="hw-single-handyman">
   <div class="hw_container">
      <div class="hw-image-with-text-wrapper">
         <div class="hw-featured-img-box">
            <img src="<?php the_post_thumbnail_url('full'); ?>">
            <?php if (get_post_meta(get_the_ID(), 'handyman_experience', true)) { ?>
                     <div class="experiecne-wrapper">
                        <h3><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_experience', true)); ?></h3>
                        <p>Year Of <br/>Experiecne</p>
                     </div>
            <?php } ?>
            
         </div>
         <div class="hw-content-box">
            <div class="hw-single-handyman-title-wrapper">
              <div>
              <h3 class="hw-single-handyman-title">
                  <?php echo the_title() ?>
               </h3>
               <?php if (get_post_meta(get_the_ID(), 'handyman_designation', true)) { ?>
                     <div class="designation-wrapper">
                        <h5><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_designation', true)); ?></h5>
                     </div>
            <?php } ?>
              </div>
              <?php if (get_post_meta(get_the_ID(), 'handyman_phone', true)) { ?>
                     <div class="handyman-contact">
                        <span>
                            <span class="icon"><i class="fa-brands fa-whatsapp"></i></span>
                            <a href="tel:<?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_phone', true)); ?>"><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_phone', true)); ?></a>
                        </span>                       
                    </div>
            <?php } ?>
            </div>
            <div class="hw-single-handyman-des">
               <?php the_content() ?>
            </div>
            <div class="hw-single-handyman-info">
            <?php if (get_post_meta(get_the_ID(), 'handyman_phone', true)) { ?>
                     <div class="handyman-phone">
                        <span class="bold"><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_phone_heading', true)); ?></span>
                        <span>
                            <a href="tel:<?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_phone', true)); ?>"><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_phone', true)); ?></a>                           
                        </span>                       
                    </div>
            <?php } ?>
            <?php if (get_post_meta(get_the_ID(), 'handyman_email', true)) { ?>
                     <div class="handyman-email">
                        <span class="bold"><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_email_heading', true)); ?></span>
                        <span>
                            <a href="mailto:<?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_email', true)); ?>"><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_email', true)); ?></a>
                        </span>                       
                    </div>
            <?php } ?>
            <?php if (get_post_meta(get_the_ID(), 'handyman_location', true)) { ?>
                     <div class="handyman-location">
                        <span class="bold"><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_location_heading', true)); ?></span>
                        <span>
                        <a href="<?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_location_link', true)); ?>" target="_blank"><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_location', true)); ?></a>
                        </span>                       
                    </div>
            <?php } ?>
            </div>
         </div>
      </div>
   </div>
</section>
<!-- Image With Text Section End -->



<!-- How Detail section start -->

<section class="hw-detail-sec">
   <div class="hw_container">
      <div class="hw-details-wrapper">
         <div class="hw-personal-skills-wrapper">
         <?php if ((get_post_meta(get_the_ID(), 'handyman_personal_skill_commercial_plumbing', true)) || (get_post_meta(get_the_ID(), 'handyman_personal_skill_residential_carpenture', true))) {
            echo ' <div class="hw-personal-skills">
                    <h4>'.esc_html(get_post_meta(get_the_ID(), 'handyman_personal_skill_heading', true)).'</h4>
                    <div>
                        <div class="progress_bar">
                           <div class="progress_bar_info">
                              <span class="title">Commercial Plumbing</span>
                              <span class="percent">'.get_post_meta(get_the_ID(), 'handyman_personal_skill_commercial_plumbing', true).'%</span>
                           </div>
                           <div class="progress">
                              <div class="bar" style="width:'.get_post_meta(get_the_ID(), 'handyman_personal_skill_commercial_plumbing', true).'%">
                              </div>
                           </div>
                        </div>
                       <div class="progress_bar">
                           <div class="progress_bar_info">
                              <span class="title">Commercial Plumbing</span>
                              <span class="percent">'.get_post_meta(get_the_ID(), 'handyman_personal_skill_residential_carpenture', true).'%</span>
                           </div>
                           <div class="progress">
                              <div class="bar" style="width:'.get_post_meta(get_the_ID(), 'handyman_personal_skill_residential_carpenture', true).'%">
                              </div>
                           </div>
                        </div>
                    </div>
                </div>';
         };?>
            <?php if (get_post_meta(get_the_ID(), 'cepr_pricing_feature', true)) { 
                $repeter  = get_post_meta(get_the_ID(),'cepr_pricing_feature', true);
                // print_r($repet);
                echo "<div class='hw-personal-qualification'>";
                echo "<h4>".get_post_meta(get_the_ID(), 'qualification_experience_heading', true)."</h4>";
                echo "<ul>";
                foreach( $repeter as  $repeter){
                    echo "<li> <span class='icon'><i class='fa-solid fa-check'></i></span>". $repeter."</li>";
                }
                echo "</ul>"
                ?>
                </div>
            <?php } ?>
           
         </div>
         <div class="hw-handyman-form contact-form">
            <div class="hw-handyman-form-wrapper">
               <h4><?php echo esc_html(get_post_meta(get_the_ID(), 'handyman_contact_form_heading', true)); ?></h4>
               <?php echo do_shortcode('[contact-form-7 id="" title="Handyman Single Page Form"]') ?>
            </div>
            
         </div>
      </div>
   </div>
   </div>
</section>

<!-- How Detail section end -->






<?php }?>
<?php get_footer(); ?>