Origin commit

This commit is contained in:
Hoang Huu
2019-09-10 11:27:33 +07:00
commit 499e068e4f
844 changed files with 188705 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$rowcls = apply_filters( 'opalestate_row_container_class', 'opal-row' );
$slocation = isset( $_GET['location'] ) ? sanitize_text_field( $_GET['location'] ) : opalestate_get_session_location_val();
$stypes = isset( $_GET['types'] ) ? sanitize_text_field( $_GET['types'] ) : -1;
?>
<div class="ajax-map-search full-width">
<div class="inner">
<div class="ajax-search-form">
<form id="opalestate-search-form" class="opalestate-search-form" method="get">
<div class="<?php echo $rowcls; ?>">
<div class="col-lg-3 col-sm-3">
<input class="form-control" name="search_text">
</div>
<div class="col-lg-2 col-sm-3">
<?php Opalestate_Taxonomy_Location::dropdown_list( $slocation ); ?>
</div>
<div class="col-lg-2">
<?php Opalestate_Taxonomy_Type::dropdown_list( $stypes ); ?>
</div>
<div class="col-lg-2">
<button type="submit" class="btn btn-danger btn-sm btn-search">
<?php esc_html_e( 'Search', 'opalestate-pro' ); ?>
</button>
</div>
</div>
</form>
</div>
<hr>
<div class="<?php echo esc_attr( $rowcls ); ?>">
<div class="col-lg-6 col-md-6">
<div class="opalesate-properties-ajax opalesate-properties-results" data-mode="html">
<?php echo opalestate_load_template_path( 'shortcodes/ajax-map-search-result' ); ?>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div id="opalestate-map-preview" style="height:500px;" data-page="<?php echo esc_attr( $paged ); ?>">
<div id="mapView">
<div class="mapPlaceholder">
<div class="sk-folding-cube">
<div class="sk-cube1 sk-cube"></div>
<div class="sk-cube2 sk-cube"></div>
<div class="sk-cube4 sk-cube"></div>
<div class="sk-cube3 sk-cube"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,75 @@
<?php
$list_layout = 'content-property-' . opalestate_get_option( 'property_archive_list_layout', 'list' );
$grid_layout = 'content-property-' . opalestate_get_option( 'property_archive_grid_layout', 'grid' );
if ( ! class_exists( 'OpalEstate_Search' ) ) {
return;
}
$query = OpalEstate_Search::get_search_results_query();
$show = ( isset( $_GET['display'] ) && $_GET['display'] == 'list' ) || ( opalestate_options( 'displaymode', 'grid' ) == 'list' ) || ( isset( $style ) && $style == 'list' ) ? 'list' : 'grid';
?>
<div class="opaleslate-ajax-search-results-container">
<div class="opalesate-archive-top">
<div class="<?php echo apply_filters( 'opalestate_row_container_class', 'opal-row' ); ?>">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="opalestate-results">
<?php if ( $query->found_posts ): ?>
<span><?php echo sprintf( esc_html__( 'Found %s Properties', 'opalestate-pro' ), $query->found_posts ); ?></span>
<?php endif; ?>
<div class="pull-right"> <?php echo opalestate_load_template_path( 'user-search/render-form' ); ?> </div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
<div class="opalestate-sortable">
<?php echo opalestate_render_sortable_dropdown(); ?>
</div>
<?php opalestate_show_display_modes( 'grid' ); ?>
</div>
</div>
</div>
<div class="opalesate-archive-bottom opalestate-rows opalestate-collection">
<?php if ( $query->have_posts() ): ?>
<div class="<?php echo apply_filters( 'opalestate_row_container_class', 'opal-row' ); ?>">
<?php if ( $show == 'list' ): ?>
<?php $cnt = 0;
while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="col-lg-12 col-md-12 col-sm-12" data-related="map" data-id="<?php echo $cnt++; ?>">
<?php echo opalestate_load_template_path( $list_layout ); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<?php
$column = isset( $column ) ? $column : apply_filters( 'opalestate_properties_column_row', 3 );
$layout = isset( $style ) ? 'content-property-' . $style : $grid_layout;
$clscol = floor( 12 / $column );
$cnt = 0;
while ( $query->have_posts() ) : $query->the_post();
$cls = '';
if ( $cnt++ % $column == 0 ) {
$cls .= ' first-child';
}
?>
<div class="<?php echo $cls; ?> col-lg-<?php echo esc_attr( $clscol ); ?> col-md-<?php echo esc_attr( $clscol ); ?> col-sm-6" data-related="map" data-id="<?php echo
esc_attr( $cnt - 1 );
?>">
<?php echo opalestate_load_template_path( $layout ); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php else: ?>
<?php echo opalestate_load_template_path( 'content-no-results' ); ?>
<?php endif; ?>
</div>
</div>
<?php if ( $query->max_num_pages > 1 ): ?>
<div class="w-pagination"><?php opalestate_pagination( $query->max_num_pages ); ?></div>
<?php endif; ?>
<?php
wp_reset_postdata();

View File

@@ -0,0 +1,119 @@
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$rowcls = apply_filters( 'opalestate_row_container_class', 'opal-row' );
$slocation = isset( $_GET['location'] ) ? sanitize_text_field( $_GET['location'] ) : opalestate_get_session_location_val();
$stypes = isset( $_GET['types'] ) ? sanitize_text_field( $_GET['types'] ) : -1;
$sstatus = isset( $_GET['status'] ) ? sanitize_text_field( $_GET['status'] ) : -1;
$search_min_price = isset( $_GET['min_price'] ) ? sanitize_text_field( $_GET['min_price'] ) : opalestate_options( 'search_min_price', 0 );
$search_max_price = isset( $_GET['max_price'] ) ? sanitize_text_field( $_GET['max_price'] ) : opalestate_options( 'search_max_price', 10000000 );
$showareasize = opalestate_options( OPALESTATE_PROPERTY_PREFIX . 'areasize_opt', 1 );
$showprice = opalestate_options( OPALESTATE_PROPERTY_PREFIX . 'price_opt', 1 );
$fields = OpalEstate_Search::get_setting_search_fields( '_v' );
?>
<div class="ajax-map-search full-width">
<div class="inner">
<div class="ajax-search-form" data-parent=".ajax-map-search">
<div class="<?php echo $rowcls; ?>">
<form id="opalestate-search-form" class="opalestate-search-form ajax-form" method="get">
<div class="col-lg-2 col-md-3 col-sm-4 ajax-change">
<?php Opalestate_Taxonomy_Status::dropdown_list( $sstatus ); ?>
</div>
<div class="col-lg-2 col-md-3 col-sm-4 ajax-change">
<?php Opalestate_Taxonomy_Location::dropdown_list( $slocation ); ?>
</div>
<div class="col-lg-2 col-md-3 col-sm-4 ajax-change">
<?php Opalestate_Taxonomy_Type::dropdown_list( $stypes ); ?>
</div>
<input type="hidden" name="paged" value="1">
</form>
<form id="opalestate-more-search-form" class="opalestate-more-search-form pull-left" method="get">
<div class="opalestate-popup">
<div class="popup-head"><span><?php esc_html_e( 'More', 'opalestate-pro' ); ?></span><i class="fa"></i></div>
<div class="popup-body">
<div class="popup-close"><i class="fa fa-times" aria-hidden="true"></i></div>
<div class="ajax-advanded-search">
<?php if ( $fields ): ?>
<?php foreach ( $fields as $key => $label ): ?>
<div class="form-group">
<label><?php echo $label; ?></label>
<?php opalestate_property_render_field_template( $key, esc_html__( "Any", 'opalestate-pro' ) ); ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php if ( $showprice ): ?>
<div class="form-group">
<div class="cost-price-content">
<?php
$data = [
'id' => 'price',
'unit' => opalestate_currency_symbol() . ' ',
'ranger_min' => opalestate_options( 'search_min_price', 0 ),
'ranger_max' => opalestate_options( 'search_max_price', 10000000 ),
'input_min' => $search_min_price,
'decimals' => opalestate_get_price_decimals(),
'input_max' => $search_max_price,
];
opalesate_property_slide_ranger_template( esc_html__( "Price:", 'opalestate-pro' ), $data );
?>
</div>
</div>
<?php endif; ?>
<?php if ( $showareasize ): ?>
<div class="form-group">
<div class="area-range-content">
<?php opalestate_property_areasize_field_template(); ?>
</div>
</div>
<?php endif; ?>
<button type="submit" class="btn btn-danger btn-sm btn-search btn-3d btn-block">
<?php esc_html_e( 'Apply', 'opalestate-pro' ); ?>
</button>
</div>
</div>
</div>
</form>
<div class="col-lg-1 col-md-2 col-sm-3 col-xs-12">
<?php echo opalestate_load_template_path( 'user-search/render-form' ); ?>
</div>
<div class="col-lg-3 col-md-5 col-sm-6 col-xs-12">
<?php do_action( 'opalestate_before_render_search_properties_result' ); ?>
</div>
</div>
</div>
</div>
<hr>
<div class="<?php echo esc_attr( $rowcls ); ?>">
<div class="col-lg-6 col-md-12">
<div class="opalesate-properties-ajax opalesate-properties-results" data-mode="html">
<?php echo opalestate_load_template_path( 'shortcodes/ajax-map-search-result' ); ?>
</div>
</div>
<div class="col-lg-6 col-md-12">
<div class="opalestate-sticky" data-parent=".ajax-map-search">
<div id="opalestate-map-preview" style="min-height:800px;" data-page="<?php echo esc_attr( $paged ); ?>">
<div id="mapView">
<div class="mapPlaceholder">
<div class="sk-folding-cube">
<div class="sk-cube1 sk-cube"></div>
<div class="sk-cube2 sk-cube"></div>
<div class="sk-cube4 sk-cube"></div>
<div class="sk-cube3 sk-cube"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,44 @@
<?php
$query = OpalEstate_Search::get_search_agents_query();
if ( ! isset( $colum ) ) {
$colum = 4;
}
$colum = apply_filters( 'opalestate_agent_grid_column', $colum );
?>
<div class="search-agents-wrap">
<?php echo opalestate_load_template_path( 'parts/search-agents-form' ); ?>
<?php if ( $query->have_posts() ): ?>
<div class="agents-container">
<div class="agents-head">
<div class="agent-result">
<h3><?php echo sprintf( esc_html__( 'Found %s Agents', 'opalestate-pro' ), '<span class="text-primary">' . $query->found_posts . '</span>' ) ?></h3>
</div>
<div class="display-mode">
<?php opalestate_show_display_modes(); ?>
</div>
</div>
<div class="<?php echo apply_filters( 'opalestate_row_container_class', 'opal-row' ); ?>">
<?php $cnt = 0;
while ( $query->have_posts() ): $query->the_post(); ?>
<div class="col-lg-3 col-md-3 col-sm-3 <?php if ( $cnt++ % $colum == 0 ): ?>first-child<?php endif; ?>">
<?php echo opalestate_load_template_path( 'content-agent-grid' ); ?>
</div>
<?php endwhile; ?>
</div>
<?php if ( $query->max_num_pages ): ?>
<div class="w-pagination">
<?php opalestate_pagination( $query->max_num_pages ); ?>
</div>
<?php endif; ?>
</div>
<?php else: ?>
<div class="agents-results">
<?php echo opalestate_load_template_path( 'content-no-results' ); ?>
</div>
<?php endif; ?>
</div>
<?php wp_reset_postdata(); ?>

View File

@@ -0,0 +1,8 @@
<?php echo opalestate_load_template_path( 'shortcodes/search-properties' );
$display = '';
?>
<div class="container">
<div class="opalesate-properties-ajax opalesate-properties-results" data-mode="html">
<?php echo opalestate_load_template_path( 'shortcodes/ajax-map-search-result', $display ); ?>
</div>
</div>

View File

@@ -0,0 +1,73 @@
<?php
$list_layout = 'content-property-' . opalestate_get_option( 'property_archive_list_layout', 'list' );
$grid_layout = 'content-property-' . opalestate_get_option( 'property_archive_grid_layout', 'grid' );
$rowcls = apply_filters( 'opalestate_row_container_class', 'opal-row' );
if ( ! class_exists( 'OpalEstate_Search' ) ) {
return;
}
$query = OpalEstate_Search::get_search_results_query();
?>
<div class="opaleslate-container">
<div class="opalesate-archive-top">
<div class="<?php echo esc_attr( $rowcls ); ?>">
<div class="col-lg-6 col-md-6 col-sm-6">
<?php opalestate_show_display_modes(); ?>
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="opalestate-sortable pull-right">
<?php echo opalestate_render_sortable_dropdown(); ?>
</div>
</div>
</div>
</div>
<div class="opalestate-results <?php echo esc_attr( $rowcls ); ?>">
<div class="col-lg-8">
<span><?php echo sprintf( esc_html__( 'Found %s Properties', 'opalestate-pro' ), $query->found_posts ); ?> </span>
<div class="pull-right"> <?php echo opalestate_load_template_path( 'user-search/render-form' ); ?> </div>
</div>
<div class="col-lg-4 text-right">
<?php do_action( 'opalestate_before_render_search_properties_result' ); ?>
</div>
</div>
<div class="opalesate-archive-bottom opalestate-rows opalestate-collection">
<?php if ( $query->have_posts() ): ?>
<div class="<?php echo esc_attr( $rowcls ); ?>">
<?php if ( ( isset( $_GET['display'] ) && $_GET['display'] == 'list' ) || opalestate_get_display_mode( 'list' ) == 'list' ) : ?>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="col-lg-12 col-md-12 col-sm-12">
<?php echo opalestate_load_template_path( $list_layout ); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<?php
$column = isset( $$column ) ? $column : apply_filters( 'opalestate_properties_column_row', 3 );
$clscol = floor( 12 / $column );
$cnt = 0;
while ( $query->have_posts() ) : $query->the_post();
$cls = '';
$layout = isset( $style ) ? 'content-property-' . $style : $grid_layout;
if ( $cnt++ % $column == 0 ) {
$cls .= ' first-child';
}
?>
<div class="<?php echo esc_attr( $cls ); ?> col-lg-<?php echo esc_attr( $clscol ); ?> col-md-<?php echo esc_attr( $clscol ); ?> col-sm-6">
<?php echo opalestate_load_template_path( $layout ); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php else: ?>
<?php echo opalestate_load_template_path( 'content-no-results' ); ?>
<?php endif; ?>
</div>
</div>
<?php if ( $query->max_num_pages > 1 ): ?>
<div class="w-pagination"><?php opalestate_pagination( $query->max_num_pages ); ?></div>
<?php endif; ?>
<?php
wp_reset_postdata();

View File

@@ -0,0 +1,5 @@
<div class="opalestate-search-properties-v">
<div class="search-properies-form">
<?php echo opalestate_load_template_path( 'parts/search-form-v' ); ?>
</div>
</div>

View File

@@ -0,0 +1,20 @@
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<div class="opalestate-search-properties">
<div class="inner">
<div id="opalestate-map-preview" style="height:600px;" data-page="<?php echo $paged; ?>">
<div id="mapView">
<div class="mapPlaceholder">
<div class="sk-folding-cube">
<div class="sk-cube1 sk-cube"></div>
<div class="sk-cube2 sk-cube"></div>
<div class="sk-cube4 sk-cube"></div>
<div class="sk-cube3 sk-cube"></div>
</div>
</div>
</div>
</div>
<div class="search-properies-form container">
<?php OpalEstate_Search::render_horizontal_form(); ?>
</div>
</div>
</div>

View File

@@ -0,0 +1,61 @@
<?php
if ( ! function_exists( 'cmb2_get_metabox_form' ) || ! isset( $metaboxes ) ) {
return;
}
$nonce = wp_nonce_field( 'submitted-property', 'submission_action', true );
?>
<div class="property-submission-form">
<div class="box-content-inner">
<div class="metabox-fields-front space-padding-lr-40 space-padding-tb-30">
<?php if ( ! empty( $_SESSION['messages'] ) ) : ?>
<div class="opalesate_messages">
<?php foreach ( $_SESSION['messages'] as $message ) : ?>
<?php $status = isset( $message[0] ) ? $message[0] : 'success'; ?>
<?php $msg = isset( $message[1] ) ? $message[1] : ''; ?>
<div class="opalesate_message_line <?php echo esc_attr( $status ) ?>">
<?php printf( '%s', $msg ) ?>
</div>
<?php endforeach;
unset( $_SESSION['messages'] ); ?>
</div>
<?php endif; ?>
<div class="submission-heading text-center">
<?php if ( ! $post_id ) : ?>
<h1><?php esc_html_e( 'Add New Property', 'opalestate-pro' ); ?></h1>
<?php else : ?>
<h1><?php esc_html_e( 'Edit Property', 'opalestate-pro' ); ?></h1>
<?php endif; ?>
</div>
<?php do_action( 'opalestate_submission_form_before' ); ?>
<?php if ( $navigation ) : ?>
<div class="opalestate-submission-tab">
<div class="opalestate-submission-tab-head">
<?php foreach ( $navigation as $key => $value ): ?>
<?php if ( $value['status'] ) : ?>
<a href="#opalestate-submission-<?php echo esc_attr( $key ); ?>" class="tab-item">
<?php echo esc_html( $value['title'] ); ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<div class="opalestate-submission-tab-wrap">
<?php
echo cmb2_get_metabox_form( $metaboxes[ OPALESTATE_PROPERTY_PREFIX . 'front' ], $post_id, [
'form_format' => '<form action="//' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '" class="cmb-form opalestate-submission-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s<input type="submit" name="submit-cmb" value="%4$s" class="button-primary btn btn-primary btn-submit-cmb">'.$nonce.'</form>',
'save_button' => esc_html__( 'Save property', 'opalestate-pro' ),
] ); ?>
</div>
</div>
<?php endif; ?>
<?php do_action( 'opalestate_submission_form_after' ); ?>
</div>
</div>
</div>