

		 {!! Form::open(array('url'=>'sections/savepublic', 'class'=>'form-vertical','files' => true , 'parsley-validate'=>'','novalidate'=>' ')) !!}

	@if(Session::has('messagetext'))
	  
		   {!! Session::get('messagetext') !!}
	   
	@endif
	<ul class="parsley-error-list">
		@foreach($errors->all() as $error)
			<li>{{ $error }}</li>
		@endforeach
	</ul>		


<div class="sbox1"><div class="col-md-6">
						<fieldset class="sbox" style="border-top:0; border-radius: 5px;"><legend> Content Section</legend>
				<?php if( !isset($row['id']))  $row['id'] = null;   ?>
		<input  type='hidden' name='id' id='id' value='{{$row['id']}}' />
									
									  <div class="form-group  depen-  wrap-code  " >
										<label for="ipt" class=" control-label "> Section Code  <span class="asterix"> * </span>  </label>
										<a class="adtip" data-toggle="tooltip" data-placement="bottom" title="Developer Purpose"><i class="fa fa-info-circle"></i></a>
										
										  <?php if( !isset($row['code']))  $row['code'] = null;   ?>
		<input  type='text' name='code' id='code' value='{{ $row['code'] }}' 
						required       class='form-control input-sm ' /> 						
									  </div> 					
									  <div class="form-group  depen-  wrap-name  " >
										<label for="ipt" class=" control-label "> Name    </label>
										
										
										  <?php if( !isset($row['name']))  $row['name'] = null;   ?>
		<input  type='text' name='name' id='name' value='{{ $row['name'] }}' 
						       class='form-control input-sm ' /> 						
									  </div> 					
									  <div class="form-group  depen-  wrap-title  " >
										<label for="ipt" class=" control-label "> Title  <span class="asterix"> * </span>  </label>
										
										
										  <?php if( !isset($row['title']))  $row['title'] = null;   ?>
		 <?php $val = json_decode($row['title']); $is_first = true; ?>	
				<ul class='editor-nav nav nav-tabs'>

				@foreach(explode(',', config('website.cnf_langs')) as $ilang )<li class='{{$is_first ? "active" : null}} '><a  href='#title_{{$ilang}}_{{$curTime}}' data-toggle='tab'>{{$ilang}}</a></li>
				<?php  $is_first = false;?>
				@endforeach </ul>
				
				<div class="tab-content ">
				<?php $is_first = true; ?>
				@foreach(explode(',', config('website.cnf_langs')) as $ilang )
				<div class='tab-pane tab_{{$ilang}}  {{$is_first ? "active" : null}}' id='title_{{$ilang}}_{{$curTime}}'>
				<input  type='text' name="title[{{$ilang}}]" id='title' value='{{   isset($val->{$ilang}) ? $val->{$ilang} : ''   }}' 
						required  placeholder='Title - {{$ilang}}'     class='form-control input-sm ' />
						</div>
						<?php  $is_first = false;?>
						@endforeach
						</div>
						 						
									  </div> 					
									  <div class="form-group  depen-  wrap-subtitle  " >
										<label for="ipt" class=" control-label "> Subtitle    </label>
										
										
										  <?php if( !isset($row['subtitle']))  $row['subtitle'] = null;   ?>
		 <?php $val = json_decode($row['subtitle']); $is_first = true; ?>	
				<ul class='editor-nav nav nav-tabs'>

				@foreach(explode(',', config('website.cnf_langs')) as $ilang )<li class='{{$is_first ? "active" : null}} '><a  href='#subtitle_{{$ilang}}_{{$curTime}}' data-toggle='tab'>{{$ilang}}</a></li>
				<?php  $is_first = false;?>
				@endforeach </ul>
				
				<div class="tab-content ">
				<?php $is_first = true; ?>
				@foreach(explode(',', config('website.cnf_langs')) as $ilang )
				<div class='tab-pane tab_{{$ilang}} {{$is_first ? "active" : null}}' id='subtitle_{{$ilang}}_{{$curTime}}'>
				
				<textarea name="subtitle[{{$ilang}}]" rows='5' id='subtitle' class='form-control input-sm '  
				             >{{   isset($val->{$ilang}) ? $val->{$ilang} : ''   }}</textarea>
				
				
						</div>
						<?php  $is_first = false;?>
						@endforeach
						</div>
						 						
									  </div></fieldset>
			</div>
			
			<div class="col-md-6">
						<fieldset class="sbox" style="border-top:0; border-radius: 5px;"><legend> Additional Details</legend>
									
									  <div class="form-group  depen-  wrap-image  " >
										<label for="ipt" class=" control-label "> Image    </label>
										
										
										  <?php if( !isset($row['image']))  $row['image'] = null;   ?>
		<input  type='hidden' name='image' id='image' value='{{ $row['image'] }}' class='image    form-control input-sm '    />

							
                <button class='btn btn-primary mr-5' data-type='mediaUpload' data-target='.image' type='button'>Choose file</button>
				<button class='btn btn-danger unUploadImage' data-type='mediaUnUpload' data-target='image' type='button'>Remove File</button>
            
			
							<div class='image_preview'></div>
							<div class='imagePreview'>
					 	<div class='img-preview'>
						{!! SiteHelpers::showUploadedFile($row['image'],'/uploads/images/section') !!}
						
						</div>					
						</div>					
					 						
									  </div> 					
									  <div class="form-group  depen-  wrap-pageID  " >
										<label for="ipt" class=" control-label "> Page    </label>
										
										
										  <?php if( !isset($row['pageID']))  $row['pageID'] = null;   ?>
		 
					<?php $row['pageID'] = trim($row['pageID'],'[]'); ?>

					 <select name='pageID' rows='5' id='pageID' class='select2 '  data-placeholder='Select Page'   placeholder='Select Page'      ></select> 						
									  </div> 					
									  <div class="form-group  depen-  wrap-btn_title  " >
										<label for="ipt" class=" control-label "> Button Title    </label>
										
										
										  <?php if( !isset($row['btn_title']))  $row['btn_title'] = null;   ?>
		 <?php $val = json_decode($row['btn_title']); $is_first = true; ?>	
				<ul class='editor-nav nav nav-tabs'>

				@foreach(explode(',', config('website.cnf_langs')) as $ilang )<li class='{{$is_first ? "active" : null}} '><a  href='#btn_title_{{$ilang}}_{{$curTime}}' data-toggle='tab'>{{$ilang}}</a></li>
				<?php  $is_first = false;?>
				@endforeach </ul>
				
				<div class="tab-content ">
				<?php $is_first = true; ?>
				@foreach(explode(',', config('website.cnf_langs')) as $ilang )
				<div class='tab-pane tab_{{$ilang}}  {{$is_first ? "active" : null}}' id='btn_title_{{$ilang}}_{{$curTime}}'>
				<input  type='text' name="btn_title[{{$ilang}}]" id='btn_title' value='{{   isset($val->{$ilang}) ? $val->{$ilang} : ''   }}' 
						  placeholder='Button Title - {{$ilang}}'     class='form-control input-sm ' />
						</div>
						<?php  $is_first = false;?>
						@endforeach
						</div>
						 						
									  </div> 					
									  <div class="form-group  depen-  wrap-btn_link  " >
										<label for="ipt" class=" control-label "> Button Link    </label>
										
										
										  <?php if( !isset($row['btn_link']))  $row['btn_link'] = null;   ?>
		<input  type='text' name='btn_link' id='btn_link' value='{{ $row['btn_link'] }}' 
						       class='form-control input-sm ' /> 						
									  </div> </fieldset>
			</div>
			
			
		</div>
		
		

			<div style="clear:both"></div>	
				
					
				  <div class="form-group">
					<label class="col-sm-4 text-right">&nbsp;</label>
					<div class="col-sm-8">	
					<button type="submit" name="apply" class="btn btn-info btn-sm" ><i class="fa  fa-check-circle"></i> {{ Lang::get('core.sb_apply') }}</button>
					<button type="submit" name="submit" class="btn btn-primary btn-sm" ><i class="fa  fa-save "></i> {{ Lang::get('core.sb_save') }}</button>
				  </div>	  
			
		</div> 
		 <input type="hidden" name="action_task" value="public" />
		 {!! Form::close() !!}
		 
   <script type="text/javascript">
	$(document).ready(function() { 
		
		
		$("#pageID").jCombo("{!! url('/manage/sections/comboselect?filter=pages:pageID:slug&values='.$row["pageID"]) !!}",
		{  selected_value : '{{ $row["pageID"] }}' });
		 

		$('.removeCurrentFiles').on('click',function(){
			var removeUrl = $(this).attr('href');
			$.get(removeUrl,function(response){});
			$(this).parent('div').empty();	
			return false;
		});		
		
	});
	</script>		 
