<!-- Script PHP/MYSQL of management of classifieds ads developed by Script PAG. Script PAG all rights reserved. Use under license. http://www.script-pag.com -->
<div class="container-100">
	<div class="container-100-child forms">
	
		<h1><?php echo $info_page; ?></h1>
		<form class="shop-form" action="" method="post" enctype="multipart/form-data">
			
			<div>
				
				<?php if(!empty($error)) : ?>
				<p class="p-error"><?php echo $language['form_message_error']; ?></span>
				<?php endif; ?>
				
				<p><?php echo $language['account_form_shop_update1']; ?> : <?php echo $language['form_info_picture1']; ?></p>
			
				<p data-error="error_file_not_allowed" class="p-error"><?php echo $language['form_error_extention']; ?></p>
				<p data-error="error_max_size" class="p-error"><?php echo $language['form_error_size']; ?></p>
				<p data-error="error_upload" class="p-error"><?php echo $language['form_error_upload']; ?></p>
				<div id="popup_msg" title=""><p></p></div>
				<div class="upload">
					<a class="upload_delete_link" href=""<?php echo (empty($shop['logo_name']) && (!isset($_POST['photo']) || empty($_POST['photo'])) ? ' style="display: none;"' :''); ?> data-text="<?php echo $language['popup_text']; ?>" data-valid="<?php echo $language['popup_valid_button']; ?>" data-cancel="<?php echo $language['popup_cancel_button']; ?>"></a>
					<input type="file" class="input-file" name="photo" data-context="logo_shop" />
					<?php if(!empty($shop['logo_name']) || (isset($_POST['photo']) && !empty($_POST['photo']))) : ?>
						<input type="hidden" name="photo" value="/upload/logos/<?php echo (!empty($_POST['photo']) ? $_POST['photo'] : $shop['logo_name']); ?>" />
					<?php endif; ?>
					<span class="icon-add"<?php echo (!empty($shop['logo_name']) || (isset($_POST['photo']) && !empty($_POST['photo'])) ? ' style="display: none;"' :''); ?>>+</span>
					<img src="<?php echo URL.(isset($_POST['photo']) && !empty($_POST['photo']) ? $_POST['photo'] : (!empty($shop['logo_name']) ? '/upload/logos/'.$shop['logo_name'] : '/template/images/upload_photo.png')); ?>"  width="130" height="85" alt="" />
					<p class="loading"><img src="<?php echo URL; ?>/template/images/loading.gif" /></p>				
				</div>
				
				<?php if($param_gen['active_rubric'] == 0) : ?>
				<?php display_rubric($cat, $cache_cat, $error); ?>
				<?php endif; ?>
		
				<input type="text" class="<?php if (isset($error['title'])) echo 'form-error'; ?>" name="title" placeholder="<?php echo $language['account_form_shop_title']; ?>" value="<?php if (isset($_POST['title'])) echo htmlspecialchars($_POST['title']); elseif(isset($shop['title'])) echo $shop['title']; ?>" />
				<textarea class="textarea-height-strong <?php if(isset($error['description'])) echo 'form-error'; ?>" cols="60" rows="10" placeholder="<?php echo $language['account_form_shop_desc']; ?>" name="description"><?php if(isset($_POST['description'])) echo htmlspecialchars($_POST['description']); elseif(isset($shop['description'])) echo $shop['description']; ?></textarea>
				<textarea class="textarea-height-short <?php if(isset($error['opening_hours'])) echo 'form-error'; ?>" cols="60" rows="4" placeholder="<?php echo $language['account_form_shop_opening_hours']; ?>" name="opening_hours"><?php if(isset($_POST['opening_hours'])) echo htmlspecialchars($_POST['opening_hours']); elseif(isset($shop['opening_hours'])) echo $shop['opening_hours']; ?></textarea>
				<input type="text" class="<?php if(isset($error['web'])) echo 'form-error'; ?>" name="web" placeholder="<?php echo $language['account_form_shop_web']; ?>" value="<?php if (isset($_POST['web'])) echo htmlspecialchars($_POST['web']); elseif(isset($shop['website'])) echo $shop['website']; ?>" />
				
				<?php if($param_api_gg['activ_gg_map'] == 1 && is_allowed_cookie('googlemap')) : ?>
				<input id="geolocation" class="av_input<?php if(isset($error['geolocation'])) echo ' form-error'; ?>" name="geolocation" placeholder="<?php echo $language['compte_form_geol']; ?>" value="<?php if (isset($_POST['geolocation'])) echo htmlspecialchars($_POST['geolocation']); ?>" type="text" autocomplete="off">
								
				<div id="geoloc-error1" class="tahoma" <?php if(!isset($_POST['lat']) || (isset($_POST['lat']) && $_POST['lat'] != 0)) echo 'style="display:none;"'; ?>><?php echo $language["form_geoloc_err_1"]; ?></div>
				<div id="geoloc-error2" class="tahoma" style="display:none;"><?php echo $language["form_geoloc_err_2"]; ?></div>
				<div id="geoloc-error3" class="tahoma" style="display:none;"><?php echo $language["form_geoloc_err_3"]; ?></div>
				<div id="geoloc-error4" class="tahoma" style="display:none;"><?php echo $language["form_geoloc_err_4"]; ?></div>
				<div id="geoloc-info" class="tahoma" style="display:none;"><?php echo $language["form_geoloc_info_1"]; ?></div>
					
				<a href="javascript:void(0)" id="geolocalisation-link" class="first-color bold"><?php echo $language['form_geoloc_info_2']; ?></a>
									
				<input type="hidden" name="lat" id="lat" value="<?php if(isset($_POST['lat'])) echo htmlspecialchars($_POST['lat']); elseif(isset($shop['lat'])) echo $shop['lat']; else echo 0; ?>" />
				<input type="hidden" name="lng" id="lng" value="<?php if(isset($_POST['lng'])) echo htmlspecialchars($_POST['lng']); elseif(isset($shop['lng'])) echo $shop['lng'];  else echo 0; ?>" />
				<?php endif; ?>
			
				<div class="geolocalisation flex-container">
					
					<div>		
						
						<?php 
							$reg = isset($_POST['reg']) ? $_POST['reg'] : (isset($shop['id_reg']) ? $shop['id_reg'] : $member['id_reg']);
							$county = isset($_POST['county']) ? $_POST['county'] : (isset($shop['id_county']) ? $shop['id_county'] : $member['id_county']);
							
							display_regions($reg, $cache_regions, $error); 
						?>
				
						<div id="display_counties">
							<?php
							
								if($reg != 0)
								{
									$display = 0;
									
									foreach($cache_counties as $v)
									{
										if($v['par_reg'] == $reg)
										$display = 1;
									}
									
									if(isset($reg) && $display == 1)
									display_counties($county, $reg, $cache_counties, $error);
								}
							?>
						</div>
						<?php if($cache_param_fields['act_city'] == 1) : ?>
						<div><input type="text" id="city" class="<?php if (isset($error['city'])) echo 'form-error'; ?>" name="city" placeholder="<?php echo $language['form_city']; ?>" value="<?php if (isset($_POST['city'])) echo htmlspecialchars($_POST['city']); elseif (isset($shop['city'])) echo $shop['city']; else echo $member['city']; ?>" /></div>
						<?php endif; ?>
						<?php if($cache_param_fields['act_postcode'] == 1) : ?>
						<div><input type="text" id="postcode" class="<?php if (isset($error['postcode'])) echo 'form-error'; ?>" name="postcode" placeholder="<?php echo $language['form_postcode']; ?> <?php echo $language['form_postcode_info']; ?>" value="<?php if (isset($_POST['postcode'])) echo htmlspecialchars($_POST['postcode']); elseif (isset($shop['postcode'])) echo $shop['postcode']; else echo $member['postcode']; ?>" /></div>
						<?php endif; ?>
						
						<?php if($param_api_gg['activ_gg_map'] == 1 && is_allowed_cookie('googlemap')) : ?>
						<div><input type="text" id="address" class="<?php if(isset($error['address'])) echo 'form-error'; ?>" name="address" placeholder="<?php echo $language['form_address']; ?>" value="<?php if (isset($_POST['address'])) echo htmlspecialchars($_POST['address']); else if (isset($shop['address'])) echo $shop['address']; else echo $member['address']; ?>" /></div>
						<?php endif; ?>
						
					</div>
					
					<?php if($param_api_gg['activ_gg_map'] == 1 && is_allowed_cookie('googlemap')) : ?>
					<div id="display-map"></div>
					<?php endif; ?>
					
				</div>
				
			</div>
	
			<input type="submit" value="<?php echo $language['bt_submit']; ?>" />
	
		</form>

	</div>
</div>