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

$message_to_seller_id = $_GET['message_to_seller_id'];
$page = isset($_GET['page'])? trim($_GET['page']):1;

	$sql = "SELECT *
		FROM ".$tableprefix."message_to_seller
                WHERE artist_id = ".$_SESSION["sess_artistid"]. " 
                 AND message_to_seller_id = '". mysql_real_escape_string($message_to_seller_id) . "'";
	$rs = mysql_query($sql) or die(mysql_error());

	

include "../includes/htmltop.php";

?>

		
		<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"><?php echo TEXT_MY_MSG;?></div>
					<div align="center" class="text_information grey_tr"><?php echo $message?></div>
            		<br>
											
					
						
					<div align="left">					
					
																																				
					<table border="0" width="100%" cellpadding="0" cellspacing="0" class="manage_table">
					
						
						
						<?php
if(mysql_num_rows($result) > 0 )
{
	
	$row = mysql_fetch_array($rs);
	
	if($row["read"] == 'N')
        {
            $sql = "UPDATE  ".$tableprefix."message_to_seller
                SET `read` = 'Y'
                WHERE artist_id = ".$_SESSION["sess_artistid"]. " 
                 AND message_to_seller_id = '". mysql_real_escape_string($message_to_seller_id) . "'";
	$rs = mysql_query($sql) or die(mysql_error());
        }
			
						
				
?>
<tr>
    <th width="10%" align="left"><?php echo TEXT_FROM;?></th>
    <td align="left"><?php echo stripslashes($row["name"]);?></td>
</tr>
<tr>
    <th align="left"><?php echo TEXT_EMAIL;?></th>
    <td align="left"><?php echo stripslashes($row["email"]);?></td>
</tr>
<tr>
    <th align="left"><?php echo TEXT_SUBJECT;?></th>
    <td align="left"><?php echo stripslashes($row["subject"]);?></td>
</tr>
<tr>
    <th align="left"><?php echo TEXT_DATE_ADDED;?></th>
    <td align="left"><?php echo dateFormat($row["created_on"], "Y-m-d", "m/d/Y");?></td>
</tr>
<tr>
    <th align="left"><?php echo TEXT_MSG;?></th>
    <td align="left"><?php echo nl2br($row["message"]);?></td>
</tr>



<?php
}	
?>
	
<tr>
    <td colspan="3">
        <input type="button" class="button" value="<?php echo BTN_BACK;?>" onclick="window.location='messages.php?page=<?php echo $page; ?>'"/>
    </td>
</tr>
	
								
					  </table>
                                        </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";
?>