<?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($_GET["artistid"]) and $_GET["artistid"] != "") {
    $artistid = $_GET["artistid"];
} else if (isset($_POST["artistid"]) and $_POST["artistid"] != "") {
    $artistid = $_POST["artistid"];
}

if (isset($_GET["storename"]) and $_GET["storename"] != "") {
	$storename = $_GET["storename"];
} else if (isset($_POST["storename"]) and $_POST["storename"] != "") {
	$storename = $_POST["storename"];
}



/*----------Multicart 2.0 Upgradation Starts------------*/

if($enable_seller_friendly == "Y")
{
	if(!empty($storename)){ 
	
		$select_artist_id = "SELECT artist_id,artist_name FROM ".$tableprefix."artists WHERE storename = ".GetSQLValueString($storename,"text");
	}else{
	
	$select_artist_id = "SELECT artist_id,artist_name FROM ".$tableprefix."artists WHERE artist_name = ".GetSQLValueString($artistid,"text");
	}
	$result_artist_id = mysql_query($select_artist_id) or die(mysql_error());
	
	if(mysql_num_rows($result_artist_id) > 0)
	{
	
		$artist_row = mysql_fetch_assoc($result_artist_id);
		$artistid = $artist_row['artist_id'];
		$artist_name = $artist_row['artist_name'];
	
	
	}
}else {
	if(!empty($storename)){
		$select_artist_id = "SELECT artist_id,artist_name FROM ".$tableprefix."artists WHERE storename = ".GetSQLValueString($storename,"text");
	
	$result_artist_id = mysql_query($select_artist_id) or die(mysql_error());
	
	if(mysql_num_rows($result_artist_id) > 0)
	{
	
		$artist_row = mysql_fetch_assoc($result_artist_id);
		$artistid = $artist_row['artist_id'];
		$artist_name = $artist_row['artist_name'];
	
	
	}
	}
}

/*----------Multicart 2.0 Upgradation Ends------------*/



$portfoliodir = SITE_URL."/portfolios/";

$sql = "SELECT ap.*, a.artist_name,a.first_name,a.last_name,a.company,a.state, a.country ,a.theme_banner,a.theme_color,a.theme_numcols,a.theme_numrows
		FROM ".$tableprefix."artists a LEFT JOIN ".$tableprefix."artist_portfolios ap ON a.artist_id = ap.artist_id  
		WHERE a.artist_id = '".addslashes($artistid)."' ";

$res = mysql_query($sql);
if(mysql_num_rows($res) > 0 ){
	$row= mysql_fetch_array($res);
	$portfolioid = $row["artist_portfolio_id"];
	$txtArtistDescription = $row["artist_description"];
        $txtArtistCompany = stripslashes($row["company"]);
        $txtThemeBanner = $row["theme_banner"];
        $txtThemeColor = $row["theme_color"];
        $txtNumRows = $row["theme_numrows"];
        $txtNumCols = $row["theme_numcols"];
        if(($txtThemeBanner!='')&&(is_file("sellerbanners/".$txtThemeBanner)))
            {
            $themefolder = SITE_URL."/sellerbanners/";
            $themeImgUrl="<img src='".$themefolder.$txtThemeBanner."' border='0' width='970' height='100' >";
        }
        if($txtThemeColor!='')
            {
            $newThemeStyle="background-color:".$txtThemeColor." !important;background-image:none;";
        }
	$txtArtistPhoto= $row["artist_photo"];
	$arrSamples = array();
	

	$txtArtistName = $row["artist_name"];
	$txtArtistFirstName = $row["first_name"];
	$txtArtistLastName = $row["last_name"];
	$txtArtistFullName = $txtArtistFirstName;
	if($txtArtistLastName!=""){
		$txtArtistFullName .= " ". $txtArtistLastName;
	}
	$txtArtistState = $row["state"];
	$txtArtistCountry = $row["country"];
	
	if(($txtArtistPhoto == "")|| (!is_file("portfolios/".$txtArtistPhoto))){
		$imageurl = "<img src='".$portfoliodir . "noimage.jpg' width='191' height='183' border='0' >";
	}else{ 
		//	if(is_fi)
		//	echo $txtArtistPhoto;
			$imageurl = "<img src='".$portfoliodir.$txtArtistPhoto."' border='0' width='191' height='183' >";
	}
}
/*----------Multicart 2.0 Upgradation Starts------------*/

if($enable_seller_friendly == "Y")
{
	$artist_name = $row['artist_name'];
}

/*----------Multicart 2.0 Upgradation Ends------------*/

/*display the active template*/

$active_template = displayTemplate();




include "includes/htmltop_portfolio.php";


/* Top File Name */

include_once ("includes/top_portfolio.php");


?>

<script>
function clickSearch()
{
	document.frmCatalog.submit();
}
</script>

<div align="left" class="main_body">

<!--mainbody area start -->
<!--center content area start-->		



<div align="left" id="item_details">
	<!--items display area start -->

        <?php if($themeImgUrl!='')
	{
	?>
		<div class="seller_port_cnt" style="margin-top:10px">
		<?php echo stripslashes($themeImgUrl);?>
		</div>
   <?php } ?>

	<?php if($txtArtistDescription!='')
	{
	?>
		<div class="seller_port_cnt"  style="margin-top:10px">
		<?php echo stripslashes($txtArtistDescription);?>
		</div>
   <?php } ?>		
		<div class="prdct_container">
		<?php
			require("./includes/artistproductlist.php");
			?>
		</div>
<!--items display area end -->
</div>


<!--mainbody area end -->
</div>
		
<?php
	include "includes/footer_portfolio.php";	/* Bottom File Name */
?>