<?php
/**
 * Template part for displaying personal info
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Covfefe
 */

?>
<div class="covf-block-personal-info">
	<div class="container">
		<div class="row">
			<div class="col-md-3">
				
				<?php
					$personal_img_src = get_theme_mod( 'personal_img_src' );
					
					if ($personal_img_src) {
						$personal_img_link = wp_get_attachment_image(absint($personal_img_src), 'full', false );
						echo '<div class="covf-ptitle-cover">';
						echo wp_kses_post( $personal_img_link );
						echo '</div>';
						
					} else {
						echo '<div class="covf-personal-info-dummy"></div>';
					}
				?>
				
			</div>
			<div class="col-md-9">
				<?php
				
					$personal_welcome = get_theme_mod( 'personal_welcome' );
					covfefe_echo( '<h4 class="covf-ptitle-welcome">' , $personal_welcome , '</h4>' );
					
					$personal_title = get_theme_mod( 'personal_title' );
					covfefe_echo( '<h2 class="covf-ptitle">' , $personal_title , '</h2>' );
					
					$personal_title_sub = get_theme_mod( 'personal_title_sub' );
					covfefe_echo( '<h3 class="covf-ptitle-sub">' , $personal_title_sub , '</h3>' );
			
					$personal_description = get_theme_mod( 'personal_description' );
					if ($personal_description) {
						echo '<div class="covf-ptitle-desc">';
						echo wp_kses_post( $personal_description );
						echo '</div>';
					}
				?>
				
				
				<div class="row">
					<?php

						$personal_phone = get_theme_mod( 'personal_phone' );
						$personal_fax = get_theme_mod( 'personal_fax' );
						$personal_email = get_theme_mod( 'personal_email' );
					?>
					<?php if ( $personal_phone ) { ?>
					<div class="col-md-4">
						<div class="covf-ptitle-field"><b><?php echo esc_html__( 'Phone' , 'covfefe' ); ?></b>: <?php echo esc_html( $personal_phone ); ?></div>
					</div>
					<?php } ?>
					<?php if ( $personal_fax ) { ?>
					
					<div class="col-md-4">
						<div class="covf-ptitle-field"><b><?php echo esc_html__( 'Fax' , 'covfefe' ); ?></b>: <?php echo esc_html( $personal_fax ); ?></div>
					</div>
					<?php } ?>
					<?php if ( $personal_email ) { ?>					
					<div class="col-md-4">
						<div class="covf-ptitle-field"><b><?php echo esc_html__( 'Email' , 'covfefe' ); ?></b>: <?php echo esc_html( $personal_email ); ?></div>
					</div>
					<?php } ?>
				</div>
			</div>
		</div>
	</div>
</div>