?>
</td>
</tr>
<?php 
}
?>
<tr><td colspan=3><hr class="dotted"></td></tr>
<tr><td colspan=3><br class="h10"></td></tr>
<tr valign=top>
  <td class="pplabel" align=right><?php 
echo ENTRY_TXN_GROSS_AMOUNT;
?>
</td>
  <td><br class="text_spacer"></td>
  <td class="ppsmalltext"><?php 
echo $paypal->format($paypal->txn['mc_gross'], $paypal->txn['mc_currency']);
?>
</td>
</tr>
<tr valign=top>
  <td class="pplabel" align=right><?php 
echo ENTRY_TXN_FEE_AMOUNT;
?>
</td>
  <td><br class="text_spacer"></td>
  <td class="ppsmalltext"><?php 
echo $paypal->format($paypal->txn['mc_fee'], $paypal->txn['mc_currency']);
?>
</td>
</tr>
<tr valign=top>
echo TABLE_HEADING_PAYMENT_NET_AMOUNT;
?>
&nbsp;</td>
			          </tr>
<?php 
if (!empty($paypal->info['txn_id'])) {
    $paypal_history_query = olc_db_query("select txn_id, payment_status, mc_gross, mc_fee, mc_currency, date_added, payment_date from " . TABLE_PAYPAL . " where parent_txn_id = '" . olc_db_input($paypal->info['txn_id']) . "' order by date_added desc");
    if (olc_db_num_rows($paypal_history_query)) {
        $phCount = 1;
        while ($paypal_history = olc_db_fetch_array($paypal_history_query)) {
            $phColor = $phCount / 2 == floor($phCount / 2) ? '#FFFFFF' : '#EEEEEE';
            $mc_currency = $paypal_history['mc_currency'] . HTML_NBSP;
            $mc_gross = $paypal_history['mc_gross'];
            $mc_fee = $paypal_history['mc_fee'];
            echo '			          <tr bgcolor="' . $phColor . '">' . NEW_LINE . ' 	           		<td nowrap="nowrap">&nbsp;' . $paypal->date($paypal_history['payment_date']) . '&nbsp;</td>' . NEW_LINE . '   	         		<td nowrap="nowrap">&nbsp;' . $paypal_history['payment_status'] . '&nbsp;</td>' . NEW_LINE . '     	       		<td nowrap="nowrap">&nbsp;' . PayPal_Page::draw_href_link(TABLE_HEADING_DETAILS, 'action=details&info=' . $paypal_history['txn_id']) . '&nbsp;
									</td>' . NEW_LINE . '      	    		 	<td nowrap="nowrap">&nbsp;</td>' . NEW_LINE . '		            	<td nowrap="nowrap" align="right">&nbsp;' . $paypal->format($mc_gross, $mc_currency) . '
									</td>' . NEW_LINE . '		   		        <td nowrap="nowrap" align="right">&nbsp;' . $paypal->format($mc_fee, $mc_currency) . '
									</td>' . NEW_LINE . '       			    <td nowrap="nowrap" align="right">&nbsp;' . $paypal->format($mc_gross - $mc_fee, $mc_currency) . '
 									</td>' . NEW_LINE . '          			</tr>' . NEW_LINE;
            $phCount++;
        }
    }
    //Now determine whether the order is on hold
    if ($order->info['orders_status'] === MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID) {
        $ppImgAccept = olc_image(PAYPAL_IPN_DIR . 'images/act_accept.gif', IMAGE_BUTTON_TXN_ACCEPT);
        $ppAction = HTML_A_START . olc_href_link(FILENAME_ORDERS, olc_get_all_get_params(array('action')) . 'action=accept_order&digest=' . $paypal->digest()) . '">' . $ppImgAccept . HTML_A_END;
    } else {
        $ppAction = '';
    }
    $mc_currency = $paypal->txn['mc_currency'];
    $mc_gross = $paypal->txn['mc_gross'];
    echo $ipn_trans['payment_status'];
    ?>
                </td>
                <td class="dataTableContent" align="right">
                	<?php 
    echo PayPal_TransactionDetails::format($ipn_trans['mc_gross'], $ipn_trans['mc_currency']);
    ?>
                </td>
                <td class="dataTableContent" align="right">
                	<?php 
    echo PayPal_TransactionDetails::format($ipn_trans['mc_fee'], $ipn_trans['mc_currency']);
    ?>
                </td>
                <td class="dataTableContent" align="right">
                	<?php 
    echo PayPal_TransactionDetails::format($ipn_trans['mc_gross'] - $ipn_trans['mc_fee'], $ipn_trans['mc_currency']);
    ?>
                </td>
                <td class="dataTableContent" align="right">
                	<?php 
    if (isset($ipnInfo) && is_object($ipnInfo) && $ipn_trans['paypal_id'] == $ipnInfo->paypal_id) {
        echo olc_image(DIR_WS_IMAGES . 'icon_arrow_right.gif');
    } else {
        echo HTML_A_START . olc_href_link(FILENAME_PAYPAL, 'page=' . $page . '&ipnID=' . $ipn_trans['paypal_id']) . '">' . olc_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . HTML_A_END;
    }
    ?>
&nbsp;
                	</td>
              </tr>
<?php 
}