

<?php $__env->startSection('title', trans('user.views.index.title')); ?>
<?php $__env->startSection('top_scripts'); ?>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('/css/jquery-ui.css')); ?>">
<script src="//cdn.ckeditor.com/4.5.11/basic/ckeditor.js"></script>
<?php $__env->startSection('content'); ?>
<div class="tp-dashboard-head"><!-- page header -->
  <div class="container">
    <div class="row">
      <div class="col-md-12 profile-header">
        <div class="profile-pic col-md-2">
          <?php if($user->logo != null): ?>

          <img src="<?php echo e($user->logo_thumb); ?>" alt="" class="img-circle">
          <?php else: ?>
          <img src="<?php echo e(asset('images/couple-profile.jpg')); ?>" alt="" class="img-circle">
          <?php endif; ?>
        </div>
        <div class="profile-info col-md-9">
          <h1 class="profile-title"><?php echo e($user->name); ?><small>Welcome Back Couple</small></h1>
        </div>
      </div>
    </div>
  </div>
</div>
<!-- /.page header -->
<div class="tp-dashboard-nav">
  <div class="container">
    <div class="row">
      <div class="col-md-12 dashboard-nav">
          <?php echo $__env->make('vendor._partials.navigation', ['_active_navigation' => 'profile'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
      </div>
    </div>
  </div>
</div>
<div class="main-container">
  <div class="container">
    <div class="row">
      <div class="col-md-12">
        <div class="dashboard-page-head">
          <div class="page-header">
            <h1>Panou de control <small>...</small></h1>
            <?php echo $__env->make('vendor._partials.errors', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            <?php echo Notification::showAll(); ?>

          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-md-8 profile-dashboard">
        <div class="row">
          <div class="col-md-12 dashboard-form calender">
            <form method="POST" class="form-horizontal" action="<?php echo e(route('user.job.update')); ?>" enctype="multipart/form-data">
              <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
              <div class="bg-white pinside40 mb30">
                <h2 class="form-title">Panou de control</h2>
				<div class="col-md-12 form-group <?php if($errors->has('title')): ?> has-error <?php endif; ?>">
				  <label class="control-label" for="title">Denumire furnizor</label>
					<input id="title" name="title" type="text" placeholder="" class="form-control input-md"  value="<?php echo e($furnizor->title); ?>">
				</div>
				<div class="col-md-12 form-group">
					<label class="control-label" for="category">Selecteaza o categorie</label>
					<select id="category" name="category[]" class="form-control">
						<option value="">Alege categorie</option>
						<?php foreach($categorii as $categorie): ?>
						<option value="<?php echo e($categorie->id); ?>" <?php if(in_array($categorie->id, old('categorii', $furnizor->categories()->lists('category_id')))): ?> selected <?php endif; ?>><?php echo e($categorie->title); ?></option>
						<?php endforeach; ?>
					</select>
				</div>
				<div class="col-md-12 form-group" id="filtru">
				</div>
				<div class="col-md-12 form-group">
                <textarea name="editor1"><?php echo e($furnizor->description); ?></textarea>
                <script>
                    CKEDITOR.replace( 'editor1' );
                </script>
                </div>
				<div class="form-group">
					<label >Locatia <span class="required">*</span></label>
					<input type="text" name="city" id="searchmap" value="" class="form-control gmap_input" placeholder="Introduceti adresa">
						<input type="hidden" class="form-control input-sm" name="lat" id="lat">
						<input type="hidden" class="form-control input-sm" name="lng" id="lng">
					<div id="map-canvas" style="width: 100%;    margin-top: 15px;height: 250px;"></div>
					<input type="hidden" class="form-control input-sm" name="lat" id="lat">
					<input type="hidden" class="form-control input-sm" name="lng" id="lng">
				</div>
				<p class="description">Mutati punctul pe harta in locatia dorita</p>
                <!-- Button -->
                <div class="form-group">
                  <label class="col-md-4 control-label" for="submit"></label>
                  <div class="col-md-4">
                    <button id="submit" name="submit" class="btn btn-primary">Adauga</button>
                  </div>
                </div>
              </div>

            
          </div>
        </div>
      </div>
	    <div class="col-md-4 profile-dashboard">
			<div class="bg-white pinside40 mb30">
				<div class="row">
					<div class="col-md-12 dashboard-form calender">
						<div class="col-md-12 form-group <?php if($errors->has('country')): ?> has-error <?php endif; ?>">
							<label class="control-label" for="country">Judet</label>
							<select id="country" name="country" class="form-control">
							<option value="">Alege judet</option>
							<?php foreach($judete as $judet): ?>
							<option value="<?php echo e($judet->name); ?>" <?php if(old('judet') == $judet->name): ?> selected <?php endif; ?>><?php echo e($judet->name); ?></option>
							<?php endforeach; ?>
							</select>
						</div>
						<div class="col-md-12 form-group">
							<label class="control-label" for="city">Oras</label>
							<select id="city" name="city2" class="form-control">
							
							</select>
						</div>
						<div class="col-md-12 form-group <?php if($errors->has('adress')): ?> has-error <?php endif; ?>">
						  <label class="control-label" for="adress">Adresa</label>
							<input id="adress" name="adress" type="text" placeholder="" class="form-control input-md"  value="<?php echo e($furnizor->adress); ?>">
						</div>
						<div class="col-md-12  form-group <?php if($errors->has('telephone1')): ?> has-error <?php endif; ?>">
						  <label class="control-label" for="telephone1">Telefon 1</label>
							<input id="telephone1" name="telephone1" type="text" placeholder="" class="form-control input-md"  value="<?php echo e($furnizor->telephone1); ?>">
						</div>
						<div class="col-md-12  form-group <?php if($errors->has('telephone2')): ?> has-error <?php endif; ?>">
						<label class="control-label" for="telephone2">Telefon 2</label>
							<input id="telephone2" name="telephone2" type="text" placeholder="" class="form-control input-md"  value="<?php echo e($furnizor->telephone2); ?>">
						</div>
						<div class="col-md-12 form-group <?php if($errors->has('website')): ?> has-error <?php endif; ?>">
						  <label class="control-label" for="website">Website</label>
						  <div class="input-group">
							<span class="input-group-addon">http://</span>
							<input id="website" name="website" type="text" placeholder="" class="form-control input-md" value="<?php echo e($furnizor->webpage); ?>">
						   </div>
					   </div>
					</div>
				</div>
			</div>
		</form>	   
	  </div>
	  </div>
    </div>
  </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('bottom_scripts'); ?>
<script type="text/javascript">	
$(document).ready(function() {	
	$('#category').on('change', function(e) {			
		var cat_id = e.target.value;
		$.get('ajax-filtru?cat_id=' +cat_id, function(data){
			$('#filtru').empty();
			$.each(data, function(index, filtruObj){
				optiuni = '<option disabled selected>Alege o optiune</option>';
				$.each(filtruObj.optiuni, function(index2, optiuniObj) {
					optiuni = optiuni+'<option value="'+optiuniObj.id+'" <?php if(old('"filtru"') == '+$filtru->optiuniObj.id+'): ?> selected="selected" <?php endif; ?>>'+optiuniObj.filters_attributes_name+'</option>'
				});
				'<label for="ad_category">Categorie<span class="required">*</span></label>'
				$('#filtru').append('<label for="ad_category">'+filtruObj.filter_name+'</label><select class="form-control" name="'+filtruObj.select_name+'" id='+filtruObj.filter_name+'>'+optiuni+'</select>');				

			});
		});
	});
});		
</script>
<script type="text/javascript">
$('#country').on('change', function(e) {
		 
	var judet_id = e.target.value;
	$('#city').empty();
	$.get('ajax-judet?judet_id=' +judet_id, function(data){		
		$.each(data, function(index, cityObj){
			$('#city').append('<option value="'+cityObj.nameCity+'" <?php if(old('"city"') == '+$city->cityObj.id+'): ?> selected="selected" <?php endif; ?>>'+cityObj.nameCity+'</option>');
		});			
	});
});
</script>
<script type="text/javascript">	

	var map = new google.maps.Map(document.getElementById('map-canvas'),{
		center:{
			lat: 46.0694,
        	lng: 23.575
		},
		zoom:6
	});
	var marker = new google.maps.Marker({
		position: {
			lat:  46.0694,
        	lng: 23.575
		},
		map: map,
		draggable: true
	});
	var searchBox = new google.maps.places.SearchBox(document.getElementById('searchmap'));
	google.maps.event.addListener(searchBox,'places_changed',function(){
		var places = searchBox.getPlaces();
		var bounds = new google.maps.LatLngBounds();
		var i, place;
		for(i=0; place=places[i];i++){
  			bounds.extend(place.geometry.location);
  			marker.setPosition(place.geometry.location); //set marker position new...
  		}
  		map.fitBounds(bounds);
  		map.setZoom(15);
	});
	google.maps.event.addListener(marker,'position_changed',function(){
		var lat = marker.getPosition().lat();
		var lng = marker.getPosition().lng();
		$('#lat').val(lat);
		$('#lng').val(lng);
	});

//$('#myForm').validator()
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>