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


/*display the active template*/

$active_template = displayTemplate();


include "includes/htmltop.php";

/* Top File Name */

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

?>
<!--mainbody area start -->
<div class="main_body">
    <div class="container">
        <div class="row">
            <section class="sec_marg">
                <div class="col-sm-12 col-lg-12 col-md-12 ">
                    <h3><?php echo HELP_TEXT; ?></h3>
                </div>
            </section>
            <div class="clear"></div>
            <!--items display area start -->

            <div class="text_information" align="center"><?php echo $message ?></div>

            <?php
            $help = "SELECT h.*,hc.* 
			FROM " . $tableprefix . "help h 
			INNER JOIN " . $tableprefix . "helpcategory hc on h.hcid=hc.hcid 
			WHERE hc.htype='client' AND h.active='1' 
			GROUP BY h.hcid 
			ORDER BY h.hposition ASC";


            $result = mysql_query($help) or die(mysql_error());
            if (mysql_num_rows($result) > 0) {
                $onThisPage = mysql_num_rows($result);
                ?>

                <?php
                for ($i = 0; $i < mysql_num_rows($result); $i++) {
                    $contents = mysql_query("SELECT * FROM " . $tableprefix . "help where active='1' and 
hcid='" . mysql_result($result, $i, 'hcid') . "' ORDER BY hposition ASC") or die(mysql_error());
                    if (mysql_num_rows($contents) > 0) {
                        ?>
                        <div class="col-sm-12 col-lg-3 col-md-3">
                            <div class="help_hdrs"><?php echo ucfirst(mysql_result($result, $i, 'hctitle')); ?></div>

            <? for ($j = 0; $j < mysql_num_rows($contents); $j++) { ?>

                                <div class="help_list">
                                    <ul>
                                        <li>  
                                            <div class="help_list_left"><a href="help_details.php?id=<?php echo mysql_result($contents, $j, 'hid'); ?>"><?php echo str_replace('{SITE_NAME}', SITE_NAME, mysql_result($contents, $j, 'htitle')); ?></div>
                                            <div class="help_list_right"><a href="help_details.php?id=<?php echo mysql_result($contents, $j, 'hid'); ?>"><img src="./help/<?php echo mysql_result($contents, $j, 'himage'); ?>" width="22" height="20" alt="<?php echo str_replace('{SITE_NAME}', SITE_NAME, mysql_result($contents, $j, 'htitle')); ?>" border="0"></a></div>
                                        </li> 
                                    </ul>
                                </div>                                                

                <?php
            }//end inner for loop
        }//end if
        ?>
                    </div>
                    <?php
                    }//end out for loop
                }//end if
                else {
                    /* echo '<tr bgcolor="#F2F9FD"><td height="51"  align="center" colspan="2" class="help_text"><p>&nbsp;</p><p>&nbsp;</p>
                      <strong>'.NO_RECORDS_MSG.'<p>&nbsp;</p><p>&nbsp;</p></strong></td></tr>'; */
                }//end else
                if (rightpaging() != '') {/*
                  ?>
                  <tr bgcolor="#FEFFF9"><td align="right" colspan="5"><?php echo rightpaging();?></td></tr>
                  <?php */
                }//end if
                ?>

        </div>
    </div>
    <!--mainbody area end -->
<div class="clear"></div>
<?php
include "includes/".$active_template[2];	
/* Bottom File Name */
?>