Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.75 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php $user_ID = get_current_user_id(); ?>
  3. <div ng-controller="singletype" ng-cloak>
  4. <div class="col-md-8">
  5. <?php
  6. if( is_user_logged_in() ) {
  7. while ( have_posts() ) : the_post();
  8. //Default values
  9. $pluginClass = ClientExchangePlugin::get_instance();
  10. $checkresults = count( $wpdb->get_results( "SELECT ID FROM wp_watchlist WHERE watching = $post->ID AND userID = $user_ID" ) );
  11. $checkresults_deal = count( $wpdb->get_results( "SELECT ID FROM wp_deals WHERE listingID = $post->ID AND Buyer = $user_ID" ) );
  12. $postmeta = get_post_meta( $post->ID);
  13. $tojson['listingID'] = $post->ID;
  14. $authormeta = get_user_meta($post->post_author);
  15. $user_info = get_userdata($post->post_author);
  16. $currenusermeta = $current_user->data;
  17. $listingauthor = $user_info->data;
  18. $user_email = get_the_author_meta('user_firstname');
  19. $avatarurl = @$pluginClass->get_avatar_url($listingauthor->data->ID);
  20.  
  21. $jsonreturn = listing_author_array($postmeta, $listingauthor, $currenusermeta);
  22.  
  23. $set_listing_type = set_listing_type($jsonreturn["wpcf_listing_type"]);
  24. $jsonarray = json_encode($jsonreturn);
  25.  
  26. ?>
  27. <div class="initvalue" ng-init='singlelistarray = <?php echo $jsonarray; ?> ' ></div>
  28. <div class="initvalue" ng-init='checkdeal = <?php echo $checkresults_deal; ?> ' ></div>
  29. <div class="wrapper_listing" ng-init="checkwatching = <?php echo $checkresults; ?> " >
  30. <div class="avada-row">
  31. <div class="col-md-12">
  32. <h2><?php the_title();?></h2>
  33. </div>
  34. </div>
  35. <hr>
  36. <div class="avada-row">
  37. <div class="col-md-4">
  38. <?php if( isset($jsonreturn['wpcf_logo']) ){
  39.  
  40. echo "<img src='".$jsonreturn['wpcf_logo'] ."' /> ";
  41.  
  42. }else{
  43. echo "<img src='$avatarurl' />";
  44. }
  45. ?>
  46. <h2><?php echo $set_listing_type; ?>: <?php echo get_the_author_meta('user_firstname'); ?> <?php echo get_the_author_meta('user_lastname'); ?></h2>
  47. </div>
  48. </div>
  49.  
  50.  
  51. <hr>
  52. <p>Location: <?php echo $jsonreturn["wpcf_city"]; ?> / <?php echo $jsonreturn["wpcf_state"] ?></p>
  53.  
  54. <p>Asking Price: $<?php echo $jsonreturn['wpcf_asking_price']; ?></p>
  55. <p>Mutual Fund Licensed: <?php echo $jsonreturn['wpcf_mutual_fund_licensed']; ?></p>
  56. <p>Life Insurance Licensed: <?php echo $jsonreturn['wpcf_life_insurance_licensed']; ?></p>
  57. <p>Liscenses and/or other designations: <?php echo $jsonreturn["wpcf_other_license"]; ?></p>
  58. <p>Description: <?php echo $jsonreturn["wpcf_buisness_description"]; ?></p>
  59.  
  60.  
  61. <button ng-show="checkwatching == 0 " ng-click="watchlist(<?php echo $user_ID; ?>, <?php echo $post->ID; ?> )">Add to Watch List</button>
  62. <button ng-show="checkwatching == 1 " ng-click="watchlistremove(<?php echo $user_ID; ?>, <?php echo $post->ID; ?> )">Remove from Watch list</button>
  63. <a href="<?php echo get_site_url(); ?>/member-area/my-deals/" ng-show="checkdeal == 1" class="btn btn-default">Contact User</a>
  64.  
  65. <?php if($jsonreturn["wpcf_listing_type"] == 'Selling'){ ?>
  66.  
  67. <button ng-show="checkdeal == 0" ng-click="newdeal()">Create New Deal</button>
  68. <a href="<?php echo get_site_url(); ?>/member-area/my-deals/" ng-show="checkdeal == 1" >View your deals</a>
  69.  
  70. <?php
  71.  
  72.  
  73. echo "<pre>";
  74. var_dump($jsonreturn);
  75. echo "</pre>";
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. }else{ ?>
  84. <?php } ?>
  85. </div>
  86.  
  87. <div ng-cloak class="addealinfo" ng-hide="extrainfo">
  88. <centered>
  89. <div class="contactform addinfoinner">
  90. <p class="closethis" ng-click="closethis()">x</p>
  91. <div id="clientform">
  92.  
  93. <form action="<?php bp_messages_form_action('compose' ); ?>/compose" method="post" id="send_message_form" class="standard-form" role="main" enctype="multipart/form-data">
  94.  
  95. <?php do_action( 'bp_before_messages_compose_content' ); ?>
  96.  
  97. <?php bp_message_get_recipient_tabs(); ?>
  98.  
  99. <input type="hidden" name="send-to-input" class="send-to-input" id="send-to-input" value="<?php the_author_meta( 'user_login' ); ?>"/>
  100.  
  101. <label for="subject"><?php _e( 'Subject', 'buddypresns' ); ?></label>
  102. <input type="text" name="subject" id="subject" value="<?php get_the_title(); ?>" />
  103.  
  104. <label for="content"><?php _e( 'Message', 'buddypress' ); ?></label>
  105. <textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea>
  106.  
  107. <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(); ?>" />
  108.  
  109. <?php do_action( 'bp_after_messages_compose_content' ); ?>
  110.  
  111. <div class="submit">
  112. <input type="submit" value="<?php esc_attr_e( "Send Message", 'buddypress' ); ?>" name="send" id="send" />
  113. </div>
  114.  
  115. <?php wp_nonce_field( 'messages_send_message' ); ?>
  116. </form>
  117.  
  118. <script type="text/javascript">
  119. document.getElementById("send-to-input").focus();
  120. </script>
  121. </div>
  122. </div>
  123. </centered>
  124. </div>
  125. <?php
  126. endwhile;// end of the loop.
  127. }// end of user check
  128. else{
  129. echo "<p> you need to be a user to be here</p>";
  130. }
  131. ?>
  132. </div>
  133. <div class="col-md-4">
  134. <div id="sidebar" style=""><?php dynamic_sidebar( 'avada-custom-sidebar-advertiserssidebar' ); ?></div>
  135. </div>
  136. </div>
  137. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement