<?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 (C) 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";


/*display the active template*/

$active_template = displayTemplate();


include "includes/htmltop.php";

/* Top File Name */

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

/*---Display the terms and conditions------*/

$cms_content_terms = displayCMS('about_us');

/*---Display the terms and conditions------*/

?>


<div align="left" class="main_body">
			<!--mainbody area start -->
		<!--center content area start-->		

		<form name="frmRegister" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST" onSubmit="">
			<input type="hidden" name="action" value="<?php echo htmlentities($action);?>">
			
		<div align="left" id="item_details">
	
	
		<!--items display area start -->
	
		<div align="left" style="height:35px; " id="items_top_area">
				<div align="left" id="items_top_area_ttl"><?php echo SELLERS_TEXT;?></div>

                               <?php
                               if(isset( $_SESSION["sess_artistid"]) and $_SESSION["sess_artistid"]!= ""){
                               }else{
                               ?>
                                    <div style="width:200px; float:right; " class="align_lt">
                                        <input type="button" onclick="window.location.href='sellers/login.php'"  style="width:auto; font-size:12px; padding:6px 0 6px 0;cursor: pointer;float:right;margin-left: 10px; " value="<?php echo SELLER_LOGIN_BUTTON;?>" class="button" />&nbsp;&nbsp;
                                        <input type="button" onclick="window.location.href='sellers/register.php'" value="<?php echo REGISTER_BUTTON;?>"  style="width:auto; font-size:12px; padding:6px 0 6px 0;cursor: pointer;float:right;; " class="button" />
                                    </div>
                                <?php }?>
		</div>
		
		<div class="text_information" align="center"><?php echo $message?></div>
	
	<div class="cms_content_area">
	<?php        
        $sql="SELECT  ar.artist_id,ap.artist_description,ap.artist_photo,
                    ar.first_name, ar.last_name, ar.artist_name,ar.storename
			  FROM ".$tableprefix."artists ar
                              LEFT JOIN ".$tableprefix."artist_portfolios ap ON ar.artist_id = ap.artist_id
			  WHERE ar.vapproved='Y' AND ar.deleted='N'
                          ORDER BY ar.first_name  ASC";
    ?>

	<!--items display area start -->
<?php	
	$limit=getPaginationLimit();

if($limit==0)
{
	$limit=10;
}	

$page=$_GET['page'];

if(empty($page))
	{
		$page = 1;
	}
	$prodimagedir = "products/";
				
	if(!(isset($pagenum)))
	{
		$pagenum = 1;
	} 
		   
	$result=mysql_query($sql) or die(mysql_error());						
	
	$totalrows = mysql_num_rows($result);
	if($page > 0){
	$limitvalue = ($page - 1) * $limit;
        }
        else
        {
            $limitvalue = 0;
        }
//	$query_string = " LIMIT $limitvalue, $limit";
//	
//	$sql = $sql.$query_string;
	
	
	$result=mysql_query($sql) or die(mysql_error());
        
	if(mysql_num_rows($result) > 0 )
	{
		while($row = mysql_fetch_array($result))
		{

                        $foto = $row['artist_photo'];
                        
                        
                        if(!(is_file("./portfolios/". $foto) && file_exists("./portfolios/". $foto)))
                        {
                            $foto = 'noimage.jpg';
                        }
                        
                                
                    
                        if($enable_seller_friendly == "Y")
                        {
                           
                            $sellerLink = (!empty($row['storename'])) ? SITE_URL . "/stores/" . $row['storename'] : SITE_URL . "/store/" . $row['artist_name'];
                            //$sellerLink = SITE_URL . "/store/" . $row['artist_name'];
                        }
                        else
                        {
                            $sellerLink = (!empty($row['storename'])) ? SITE_URL."/showportfolio.php?storename=" . $row['storename'] : SITE_URL."/showportfolio.php?artistid=" . $row['artist_id'];
                        }
?>			
<!--Display the product details-->
<div class="seller_lst_wrap">
<div class="image_div">
   <a href="<?php echo $sellerLink; ?>" target="_blank">  <img src="./portfolios/<?php echo $foto; ?>" width="100" height="100"/></a>
</div>
    
    <div class="sellerlst_content">
<h3><a href="<?php echo $sellerLink; ?>" target="_blank" >  <?php echo ucfirst($row["first_name"]). ' ' .ucfirst($row["last_name"]); ?> </a>        </h3>
<div> <table width="100%" cellpadding="0" cellspacing="0"> <tr><td>
    <?php 
    $desc = substr($row["artist_description"],0,400);
    echo nl2br($desc); 
    ?></td></tr></table>
</div>

<div class="clear"></div>

</div>
    
<div class="clear"></div>

</div>
    
			
<!--Display the product details-->			
			

<?php
			}
		
	
		}
		else{
		
		     echo "<br>".SELLER_NOT_FOUND_TEXT;
		}
	
			
		if($page > 1)
		{
			$pageprev = $page-1;
			
			$previous_page = "<a href=".$_SERVER['PHP_SELF']."?page=$pageprev&tab=$currentTabID alt='".PREVIOUS_TEXT."' title='".PREVIOUS_TEXT."' border='0'><img src='".$active_template[3]."/previous_btn.gif' alt='".PREVIOUS_TEXT."' border='0' /></a>";
			
		}
		
		$numofpages = ceil($totalrows / $limit);
					
		if($page < $numofpages)
		{
			$pagenext = ($page + 1);
			
			$next = "<a href=".$_SERVER['PHP_SELF']."?page=$pagenext&tab=$currentTabID alt='".NEXT_TEXT."' title='".NEXT_TEXT."' border='0'><img src='".$active_template[3]."/next_btn.gif' alt='".NEXT_TEXT."' border='0'/></a>&nbsp;";
			
		}
		
?>	
		</div>	
	
	
					
					
		 <!--items display area end -->
		  </div>
		
			</form>
		<!--center content area end-->	


		<!--mainbody area end -->
        </div>

    <?php
        if(isset( $_SESSION["sess_artistid"]) and $_SESSION["sess_artistid"]!= ""){
        }else{
    ?>
        <div style="width:170px; float:right;" class="align_lt">
            <input type="button" onclick="window.location.href='sellers/login.php'"  style="width:80px; font-size:12px; padding:6px 0 6px 0; cursor: pointer; " value="<?php echo SELLER_LOGIN_BUTTON;?>" class="button" />&nbsp;&nbsp;
            <input type="button" onclick="window.location.href='sellers/register.php'" value="<?php echo REGISTER_BUTTON;?>"  style="width:80px; font-size:12px; padding:6px 0 6px 0; cursor: pointer; " class="button" />
        </div>
    <?php }?>


				

<?php
include "includes/".$active_template[2];	/* Bottom File Name */
?>