 <style>
.autocomplete-suggestions { border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
.autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
.autocomplete-no-suggestion { padding: 2px 5px;}
.autocomplete-selected { background: #F0F0F0; }
.autocomplete-suggestions strong { font-weight: bold; color: #000; }
.autocomplete-group { padding: 2px 5px; }
.autocomplete-group strong { font-weight: bold; font-size: 16px; color: #000; display: block; border-bottom: 1px solid #000; }
.amenities_listitem{ display:flex; margin-right:10px;}
 .amenities_list {
    display: flex;
    flex-wrap: wrap;
}
 </style>
<?php defined('MW_PATH') || exit('No direct script access allowed');
 
/**
 * This file is part of the MailWizz EMA application.
 * 
 * @package MailWizz EMA
 * @author Serban George Cristian <cristian.serban@mailwizz.com> 
 * @link http://www.mailwizz.com/
 * @copyright 2013-2014 MailWizz EMA (http://www.mailwizz.com)
 * @license http://www.mailwizz.com/license/
 * @since 1.0
 */

/**
 * This hook gives a chance to prepend content or to replace the default view content with a custom content.
 * Please note that from inside the action callback you can access all the controller view
 * variables via {@CAttributeCollection $collection->controller->data}
 * In case the content is replaced, make sure to set {@CAttributeCollection $collection->renderContent} to false 
 * in order to stop rendering the default content.
 * @since 1.3.3.1
 */
$hooks->doAction('before_view_file_content', $viewCollection = new CAttributeCollection(array(
    'controller'    => $this,
    'renderContent' => true,
)));

// and render if allowed
if ($viewCollection->renderContent) {
    /**
     * This hook gives a chance to prepend content before the active form or to replace the default active form entirely.
     * Please note that from inside the action callback you can access all the controller view variables 
     * via {@CAttributeCollection $collection->controller->data}
     * In case the form is replaced, make sure to set {@CAttributeCollection $collection->renderForm} to false 
     * in order to stop rendering the default content.
     * @since 1.3.3.1
     */
    $hooks->doAction('before_active_form', $collection = new CAttributeCollection(array(
        'controller'    => $this,
        'renderForm'    => true,
    )));
    
    // and render if allowed
    if ($collection->renderForm) {
        $form = $this->beginWidget('CActiveForm',array('focus'=>array($model,Yii::app()->controller->focus))); 
        ?>
         <style>
 #EGMapContainer1{ margin:auto;}
 .jqTransformTextarea{ display:none;}
 </style>
        <div class="box box-primary">
            <div class="box-header">
                <div class="pull-left">
                    <h3 class="box-title"><span class="glyphicon glyphicon-star"></span> <?php echo $pageHeading;?></h3>
                </div>
             
                <div class="clearfix"><!-- --></div>
            </div>
            <div class="box-body">
                <?php 
                /**
                 * This hook gives a chance to prepend content before the active form fields.
                 * Please note that from inside the action callback you can access all the controller view variables 
                 * via {@CAttributeCollection $collection->controller->data}
                 * @since 1.3.3.1
                 */
                $hooks->doAction('before_active_form_fields', new CAttributeCollection(array(
                    'controller'    => $this,
                    'form'          => $form    
                )));
                ?>
          
                
                <div class="clearfix"><!-- --></div>
                  <div class="clearfix"><!-- --></div>
                  <?php
                  if($model->id)
                  {
					   $name="Edit";
				  }
				  else
				  {
					   $name="Choose";
				  }
				  ?>
                <ol class="progtrckr" data-progtrckr-steps="4">
					<li class="progtrckr-done"><?php echo $this->tag->getTag('choose-ad-type','Choose Ad Type');?></li> 
					<li class="progtrckr-done"><?php echo $this->tag->getTag('enter-details','Enter Details');?></li> 
					<li class="progtrckr-done"><?php echo $this->tag->getTag('choose-location','Choose Location');?></li>
					<li class="progtrckr-todo"><?php echo $this->tag->getTag('done','Done');?></li> 
				</ol>
                <div  class="content_place_an_ad">
					
				   <div  class="content_head" >  <?php echo $this->tag->getTag('preview','Ad Preview');?> </div>
						  
				
				  <div  style="padding:20px;">
					  
					  <div class="col-lg-8">
									<h3 class="facts_heading"><?php echo $this->tag->getTag('title_of_your_ad','Ad Title');?></h3>
									<div  class="margin-bottom-10 txto"><?php echo $model->ad_title;?></div>
									<div style="clear:both"></div>

									
									<div style="clear:both"></div>
								 <div class="propertypage_factsamenities">
   <div class="facts margin-top-10" style="margin-top: 30px;">
      <div class="facts_container">
         <h3 class="facts_heading">Facts</h3>
         <div class="facts_list">
            <div class="facts_listitem">
               <div class="facts_label">Price</div>
               <div class="facts_content">
                 <?php echo $model->PriceTitleSpan;?>
               </div>
            </div>
			<?php
			foreach($array as $k=>$fld){
			if(!empty( $fld)) { 
			?>
			<div class="facts_listitem">
               <div class="facts_label"><?php echo $model->getAttributeLabel($k);?></div>
               <div class="facts_content"><?php echo $fld;?></div>
            </div>
			<?
			}
			}
			?>
           
         </div>
      </div>
   </div>
</div>
<div class="clearfix"></div>
<div class="text-trimmer-wrapper  margin-top-20" style="margin-top: 30px;">
     <h3 class="facts_heading">Description</h3>
	<input type="text" id="asss"  style="position:absolute;left:-999999px;height:1px;visinility:hidden;"/>
	<input type="text" id="asss2"  style="position:absolute;left:-999999px;height:1px;visinility:hidden;"/>
	<div data-qs="text-trimmer"  id="txttrim" class=""  ><?php echo nl2br($model->ad_description);?></div></div>
 
<script>
function showWithoutTrim(k){
	if($('#txttrim').hasClass('texttrim-enabled')){
		$('#txttrim').removeClass('texttrim-enabled');
		$('#asss2').focus();
		$(k).html('Read Less')
	}
	else{
		$('#txttrim').addClass('texttrim-enabled');
		$('#asss').focus();
		$(k).html('Read More')
	}
}
</script>
 


<div class="clearfix"></div>
									<div class="clearfix"><!-- --></div>
									<div class="clearfix"><!-- --></div>
									
									<?php
									
									if(!empty( $model->amenities)){
									$amentites = $model->all_amentitie_from_array( $model->amenities);	
								    ?>                     
									<div class="propertypage_factsamenities margin-top-20">
									<div class="amenities">
									<div class="amenities_container">
									<h3 class="amenities_heading">Amenities</h3>
									<div class="amenities_list">
									<?php
									foreach($amentites as $k=>$v){ ?> 
									<div class="amenities_listitem">
									<i class="fa fa-check amenities_icon"></i>
									<div class="amenities_content"><?php echo $v->amenities_name;?></div>
									</div>
									<?php } ?> 
									</div>
									</div>
									</div>
									</div>
									<?php } ?> 
									<div class="clearfix"><!-- --></div>
									
									 	<?php 
									if(!empty($image_array) )
									{

									?>
									<div class="homeDetailsHeading margin-top-20" style="margin-top:20px;">
									<span class="h5 prm backgroundBasic"><?php echo $this->tag->getTag('map','Images');?> &nbsp;&nbsp;[ <small style="text-transform:initial;color: red;font-size: 13px;">Change Position by drag</small> ]</span>
									</div>	
									<div class="property_img_box" style="margin-bottom:20px;position:relative;">
									<ul class="sortableList">   
									<?php
									$image = "";
									foreach($image_array as $k=>$v)
									{
									$image .= ",".$v;
									?>
									 <li class="ui-state-default" data-image="<?php echo $v;?>" ><div id="property_img_<?php echo $k;?>" class="property_img">
									<div  style="background-image:url(<?php echo Yii::app()->apps->getBaseUrl('uploads/images/'.@$v) ?>);backgroundiposition:center;background-size:cover;background-repeat:no-repeat;width:90px;height:90px;"></div>
									<div class="property_img_overlay">
								 
											<a class="btn btn-danger btn-small" onclick="delete_preview_image2(this);">
											<span class="isw-delete2 fa fa-trash" style="margin-right: 0px;color:#fff"></span>
											</a>
											</div>
									</div>
									
									</li>
									<?
									}
									?>
								 
									
									 </ul>
									 <div class="ove" id="ove"></div>
								
									<div class="clearfix"><!-- --></div>
									
									</div>
									<?php } ?> 
						</div>
						<div class="col-lg-4 margin-top-0">
						<h3 class="facts_heading">MAP</h3>
						<div  class=""><?php $this->renderPartial('root.apps.backend.views.offplan._detail_map_view');?></div>
						<div class="clearfix"><!-- --></div>
						</div>
						<div class="clearfix"><!-- --></div>
						<p class="smf">
				By clicking '<b>Go To Next</b>' you agree that the above information is correct and you are not submit wrong documents against your id or property deeds .
				</p> 
				 </div>
                <div class="clearfix"><!-- --></div>
                
                     <?php $this->renderPartial('root.apps.backend.views.offplan._hidden_fields',compact('form'));?>
					  
				 
 					
				</div>	
				
				<div class="clearfix"></div> 
				</div>	 
                <div class="box-footer"  style="position:relative;">
				<div class="ove"></div>
				<div class="clearfix"><!-- --></div>
                <div class="pull-right">
					<?php
					if($model->isNewRecord){ ?> 
					<a href="<?php echo Yii::app()->createUrl($this->id.'/create',array('pot'=>$pot));?>" style="background: #eee;color: #000;" class="btn2 btn-default btn-submit pull-left margin-right-5" data-loading-text="<?php echo Yii::t('app', 'Please wait, processing...');?>"><?php echo $this->tag->getTag('go-back','Go Back');?></a>
					<?php } 
					else{
						?>
						<a href="<?php echo Yii::app()->createUrl($this->id.'/update',array('id'=>$model->primaryKey,'pot'=>$pot));?>" style="background: #eee;color: #000;" class="btn2 btn-default btn-submit pull-left margin-right-5" data-loading-text="<?php echo Yii::t('app', 'Please wait, processing...');?>"><?php echo $this->tag->getTag('go-back','Go Back');?></a>
					
						<?
					}
					
					?> 
                    <button type="submit"  class="btn btn-primary btn-submit" style="padding: 9px 20px;color:#fff" data-loading-text="<?php echo Yii::t('app', 'Please wait, processing...');?>"><?php echo $this->tag->getTag('go-to-next','Go to Next');?></button>
                </div>
                <div class="clearfix"><!-- --></div>
            </div>
            </div>
            <style>
            div.property_img_box div.property_img{ width:100px !important; height:100px !important; line-height:100px;}
            
            </style>
         
        <?php 
        $this->endWidget(); 
    }
    /**
     * This hook gives a chance to append content after the active form.
     * Please note that from inside the action callback you can access all the controller view variables 
     * via {@CAttributeCollection $collection->controller->data}
     * @since 1.3.3.1
     */
    $hooks->doAction('after_active_form', new CAttributeCollection(array(
        'controller'      => $this,
        'renderedForm'    => $collection->renderForm,
    )));
}
/**
 * This hook gives a chance to append content after the view file default content.
 * Please note that from inside the action callback you can access all the controller view
 * variables via {@CAttributeCollection $collection->controller->data}
 * @since 1.3.3.1
 */
$hooks->doAction('after_view_file_content', new CAttributeCollection(array(
    'controller'        => $this,
    'renderedContent'   => $viewCollection->renderContent,
)));
?> 
<style>
.facts_listitem{ height:35px !important; }
.facts_label,span.pri{ font-size:14px;}
.facts_content{ font-size:14px;font-weight: 600;}
</style>
<style>
.sortableList{ list-style-type:none;margin:0;padding:0;  cursor: move }
.sortableList li { width: auto; float:left; }
.ove{  position: absolute; 	background: rgba(255,255,255, 0.9); 	left: 0; 	right: 0; 	bottom: 0; top: 0; 	z-index:234234234234; display:none;   }
</style>
<script>
var myVar;
var pot = '<?php echo $pot;?>'
var sort_url = '<?php echo Yii::app()->createUrl('place_an_ad/chnimge');?>';
$(document).ready(function () {										 
sortable();									 

});
</script>
