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_pay_function($arr = '')
{
    $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);
    $post = get_post(get_the_ID());
    $hide_project_p = get_post_meta(get_the_ID(), 'private_bids', true);
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    $bid = projectTheme_get_winner_bid(get_the_ID());
    $bid_wn = ProjectTheme_get_show_price($bid->bid);
    $winner = get_post_meta(get_the_ID(), 'winner', true);
    $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);
    $posted = get_the_time("jS F Y");
    ?>



        <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">

            	

                <?php 
    $projecttheme_escrow_was_made_for_project_not_released = projecttheme_escrow_was_made_for_project_not_released(get_the_ID());
    if ($projecttheme_escrow_was_made_for_project_not_released == false) {
        $projectTheme_project_function_filter_adv = true;
        $projectTheme_project_function_filter_adv = apply_filters('projectTheme_project_function_filter_adv', get_the_ID());
        if ($projectTheme_project_function_filter_adv == true) {
            $adaptive_done = get_post_meta(get_the_ID(), 'adaptive_done', true);
            if ($adaptive_done == "started") {
                ?>

                            

                            	 <a href="<?php 
                echo get_bloginfo('siteurl');
                ?>
/?complete_paypal_escrow=<?php 
                the_ID();
                ?>
" class="green_btn"><?php 
                echo __("Complete PayPal Escrow Payment", "ProjectTheme");
                ?>
</a>

                            

                            <?php 
            } else {
                $ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');
                if ($ProjectTheme_enable_credits_wallet == "yes") {
                    ?>

       

                        <!-- <a href="<?php 
                    echo ProjectTheme_get_pay4project_page_url(get_the_ID());
                    ?>
" 

                        class="green_btn"><?php 
                    echo __("Pay This", "ProjectTheme");
                    ?>
</a> -->



                        <br/>

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

                        

                   

                   

				<?php 
                }
            }
        } else {
            do_action('projectTheme_project_function_filter_1_action', get_the_ID());
        }
    } else {
        ?>

                

                	<?php 
        $kk = ProjectTheme_get_payments_page_url_redir('');
        echo sprintf(__('Escrow was made. <a href="%s" class="green_btn">Go and release it.</a>', 'ProjectTheme'), $kk);
        ?>
	

                

                <?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 
}