<?php TPL::output('global/header.tpl.htm'); ?>

<div class="tny-basic tny-main tny-clear">
	<div class="cMain q_x3">
		<div class="mainData">
			<span class="userPic tny-left"><img title="<?php echo $this->user['user_name']; ?>" alt="tanyacms" class="<?php echo $this->user['user_name']; ?>" src="<?php echo get_avatar_url($this->user['uid'], 'max'); ?>" /></span>
			<p class="c_Username"><b class="tny-gloCor"><?php echo $this->user['user_name']; ?></b> <?php if ($this->user['verified']) { ?><em title="Certified" class="v tny-small"></em> <?php } ?><span class="c_autograph tny-cl_02 tny-txtHide"><?php echo $this->user['signature']; ?></span></p>
			<div class="c_userflg tny-basicted">
				<p class="tny-right c_tosend">
				<?php if ($this->user['uid'] != $this->user_id AND $this->user_id) { ?><a href="javascript:;" title="Send private messages" onClick="$.sQuestions({flgs:1,msg:true,username:'<?php echo $this->user['user_name']; ?>'});">Send private messages</a><a href="javascript:;" title="Initiate a question to ta" onClick="$.sQuestions({category_enable:<?php echo (get_setting('category_enable') == 'Y') ? 1 : 0; ?>, username:'<?php echo $this->user['user_name']; ?>',user_id:<?php echo $this->user['uid']; ?>});">Ask her/him</a><a href="javascript:;" class="btn-blue2<?php if ($this->user_follow_check) { ?> cur <?php } ?>" onclick="follow_people($(this), $(this), <?php echo $this->user['uid']; ?>);"><?php if ($this->user_follow_check) { ?>Un<?php } ?>follow</a><?php } else if ($this->user_id == $this->user['uid']) { ?><a href="account/setting/profile/" class="btn-blue2">Edit</a><?php } ?>
				</p>
				
				<p class="gloicon">
					<?php if ($this->user['province']) { ?><span class="c_s1"><?php echo $this->user['province']; ?> <?php echo $this->user['city']; ?></span><?php } ?>
					<?php if ($this->job_name) { ?><span class="c_s2"><?php echo $this->job_name; ?></span><?php } ?>
					<span class="c_s4">Profil: <?php echo $this->user['views_count']; ?> visits</span>
				</p>
			</div>

			<p class="c_capacity gloicon">
				<span class="c_s5">Reputation: <big class="u_linkColor"><?php echo $this->user['reputation']; ?></big></span>
				<?php if (get_setting('integral_system_enabled') == 'Y') { ?><span class="c_s6">Credits:<big class="u_linkCly"><?php echo $this->user['integral']; ?></big><!--<em class="c_topten tny-small" title="top50"></em>--></span><?php } ?>
				<span class="c_s7">Agree: <?php echo $this->user['agree_count']; ?></span>
				<span class="c_s8">Thanks: <?php echo $this->user['thanks_count']; ?></span>
			</p>
		</div>
        </div>
        <div class="b_restrain u_mainElm">
		<h3 class="trends-H3 qAll rel content-H3 ">
			<p class="navC abs" id="Elm">
				<a href="javascript:;">Detailed information</a>
				<a href="javascript:;" id="page_actions">Status</a>
				<a href="javascript:;" id="page_focus">Follow</a>
				<a href="javascript:;" id="page_questions">Ask</a>
				<a href="javascript:;" id="page_answers">Reply</a>
				<a href="javascript:;" class="cur">Summary</a>
			</p>
		</h3>
		
		<div class="c_mainDiv">
			<!--Overview START-->
			<div class="c_fx tny-clear" id="Elm_5">				
				<?php if ($this->reputation_topics) { ?>
				<h4 class="c_h4 tny-gloCor trends-H3 noBdr">Familiar feature</h4>
					<ul class="c_topic tny-clear">
					<?php foreach ($this->reputation_topics AS $key => $val) { ?>
						<li>
							<a href="topic/<?php echo $val['url_token']; ?>" title="<?php echo $val['topic_title']; ?>" class="glotopic umsg" data-message="&uid=<?php echo $val['topic_id']; ?>&card=topic"><?php echo $val['topic_title']; ?></a>
							<span class="c_progressBar tny-cl_02"><?php echo $val['percent'];?>%<big class="b tny-radiu3"><small class="sm" style=" width:<?php echo $val['percent'];?>%;"></small></big></span>
						</li>
					<?php } ?>
                    </ul>
                    <?php } ?>
                    <!--Right column-->
                    <div class="tny-right c_main">
                    <h4 class="c_h4 tny-gloCor trends-H3"><a href="javascript:;" onclick="$('#page_questions').click(); $.scrollTo(1, 600, {queue:true});" class="v_more tny-right">More »</a>Ask</h4>
                    <?php foreach ($this->user_actions_questions AS $key => $val) { ?>
                    <div class="smodule c_module c_rightReply">
                    	<h4 class="tny-txtHide"><a href="question/<?php echo $val['question_id']; ?>"><?php echo $val['question_content']; ?></a></h4>
                    	<div class="s-txt rel">
                    		<p class="tny-txtHide"><?php echo $val['view_count']; ?> views &nbsp;• <?php echo $val['focus_count']; ?> Followers &nbsp;• <?php echo date_friendly($val['add_time']); ?></p>
                    		<!--Agree number--> 
                    		<a class="sendorse abs tny-small" href="question/<?php echo $val['question_id']; ?>" title="This question has been restored <?php echo $val['answer_count']; ?> second"><?php echo $val['answer_count']; ?></a>
                    	</div>
                    </div>
                    <?php } ?>

                    <h4 class="tny-gloCor trends-H3"><a href="javascript:;" onclick="$('#page_focus').click(); $.scrollTo(1, 600, {queue:true});" class="v_more tny-right">More »</a>Follow</h4>
                    <span class="c_addUs tny-right"><b>Followers <em class="tny-blue"><?php echo $this->user['fans_count']; ?></em> people</b>
					
					<?php if ($this->fans_list) { ?>
                    <p class="quserList">
                    	<?php foreach ($this->fans_list AS $key => $val) { ?>
	                    	<a class="imgUser umsg" href="people/<?php echo $val['url_token']; ?>" data-message="&uid=<?php echo $val['uid']; ?>&card=user" ><img src="<?php echo get_avatar_url($val['uid'], 'max'); ?>" alt="<?php echo $val['user_name']; ?>"></a>
	                    <?php } ?>
                    </p>
					<?php } ?>
                    </span>
                    
                    <span class="c_addUs"><b>Attention <em class="tny-blue"><?php echo $this->user['friend_count']; ?></em> people</b>
						
						<?php if ($this->friends_list) { ?>
                    	<p class="quserList">
                    	<?php foreach ($this->friends_list AS $key => $val) { ?>
	                    	<a class="imgUser umsg" href="people/<?php echo $val['url_token']; ?>" data-message="&uid=<?php echo $val['uid']; ?>&card=user"><img src="<?php echo get_avatar_url($val['uid'], 'max'); ?>" alt="<?php echo $val['user_name']; ?>"></a>
	                    <?php } ?>
	                    </p>
						<?php } ?>
                    </span>

                    <div class="c_TopicRight"><b>Attention <em class="tny-blue"><?php echo $this->user['topic_focus_count']; ?></em> Topic</b>
                    	<p class="stpd">
                    	<?php foreach ($this->focus_topics AS $key => $val) { ?>
	                    	<a class="glotopic umsg" data-message="&uid=<?php echo $val['topic_id']; ?>&card=topic" href="topic/<?php echo $val['url_token']; ?>"><?php echo $val['topic_title']; ?></a>
	                    <?php } ?>
	                    </p>
	                </div>
	                </div>
                    <!--Left column-->
                    <div class="c_main">
                    	 <h4 class="c_h4 tny-gloCor trends-H3"><a href="javascript:;" onclick="$('#page_answers').click(); $.scrollTo(1, 600, {queue:true});" class="v_more tny-right">More »</a>Reply</h4>
                    	 <?php foreach ($this->user_actions_answers AS $key => $val) { ?>
                         <div class="smodule c_module">
                            <h4 class="tny-txtHide"><a href="question/<?php echo $val['question_id']; ?>"><?php echo $val['question_content']; ?></a></h4>
                            <div class="s-txt rel">
                            	<p class="tny-txtHide"><?php echo utf8_substr($val['answer_info']['answer_content'], 0, 130, 'UTF-8', '...'); ?></p>
                           		<!--Agree number--> 
                            	<a class="sendorse abs tny-small" href="question/<?php echo $val['question_id']; ?>" title="<?php echo $val['answer_info']['agree_count']; ?> Times Agree"><?php echo $val['answer_info']['agree_count']; ?></a> 
                            </div>
                         </div>
                         <?php } ?>
                        
                        <h4 class="tny-gloCor trends-H3"><a href="javascript:;" onclick="$('#page_actions').click(); $.scrollTo(1, 600, {queue:true});" class="v_more tny-right">More »</a>Latest post</h4>
                        <div class="c_trends stpd">
                        	<?php foreach ($this->user_actions_answers AS $key => $val) { ?>
                            <p><span class="tny-cl_02 tny-right"><?php echo date_friendly($val['add_time']); ?></span><?php echo str_replace('Agreed with reply', 'Agree 1 Replies', $val['last_action_str']); ?>, <a href="question/<?php echo $val['question_id']; ?>" class="tny-txtHide"><?php echo $val['question_content']; ?></a></p>
                            <?php } ?>
                        </div>
                    </div>
              </div>
              <!--Overview END-->   
              
                <!--Reply<START-->
             	<div class="tny-hide" id="Elm_4">
             		<h4 class="c_h4 tny-gloCor trends-H3 noBdr">Reply</h4>
             		<div id="contentsuser_actions_answers">
             		
             		</div>
               
                    <p id="io_user_actions_answers_more"><a title="See more »" href="javascript:;" class="ajax-more">Show More</a></p>
                </div>
                <!--Reply<END-->
             
                <!--Ask START-->
             	<div class="tny-hide" id="Elm_3">
                	<h4 class="c_h4 tny-gloCor trends-H3 noBdr">Ask</h4>
                	<div id="contentsuser_actions_questions">
                	
                	</div>
                   
                   <p id="io_user_actions_questions_more"><a title="See more »" href="javascript:;" class="ajax-more">Show More</a></p>
              </div>
                <!--Ask END-->
             
                <!--Follow START-->
             	<div class="tny-hide" id="Elm_2">
                	<p class="c_atte tny-gray" id="clevel">
                    	<a href="javascript:;" class="cur">People followed</a>
                        <a href="javascript:;">Followers</a>
                        <a href="javascript:;">Topics followed</a>
                    </p>
                    
                    <div class="c_attent">
                        <div class="c_mytopic tMain" id="clevel_0">
                        	<h4 class="c_h4 tny-gloCor trends-H3 noBdr">People followed</h4>
                            <ul class="pri_letter tny-clear t_hot" id="contentsuser_follows">
                            
                            </ul>
                           
                           <p id="io_user_follows_more"><a title="See more »" href="javascript:;" class="ajax-more">Show More</a></p>
                        </div>
                        <div class="c_mytopic tMain tny-hide" id="clevel_1">
                        	<h4 class="c_h4 tny-gloCor trends-H3 noBdr">Followers</h4>
                            <ul class="pri_letter tny-clear t_hot" id="contentsuser_fans">
                            </li>
                           </ul>
                           
                           <p id="io_user_fans_more"><a title="See more »" href="javascript:;" class="ajax-more">Show More</a></p>
                        </div>
                        <div class="c_mytopic tMain tny-hide" id="clevel_2">
                        	<h4 class="c_h4 tny-gloCor trends-H3 noBdr">Attention <?php echo $this->user['topic_focus_count']; ?> By Subject</h4>
                            <ul class="pri_letter tny-clear t_hot" id="contentsuser_topics">
                            </ul>
                           
                            <p id="io_user_topics_more"><a title="See more »" href="javascript:;" class="ajax-more">Show More</a></p>
                        </div>
                    </div>
                </div>
                <!--Follow END-->
             
                <!--Dynamic START-->
             	<div class="tny-hide" id="Elm_1">
                	<h4 class="c_h4 tny-gloCor trends-H3 noBdr">Latest post</h4>
                	<ul class="new_ls" id="contentsuser_actions">
                    </ul>
                    <p id="io_user_actions_more"><a title="See more »" href="javascript:;" class="ajax-more">Show More</a></p>
                </div>
                <!--Dynamic END-->
             
                <!--Detailed informationSTART-->
             	<div class="tny-hide" id="Elm_0">
                	<h4 class="c_h4 tny-gloCor trends-H3 noBdr">Detailed information</h4>
                    <ul class="c_details">
                        
                        <li><span class="tny-cl_01">Brag permission:</span>
                        	<p class="gloicon">
                              <span class="c_s5">Reputation: <big class="u_linkColor"><?php echo $this->user['reputation']; ?></big><!--<span title="Lv9" class="clevel tny-small c_Lv9"></span>--></span>
                              <?php if (get_setting('integral_system_enabled') == 'Y') { ?><span class="c_s6">Credits:<big class="u_linkCly"><?php echo $this->user['integral']; ?></big></span><?php } ?>
                              <span class="c_s7">Agree: <?php echo $this->user['agree_count']; ?></span>
                              <span class="c_s8">Thanks: <?php echo $this->user['thanks_count']; ?></span>
                          </p>
                        </li>
                    	<?php if ($this->user['area_name']) { ?><li><span class="tny-cl_01">Currently residing Location</span><?php echo $this->user['area_name']; ?></li><?php } ?>
                        <?php if ($this->education_experience_list) { ?><li><span class="tny-cl_01">Education and experience:</span>
                        <?php foreach($this->education_experience_list as $k => $v) { ?>
                        <?php echo $v['education_years']; ?> Studied at the <?php echo $v['school_name']; ?> <?php echo $v['departments']; ?> 
                        <br />
                        <?php } ?>
                        </li>
                        <?php } ?>
                        
                        <?php if ($this->work_experience_list) { ?>
                        <li><span class="tny-cl_01">Professional experience:</span>
                        <?php foreach($this->work_experience_list as $k => $v) { ?>
                        	<?php echo $v['start_year']; ?> - <?php if ($v['end_year'] == -1) { ?>so far<?php } else { ?><?php echo $v['end_year']; ?><?php } ?> Working in <?php echo $v['company_name']; ?> <?php if ($v['job_name']) { ?> Office <?php echo $v['job_name']; ?><?php } ?><br />
                        <?php } ?> 
                        </li>
                        <?php } ?> 
                        <li><span class="tny-cl_01">Last Active:</span><?php if($this->user['last_active']){ ?><?php echo date_friendly($this->user['last_active']); ?><?php } ?></li>
                        <?php if ($this->reputation_topics) { ?>
                        <li class="c_last"><span class="tny-cl_01">Familiar feature:</span>
                        <?php foreach ($this->reputation_topics AS $key => $val) { ?>
                        	<p class="c_list_topic">
                                <a href="topic/<?php echo $val['url_token']; ?>" title="<?php echo $val['topic_title']; ?>" class="glotopic umsg" data-message="&uid=<?php echo $val['topic_id']; ?>&card=topic"><?php echo $val['topic_title']; ?></a>
                                <span title="30%" class="c_progressBar tny-cl_02"><?php echo $val['percent'];?>%<big class="b tny-radiu3"><small style="width:<?php echo $val['percent'];?>%;" class="sm"></small></big></span>
                            </p>
                        <?php } ?>
                        </li>
                        <?php } ?>
                    </ul>
                </div>
                <!--Detailed informationEND-->          
        </div>
    </div>
</div>

<script type="text/javascript">
	var PEOPLE_USER_ID = '<?php echo $this->user['uid']; ?>';
	
	var ACTIVITY_ACTIONS = '<?php echo implode(',', array(
		ACTION_LOG::ADD_QUESTION,
		ACTION_LOG::ANSWER_QUESTION,
		ACTION_LOG::ADD_REQUESTION_FOCUS,
		ACTION_LOG::ADD_AGREE,
		ACTION_LOG::ADD_TOPIC,
		ACTION_LOG::ADD_TOPIC_FOCUS
	)); ?>';
	
	$(document).ready(function () {
		$.tabs('#Elm');
		$.tabs('#clevel');
		
		io_more_load(GET_BASE_URL + '/people/ajax/user_actions/uid-' + PEOPLE_USER_ID + '__actions-201', $('#io_user_actions_answers_more'), $('#contentsuser_actions_answers'));	// The issue of participation
			  
		io_more_load(GET_BASE_URL + '/people/ajax/user_actions/uid-' + PEOPLE_USER_ID + '__actions-101', $('#io_user_actions_questions_more'), $('#contentsuser_actions_questions'));	// Initiated questions
		
		io_more_load(GET_BASE_URL + '/people/ajax/user_actions/distint-1__uid-' + PEOPLE_USER_ID + '__actions-' + ACTIVITY_ACTIONS, $('#io_user_actions_more'), $('#contentsuser_actions'));	// Personal Dynamic
		
		io_more_load(GET_BASE_URL + '/people/ajax/follows/type-follows__uid-' + PEOPLE_USER_ID, $('#io_user_follows_more'), $('#contentsuser_follows'));	// Follow
		io_more_load(GET_BASE_URL + '/people/ajax/follows/type-fans__uid-' + PEOPLE_USER_ID, $('#io_user_fans_more'), $('#contentsuser_fans'));	// Fans
		
		io_more_load(GET_BASE_URL + '/people/ajax/topics/uid-' + PEOPLE_USER_ID, $('#io_user_topics_more'), $('#contentsuser_topics'));	// Topic
	});
</script>

<?php TPL::output('global/footer.tpl.htm'); ?>
