<?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";
include "includes/arrays.inc.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_userid"]) and $_SESSION["sess_userid"]!= ""){
	$userid = $_SESSION["sess_userid"];
}else{
	header("Location:login.php");
	exit;
}
$refund_id=$_GET['id'];
$qry="select * from ".$tableprefix."settings ";
$rs_q=mysql_query($qry) or die(mysql_error());
$row=mysql_fetch_array($rs_q);

 $sql="SELECT o.billing_first_name,o.billing_last_name,o.billing_email ,o.order_id,a.artist_name,a.first_name,a.last_name,od.product_name,r.*
	     FROM ".$tableprefix."orders o ,".$tableprefix."artists a , ".$tableprefix."order_details od ,".$tableprefix."refunds r 
	    WHERE ".$qryopt." 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.buyer_id=".$userid." and r.refund_id='".$refund_id."' ";
	 		 
$result = mysql_query($sql);

$totalrows = mysql_num_rows($result);

if($totalrows>0)
{
	
	$rr=mysql_fetch_array($result);
} 
/*display the active template*/

$active_template = displayTemplate();


include "includes/htmltop.php";

/* Top File Name */

include_once ("includes/".$active_template[0]);

?>
<script language="JavaScript" type="text/JavaScript">
function clickSearch()
{
	document.frmFeedbacks.submit();
}
function changeStatus(id){
	var frm = document.frmFeedbacks;
	if(Confirm('<?php echo CONFIRM_CHANGE_STATUS_TEXT;?>')){
		document.frmFeedbacks.submit();
	}
}

function checkConfirm()
{
var chks = document.frmresponse.elements['ids[]'];
var hasChecked = false;
for (var i=0;i<chks.length;i++){
if (chks[i].checked){
hasChecked = true;
break;
}
}
if (!hasChecked){
alert('<?php echo SELECT_CHECK_BOX_TEXT;?>');
chks[0].focus();
return false;
}

return true;

}

checked=false;
function checkedAll (frm1) {
	var aa= document.getElementById('frmresponse');
	 if (checked == false)
          {
           checked = true
          }
        else
          {
          checked = false
          }
	for (var i =0; i < aa.elements.length; i++) 
	{
	 aa.elements[i].checked = checked;
	}
      }
</script>

			<div align="left" class="main_body">
			
			<!--mainbody area start -->
			
			<div align="left" id="body_left_area">
				<!--body left area start -->
		
				
				
			<!--categories area start -->
			
<?php

	include_once("includes/categorylist.php");

?>			
			
			<!--categories area end -->	
			
			<!--body left area end -->
			  </div>


		<!--center content area start-->		

		<div align="left" id="item_details">
		<!--items display area start -->
		<div align="left" id="items_top_area">
				<div align="left" id="items_top_area_ttl"><?php echo RETURN_PAYMENTS_TEXT;?></div>
		</div>

		
		<div class="order_listings">
			<table width="100%"  border="0" cellpadding="5" cellspacing="5" align="center" class="manage_table">
				
				<tr>
					<td width="26%" height="21"  align="left"><?php echo PRODUCT_NAME_TEXT1;?> </td>
				    <td width="3%"  align="left">:</td>
				    <td width="71%"  align="left"><?php echo $rr['product_name'];?></td>
				</tr>
				<tr>
				  <td align="left"><?php echo SELLER_NAME_TEXT;?> </td>
				  <td>:</td>
				  <td><?php echo $rr['first_name'] . " ".$rr['last_name'];?></td>
				</tr>
				
						
								<tr>
								  <td align="left" ><?php echo REFUND_REQ_DATE_TEXT;?> </td>
								  <td align="center" >:</td>
								  <td align="left" ><?php echo dateFormat($rr["date"], "Y-m-d", "m/d/Y");?></td>
			  </tr>
								<tr>
								  <td align="left" ><?php echo REFUND_REASON_TEXT;?> </td>
								  <td align="center" >:</td>
								  <td align="left" ><?php echo stripslashes($rr['return_reason']);?></td>
			  </tr>
								<tr>
								  <td align="left" ><?php echo REFUND_STATUS_TEXT;?> </td>
								  <td align="center" >:</td>
								  <td align="left" ><?php if($rr['Status']!=''){ echo $rr['Status']; } else { echo AWAIT_RESPONSE_TEXT;} ?></td>
			  </tr>
			  	<?php 
					if($rr['refund_mode']!='')
					{ 
				?>
					<tr>
						<td align="left" ><?php echo REFUND_MODE_TEXT;?></td>
						<td align="center" >:</td>
						<td align="left" ><?php echo $rr['refund_mode'];?></td>
					</tr>
			  <?php 
			  } // end if 
			  ?>
			  
			  <?php if($rr['reference_number']!=''){ ?>
								<tr>
								  <td align="left" ><?php echo REF_NO_TEXT;?></td>
								  <td align="center" >:</td>
								  <td align="left" ><?php echo $rr['reference_number'];?></td>
			  </tr>
			  <?php } // end if ?>
								<tr>
								  <td align="left" ><?php echo BUYER_COMMENT_TEXT;?> </td>
								  <td align="center" >:</td>
								  <td align="left" ><?php echo $rr['Additional_info'];?></td>
			  </tr>
								
					<?php if($rr['Customer_Feedback']!='') { ?>			
								
								<tr>
								  <td align="left" ><?php echo SELLER_FEEDBACK_TEXT;?> </td>
								  <td align="center" >:</td>
								  <td align="left" ><?php echo $rr['Customer_Feedback'];?></td>
			  </tr> <?php } // end if ?>
								<tr>
								  <td align="left" >&nbsp;</td>
								  <td align="center" >&nbsp;</td>
								  <td align="left" >&nbsp;</td>
			  </tr>
								<tr>
									<td align="left" ><input type="button" value="<?php echo BACK_RETURN_BUTTON;?>" name="btnBack"  class="button" onClick="window.location.href='myreturns.php'">
									
									</td>
								    <td align="center" >&nbsp;</td>
								    <td align="center" >&nbsp;</td>
								</tr>
								
		  </table>
<div class="clear"></div>
						
																										
		</div>	
	
	
		<div align="left" class="float_clear1"></div>
					
					
		 <!--items display area end -->
		  </div>

		<!--center content area end-->	


		<!--mainbody area end -->
        </div>
<?php
include "includes/".$active_template[2];	/* Bottom File Name */
?>																										
																										
																										
																									