Big fixes

This commit is contained in:
Hoang Huu
2020-05-04 15:53:09 +07:00
parent 453e78da8b
commit b4db533574
24 changed files with 4837 additions and 4697 deletions

View File

@@ -66,7 +66,7 @@ $agent = new OpalEstate_Agent();
<?php $fax = $agent->get_meta( 'fax' ); ?>
<?php if ( ! empty( $fax ) ) : ?>
<div class="agent-box-fax">
<i class="fa fa-fax"></i><span><?php echo esc_attr( $fax ); ?></span>
<i class="fa fa-fax"></i><span><?php echo esc_html( $fax ); ?></span>
</div>
<?php endif; ?>
@@ -117,4 +117,4 @@ $agent = new OpalEstate_Agent();
</div><!-- /.agent-box-content -->
</div>
</div>
</article>
</article>

View File

@@ -74,7 +74,7 @@ if ( $agent_id ) {
<div class="agent-box-email">
<i class="fa fa-envelope"></i>
<a href="mailto:<?php echo esc_attr( $email ); ?>">
<span><?php echo esc_attr( $email ); ?></span>
<span><?php echo esc_html( $email ); ?></span>
</a>
</div>
<?php endif; ?>
@@ -84,7 +84,7 @@ if ( $agent_id ) {
<div class="agent-box-phone">
<i class="fa fa-phone"></i>
<a href="tel:<?php echo sanitize_title( $phone ); ?>">
<span><?php echo esc_attr( $phone ); ?></span>
<span><?php echo esc_html( $phone ); ?></span>
</a>
</div>
<?php endif; ?>
@@ -94,7 +94,7 @@ if ( $agent_id ) {
<div class="agent-box-mobile">
<i class="fa fa-mobile"></i>
<a href="tel:<?php echo sanitize_title( $mobile ); ?>">
<span><?php echo esc_attr( $mobile ); ?></span>
<span><?php echo esc_html( $mobile ); ?></span>
</a>
</div>
<?php endif; ?>
@@ -102,7 +102,7 @@ if ( $agent_id ) {
<?php $fax = $agent->get_meta( 'fax' ); ?>
<?php if ( ! empty( $fax ) ) : ?>
<div class="agent-box-fax">
<i class="fa fa-fax"></i><span><?php echo esc_attr( $fax ); ?></span>
<i class="fa fa-fax"></i><span><?php echo esc_html( $fax ); ?></span>
</div>
<?php endif; ?>
@@ -111,7 +111,7 @@ if ( $agent_id ) {
<div class="agent-box-web">
<i class="fa fa-globe"></i>
<a href="<?php echo esc_attr( $web ); ?>" rel="nofollow" target="_blank">
<span><?php echo esc_attr( $web ); ?></span>
<span><?php echo esc_html( $web ); ?></span>
</a>
</div>
<?php endif; ?>
@@ -145,4 +145,4 @@ if ( $agent_id ) {
</div><!-- /.agent-box-content -->
</div>
</div>
</article>
</article>

View File

@@ -26,19 +26,17 @@ wp_localize_script( 'opalestate-scripts', 'opalestate_mortgage',
]
);
$max_price = intval( $property && $property->get_price() ) ? $property->get_price() : opalestate_options( 'search_max_price', 10000000 );
$max_price = str_replace( ",", "", $max_price );
$max_price = str_replace( ".", "", $max_price );
$max_price = (int) ( $property && $property->get_price() ) ? $property->get_price() : opalestate_options( 'search_max_price', 10000000 );
$max_price = str_replace( [ ",", "." ], "", $max_price );
$start_price = $max_price;
$max_price = $max_price + ( $max_price * 20 / 100 );
$max_price = apply_filters( 'opalestate_mortgage_max_price', $max_price + ( $max_price * 20 / 100 ) );
$rate_start = 10;
$rate_start = apply_filters( 'opalestate_mortgage_rate_start', 10 );
$interest_rate_start = $rate_start / 100;
$years_start = 2;
$deposit_start = $max_price / 2;
$years_start = apply_filters( 'opalestate_mortgage_years_start', 2 );
$deposit_start = apply_filters( 'opalestate_mortgage_deposit_start', $max_price / 2 );
$loan_amount = $max_price - $deposit_start;
$interest_rate_month = $interest_rate_start / 12;
$number_of_payments_month = $years_start * 12;
@@ -97,7 +95,7 @@ $data_years = [
'step' => 0.5,
];
if ( opalestate_options( 'currency_position', 'before' ) == 'before' ) {
if ( opalestate_options( 'currency_position', 'before' ) === 'before' ) {
$data_sale_price['unit_position'] = 'prefix';
$data_deposit['unit_position'] = 'prefix';
}

View File

@@ -106,7 +106,7 @@ $address = $agency->get_meta( 'address' ); ?>
<?php $mobile = get_post_meta( $id, OPALESTATE_AGENCY_PREFIX . 'mobile', true ); ?>
<?php if ( ! empty( $mobile ) ) : ?>
<div class="agency-box-mobile">
<i class="fa fa-mobile"></i><span><a href="tel:<?php echo esc_attr( $phone ); ?>"><?php echo esc_attr( $mobile ); ?></a></span>
<i class="fa fa-mobile"></i><span><a href="tel:<?php echo esc_attr( $mobile ); ?>"><?php echo esc_html( $mobile ); ?></a></span>
</div><!-- /.agency-box-phone -->
<?php endif; ?>

View File

@@ -62,7 +62,7 @@ $agent = new OpalEstate_Agent();
<div class="agent-box-mobile">
<i class="fa fa-mobile"></i>
<a href="tel:<?php echo sanitize_title( $mobile ); ?>">
<span><?php echo esc_attr( $mobile ); ?></span>
<span><?php echo esc_html( $mobile ); ?></span>
</a>
</div>
<?php endif; ?>

View File

@@ -1,4 +1,4 @@
<?php
<?php
if( !isset($id) ){
$id = get_the_ID();
}
@@ -20,7 +20,7 @@
<?php if( $type =='agency'): ?>
<div class="agent-preview has-avatar"><a href="<?php echo esc_url($link); ?>">
<?php if ( has_post_thumbnail( $id ) ) : ?>
<?php echo get_the_post_thumbnail( $id, 'full' ); ?>
<?php echo get_the_post_thumbnail( $id, 'full' ); ?>
<?php endif; ?>
<img src="<?php echo esc_url($avatar);?> " class="agent-avatar"></a>
@@ -29,13 +29,13 @@
<i class="fas fa-star"></i>
</span>
<?php endif; ?>
</div>
<?php else : ?>
<div class="agent-preview"><a href="<?php echo esc_url($link); ?>">
<img src="<?php echo esc_url($avatar);?> " class="agent-avatar"></a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<div class="agent-box-meta">
<h4 class="agent-box-title">
@@ -50,7 +50,7 @@
<div class="agent-box-email">
<i class="fa fa-envelope"></i>
<a href="mailto:<?php echo esc_attr( $email ); ?>">
<span><?php echo esc_attr( $email ); ?></span>
<span><?php echo esc_html( $email ); ?></span>
</a>
</div><!-- /.agent-box-email -->
<?php endif; ?>
@@ -59,21 +59,21 @@
<?php $phone = get_post_meta( $id, $prefix . 'phone', true ); ?>
<?php if ( ! empty( $phone ) ) : ?>
<div class="agent-box-phone">
<i class="fa fa-phone"></i><span><a href="tel:<?php echo sanitize_title( $phone ); ?>"><?php echo esc_attr( $phone ); ?></a></span>
<i class="fa fa-phone"></i><span><a href="tel:<?php echo sanitize_title( $phone ); ?>"><?php echo esc_html( $phone ); ?></a></span>
</div><!-- /.agent-box-phone -->
<?php endif; ?>
<?php $mobile = get_post_meta( $id, $prefix . 'mobile', true ); ?>
<?php if ( ! empty( $mobile ) ) : ?>
<div class="agent-box-mobile">
<i class="fa fa-mobile"></i><span><a href="tel:<?php echo sanitize_title( $phone ); ?>"><?php echo esc_attr( $mobile ); ?></a></span>
<i class="fa fa-mobile"></i><span><a href="tel:<?php echo sanitize_title( $mobile ); ?>"><?php echo esc_html( $mobile ); ?></a></span>
</div><!-- /.agent-box-phone -->
<?php endif; ?>
<?php $fax = get_post_meta( $id, $prefix . 'fax', true ); ?>
<?php if ( ! empty( $fax ) ) : ?>
<div class="agent-box-fax">
<i class="fa fa-fax"></i><span><?php echo esc_attr( $fax ); ?></span>
<i class="fa fa-fax"></i><span><?php echo esc_html( $fax ); ?></span>
</div><!-- /.agent-box-phone -->
<?php endif; ?>
@@ -82,7 +82,7 @@
<div class="agent-box-web">
<i class="fa fa-globe"></i>
<a href="<?php echo esc_attr( $web ); ?>" rel="nofollow" target="_blank">
<span><?php echo esc_attr( $web ); ?></span>
<span><?php echo esc_html( $web ); ?></span>
</a>
</div><!-- /.agent-box-web -->
<?php endif; ?>

View File

@@ -3,7 +3,7 @@
<?php do_action( 'opalestate_user_dashboard_before' ); ?>
<?php
$statistics = new OpalEstate_User_Statistics();
$statistics = new OpalEstate_User_Statistics();
$properties_count = [];
$properties_count[] = [
@@ -52,7 +52,7 @@
<div class="col-lg-12 col-md-12">
<div class="card-item inner">
<div class="heading"><i class="fa fa-comment"></i> <span><?php esc_html_e( 'Latest review' ) ?></span>
<div class="heading"><i class="fa fa-comment"></i> <span><?php esc_html_e( 'Latest review', 'opalestate-pro' ); ?></span>
<a href="<?php echo esc_url( opalestate_get_user_management_page_uri() . '?tab=reviews' ); ?>" class="dash-view-all"><?php esc_html_e( 'View All', 'opalestate-pro' );
?></a>
</div>

View File

@@ -1,29 +1,29 @@
<?php if( $loop->have_posts() ): ?>
<div class="property-listing my-favorite">
<div class="box-content">
<div class="opalestate-rows">
<div class="opalestate-rows">
<div class="<?php echo apply_filters('opalestate_row_container_class', 'opal-row');?>">
<?php $cnt=0; while ( $loop->have_posts() ) : $loop->the_post(); global $post; ?>
<div class="col-lg-4 col-md-4">
<?php echo opalestate_load_template_path( 'content-property-grid' ); ?>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<?php opalestate_pagination( $loop->max_num_pages ); ?>
</div>
</div>
</div>
<?php else : ?>
<div class="opalestate-box">
<div class="opalestate-box">
<div class="box-content">
<div class="opalestate-message">
<h3>No Item In Favorite</h3>
<h3><?php esc_html_e( 'No item in your favorite', 'opalestate-pro' ) ;?></h3>
<p><?php esc_html_e( 'You have not added any property as favorite.', 'opalestate-pro' ) ;?></p>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
<?php wp_reset_postdata(); ?>