<div class="user_profile_search_side">
	<div class="side_panel">
		<h1>{{'User profile search'|trans}}</h1>
		{{Open_Form}} 
		<div class="subpanel_world_zones">
			<select class="input_select" name="country_id_to_search" onchange="this.form.doSearch.click()">
				{% for country in countries %}
					
					<option value="{{country.id|e}}"
						{% if country_id_to_search == country.id %}
							selected="selected"
						{% endif %}
					>
						{{country.name|e}}
					</option>
				{% endfor %}
			</select>
		</div>        
		<div class="criteria_fields">
			<div class="criteria_text_field">
				<label for="name_to_search">{{'Name contains:'|trans}}</label>
				<input type="text" id="name_to_search" name="name_to_search" value="{{name_to_search|e}}"
					onkeyup="zenario_user_profile_search_as_we_type(this)" />
			</div>
			<div class="criteria_text_field">
				<label for="keywords_to_search">{{'Has keywords:'|trans}}</label>
				<input type="text" id="keywords_to_search" name="keywords_to_search" value="{{keywords_to_search|e}}"
					onkeyup="zenario_user_profile_search_as_we_type(this)" />
			</div>
		</div>
		<div class="side_panel buttons">
			<div class="nice_button">
				<div class="r">
					<input class="i" type="submit" name="doSearch" value="{{'Search'|trans}}" />
				</div>
			</div>
			<div class="nice_button">
				<div class="r">
					<a class="i" href="{{Clear_Search_Link|e}}">{{'Clear'|trans}}</a>
				</div>
			</div>
		</div>        
		{{Close_Form}}
	</div>
	
	<div class="zenario_user_profile_search_results">
		<div class="search_results_list">
			<h2>{{'User profile search results'|trans}}</h2>
				<table>
					<tr>
					{% set count = 0 %}
					{% for result in results %}
						{% set count = count + 1 %}
						<td id="row_user_{{result.id|e}}">
						
						{% if result.Photo_Listing %}
							<div class="row_user_image"><a title="View user profile" onclick="$.colorbox({inline: true, transition: 'none', href:'#profile_popup_{{result.id|e}}'});"><img src='{{result.Photo_Listing|e}}'></a></div>
						{% else %}
							<div class="row_user_image"><a title="View user profile" onclick="$.colorbox({inline: true, transition: 'none', href:'#profile_popup_{{result.id|e}}'});"><span class="generic_profile_image"></span></a></div>
						{% endif %}
						
						<br>
						<a title="View user profile" onclick="$.colorbox({inline: true, transition: 'none', href:'#profile_popup_{{result.id|e}}'});">
							<strong>{{result.first_name|e}} {{result.last_name|e}}</strong>
						</a>
						<br>{{result.company_name|e}}
						<br>{{result.bus_country_id|e}}
						<!-- All fields from the listing form can be used here -->
							
						<div style="display:none;">
							<div id="profile_popup_{{result.id|e}}" class="popup_profile">
								<div class="user_details">
									<div>
										{% if result.Photo_Popup %}
											<img src='{{result.Photo_Popup|e}}'>
										{% else %}
											<span class="generic_profile_image"></span>
										{% endif %}
									</div>
									<div>
										<!-- All fields from the popup form can be used here -->
										<h2><span>{{result.salutation|e}}</span> {{result.first_name|e}} {{result.last_name|e}}</h2>
										<p><strong>{{'_EMAIL:'|trans}}</strong> <a href="mailto:{{result.email|e}}">{{result.email|e}}</a></p>
									</div>
								</div>
								<div class="user_aditional_info section_1">
										<p><strong>{{'_JOB_TITLE:'|trans}}</strong> {{result.job_title|e}}</p>
										<p><strong>{{'_JOB_TYPE:'|trans}}</strong> {{result.job_type|e}}</p>
										<p><strong>{{'_COMPANY_NAME:'|trans}}</strong> {{result.company_name|e}}</p>
										<p><strong>{{'_DEPARTMENT:'|trans}}</strong> {{result.job_department|e}}</p>
										<p><strong>{{'_ADDRESS:'|trans}}</strong> {{result.address1|e}} {{result.address2|e}}</p>
										<p><strong>{{'_CITY:'|trans}}</strong> {{result.city|e}}</p>
										<p><strong>{{'_STATE:'|trans}}</strong> {{result.state|e}}</p>
										<p><strong>{{'_POSTCODE:'|trans}}</strong> {{result.postcode|e}}</p>
										<p><strong>{{'_COUNTRY:'|trans}}</strong> {{result.bus_country_id|e}}</p>
										<p><strong>{{'_MOBILE:'|trans}}</strong> {{result.mobile|e}}</p>
										<p><strong>{{'_PHONE:'|trans}}</strong> {{result.phone|e}}</p>
								</div>
								<div class="user_aditional_info section_2">
									<p><strong>{{'_INTERESTS:'|trans}}</strong> {{result.interests|e}}</p>
									<p><strong>{{'_SKILLS_EXPERTISE:'|trans}}</strong> {{result.skills_expertise|e}}</p>
									<p><strong>{{'_SUMMARY_BUSINESS:'|trans}}</strong> {{result.summary_of_my_business|e}}</p>
									<p><strong>{{'_LINKEDIN:'|trans}}</strong> <a href="{{result.linkedin|e}}" target="_blank">{{result.linkedin|e}}</a></p>
									<p><strong>{{'_LANGUAGES:'|trans}}</strong> {{result.languages_spoken|e}}</p>
									<p><strong>{{'_OTHER_LANGUAGES:'|trans}}</strong> {{result.other_languages_spoken|e}}</p>
								</div>
							</div>                        
						</div>
						{% if (count is divisible by(Column_Count)) and (not result.last_result) %}
							</tr><tr>
						{% endif %}
				{% endfor %}
				</tr>
			</table>
			{{Pagination}}
			{% if No_Rows %}
				{{'No results found with your search criteria'|trans}}
			{% endif %}
		</div>
	</div>        
</div>
