Monday, 19 August 2013

How to make a list of escrows only specific to the project and not to call all escrow payments of the user?

How to make a list of escrows only specific to the project and not to call
all escrow payments of the user?

This is the code of a page where I would like to display only the escrow
payments related to the specific project. I am currently only able to show
all escrow payments created by the user, but not the specific ones for the
project. I will appreciate if anyone can help me retouch the code in order
to show only project-specific escrow payments
Outstanding Escrow Payments
<?php
$s = "select * from ".$wpdb->prefix."project_escrow where released='0'
AND fromid='$uid' order by id desc";
$r = $wpdb->get_results($s);
if(count($r) == 0) echo __('No payments pending yet.','ProjectTheme');
else
{
echo '<table width="100%">';
echo '<tr>';
echo '<td><b>'.__('Project','ProjectTheme').'</b></td>';
echo '<td><b>'.__('Amount','ProjectTheme').'</b></td>';
echo '<td><b>'.__('Options','ProjectTheme').'</b></td>';
echo '</tr>';
foreach($r as $row) // = mysql_fetch_object($r))
{
$post = get_post($row->pid);
echo '<tr>';
echo '<td><a
href="'.get_permalink($post->ID).'">'.$post->post_title.'</a></td>';
echo '<td>'.ProjectTheme_get_show_price($row->amount).'</td>';
echo '<td><a
href="'.ProjectTheme_get_payments_page_url('releasepayment',
$row->id).'" class="green_btn">'.__('Release
Payment','ProjectTheme').'</a></td>';
echo '</tr>';
}
echo '</table>';
}
?>

No comments:

Post a Comment