<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Santhosh Thomas Alexander<@santhosh.thomas@armiasystems.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;
}
if(isset($_POST['gotoPage']))
{
	header("Location:".$_SERVER['PHP_SELF']."?page=".$_POST['gotoPage']);
}

$qryopt="";
/*
        $sql  = " SELECT h.*,hc.* 
                    FROM ".$tableprefix."help h 
              INNER JOIN ".$tableprefix."helpcategory hc 
                      ON h.hcid=hc.hcid
                   WHERE hc.htype='admin' and h.active='1' 
                GROUP BY h.hcid 
                ORDER BY h.hposition desc ";
*/
        $sql  = " SELECT hc.* 
                    FROM ".$tableprefix."helpcategory hc 
                   WHERE hc.htype='seller' AND hc.active ='1'
                ORDER BY hc.hcposition";
	if(!(isset($pagenum)))
	{
		$pagenum = 1;
	} 
	
	$limit = getSettingsValue('npagination_limit');
	
	$page = isset($_GET['page'])? trim($_GET['page']):1;

	
	$page = $_GET['page'];
	
	if(empty($page))
	{
		$page = 1;
	}
	
	$result=mysql_query($sql) or die(mysql_error());						
	
	$totalrows = mysql_num_rows($result);
	
	$limitvalue = ($page - 1) * $limit;
	
	$query_string = " LIMIT $limitvalue, $limit";
	
	$sql = $sql.$query_string;
	$rs = mysql_query($sql) or die(mysql_error());

	$numofpages = ceil($totalrows / $limit);

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">
					<div align="left" class="page_title"><?php echo TEXT_SELLER_HELP;?></div>
					<div align="center" class="text_information grey_tr"><?php echo $message?></div>
                    <br>
                    
					<table width="100%"  border="0" cellpadding="0" cellspacing="0" >
                                            
                                        <?php
						if(mysql_num_rows($result) > 0 )
						{
					?>
					<br>
						<tr>
							<td align="center" valign="middle" >
								<table border="0" align="center" cellpadding="0" cellspacing="1">
										<tr>
											<td colspan="5">
												<?php echo rightpaging(); ?>
											</td>
										</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td>
								<table width="100%"  border="0" cellspacing="0" cellpadding="0">
								<?php
								$i = 1;
								
								while($row = mysql_fetch_array($rs))
								{
								?>
								<tr>
									<td width="25%" valign="top">
										<table class="manage_table" border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr class="form_header">
												<td height="24" align="left">&nbsp;&nbsp;<b><?php echo ucfirst($row['hctitle'])?></b></td>
											</tr>
                                    <tr>
                                        <td>
                                            <?php
                                            $contents=mysql_query("SELECT * FROM ".$tableprefix."help where active='1' and 
                                            hcid='".$row['hcid']."' ORDER BY hposition ") or die(mysql_error());
                                            if(mysql_num_rows($contents)>0)
                                            {	
                                                while($helpObj = mysql_fetch_object($contents))
                                                {
                                                ?><div style='margin-top:10px;width:150px;float:left;padding:2px 10px 2px 5px;'>
                                                    <a href="help_details.php?id=<?php echo $helpObj->hid;?>&name=<?php echo $helpObj->htitle;?>&rghMenu=<?php echo $_GET['rghMenu'];?>&page=<?php echo $_GET['page']?>&pagegroup=<?php echo $_GET['pagegroup']?>" class="links">
                                                    <?php echo $helpObj->htitle;?>
                                                    <img src="../images/arrow-new.gif" border="0" />
                                                    </a>
                                                </div>
                                                <?php
                                                }//end inner for loop
                                            ?>
                                        </td>
                                    </tr>
                                <?php
                                            }else {
                                        ?>
                                                        <tr>
                                                                <td><?php echo TEXT_NO_TOPICS;?></td>
                                                        </tr>
                                        <?php
                                        }
                                        ?>
									</table>
									</td>
									</tr>
									<?php
									
								}
								?>
								<tr>
									<td align="center" valign="middle" >
										<table border="0" align="center" cellpadding="0" cellspacing="1">
												<tr>
													<td colspan="5">
														<?php echo rightpaging(); ?>
													</td>
												</tr>
										</table>
									</td>
								</tr>												
									<?php
									}//end if
									else {
												echo '<tr>
						<td height="148" align="center" valign="middle" ><strong>Sorry, no records !!</strong></td></tr>';
									}//end else
									?>
								
						 </table>								
				
						</td>
					</tr>
				</table>
					</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";
?>