Example #1
0
function projectTheme_get_post_awaiting_compl_function()
{
    $ending = get_post_meta(get_the_ID(), 'ending', true);
    $sec = $ending - current_time('timestamp', 0);
    $location = get_post_meta(get_the_ID(), 'Location', true);
    $closed = get_post_meta(get_the_ID(), 'closed', true);
    $featured = get_post_meta(get_the_ID(), 'featured', true);
    $hide_project_p = get_post_meta(get_the_ID(), 'private_bids', true);
    //			$mark_coder_delivered 			= get_post_meta(get_the_ID(), 'mark_coder_delivered', true);
    $posted = get_the_time("jS M Y");
    $post = get_post(get_the_ID());
    $pid = get_the_ID();
    $mark_coder_delivered_array = Bid::get_field_by_pid($pid, 'mark_coder_delivered');
    $project_bids = Bid::get_by_pid_uid($pid);
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    //			$bid 		 = projectTheme_get_winner_bid(get_the_ID());
    $bid = Bid::get_by_pid_uid($pid, $uid);
    $bid_wn = ProjectTheme_get_show_price($bid->bid);
    $winner = get_post_meta(get_the_ID(), 'winner', true);
    $get_winner = $winner;
    $winner = get_userdata($winner);
    $winner = '<a href="' . ProjectTheme_get_user_profile_link($winner->ID) . '">' . $winner->user_login . '</a>';
    if (is_group_winner()) {
        $winner = sprintf(__("WInner: %s", 'ProjectTheme'), '<a href="">Group</a>');
    } else {
        $winner = sprintf(__("WInner: %s", 'ProjectTheme'), $winner);
    }
    $tm_d = get_post_meta(get_the_ID(), 'expected_delivery', true);
    $delivery_on = sprintf(__('Delivery On: %s', 'ProjectTheme'), date_i18n('d-M-Y g:iA', $tm_d));
    $auth = get_userdata($post->post_author);
    ?>



        <div class="post" id="post-<?php 
    the_ID();
    ?>
"><div class="padd10">

    		<div class="post-title"><a href="<?php 
    the_permalink();
    ?>
"><?php 
    the_title();
    ?>
</a>

            

             <?php 
    if ($featured == "1") {
        echo '<span class="featured_thing_project2">' . __('Featured Project', 'ProjectTheme') . '</span>';
    }
    if ($hide_project_p == "1" or $hide_project_p == "yes") {
        echo '<span class="private_thing_project2">' . __('Sealed Bidding', 'ProjectTheme') . '</span>';
    }
    ?>

            

            </div>

    		<div class="post-main-details">

            	<ul>

                	<li>

                    	<p><img src="<?php 
    bloginfo('template_url');
    ?>
/images/wallet_icon2.png" alt="project budget" width="16" height="16" /></p>

                        <h4><?php 
    echo sprintf(__('Winning Bid: %s', 'ProjectTheme'), $bid_wn);
    ?>
</h4>

                    </li>

                    

                    <li>

                    	<p><img src="<?php 
    bloginfo('template_url');
    ?>
/images/prop_icon.png" alt="project proposals" width="16" height="16" /></p>

                        <h4><?php 
    echo $winner;
    ?>
</h4>

                    </li>

                    

                    <li>

                    	<p><img src="<?php 
    bloginfo('template_url');
    ?>
/images/cal_icon.png" alt="project calendar" width="16" height="16" /></p>

                        <h4><?php 
    echo $posted;
    ?>
</h4>

                    </li>

                    

                    <li class="last">

                    	<p><img src="<?php 
    bloginfo('template_url');
    ?>
/images/clock_icon.png" alt="project clock" width="16" height="16" /></p>

                        <h4><?php 
    echo $delivery_on;
    ?>
</h4>

                    </li>

                    

                </ul>

            </div> <!-- end post-main-details -->

          

            <div class="excerpt-thing">

            	

                    <!--Nobode mark as delivered-->

                	<?php 
    if (!in_array("1", $mark_coder_delivered_array)) {
        ?>

       

                        <?php 
        _e('Nobody mark this project as delivered to complete.', 'ProjectTheme');
        ?>

                        <?php 
        $projectTheme_enable_paypal_ad = get_option('projectTheme_enable_paypal_ad');
        if ($projectTheme_enable_paypal_ad == "yes") {
            $adaptive_done = get_post_meta(get_the_ID(), 'adaptive_done', true);
            if (empty($adaptive_done)) {
                ?>

                                

                                	<a href="<?php 
                bloginfo('siteurl');
                ?>
/?p_action=pay_for_project_paypal&pid=<?php 
                echo get_the_ID();
                ?>
" class="green_btn"><?php 
                _e('Deposit PayPal Escrow', 'ProjectTheme');
                ?>
</a>

                                

                                <?php 
            } elseif ($adaptive_done == 'started') {
                echo '<br/>';
                echo _e('You have deposited escrow by PayPal for this project. Once the freelancer delivers the project, and you accept it, you will release the funds to freelancer. ', 'ProjectTheme');
            }
        } else {
            if ($get_winner) {
                if (!projecttheme_escrow_was_made_for_project_done(get_the_ID())) {
                    $ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');
                    if ($ProjectTheme_enable_credits_wallet != 'no') {
                        ?>
 

                        <br/>

                        <a href="<?php 
                        echo ProjectTheme_get_payments_page_url_redir('escrow');
                        ?>
" class="post_bid_btn"><?php 
                        _e('Make Escrow', 'ProjectTheme');
                        ?>
</a>

                        

                        <?php 
                    }
                } else {
                    echo '<br/>';
                    _e('Escrow was made for this project.', 'ProjectTheme');
                }
            } else {
                echo '<br/>';
                _e('No winner to make Escrow.', 'ProjectTheme');
            }
        }
    } else {
        $dv_bids = Bid::get_by_pid_uid($pid, $uid = '', $single = false, array("mark_coder_delivered='1'", "mark_seller_accepted='0'"));
        ?>
                        
                    <div>
                            
                        
                        <?php 
        foreach ($dv_bids as $one_bid) {
            $user = get_user_by('id', $one_bid->uid);
            $dv = $one_bid->mark_coder_delivered_date;
            $dv = date_i18n('d-M-Y H:i:s', $dv);
            $user_link = "<a href='" . ProjectTheme_get_user_profile_link($user->ID) . "'>{$user->user_login}</a>";
            ?>
                            <div>
                                <div>

                                    <span class="zbk_zbk">

                                        <?php 
            printf(__("Marked as delivered on: <b>%s</b> by %s", "ProjectTheme"), $dv, $user_link);
            ?>
                                </div>
                                <div>

                                    <span style="white-space: nowrap;">

                                        <?php 
            _e('Accept this project and: ', 'ProjectTheme');
            ?>

                                        <a href="<?php 
            echo get_bloginfo('siteurl');
            ?>
/?p_action=mark_completed&bid=<?php 
            echo $one_bid->id;
            ?>
&pid=<?php 
            echo $pid;
            ?>
" 

                                           class="green_btn inline-block"><?php 
            echo __("Mark Completed", "ProjectTheme");
            ?>
</a>

                                    </span>

                                    <span style="white-space: nowrap;">
                                        <?php 
            _e('Or: ', 'ProjectTheme');
            ?>
<a href="<?php 
            echo get_bloginfo('siteurl');
            ?>
/?p_action=mark_in_progress&bid=<?php 
            echo $one_bid->id;
            ?>
&pid=<?php 
            echo $pid;
            ?>
" 

                                           class="grey_btn inline-block"><?php 
            echo __("Mark in progress again", "ProjectTheme");
            ?>
</a>
                                    </span>

                                </div>

                        </div>

                   <?php 
        }
        ?>
                    </div>
                   <?php 
    }
    ?>

                   

                

            </div> <!-- end excerpt-thing -->

            

            

            <div class="user-poster-thing">

            	<div class="user-avatar-me">

                	<img src="<?php 
    echo ProjectTheme_get_avatar($post->post_author, 25, 25);
    ?>
" alt="avatar-user" class="acc_m1" width="25" height="25" />

                </div>

                

                <div class="user-avatar-me fun-time">

                <div class="post-main-details">

            	<ul>

                	<li><a class="avatar-posted-by-username" href="<?php 
    bloginfo('siteurl');
    ?>
/?p_action=user_profile&post_author=<?php 
    echo $post->post_author;
    ?>
"><?php 
    echo $auth->user_login;
    ?>
</a></li>

                	<li><?php 
    echo ProjectTheme_project_get_star_rating($post->post_author);
    ?>
</li>

                    <li class="last"><a href="<?php 
    echo ProjectTheme_get_user_feedback_link($post->post_author);
    ?>
"><?php 
    _e('View User Feedback', 'ProjectTheme');
    ?>
</a></li>

                </ul>

                

                </div>

                </div>

                

            </div> <!-- end user-poster-thing -->

        

        </div></div>







		  <?php 
}
Example #2
0
function projectTheme_get_post_awaiting_compl_function_old()
{
    $ending = get_post_meta(get_the_ID(), 'ending', true);
    $sec = $ending - current_time('timestamp', 0);
    $location = get_post_meta(get_the_ID(), 'Location', true);
    $closed = get_post_meta(get_the_ID(), 'closed', true);
    $featured = get_post_meta(get_the_ID(), 'featured', true);
    $mark_coder_delivered = get_post_meta(get_the_ID(), 'mark_coder_delivered', true);
    $post = get_post(get_the_ID());
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
				<div class="post" id="post-<?php 
    the_ID();
    ?>
"><div class="padd10">
                
                <?php 
    if ($featured == "1") {
        ?>
                <div class="featured-one"></div>
                <?php 
    }
    ?>
                
                
                <?php 
    if ($private_bids == "yes" or $private_bids == "1") {
        ?>
                <div class="sealed-one"></div>
                <?php 
    }
    ?>
                
                
                <div class="padd10_only_top">
                <div class="image_holder">
                 <?php 
    $ProjectTheme_enable_images_in_projects = get_option('ProjectTheme_enable_images_in_projects');
    if ($ProjectTheme_enable_images_in_projects == "yes") {
        $width = 40;
        $height = 32;
        $image_class = "image_class";
        $width = apply_filters("ProjectTheme_awaiting_completion_proj_img_width", $width);
        $height = apply_filters("ProjectTheme_awaiting_completion_proj_img_height", $height);
        $image_class = apply_filters("ProjectTheme_awaiting_completion_proj_img_class", $image_class);
        ?>
                
                <a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
"><img alt="<?php 
        the_title();
        ?>
" width="<?php 
        echo $width;
        ?>
" height="<?php 
        echo $height;
        ?>
" class="<?php 
        echo $image_class;
        ?>
" 
                src="<?php 
        echo ProjectTheme_get_first_post_image(get_the_ID(), $width, $height);
        ?>
" /></a>
               
               <?php 
    }
    ?>
               
                </div>
                <div class="title_holder" > 
                     <h2><a class="post-title-class" href="<?php 
    the_permalink();
    ?>
" rel="bookmark" title="<?php 
    the_title();
    ?>
"><?php 
    the_title();
    ?>
</a></h2>
                        
    
                        
                  <p class="mypostedon">
                        <?php 
    _e("Posted in", 'ProjectTheme');
    ?>
: <?php 
    echo get_the_term_list(get_the_ID(), 'project_cat', '', ', ', '');
    ?>
 
                        <?php 
    _e("by", 'ProjectTheme');
    ?>
: <a href="<?php 
    echo ProjectTheme_get_user_profile_link($post->post_author);
    ?>
"><?php 
    the_author();
    ?>
</a> 
                  </p>
                       
                        
              <p class="task_buttons">   
                        
		
       				<?php 
    if ($mark_coder_delivered != "1") {
        ?>
       
                        <?php 
        _e('The winner must mark this as delivered.', 'ProjectTheme');
        ?>
                        <?php 
        if (!projecttheme_escrow_was_made_for_project_done(get_the_ID())) {
            $ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');
            if ($ProjectTheme_enable_credits_wallet != 'no') {
                ?>
 
                        <br/>
                        <a href="<?php 
                echo ProjectTheme_get_payments_page_url_redir('escrow');
                ?>
" class="post_bid_btn"><?php 
                _e('Make Escrow', 'ProjectTheme');
                ?>
</a>
                        
                        <?php 
            }
        } else {
            echo '<br/>';
            _e('Escrow was made for this project.', 'ProjectTheme');
        }
    } else {
        $dv = get_post_meta(get_the_ID(), 'mark_coder_delivered_date', true);
        $dv = date_i18n('d-M-Y H:i:s', $dv);
        ?>
                   
                   <span class="zbk_zbk">
                   <?php 
        printf(__("Marked as delivered on: %s", "ProjectTheme"), $dv);
        ?>
<br/><br/>
                   <?php 
        _e('Accept this project and: ', 'ProjectTheme');
        ?>
                     <a href="<?php 
        echo get_bloginfo('siteurl');
        ?>
/?p_action=mark_completed&pid=<?php 
        the_ID();
        ?>
" 
                        class="green_btn"><?php 
        echo __("Mark Completed", "ProjectTheme");
        ?>
</a>
                   
                   </span>
                   
                   <?php 
    }
    ?>
                   

                  </p>
      </div> 
                     
                  <div class="details_holder"> 

                  
                  <ul class="project-details1 project-details1_a">
							<li>
								<img src="<?php 
    echo get_bloginfo('template_url');
    ?>
/images/price.png" width="15" height="15" /> 
								<h3><?php 
    echo __("Budget", 'ProjectTheme');
    ?>
:</h3>
								<p><?php 
    $sel = get_post_meta(get_the_ID(), 'budgets', true);
    echo ProjectTheme_get_budget_name_string_fromID($sel);
    ?>
                                
                                </p>
							</li>
                            
                            
                            <li>
								<img src="<?php 
    echo get_bloginfo('template_url');
    ?>
/images/price.png" width="15" height="15" /> 
								<h3><?php 
    echo __("Winning Bid", 'ProjectTheme');
    ?>
:</h3>
								<p><?php 
    $bid = projectTheme_get_winner_bid(get_the_ID());
    echo ProjectTheme_get_show_price($bid->bid);
    ?>
                                
                                </p>
							</li>
					
             				
                            <li>
								<img src="<?php 
    echo get_bloginfo('template_url');
    ?>
/images/location.png" width="15" height="15" /> 
								<h3><?php 
    echo __("Winner", 'ProjectTheme');
    ?>
:</h3>
								<p><?php 
    $winner = get_post_meta(get_the_ID(), 'winner', true);
    $winner = get_userdata($winner);
    echo '<a href="' . ProjectTheme_get_user_profile_link($winner->ID) . '">' . $winner->user_login . '</a>';
    ?>
</p>
							</li>
                        

							
                            <li>
								<img src="<?php 
    echo get_bloginfo('template_url');
    ?>
/images/clock.png" width="15" height="15" /> 
								<h3><?php 
    echo __("Delivery On", 'ProjectTheme');
    ?>
:</h3>
								<p><?php 
    $tm_d = get_post_meta(get_the_ID(), 'expected_delivery', true);
    echo date_i18n('d-M-Y H:i:s', $tm_d);
    ?>
</p>
							</li>
							
					
                    
						</ul>
                      
               
                  </div>   
                     
                     </div></div></div> <?php 
}