Opal-Estate-Pro/templates/user/read-messages.php

61 lines
2.9 KiB
PHP
Raw Permalink Normal View History

2019-09-25 05:00:39 +02:00
<?php if ( $message ):
$form = OpalEstate()->html->render_form( $fields );
$id = 'message-reply';
2019-09-10 06:27:33 +02:00
?>
2019-09-25 04:03:55 +02:00
<div class="opalestate-admin-box">
<div class="opalestate-nav-bc opal-row">
2019-09-25 05:00:39 +02:00
<div class="col-lg-12"><a href="<?php echo esc_url( opalestate_get_user_tab_uri( 'messages' ) ); ?>"><?php esc_html_e( 'Messages', 'opalestate-pro' ); ?></a> /
2019-09-25 04:03:55 +02:00
<?php echo esc_html( $message->subject ); ?>
</div>
</div>
<div class="opalestate-read-message">
2019-09-25 05:00:39 +02:00
<div class="message-container">
<div class="message-body">
<div class="message-meta">
<div class="message-avatar">
<img src="<?php echo esc_url( OpalEstate_User::get_author_picture( $message->sender_id ) ); ?>" width="60" alt="<?php esc_attr_e( 'User Avatar', 'opalestate-pro' ); ?>"/>
2020-05-21 12:08:16 +02:00
<?php if ( isset( $message->name ) && $message->name ) : ?>
<span class="message-name"><?php echo esc_html( $message->name ); ?></span>
<?php endif; ?>
<span class="message-email"><?php echo esc_html( $message->sender_email ); ?></span> /
<span class="message-phone"><?php echo esc_html( $message->phone ); ?></span>
2019-09-25 05:00:39 +02:00
</div>
2020-05-21 12:08:16 +02:00
<code class="message-date"><?php echo esc_html( $message->created ); ?></code>
2019-09-25 05:00:39 +02:00
</div>
<div class="message-content">
2020-05-21 12:08:16 +02:00
<p><?php echo esc_html( $message->message ); ?></p>
2019-09-25 05:00:39 +02:00
</div>
2019-09-25 04:03:55 +02:00
</div>
</div>
2019-09-25 05:00:39 +02:00
<?php if ( $replies ): ?>
2020-05-21 12:08:16 +02:00
<?php foreach ( $replies as $reply ) : ?>
2019-09-25 04:03:55 +02:00
<div class="message-body">
<div class="message-avatar">
<img src="<?php echo OpalEstate_User::get_author_picture( $reply->sender_id ); ?>" width="60" alt="<?php esc_attr_e( 'User Avatar', 'opalestate-pro' ); ?>"/>
2020-05-21 12:08:16 +02:00
<?php if ( $reply->sender_id ) : ?>
<span class="message-name"><?php echo opalestate_user_fullname( $reply->sender_id ); ?></span>
<?php endif; ?>
2019-09-25 04:03:55 +02:00
</div>
2020-05-21 12:08:16 +02:00
<code class="message-date"><?php echo esc_html( $reply->created ); ?></code>
2019-09-25 04:03:55 +02:00
<div class="message-content">
<?php echo $reply->message; ?>
</div>
</div>
2019-09-10 06:27:33 +02:00
2019-09-25 04:03:55 +02:00
<?php endforeach; ?>
<?php endif; ?>
</div>
<div class="opalestate-message-reply">
2019-09-25 05:00:39 +02:00
<form class="opalestate-form-reply" method="post">
2019-09-25 04:03:55 +02:00
<?php echo $form; ?>
2019-09-25 05:00:39 +02:00
<?php wp_nonce_field( $id, 'message_action' ); ?>
2019-09-25 04:03:55 +02:00
<div class="form-group">
<input type="hidden" name="message_id" value="<?php echo $message->id; ?>">
2019-09-25 05:00:39 +02:00
<button type="submit" class="button btn btn-primary btn-3d"><?php esc_html_e( 'Reply', 'opalestate-pro' ); ?></button>
2019-09-25 04:03:55 +02:00
</div>
</form>
</div>
2019-09-10 06:27:33 +02:00
<?php endif; ?>
</div>