Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php $user_ID = get_current_user_id(); ?>
- <div id="content" ng-controller="singletype" class="<?php echo $content_class; ?>" style="<?php echo $content_css; ?>" ng-cloak>
- <div class="avada-row" style="">
- <div id="content" class="full-width">
- <?php
- if( is_user_logged_in() ) {
- while ( have_posts() ) : the_post();
- $checkresults = count( $wpdb->get_results( "SELECT ID FROM wp_watchlist WHERE watching = $post->ID AND userID = $user_ID" ) );
- $checkresults_deal = count( $wpdb->get_results( "SELECT ID FROM wp_deals WHERE listingID = $post->ID AND Buyer = $user_ID" ) );
- $postmeta = get_post_meta( $post->ID);
- $tojson = array();
- foreach ($postmeta as $key => $value) {
- # code...
- $tojson[str_replace("-", "_", $key)] = $value[0];
- }
- $res = array();
- foreach ($postmeta as $key => $value) {$res[$key] = $value[0];}
- $user_email = get_the_author_meta('user_firstname');
- $authormeta = get_user_meta($post->post_author);
- $user_info = get_userdata($post->post_author);
- $currenusermeta = $current_user->data;
- $listingauthor = $user_info->data;
- foreach ($listingauthor as $key => $value) {
- # code...
- if($key != 'user_pass' || $key != 'user_login'){
- $tojson['author_info'][$key] = $value;
- }
- }
- foreach ($currenusermeta as $key => $value) {
- if($key != 'user_pass' || $key != 'user_login'){
- $tojson['current_user_info'][$key] = $value;
- }
- }
- $tojson['listingID'] = $post->ID;
- $jsonarray = json_encode($tojson);
- ?>
- <div class="initvalue" ng-init='singlelistarray = <?php echo $jsonarray; ?> ' ></div>
- <div class="initvalue" ng-init='checkdeal = <?php echo $checkresults_deal; ?> ' ></div>
- <div class="wrapper_listing" ng-init="checkwatching = <?php echo $checkresults; ?> " >
- <h2><?php echo $res["wpcf-listing-type"]; ?> Listing ID: <?php echo get_the_author_meta('user_firstname'); ?> <?php echo get_the_author_meta('user_lastname'); ?></h2>
- <hr>
- <p>Location: <?php echo $res["wpcf-city"]; ?> / <?php echo $res["wpcf-state"] ?></p>
- <p>Asking Price: $<?php echo $res['wpcf-asking-price']; ?></p>
- <p>Mutual Fund Licensed: <?php echo $res['wpcf-mutual-fund-licensed']; ?></p>
- <p>Life Insurance Licensed: <?php echo $res['wpcf-life-insurance-licensed']; ?></p>
- <p>Liscenses and/or other designations: <?php echo $res["wpcf-other-license"]; ?></p>
- <p>Description: <?php echo $res["wpcf-buisness-description"]; ?></p>
- <button ng-show="checkwatching == 0 " ng-click="watchlist(<?php echo $user_ID; ?>, <?php echo $post->ID; ?> )">Add to Watch List</button>
- <button ng-show="checkwatching == 1 " ng-click="watchlistremove(<?php echo $user_ID; ?>, <?php echo $post->ID; ?> )">Remove from Watch list</button>
- <?php if($res["wpcf-listing-type"] == 'Selling'){ ?>
- <button ng-show="checkdeal == 0" ng-click="newdeal()">Create New Deal</button>
- <a href="<?php echo get_site_url(); ?>/member-area/my-deals/" ng-show="checkdeal == 1" >View your deals</button>
- <?php }else{ ?>
- <?php } ?>
- </div>
- <div ng-cloak class="addealinfo" ng-hide="extrainfo">
- <centered>
- <div class="contactform addinfoinner">
- <p class="closethis" ng-click="closethis()">x</p>
- <div id="clientform">
- <form action="<?php bp_messages_form_action('compose' ); ?>/compose" method="post" id="send_message_form" class="standard-form" role="main" enctype="multipart/form-data">
- <?php do_action( 'bp_before_messages_compose_content' ); ?>
- <?php bp_message_get_recipient_tabs(); ?>
- <input type="hidden" name="send-to-input" class="send-to-input" id="send-to-input" value="<?php the_author_meta( 'user_login' ); ?>"/>
- <label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
- <input type="text" name="subject" id="subject" value="<?php get_the_title(); ?>" />
- <label for="content"><?php _e( 'Message', 'buddypress' ); ?></label>
- <textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea>
- <input type="hidden" name="send_to_usernames" id="send-to-usernames" value="<?php bp_message_get_recipient_usernames(); ?>" class="<?php bp_message_get_recipient_usernames(); ?>" />
- <?php do_action( 'bp_after_messages_compose_content' ); ?>
- <div class="submit">
- <input type="submit" value="<?php esc_attr_e( "Send Message", 'buddypress' ); ?>" name="send" id="send" />
- </div>
- <?php wp_nonce_field( 'messages_send_message' ); ?>
- </form>
- <script type="text/javascript">
- document.getElementById("send-to-input").focus();
- </script>
- </div>
- </div>
- </centered>
- </div>
- </div>
- <?php
- endwhile;// end of the loop.
- }// end of user check
- else{
- echo "<p> you need to be a user to be here</p>";
- } ?>
- </div>
- </div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement