<?php
$item = $this->item;
$arrTitle = explode(' ', $item->address);
$arrTitle = array_slice($arrTitle, 0, 3);
$char = "";
foreach ($arrTitle as $text) {
	$char .= substr($text, 0, 1);
}
$char = strtoupper($char);
?>
<div class="wrapper-location-item" data-location_id="<?php esc_html_e($item->id); ?>">
    <div class="wrapper-location-content">
        <input type="checkbox"  class="delete-location" name="list_delete_location_id[]" value="<?php esc_html_e($item->id); ?>" style="display: none" />
        <span class="checkmark"></span>
        <div class="location-item-image pull-left">
            <img class="image-cover" src="<?php esc_html_e($item->map_image); ?>" alt="location-item-image" />
        </div>
        <div class="location-item-content pull-left">
            <div class="location-item-avatar">
                <img src="<?php esc_html_e(Factory::getRootUrlPlugin() . $item->image_location_avatar)  ?>" alt="location-item-image" class="img-location" style="<?php $item->image_location_avatar == null ? 'display:none' : '' ?>" />
                <span><?php esc_html_e($item->image_location_avatar == null ? $char : '','wpbookingpro')  ?></span>
            </div>
            <div class="location-item-content-right">
                <h3><?php esc_html_e($item->name) ?></h3>
                <p>
                    <span><img src="<?php esc_attr_e(Factory::getRootUrlPlugin() . 'upload/locations/icon/icon.png','wpbookingpro')  ?>" alt="gps" /></span>
                    <span><?php esc_html_e($item->address) ?></span>
                </p>
            </div>
            <button class="btn btn-primary btn-location-edit" data-id="<?php esc_html_e($item->id); ?>">
                <i class="fas fa-edit"></i><span><?php esc_attr_e('Edit','wpbookingpro') ?></span>
            </button>
        </div>
    </div>
</div>
