<?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;
}

	include "../includes/htmltop.php";
	$seller_plan_details=GetSellerPlanDetails($artistid);
	
	
	$plan_Upgrade_Status=0;
	
  $sql_date_check = "SELECT ar . * , am . *
						FROM ".$tableprefix."artists_membershipDetails am
						INNER JOIN ".$tableprefix."artists ar ON ar.artist_id = am.artist_id
						INNER JOIN ".$tableprefix."sellerPlans s ON s.plan_Id = ar.sellerPlanID AND  s.plan_Id = am.plan_Id 
						WHERE  s.plan_Period IN ('Y','M') AND ar.artist_id='".$artistid."' ORDER BY am.artist_memEndDate  DESC LIMIT 1  ";
  $rs_date_check	=mysql_query($sql_date_check) or die(mysql_error());
  
  


 $sql_date_check1 = "SELECT ar . * , am . *
						FROM ".$tableprefix."artists_membershipDetails am
						INNER JOIN ".$tableprefix."artists ar ON ar.artist_id = am.artist_id
						INNER JOIN ".$tableprefix."sellerPlans s ON s.plan_Id = ar.sellerPlanID AND  s.plan_Id = am.plan_Id 
						WHERE DATE_ADD(CURDATE() , INTERVAL 1
						DAY ) >= am.artist_memEndDate AND s.plan_Period IN ('Y','M') AND ar.artist_id='".$artistid."'  ORDER BY am.artist_memEndDate  DESC LIMIT 1  ";
$rs_date_check1	=mysql_query($sql_date_check1) or die(mysql_error());
	

if(mysql_num_rows($rs_date_check1)>0)
  {
  		$plan_Upgrade_Status =1;
  }
?>


		
		<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_PLAN_DTLS; ?></div>
					<div align="center" class="text_information grey_tr"><?php echo $message?></div>
            		<br>
											
					<div align="left">			
					
					<?php if(count($seller_plan_details)>0)
					{?>																
						<table cellpadding="3" cellspacing="3" align="center" class="manage_table" width="100%">
								<tr align="left">
								  <td colspan="3" ><strong><?php echo TEXT_CUR_PLAN_DTLS; ?></strong></td>
						  </tr>
								<tr align="left">
								  <td width="23%" ><?php echo TEXT_PLAN_NAME; ?></td>
								  <td width="1%" >&nbsp;</td>
								  <td width="76%" align="left"><b><?php echo stripslashes($seller_plan_details['Plan_name']);?></b></td>
							  </tr>
								
								<tr align="left">
								  <td ><?php echo TEXT_PLAN_DESC;?> </td>
								<td >&nbsp;</td><td align="left"><b><?php echo stripslashes($seller_plan_details['Plan_description']);?></b></td></tr>
								<tr align="left">
								  <td ><?php echo TEXT_PLAN_AMT;?> &nbsp; </td>
								<td >&nbsp;</td><td align="left"><b> <?php echo $adminCurrency['currency_symbol'];?> &nbsp;<?php echo stripslashes($seller_plan_details['Plan_amount']);?></b></td></tr>
								<tr align="left">
								  <td ><?php echo TEXT_START_DT;?></td>
								<td >&nbsp;</td><td align="left"><b><?php echo dateFormat($seller_plan_details['Plan_startDate'] , "Y-m-d", "m/d/Y") ;?></b></td></tr>
								<tr align="left">
								  <td ><?php echo TEXT_EXP_DT;?></td>
								<td >&nbsp;</td><td align="left"><b><?php echo dateFormat($seller_plan_details['Plan_expiry'] , "Y-m-d", "m/d/Y") ;?></td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
						<?php if($plan_Upgrade_Status==1)
						{
						?>		
						  <tr align="left"><td colspan="3"><input type='button' value='Make Payment'  class='button' onClick="window.location.href='<?php echo SITE_URL?>/sellers/seller_plan_upgrade.php?sellerid=<?php echo $artistid?>'"></td>
						  </tr>
					  <?php } ?>			
								<tr><td colspan="3">&nbsp;</td></tr>
					  </table>
				<?php } ?>		
				
				<?php if(count($seller_plan_details)==0)
					{?>	
					
					<table cellpadding="3" cellspacing="3" align="center" class="manage_table" width="100%">
								<tr align="left">
								  <td align="center" >&nbsp; </td>
							  </tr>
								<tr align="left">
								  <td align="center" ><strong><?php echo TEXT_NO_PLANS; ?></strong></td>
					  </tr>
								<tr align="left">
								  <td align="center" >&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";
?>
