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

		<?php TPL::output('account/setting/setting_header.tpl.htm'); ?>
		<!--Basic InformationSTART--> 
		<div class="v_setting inputs">
			<h4 class="h4">Basic information</h4>
				<div class="v_setMain v_ess">
					<!--AvatarSTART-->
					<div class="headSet">
						<div class="uheadimg"><img id="avatar_src" alt="" class="tny-radiu5" src="<?php echo get_avatar_url($this->user_id, 'max'); ?>" /></div>
						<h5 class="tny-cl_01">Avatar</h5>
						<p>Support jpg, gif, png format images</p>
						<a class="btn-blue" id="avatar_uploader" href="javascript:;">Upload</a> <span id="avatar_uploading_status" style="display:none"><img src="<?php echo GET_STATIC_URL; ?>/common/load.gif" align="absmiddle"> Uploading...</span>
					</div>
					<!--AvatarEND-->
					<form id="setting_form" method="post" action="account/ajax/profile_setting/">
					<ul class="v_essential ">
						<li><label>Account:</label><?php echo $this->user_info['email']; ?><?php if ($this->user_info['valid_email'] == 0) { ?> &nbsp; (<a href="javascript:;" onclick="ajax_request(GET_BASE_URL + '/account/ajax/send_valid_mail/');">Your email address has not been verified, please click to verify</a>)<?php } ?></li>
						<li><label>Username:</label><?php if ($this->user_info['user_name'] AND $this->user_info['user_name'] != $this->user_info['email']) { ?><?php echo $this->user_info['user_name']; ?><?php } else { ?><input type="text" class="v_intr"  name="user_name" id="user_name" value="<?php echo $this->user_info['user_name']; ?>" /><?php } ?></li>
						<li><label>Gender:</label><input type="radio" name="sex" id="sex" value="1"<?php if ($this->user_info['sex'] == 1 || empty($this->user_info['sex'])) { ?> checked="checked"<?php } ?>/> Male &nbsp; <input type="radio" name="sex" id="sex" value="2" <?php if ($this->user_info['sex'] == 2) { ?> checked="checked"<?php } ?>/> Female &nbsp; <input type="radio" name="sex" id="sex" value="3" <?php if ($this->user_info['sex'] == 3) { ?> checked="checked"<?php } ?>/> Secret</li></li>
						<li ><label>Birthday:</label><select name="birthday_y"><option value=""></option><?php echo H::display_options($this->birthday_y, $this->birthday_y_s); ?></select> Years <select name="birthday_m"><option value=""></option><?php echo H::display_options($this->birthday_m, $this->birthday_m_s); ?></select>Month <select name="birthday_d"><option value=""></option><?php echo H::display_options($this->birthday_d, $this->birthday_d_s); ?></select> Day</li>
						<li><label>Now lives in:</label><select name="province" class="select_area"></select> <select name="city" class="select_area"></select></li>
						<li><label>Profession:</label><select name="job_id" class="select_job"><option value="">--</option><?php echo H::display_options($this->job_list, $this->user_info['job_id']); ?></select></li>
						<li><label>Signature:</label><input name="signature" maxlength="128" onKeyUp="if($.trim($(this).val()).length >=128){$.alert('Write a description, limited to 128 characters!');}" type="text" id="signature" class="v_intr" value="<?php echo $this->user_info['signature']; ?>"<?php if ($this->user_info['verified']) { ?> disabled="disabled"<?php } ?> /></li>
						<li><label>Personalized URLs:</label><script type="text/javascript">document.write(GET_BASE_URL);</script>/people/ <input name="url_token" maxlength="32" style="width:90px" onKeyUp="if($.trim($(this).val()).length >=32){$.alert('Personalized URLs, only 32 characters!');}" type="text" id="url_token"  class="v_intr" value="<?php echo $this->user_info['url_token']; ?>"<?php if ($this->user_info['url_token_update'] AND $this->user_info['url_token_update'] > (time() - 3600 * 24 * 30)) { ?> disabled="disabled"<?php } ?>/><br /><p>(Personalized URLs, only 32 characters!)</p></li>
						<li>
						<label>Time zone:</label>
						<select name="default_timezone">
							<option value=''>Use system default time zone</option>
							<option value='Etc/GMT+12'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+12') { ?> selected="selected"<?php } ?>>(GMT - 12:00 hour) Eniwetok Island, Kwajalein</option>
							<option value='Etc/GMT+11'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+11') { ?> selected="selected"<?php } ?>>((GMT - 11:00 hour) Midway Islands, Samoa</option>
							<option value='Etc/GMT+10'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+10') { ?> selected="selected"<?php } ?>>(GMT - 10:00 hour) Hawaii</option>
							<option value='Etc/GMT+9'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+9') { ?> selected="selected"<?php } ?>>(GMT - 9:00 hour) Alaska</option>
							<option value='Etc/GMT+8'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+8') { ?> selected="selected"<?php } ?>>(GMT - 8:00 hour) Pacific Time</option>
							<option value='Etc/GMT+7'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+7') { ?> selected="selected"<?php } ?>>(GMT - 7:00 hour) Mountain Time Zone</option>
							<option value='Etc/GMT+6'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+6') { ?> selected="selected"<?php } ?>>(GMT - 6:00 hour) Central Standard Time, Mexico City</option>
							<option value='Etc/GMT+5'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+5') { ?> selected="selected"<?php } ?>>(GMT - 5:00 hour) Eastern Standard Tim, Bogotá, Lima</option>
							<option value='Etc/GMT+4'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+4') { ?> selected="selected"<?php } ?>>(GMT - 4:00 hour) Atlantic Time (Canada), Caracas, La Paz</option>
							<option value='Canada/Newfoundland'<?php if ($this->user_info['default_timezone'] == 'Canada/Newfoundland') { ?> selected="selected"<?php } ?>>(GMT - 3:30 hour) Newfoundland</option>
							<option value='Etc/GMT+3'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+3') { ?> selected="selected"<?php } ?>>(GMT - 3:00 hour) Brazil, Buenos Aires, Falkland Islands</option>
							<option value='Etc/GMT+2'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+2') { ?> selected="selected"<?php } ?>>(GMT - 2:00 hour) Mid Atlantic, Ascension, Saint Helena</option>
							<option value='Etc/GMT+1'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT+1') { ?> selected="selected"<?php } ?>>(GMT - 1:00 hour) Azores, Cape Verde</option>
							<option value='Etc/GMT'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT') { ?> selected="selected"<?php } ?>>(GMT) Casablanca, Dublin, London, Lisbon, Monrovia</option>
							<option value='Etc/GMT-1'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-1') { ?> selected="selected"<?php } ?>>(GMT + 1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
							<option value='Etc/GMT-2'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-2') { ?> selected="selected"<?php } ?>>(GMT + 2:00 hour) Kaliningrad, South Africa</option>
							<option value='Etc/GMT-3'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-3') { ?> selected="selected"<?php } ?>>(GMT + 3:00 hour) Baghdad, Riyadh, Moscow, Nairobi</option>
							<option value='Iran'<?php if ($this->user_info['default_timezone'] == 'Iran') { ?> selected="selected"<?php } ?>>(GMT + 3:30 hour) Tehran</option>
							<option value='Etc/GMT-4'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-4') { ?> selected="selected"<?php } ?>>(GMT + 4:00 hour) Abu Dhabi, Baku, Muscat, Tbilisi</option>
							<option value='Asia/Kabul'<?php if ($this->user_info['default_timezone'] == 'Asia/Kabul') { ?> selected="selected"<?php } ?>>(GMT + 4:30 hour) Kabul</option>
							<option value='Etc/GMT-5'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-5') { ?> selected="selected"<?php } ?>>(GMT + 5:00 hour) Yekaterinburg, Karachi, Tashkent</option>
							<option value='Asia/Kolkata'<?php if ($this->user_info['default_timezone'] == 'Asia/Kolkata') { ?> selected="selected"<?php } ?>>(GMT + 5:30 hour) Mumbai, Kolkata, Madras, New Delhi</option>
							<option value='Etc/GMT-6'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-6') { ?> selected="selected"<?php } ?>>(GMT + 6:00 hour) Almaty, Colomba, Dhaka</option>
							<option value='Etc/GMT-7'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-7') { ?> selected="selected"<?php } ?>>(GMT + 7:00 hour) Bangkok, Hanoi, Jakarta</option>
							<option value='Etc/GMT-8'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-8') { ?> selected="selected"<?php } ?>>(GMT + 8:00 hour) Beijing, Hong Kong, Perth, Singapore, Taipei</option>
							<option value='Etc/GMT-9'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-9') { ?> selected="selected"<?php } ?>>(GMT + 9:00 hour) Osaka, Sapporo, Seoul, Tokyo, Yakutsk</option>
							<option value='Etc/GMT-10'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-10') { ?> selected="selected"<?php } ?>>(GMT + 10:00 hour) Melbourne, Papua New Guinea, Sydney</option>
							<option value='Etc/GMT-11'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-11') { ?> selected="selected"<?php } ?>>(GMT + 11:00 hour) Magadan, New Caledonia, Solomon Islands</option>
							<option value='Etc/GMT-12'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-12') { ?> selected="selected"<?php } ?>>(GMT + 12:00 hour) New Zealand, Fiji, Marshall Islands</option>
							<option value='Etc/GMT-13'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-13') { ?> selected="selected"<?php } ?>>(GMT + 13:00 hour) Kamchatka Peninsula, Anadyr</option>
							<option value='Etc/GMT-14'<?php if ($this->user_info['default_timezone'] == 'Etc/GMT-14') { ?> selected="selected"<?php } ?>>(GMT + 14:00 hour) Christmas Island</option>
						</select>
						</li>
					</ul>
				</div>
				
				<h4 class="h4">Contact us</h4>
				<div class="v_setMain">
					<ul class="v_myct tny-clear">
						<li class="sp"><label>YM:</label> &nbsp; <input type="text" name="ym" value="<?php echo $this->user_info['ym']; ?>" /></li>
						<li class="sp"><label>Phone:</label> &nbsp; <input type="text" name="mobile" value="<?php echo $this->user_info['mobile']; ?>" /></li>
						<li class="sp"><label style="width:80px;">E-mail:</label> &nbsp; <input type="text" name="common_email" value="<?php echo $this->user_info['common_email']; ?>" /></li>
						<li class="sp"><label>Website:</label> &nbsp; <input type="text" name="homepage" value="<?php echo $this->user_info['homepage']; ?>" /></li>
					</ul>
				</div>
				</form>
				<h4 class="h4">Education</h4>
				<!-- This form is used to reset the -->
				
				<div class="v_setMain" id="v_education">
					<p class="vgrouptitle tny-cl_01">
						<span class="s1">University</span>
						<span class="s1">Department</span>
						<span class="s2">Admission year</span>
						<span class="s2">Operation</span>
					</p>
					<form id="v_education_formReset" onSubmit="return false;">
					<ul class="vgroup tny-clear bottomRadius5">
						<li class="s1"><input type="text" name="school_name" value="Such as: xx university..." onFocus="$.focus(this,'Such as: xx university...');"/></li>
						<li class="s1"><input type="text" name="departments" value="Such as: Department of Computer Engineering" onFocus="$.focus(this,'Such as: Department of Computer Engineering');"/></li>
						<li class="s2" id="v_groupSelects">
							<select class="v_group_selects_years" name="education_years">
								<option value=""></option>
								<?php echo H::display_options($this->birthday_y); ?>
							</select> Years
						</li>
						<li class="s2"><a href="javascript:;" onClick="$.set.addElem({flg:this,eventType:event,changer:false});">Add</a></li>
					</ul>                                             
                    </form>
				</div>
			
			
			<h4 class="h4">Work experience</h4>
			<!--This form is used to reset the-->
			
			
			<div class="v_setMain"  id="v_jobs">
				<p class="vgrouptitle tny-cl_01">
					<span class="s1">Company</span>
					<span class="s1">Position</span>
					<span class="s3">Work period</span>
				</p>
				<form id="v_job_formReset" onSubmit="return false;">
				<ul class="vgroup tny-clear" id="user_Jobs_Ul">
					<li class="s1"><input type="text" name="company_name" id="Job_company_name" value="xx listed company..." onFocus="$.focus(this,'xx listed company...');"/></li>
					<li class="s1">
						<select class="v_group_selects_jobs" name="job_id" id="work_jobs_list">
							<option value=""></option>
							<?php echo H::display_options($this->job_list); ?>
						</select>
					</li>
						
					<li class="s3" id="work_timeline">
						<p> 
							<select class="v_group_selects_years" id="work_start_year" name="start_year">
								<option value=""></option>
								<?php echo H::display_options($this->birthday_y); ?>
							</select> Years 
								
							 &nbsp; to <select class="v_group_selects_years" id="work_end_year" name="end_year">
								<option value=""></option>
								<option value="-1">so far</option>
								<?php echo H::display_options($this->birthday_y); ?>
							</select> Years 
						</p>
						</li>
					</ul>
					</form>
					<p class="vgroup-operate" id="user_Manipulates">Operation: <a href="javascript:;" onclick="$.set.addjobs({flg:this,eventType:event,changer:false});">Add</a></p>
				</div>
				
				
				
				<p class="v_submit tny-tr"><a title="Save" href="javascript:;" onclick="ajax_post($('#setting_form'));" class="btn-raplay2">Save</a></p>
			</div>
		<?php TPL::output('account/setting/setting_footer.tpl.htm'); ?>



<script type="text/javascript" src="<?php echo GET_STATIC_URL; ?>/js/app/setting.js"></script>

<script type="text/javascript">
$(document).ready(function () {
	$('.select_area').LocationSelect({
        labels: ["Province", "City"],
        elements: document.getElementsByTagName("select"),
        detector: function () {
            this.select(["<?php echo $this->user_info['province']; ?>", "<?php echo $this->user_info['city']; ?>"]);
        },
		dataUrl: GET_BASE_URL + '/account/ajax/areas_json_data/'
    });
	
    init_avatar_uploader($('#avatar_uploader'), $('#avatar_uploading_status'), $("#avatar_src"));
});
</script>

<script type="text/javascript">
<?php if ($this->education_experience_list) { ?>
/*
*   $.set.addElem:function(settings);
*   Note: the call is required to load the common.js, otherwise $.alert is invalid.
*/

//Education
$.set.addElem({
	  changer: true,   //Set the switch, when set to true, shows the user experience and education. (If the user does not fill any Information is: false)
	    array: <?php echo json_encode($this->education_experience_list); ?>
});
<?php } ?>

<?php if ($this->work_experience_list) { ?>
//Work experience
$.set.addjobs({
	 changer: true,
	   array: <?php echo json_encode($this->work_experience_list); ?>
});
<?php } ?>
</script>

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