<?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_adminname"]) and $_SESSION["sess_adminname"]!= ""){
	$adminname = $_SESSION["sess_adminname"];
}else{
	header("Location:login.php");
	exit;
}

$refund_id=$_GET['id'];

$sql="select  o.billing_first_name,o.billing_last_name,o.billing_email ,a.artist_name,od.product_name,r.status,r.*
	 from ".$tableprefix."orders o ,".$tableprefix."artists a ,  ".$tableprefix."order_details od ,".$tableprefix."refunds r 
	 where  o.order_id=r.order_id AND od.order_id=r.order_id and od.product_id=r.product_id 
	 and a.artist_id=r.seller_id  and r.refund_id='".$refund_id."'";
$rs=mysql_query( $sql) or die(mysql_error());

$numrows=mysql_num_rows($rs);
if($numrows>0)
{
	$rr=mysql_fetch_array($rs);
}	
include "../includes/htmltop.php";
?>
<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_admin.php")

?>
				
				<!--header area end -->
				
				
				
				
				<div align="left" class="main_body">
				<!--main body start -->
				
				
				
<?php
		include_once("../includes/admintopmenu.php")
?>		
																					
								
					<div align="left" class="content_area">
					
					<!--content area start -->
							
					<div align="left" class="page_title"><?php echo TEXT_VIEW_REFUND_DETAILS; ?> (#<?php echo $ordernumber;?>)</div>
					<div align="center" class="text_information grey_tr"><?php echo $message?></div>
            		<br>
											
					<div align="left">																			
		
					<?php if($numrows>0) { ?>
																									
					<table cellpadding="3" cellspacing="3" border="0" width="100%" class="manage_table">
						<tr>
						  <td colspan="3" class="form_header"><strong><?php echo TEXT_REFUND_DETAILS; ?> </strong></td>
						</tr>
						<tr>
						  <td align="left" ><?php echo TEXT_RETURN_STATUS; ?> </td>
						  <td >:</td>
						  <td align="left" class="innertextCopy2"><?php if($rr['Status']==''){ echo "Awaiting Response";}else {  echo $rr['Status']; }?></td>
					  </tr>
						<tr>
						  <td align="left" width="25%" ><?php echo BUYER_NAME; ?> </td>
						  <td width="1%" >:</td>
						  <td width="74%" align="left" class="innertextCopy2"><?php echo $rr['billing_first_name'] . " " . $rr['billing_last_name'];?></td></tr>
						<tr>
						  <td align="left" ><?php echo TEXT_SELLER_NAME; ?> </td>
						  <td >:</td>
						  <td align="left" class=""><?php echo $rr['artist_name'];?></td></tr>
						<tr>
						  <td align="left" ><?php echo PRODUCT_NAME; ?> </td>
						  <td >:</td>
						  <td align="left" class=""><?php echo stripslashes($rr['product_name']);?></td></tr>
						<tr>
						  <td align="left" valign="top"><?php echo TEXT_RETURN_REASON; ?> </td>
						  <td >:</td>
						  <td align="left" class=""><?php echo  stripslashes($rr['return_reason']);?></td></tr>
						<tr>
						<tr>
						  <td align="left" valign="top"><?php echo TEXT_CUSTOMER_FEEDBACK; ?> </td>
						  <td >:</td>
						  <td align="left" class=""><?php  if($rr['Additional_info']==''){ echo "Not yet Updated" ; } else { echo stripslashes($rr['Additional_info']);}?></td></tr>
						<tr>
						
						<tr>
						  <td align="left" valign="top"><?php echo TEXT_SELLER_REMARKS; ?> </td>
						  <td >:</td>
						  <td align="left" class=""><?php  if($rr['Customer_Feedback']==''){ echo "Not yet Updated" ; } else { echo stripslashes($rr['Customer_Feedback']);}?></td></tr>
						<tr>
						
						<tr>
						  <td align="left" valign="top"><?php echo TEXT_REFUND_REQUEST_DATE; ?> </td>
						  <td >:</td>
						  <td align="left" class=""> <?php echo dateFormat($rr["date"],"Y-m-d","m/d/Y")?></td>
						</tr>
						<tr>
						  <td>&nbsp;</td>
						  <td>&nbsp;</td>
						  <td>&nbsp;</td>
						</tr>
						<tr>
						  <td>&nbsp;</td>
						  <td>&nbsp;</td>
						  <td><input type="button" class="button" name="Submit" value="<?php echo BTN_BACK_TO_REFUNDS; ?>" onClick="window.location.href='refunds_requests.php'"></td>
					  </tr>
					</table>
			<?php
			}
			 else
			 {
			 
			?>		
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="manage_table">
						<tr><td colspan="3">&nbsp;</td></tr>
						<tr>
						  <td align="center" ><?php echo NO_RECORDS_FOUND; ?>  </td>
						  <td >&nbsp;</td>
						  <td align="left" class="innertextCopy2">&nbsp;</td>
					  </tr>
			</table>	
			<?php } ?>	  
					
			</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>
				
				
<?php
	include "../includes/footer.php";

?>