<?php
/* 
* Theme: PREMIUMPRESS CORE FRAMEWORK FILE
* Url: www.premiumpress.com
* Author: Mark Fail
*
* THIS FILE WILL BE UPDATED WITH EVERY UPDATE
* IF YOU WANT TO MODIFY THIS FILE, CREATE A CHILD THEME
*
* http://codex.wordpress.org/Child_Themes
*/
if (!defined('THEME_VERSION')) {	div('HTTP/1.0 403 Forbidden'); exit; }

?>

<?php get_header($CORE->pageswitch()); ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 
 
<?php
 
// GET LAST LOGIN DATE
$lastlogin = get_user_meta($post->post_author, 'login_lastdate', true);
 		
// USER COUNTRY
$selected_country = get_user_meta($post->post_author,'country',true); 

// CHECK FOR CV FILE
$cv = get_post_meta($post->ID, 'cv', true);

// GET RESUME DATA
$resume0 = get_post_meta($post->ID, 'resume0', true); // quick txt
$resume1 = get_post_meta($post->ID, 'resume1', true); // skills
$resume2 = get_post_meta($post->ID, 'resume2', true); // education
$resume3 = get_post_meta($post->ID, 'resume3', true); // work history
$resume4 = get_post_meta($post->ID, 'resume4', true); // interest

?>
 
 
	<div class="panel panel-default">
 	 
	<div class="panel-body">  
    
    
    <div class="thumbnail pull-right" style="margin-left:50px;"><?php echo str_replace("img-responsive","img-responsive img-circle", get_avatar( $post->post_author,100 ) ); ?> </div>


 
<article>

<h1><?php echo $post->post_title; ?></h1>           
 	 
<p class="welcome"><?php echo wpautop(get_post_meta($post->ID, 'resume0', true)); ?> <br> 

  

<ul class="list-inline">
            <?php 
			
			// MSG USER
			 echo "<li class='ee'><i class='fa fa-envelope'></i> <a href='".$GLOBALS['CORE_THEME']['links']['myaccount']."/?u=".$post->post_author."&tab=msg&show=1' rel='nofollow' target='_blank'>".$CORE->_e(array('single','7'))."</a></li> ";			
            
            // URL
            $data = get_user_meta( $post->post_author, 'url', true);
            if(strlen($data) > 1){ 
            echo "<li><i class='fa fa-globe'></i> <a href='".$data."' rel='nofollow' target='_blank'>".$CORE->_e(array('button','12'))."</a></li> "; 
            }           
                
            // FACEBOOK
            $data = get_user_meta( $post->post_author, 'facebook', true);
            if(strlen($data) > 0){ 
            echo "<li class='fb'><i class='fa fa-facebook-square'></i> <a href='".$data."' rel='nofollow' target='_blank'>Facebook</a></li>"; 
            }  	
            
            // TWITTER
            $data = get_user_meta( $post->post_author, 'twitter', true);
            if(strlen($data) > 0){ 
            echo "<li class='tw'><i class='fa fa-twitter-square'></i> <a href='".$data."' rel='nofollow' target='_blank'>Twitter</a></li> "; 
            }  		
            
            // LINKEDIN
            $data = get_user_meta( $post->post_author, 'linkedin', true);
            if(strlen($data) > 0){ 
            echo "<li class='in'><i class='fa fa-linkedin-square'></i> <a href='".$data."' rel='nofollow' target='_blank'>Linkedin</a></li>"; 
            } 	
    
            // SKYPE
            $data = get_user_meta( $post->post_author, 'skype', true);
            if(strlen($data) > 0){ 
            echo "<li class='sk'><i class='fa fa-skype'></i> <a href='skype:".$data."' rel='nofollow' target='_blank'>Skype</a> </li>"; 
            }
            
            ?>
</ul> 

<?php if($cv != "" && is_array($cv)){ ?>
 <a href="<?php echo $cv['url']; ?>" class="btn btn-lg btn-success">Download CV</a>
 
<?php } ?>  
       
            
</article>
            
            

            
<?php 

// SKILLS
if($resume1 != ""){ ?>          
<div class="clearfix"></div>
<hr /> 

			
			<article>
				<div class="col-md-3">
					<h3>Skills</h3>
				</div>
				<div class="col-md-9">
					<div class="row-fluid skills">
					
                    <ul class="list-inline">
                    <?php $skills = explode(",",$resume1); foreach($skills as $skill){ ?>
                    
                    <li><span class="btn btn-default" style="margin-bottom:20px;"><?php echo $skill; ?></span></li>
                    
                    <?php } ?>
                    </ul>
                    
					</div>
				</div>
			</article>
<?php } ?> 
            
<?php 

// EDUCATION
if($resume2 != ""){ ?>          
<div class="clearfix"></div>
<hr /> 

			<!-- Education -->
			<article>
				<div class="col-md-3">
					<h3>Education</h3>
				</div>
				<div class="col-md-9">
					<?php echo wpautop($resume2); ?>
				</div>
			</article>
            
<?php } ?>
            


<?php 

// WORK HISTORY
if($resume3 != ""){ ?>    
<div class="clearfix"></div>
<hr /> 

			<article>
				<div class="col-md-3">
					<h3>Work Experience</h3>
				</div>
				<div class="col-md-9">
					<?php echo wpautop($resume3); ?>
				</div>
			</article>
<?php } ?>
            
            
<?php 

// interests
if($resume4 != ""){ ?>   
<div class="clearfix"></div>
<hr /> 

			<article>
				<div class="col-md-3">
					<h3>Interests</h3>
				</div>
				<div class="col-md-9">
					<?php echo wpautop($resume4); ?>
				</div>
			</article>
<?php } ?>        
            

<div class="clearfix"></div>


<hr />
<ul class="list-inline" style="font-size:12px;">
            
            <li> <strong><?php echo $CORE->_e(array('widgets','26')); ?></strong> <?php echo hook_date($lastlogin); ?> </li>
            
            <?php if(strlen($selected_country) > 0){ ?>
            
            <li> <div class="flag flag-<?php echo strtolower($selected_country); ?> wlt_locationflag"></div><?php echo $GLOBALS['core_country_list'][$selected_country]; ?></li>
            
            <?php } ?>
            

</ul>

</div></div> 
  
	
	<?php endwhile; endif; ?>
	 
<?php get_footer($CORE->pageswitch()); ?> 