Пример #1
0
    function PricerrTheme_show_sale($row)
    {
        $pid = $row->pid;
        $post = get_post($row->pid);
        $max_days = get_post_meta($pid, 'max_days', true);
        $date_made = $row->date_made;
        $sold = date("D jS \\of F Y", $date_made);
        $expected = date("D jS \\of F Y", $date_made + 24 * 3600 * $max_days);
        global $current_user;
        get_currentuserinfo();
        $uid = $current_user->ID;
        $delivered = 0;
        if ($row->done_seller == 1) {
            $delivered = 1;
        }
        $id = $row->id;
        $closed = $row->closed;
        $completed = 0;
        if ($row->done_buyer == 1) {
            $completed = 1;
        }
        $can_request_closed = 1;
        if ($closed == 1) {
            $can_request_closed = 0;
        }
        //---------------------------------
        ?>
				<div class="post" id="post-<?php 
        echo $id;
        ?>
">
                <div class="padd10_only">
                <div class="image_holder3">
                <a href="<?php 
        the_permalink();
        ?>
"><img width="65" height="50" class="<?php 
        echo $img_class;
        ?>
" 
                src="<?php 
        echo PricerrTheme_get_first_post_image($pid, 65, 50);
        ?>
" /></a>
                </div>
                <div  class="title_holder3" > 
                     <h2>
                     
                       <?php 
        $days_needed = get_post_meta($pid, 'max_days', true);
        $instant = get_post_meta($pid, 'instant', true);
        if ($days_needed == 1) {
            echo '<span class="express_job_spn">' . __('Express', 'PricerrTheme') . '</span>';
        }
        if ($instant == 1) {
            echo '<span class="instant_job_spn">' . __('Instant Delivery', 'PricerrTheme') . '</span>';
        }
        ?>
                     
                     <a href="<?php 
        echo get_permalink($pid);
        ?>
" rel="bookmark" title="">
                        <?php 
        echo PricerrTheme_wrap_the_title($post->post_title, $pid);
        ?>
</a> 
                        
                      
                        
                        </h2>
                        <div class="sold_on"><?php 
        echo sprintf(__("Sold on: %s", "PricerrTheme"), $sold);
        ?>
 &diams; 
						<?php 
        echo sprintf(__(" Expected Delivery: %s", "PricerrTheme"), $expected);
        ?>
 &diams; <?php 
        echo sprintf(__("Order ID: #%s", "PricerrTheme"), $row->id);
        ?>
                         </div>
                     	
                        <?php 
        if ($can_request_closed == 1) {
            if ($row->accept_cancellation_request != -1) {
                if ($row->request_cancellation_from_seller == 0 and $row->request_cancellation_from_buyer == 0) {
                    ?>
                   		<a href="<?php 
                    echo get_bloginfo('siteurl');
                    ?>
/?jb_action=request_mutual_cancelation&orderid=<?php 
                    echo $row->id;
                    ?>
" 
                        class="show_status"><?php 
                    _e("Request Mutual Cancelation", "PricerrTheme");
                    ?>
</a>
                    
                        <?php 
                }
                ?>
                        
                        
                        <?php 
                if ($row->request_cancellation_from_buyer == 1) {
                    ?>
                                		<br/> 
                                    	<?php 
                    $using_perm = PricerrTheme_using_permalinks();
                    if ($using_perm) {
                        $lnk7 = get_permalink(get_option('PricerrTheme_my_account_mutual_cancellation')) . "?oid=" . $row->id;
                    } else {
                        $lnk7 = get_permalink(get_option('PricerrTheme_my_account_mutual_cancellation')) . "&oid=" . $row->id;
                    }
                    $ss = $row->message_to_seller;
                    $dt = date_i18n('d-M-Y H:i:s', $row->date_request_cancellation);
                    printf(__('The buyer of this job has requested a mutual cancellation for this job on %s. <br/>Buyer\'s Message: <span class="en_em">%s</span> <br/><br/> <b><a href="%s">Answer this request</a></b>.', 'PricerrTheme'), $dt, $ss, $lnk7);
                    ?>
                                    	
                                        <br/><br/>
                                        
                                        
                                    <?php 
                }
                ?>
                        
                        
                         <?php 
                if ($row->request_cancellation_from_seller == 1) {
                    $dt = date_i18n('d-M-Y H:i:s', $row->date_request_cancellation);
                    printf(__('You have requested a mutual cancellation on this job on %s. Waiting the buyer\' reply.', 'PricerrTheme'), $dt);
                    echo '<br/><br/>';
                }
                ?>
                        
                        
                        <?php 
            }
        }
        ?>
 
                        
                        
                     	<?php 
        if ($delivered == 0 && $closed != 1) {
            if ($row->request_cancellation_from_seller == 0 and $row->request_cancellation_from_buyer == 0) {
                ?>
                        <a href="<?php 
                echo get_bloginfo('siteurl');
                ?>
/?jb_action=mark_delivered&oid=<?php 
                echo $row->id;
                ?>
" 
                        class="show_status"><?php 
                _e("Mark as Delivered", "PricerrTheme");
                ?>
</a>
                        
                        
                        <a href="#" class="show_status cancel_order" rel="<?php 
                echo $row->id;
                ?>
"><?php 
                _e("Cancel Order", "PricerrTheme");
                ?>
</a>
                        
                        <?php 
            }
        } elseif ($completed != 1 && $closed != 1) {
            ?>
                        
                        <span style="font-size:10px;"><em> <?php 
            _e('Waiting for the buyer to confirm.', 'PricerrTheme');
            ?>
   </em></span>
                        
                        <?php 
        }
        ?>
                        
                        <a href="<?php 
        echo get_permalink(get_option('PricerrTheme_my_account_priv_mess_page_id'));
        ?>
?priv_act=send&pid=<?php 
        echo $row->pid;
        ?>
&uid=<?php 
        echo $row->uid;
        ?>
" 
                        class="show_status"><?php 
        _e("Contact Buyer", "PricerrTheme");
        ?>
</a> 
                        
                        <a href="<?php 
        bloginfo('siteurl');
        ?>
?jb_action=chat_box&oid=<?php 
        echo $row->id;
        ?>
" class="show_buyer_notes" rel="<?php 
        echo $id;
        ?>
"><?php 
        _e("Conversation Page", "PricerrTheme");
        ?>
</a>
                        
          			<br/><br/>
                       <?php 
        $instruction_box = get_post_meta($pid, 'instruction_box', true);
        if (!empty($instruction_box)) {
            echo '<br/><br/>' . sprintf(__('Instructions for the buyer: %s', 'PricerrTheme'), $instruction_box);
        }
        $instant = get_post_meta($pid, 'instant', true);
        if ($instant == "1") {
            $args = array('order' => 'ASC', 'orderby' => 'post_date', 'post_type' => 'attachment', 'post_parent' => $pid, 'post_mime_type' => 'application/zip', 'numberposts' => -1);
            $i = 0;
            $attachments = get_posts($args);
            if ($attachments) {
                foreach ($attachments as $attachment) {
                    $url = wp_get_attachment_url($attachment->ID);
                    $dnls = "<a href='" . $url . "' target='_blank'>" . $attachment->post_title . "</a>";
                }
            }
            echo ' ' . sprintf(__('Download File: <b>%s</b>', 'PricerrTheme'), $dnls) . " <br/>";
        }
        if ($row->extra1 == 1) {
            $extra_price = get_post_meta($pid, 'extra1_price', true);
            $extra_content = get_post_meta($pid, 'extra1_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra2 == 1) {
            $extra_price = get_post_meta($pid, 'extra2_price', true);
            $extra_content = get_post_meta($pid, 'extra2_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra3 == 1) {
            $extra_price = get_post_meta($pid, 'extra3_price', true);
            $extra_content = get_post_meta($pid, 'extra3_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra4 == 1) {
            $extra_price = get_post_meta($pid, 'extra4_price', true);
            $extra_content = get_post_meta($pid, 'extra4_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra5 == 1) {
            $extra_price = get_post_meta($pid, 'extra5_price', true);
            $extra_content = get_post_meta($pid, 'extra5_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra6 == 1) {
            $extra_price = get_post_meta($pid, 'extra6_price', true);
            $extra_content = get_post_meta($pid, 'extra6_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra7 == 1) {
            $extra_price = get_post_meta($pid, 'extra7_price', true);
            $extra_content = get_post_meta($pid, 'extra7_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra8 == 1) {
            $extra_price = get_post_meta($pid, 'extra8_price', true);
            $extra_content = get_post_meta($pid, 'extra8_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra9 == 1) {
            $extra_price = get_post_meta($pid, 'extra9_price', true);
            $extra_content = get_post_meta($pid, 'extra9_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        if ($row->extra10 == 1) {
            $extra_price = get_post_meta($pid, 'extra10_price', true);
            $extra_content = get_post_meta($pid, 'extra10_content', true);
            echo '<span class="my_extr_sh">' . $extra_content . " - " . PricerrTheme_get_show_price($extra_price) . "</span><br/>";
        }
        ?>
 
                
                  </div></div>
                  
                  	<div class="close_order_div" id="cancel_order_div_id_<?php 
        echo $row->id;
        ?>
"><div class="padd10">
                  		
                       <!-- <div class="box_title_special"><?php 
        _e('Request Cancellation', 'PricerrTheme');
        ?>
</div>
                        <form method="post"  action="<?php 
        bloginfo('siteurl');
        ?>
/?jb_action=cancel_job_request">
                        <input type="hidden" value="<?php 
        echo $row->id;
        ?>
" name="orderid" />
                            <table>
                            <tr><td colspan="2"><?php 
        _e('By using this option you are asking the buyer to cancel the order. If he agrees with this, and cancels the order, the money gets refunded into his account and
                            you will not get a bad review over it.', 'PricerrTheme');
        ?>
</td></tr>
                            
                            <tr>
                            <td valign="top" width="120"><?php 
        _e('Message for Buyer', 'PricerrTheme');
        ?>
:</td>
                            <td><textarea rows="3" cols="50" name="message_to_buyer" ></textarea></td>
                            </tr>
                            
                            <tr>
                            <td valign="top" width="120">&nbsp;</td>
                            <td><input type="submit" name="request_cancellation" value="<?php 
        _e('Submit', 'PricerrTheme');
        ?>
" /></td>
                            </tr>
                            
                            </table>
                        </form> -->
                        
                        <div class="clear10"></div>
                        
                        <div class="box_title_special"><?php 
        _e('Force Cancellation', 'PricerrTheme');
        ?>
</div>
                        <form method="post" action="<?php 
        bloginfo('siteurl');
        ?>
/?jb_action=cancel_job_request">
                        <input type="hidden" value="<?php 
        echo $row->id;
        ?>
" name="orderid" />
                            <table>
                            <tr><td colspan="2"><?php 
        _e("By using this option you are forcing cancelling this order. The money gets refunded into the buyer's account, and you will get a bad review over the job.", 'PricerrTheme');
        ?>
</td></tr>
                            
                         
                            
                            <tr>
                            <td valign="top" width="120">&nbsp;</td>
                            <td><input type="submit" name="force_cancellation" value="<?php 
        _e('Submit', 'PricerrTheme');
        ?>
" /></td>
                            </tr>
                            
                            </table>
                        </form>
                        
                  	</div></div>
                  
                  </div>
<?php 
    }
Пример #2
0
    function PricerrTheme_my_account_reviews_area_function()
    {
        global $current_user;
        get_currentuserinfo();
        $uid = $current_user->ID;
        //-------------------------------------
        global $wpdb, $wp_rewrite, $wp_query;
        $third_page = $wp_query->query_vars['third_page'];
        $third_page = $_GET['pg'];
        if (empty($_GET['pg'])) {
            $third_page = 'home';
        }
        ?>
	
       
		<div id="content">
        	
        <div class="my_box3">
            	<div class="padd10">
        
        
		<!-- page content here -->	
		<div class="box_title3"><?php 
        _e("My Ratings", 'PricerrTheme');
        ?>
</div>

			<?php 
        $using_perm = PricerrTheme_using_permalinks();
        if ($using_perm) {
            $rev_pg_lnk = get_permalink(get_option('PricerrTheme_my_account_reviews_page_id')) . "/?";
        } else {
            $rev_pg_lnk = get_bloginfo('siteurl') . "/?page_id=" . get_option('PricerrTheme_my_account_reviews_page_id') . "&";
        }
        ?>
            <div id="padd10">
            <a class="green_btn"<?php 
        echo $third_page == "home" ? 'class="actiove"' : "";
        ?>
 href="<?php 
        echo $rev_pg_lnk;
        ?>
"><?php 
        _e("Ratings to Award", "PricerrTheme");
        ?>
</a>
            <a class="green_btn"<?php 
        echo $third_page == "waiting" ? 'class="actiove"' : "";
        ?>
 href="<?php 
        echo $rev_pg_lnk;
        ?>
pg=waiting"><?php 
        _e("Pending Ratings", "PricerrTheme");
        ?>
</a>
            <a class="green_btn"<?php 
        echo $third_page == "my_rev" ? 'class="actiove"' : "";
        ?>
 href="<?php 
        echo $rev_pg_lnk;
        ?>
pg=my_rev"><?php 
        _e("My Ratings", "PricerrTheme");
        ?>
</a>
            	
            </div>
            

			<div class="clear10"></div>
			
            <?php 
        if ($third_page == "home") {
            ?>

                <div class="box_content">    
				<script>
				
					 jQuery(document).ready(function() {
  
					jQuery('.dd-submit-rating').click(function() {
					
					var id = jQuery(this).attr('rel');  
					var uprating = jQuery("#rating_me-" + id + " :selected").val();
					var reason = jQuery("#reason-" + id).val();
					if(reason.length < 10) { alert("<?php 
            _e('Please input a longer description for your rating', 'PricerrTheme');
            ?>
"); return false; }
					
					jQuery.ajax({
						   type: "POST",
						   url: "<?php 
            echo get_bloginfo('siteurl');
            ?>
/",
						   data: "rate_me=1&ids="+id+"&uprating="+uprating+"&reason="+reason,
						   success: function(msg){
							   
							jQuery("#post-" + id).hide('slow');
							
						   }
						 });
					
					return false;
					});
					
					//-------------------------
					 
				  
				  
				 });
								
				
				</script>
              	<?php 
            global $wpdb;
            $query = "select distinct *, ratings.id ratid from " . $wpdb->prefix . "job_ratings ratings, " . $wpdb->prefix . "job_orders orders where \r\n\t\t\t\t\t ratings.awarded='0' AND orders.id=ratings.orderid AND orders.uid='{$uid}'";
            $r = $wpdb->get_results($query);
            if (count($r) > 0) {
                foreach ($r as $row) {
                    $post = $row->pid;
                    $post = get_post($post);
                    $user = get_userdata($row->touser);
                    ?>
                            
                            <div class="post" id="post-<?php 
                    echo $row->ratid;
                    ?>
">
                                <div class="padd10_only">
                                <div class="image_holder3">
                                <a href="<?php 
                    the_permalink();
                    ?>
"><img width="65" height="50" 
                                src="<?php 
                    echo PricerrTheme_get_first_post_image($row->pid, 65, 50);
                    ?>
" /></a>
                                </div>
                            
                            <div  class="title_holder3" >
                            <h2><a href="<?php 
                    echo get_permalink($row->pid);
                    ?>
"><?php 
                    echo PricerrTheme_wrap_the_title($post->post_title, $row->pid);
                    ?>
</a></h2>
                            
                            <div class="c111">Rate:</div>
                            <div class="c111"><textarea id="reason-<?php 
                    echo $row->ratid;
                    ?>
" rows="2" cols="35"></textarea></div>
                            
                            <div class="c111"> <select name="rating_me" id="rating_me-<?php 
                    echo $row->ratid;
                    ?>
">
                            
                            <option value="5">5</option>
                            <option value="4">4</option>
                            <option value="3">3</option>
                            <option value="2">2</option>
                            <option value="1">1</option>
                            </select>
                            
                            </div>
                            <div class="c111 ck999">
                            <a href="#" rel="<?php 
                    echo $row->ratid;
                    ?>
" class="dd-submit-rating"><?php 
                    _e('Submit Rating Now', 'PricerrTheme');
                    ?>
</a>
                            
                            </div>
                            
                            
                            </div> 
                            
                         
                            
                            </div>
                            </div>
                        
                            
                            <?php 
                }
            } else {
                _e("There are no reviews to be awarded.", "PricerrTheme");
            }
            ?>
                
          
           </div>    
           
           <?php 
        } elseif ($third_page == "waiting") {
            ?>
                <div class="box_content">    
				
              	<?php 
            global $wpdb;
            $query = "select distinct * from " . $wpdb->prefix . "job_ratings ratings, " . $wpdb->prefix . "job_orders orders, \r\n\t\t\t\t\t" . $wpdb->prefix . "posts posts where posts.ID=orders.pid AND \r\n\t\t\t\t\t ratings.awarded='0' AND orders.id=ratings.orderid AND posts.post_author='{$uid}'";
            $r = $wpdb->get_results($query);
            if (count($r) > 0) {
                foreach ($r as $row) {
                    $post = $row->pid;
                    $post = get_post($post);
                    $user = get_userdata($row->uid);
                    ?>
                            
                            <div class="post" id="post-<?php 
                    echo $row->ratid;
                    ?>
">
                                <div class="padd10_only">
                                <div class="image_holder3">
                                <a href="<?php 
                    the_permalink();
                    ?>
"><img width="65" height="50" 
                                src="<?php 
                    echo PricerrTheme_get_first_post_image($row->pid, 65, 50);
                    ?>
" /></a>
                                </div>
                            
                            <div  class="title_holder3" >
                            <h2><a href="<?php 
                    echo get_permalink($row->pid);
                    ?>
"><?php 
                    echo PricerrTheme_wrap_the_title($post->post_title, $row->pid);
                    ?>
</a></h2> 
                            <?php 
                    echo sprintf(__('Waiting from: %s', 'PricerrTheme'), $user->user_login);
                    ?>
                            
                            
                            
                            
                            </div> 
                            
                         
                            
                            </div>
                            </div>
                        
                            
                            <?php 
                }
            } else {
                _e("You have no pending reviews.", "PricerrTheme");
            }
            ?>
                
                
                </div>
  
  
  				<?php 
        } elseif ($third_page == "my_rev") {
            ?>
  
                <div class="box_content">    
				
              	<?php 
            global $wpdb;
            $query = "select distinct *, ratings.id ratid from " . $wpdb->prefix . "job_ratings ratings, " . $wpdb->prefix . "job_orders orders, \r\n\t\t\t\t\t" . $wpdb->prefix . "posts posts where posts.ID=orders.pid AND \r\n\t\t\t\t\t ratings.awarded='1' AND orders.id=ratings.orderid AND posts.post_author='{$uid}'";
            $r = $wpdb->get_results($query);
            if (count($r) > 0) {
                foreach ($r as $row) {
                    $post = $row->pid;
                    $post = get_post($post);
                    $user = get_userdata($row->touser);
                    ?>
                            
                            <div class="post" id="post-<?php 
                    echo $row->ratid;
                    ?>
">
                                <div class="padd10_only">
                                <div class="image_holder3">
                                <a href="<?php 
                    the_permalink();
                    ?>
"><img width="65" height="50" 
                                src="<?php 
                    echo PricerrTheme_get_first_post_image($row->pid, 65, 50);
                    ?>
" /></a>
                                </div>
                            
                            <div  class="title_holder3" >
                            <h2><a href="<?php 
                    echo get_permalink($row->pid);
                    ?>
"><?php 
                    echo PricerrTheme_wrap_the_title($post->post_title, $row->pid);
                    ?>
</a></h2>
                            
                            <div class="c111"><b><?php 
                    _e("Rated", "PricerrTheme");
                    ?>
: </b></div>
                            
                            <div class="c111"><?php 
                    echo PricerrTheme_show_stars_our_of_number($row->grade);
                    ?>
                            </div>
                            <div class="clear10" style="float:left"></div>
                            <div class="c111"><b><?php 
                    _e("Description", "PricerrTheme");
                    ?>
: </b></div>
                            
                            <div class="c111"><?php 
                    echo stripslashes($row->reason);
                    ?>
                            </div>
                            
                            
                            </div> 
                            
                         
                            
                            </div>
                            </div>
                        
                            
                            <?php 
                }
            } else {
                _e("You have no reviews.", "PricerrTheme");
            }
            ?>
                
                
                </div>
          <?php 
        }
        ?>
		<!-- page content here -->	
		</div></div></div>		
    
    
    
    
    
    <?php 
        PricerrTheme_get_users_links();
    }
Пример #3
0
            $active = array('key' => 'active', 'value' => "1", 'compare' => '=');
            $closed = array('key' => 'closed', 'value' => "0", 'compare' => '=');
            $args = array('post__not_in' => array($pid), 'meta_query' => array($closed, $active), 'tax_query' => array($job_cat), 'posts_per_page' => $nrpostsPage, 'paged' => 1, 'post_type' => 'job', 'order' => "DESC", 'orderby' => "date");
            $the_query = new WP_Query($args);
            // The Loop
            if ($the_query->have_posts()) {
                while ($the_query->have_posts()) {
                    $the_query->the_post();
                    $new_post_id = get_the_ID();
                    ?>
	
			<div class="post" style="border:0">
                                <div class="padd10_only_tp">
                                <div class="image_holder6">
                                <img width="32" class="image_small_jb" height="25" src="<?php 
                    echo PricerrTheme_get_first_post_image($new_post_id, 32, 25);
                    ?>
" />
                                </div>
                            
                            <div class="title_holder6" >
                            <h2><a href="<?php 
                    echo get_permalink($new_post_id);
                    ?>
"><?php 
                    echo get_the_title();
                    ?>
</a> </h2>
               
                            
                            </div>