<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		              |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com © 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
include "../includes/config.php";
include "../includes/session.php";
include "../includes/functions.php";

if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE); 
} 

if(isset( $_SESSION["sess_artistid"]) and $_SESSION["sess_artistid"]!= ""){
	$artistid = $_SESSION["sess_artistid"];
}else{
	header("Location:login.php");
	exit;
}
if(checkArtistExpired($artistid)){
	header("Location:seller_plan_upgrade.php?sellerid=".$artistid);
	exit;
}
if(isset( $_GET["paymentid"]) and $_GET["paymentid"]!= ""){
	$paymentid = $_GET["paymentid"];
}else if(isset( $_POST["paymentid"]) and $_POST["paymentid"]!= ""){
	$paymentid = $_POST["paymentid"];
}else{
	header("Location:payments.php");
	exit;
}





$sql = "SELECT sp.*, s.artist_name FROM ".$tableprefix."artist_payments sp INNER JOIN  ".$tableprefix."artists s ON sp.artist_id = s.artist_id  WHERE artist_payment_id = '".addslashes($paymentid)."' ";
$result = mysql_query($sql);
if(mysql_num_rows($result) != 0){
	$row = mysql_fetch_array($result);
	$txtArtistName = $row["artist_name"];
	$txtOrderNumber = $row["order_id"];
	$txtOrderTotal = $row["total_amount"];
	$txtTotalPaid = $row["amount_paid"];
	$txtArtistCommission = $row["commission_percentage"]; 
	$txtPaymentMarkedDate = (isNotNull($row["date_marked_for_payment"]) ? dateFormat($row["date_marked_for_payment"],"Y-m-d","m-d-Y") : "");
	$txtPaymentDate = (isNotNull($row["payment_date"] and ($row["payment_date"]!= "0000-00-00")) ? dateFormat($row["payment_date"],"Y-m-d","m-d-Y") : "");
	$txtComments = $row["comments"];
	$txtPaymentMethod = $row["payment_method"];
}else{
	header("Location:payments.php");
	exit;
}
include "../includes/htmltop.php";
?>

<link href="../style/calendar-win2k-cold-1.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../includes/calendar.js"></script>
<script type="text/javascript" src="../includes/calendar-setup.js"></script>
<script type="text/javascript" src="../includes/calendar-en.js"></script>
<SCRIPT>
function confirmDelete(){
	if(confirm("Are you sure you want to delete this record?") ){
		return true;
	}
	return false;
}
</SCRIPT>
<body>
		
		<center>
		
		<div align="left" id="layout">
		
		
				
				
				<!--header area start -->
<?php

	include_once("../includes/topheader_seller.php")

?>
				
				<!--header area end -->
				
				
				
				
				<div align="left" class="main_body">
				<!--main body start -->
				
				
				
<?php
		include_once("../includes/artisttopmenu.php")
?>		
																					
								
					<div align="left" class="content_area">
					
					<!--content area start -->
							
					<div align="left" class="page_title">View Payment Details</div>
					<div align="center" class="text_information grey_tr"><?php echo $message?></div>
            		<br>
											
					<div align="left">		
					<form name="frmPaymentDetails" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
					<input type="hidden" name="paymentid" value="<?php echo htmlentities($paymentid);?>">
						<table width="100%" border="0" cellpadding="0" cellspacing="0" class="manage_table">
							<tr><td colspan="3" class="message" align="left"><?php echo $message;?></td></tr>
							<tr><td colspan="3">&nbsp;</td></tr>
							<tr><td align="left" width='25%'>Seller Name&nbsp;</td><td width='5%'>&nbsp;</td><td width='70%' align="left" class="innertextCopy2"><?php echo htmlentities($txtArtistName);?></td></tr>
							<tr><td align="left" >Order Number &nbsp;</td><td >&nbsp;</td><td align="left" class="innertextCopy2"><?php echo htmlentities($txtOrderNumber);?></td></tr>
							<tr><td align="left" >Order Total&nbsp;</td><td >&nbsp;</td><td align="left" class="innertextCopy2"><?php echo htmlentities(number_format($txtOrderTotal, 2, '.', ''));?></td></tr>
							<tr><td align="left" >Seller Commission(%)&nbsp;</td><td >&nbsp;</td><td align="left" class="innertextCopy2"><?php echo htmlentities(number_format($txtArtistCommission, 2, '.', ''));?></td></tr>
							<tr><td align="left" >Total Payable&nbsp;</td><td >&nbsp;</td><td align="left" class="innertextCopy2"><?php echo htmlentities(number_format($txtTotalPaid, 2, '.', ''));?></td></tr>
							<tr><td align="left" >Date Marked for Payment&nbsp;</td><td >&nbsp;</td><td align="left" class="innertextCopy2"><?php echo htmlentities($txtPaymentMarkedDate);?></td></tr>
							<tr>
								<td align="left" >Date of Actual Payment&nbsp;</td>
								<td >&nbsp;</td>
								<td align="left" class="innertextCopy2"><?echo $txtPaymentDate?>
								</td>
							</tr>
							<tr><td align="left" >Payment Method&nbsp;</td><td >&nbsp;</td><td align="left" class="innertextCopy2"><?php echo htmlentities($txtPaymentMethod);?></td></tr>
							<tr><td align="left" valign="top">Comments&nbsp;</td><td >&nbsp;</td><td align="left" class="innertextCopy2"><div name="txtComments"><?php echo nl2br(htmlentities($txtComments));?></div></td></tr>
							<tr><td colspan="3">&nbsp;</td></tr>
							<tr><td colspan="3" align="center"><input type="button" value="Back" class="button" name="btnBack" onClick="window.location.href='payments.php'" ></td></tr>
						</table>
					</form>

																									</div>
						
						
				<!--content area end-->
								
				</div>
				
								
					<div align="left" class="clear_float"><img src="<?php echo $imagefolder;?>/clear.gif" alt="" width="1" height="1" /></div>
				<!--main body end -->
				</div>
				
				
<?
	include "../includes/footer.php";
?>