<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2005-2006 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts EasyCreate 1.1                 |
// +----------------------------------------------------------------------+
// | Authors: programmer<programmer@armia.com>        		              |
// |          									                          |
// +----------------------------------------------------------------------+
?>
<?php
include "includes/session.php";
include "includes/config.php";
if($_GET['cat']=="simple"){
          $_SESSION['session_buildtype']="simple";
}else{
          $_SESSION['session_buildtype']="advanced";
}
$sql="select * from tbl_template_category  order by vcat_name ";
$rs = mysql_query($sql);
include "includes/userheader.php";
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td  valign="top" align=center>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="left">
                        <div class="stage_selector">
                            <span>1</span>&nbsp;&nbsp;Select Template
                        </div>
                        <div class="bc01">
                            <ul>
                                <li><a href="#">Home</a> � </li>
                                <li><a href="#">Control Panel</a> � </li>
                                <li class="active">&nbsp;Site Manager</li>
                            </ul>
                            <div class="clear"></div>
                        </div>
                        <h2 class="lft">Select a category/theme for your site.</h2>
                        <a href="showalltemplates.php" class="ryt grey-btn01">Show all Templates</a>  
                    </td>
                </tr>
                <tr>
                    <td align=center>&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <!-- Main section starts here-->
                        <table width="100%" border=0 align=center>
                            <?php
                            if (mysql_num_rows($rs) > 0) {
                                $i = 0;
                                while ($row = mysql_fetch_array($rs)) {
                                    if ($i == 0) {
                                        echo "<tr>";
                                    }
                                    if ($i == 2) {
                                        $i = 0;
                                        echo "</tr><tr>";
                                    }
                                    ?>

                                    <td align=left  width="10%">
                                        <a href="./showtemplates.php?catid=<?php echo $row['ncat_id']; ?>"><img src="./<?php echo $row['vcat_thumpnail']; ?>" alt="<?php echo htmlentities($row['vcat_name']); ?>" title="<?php echo htmlentities($row['vcat_name']); ?>" border=0></a>
                                    </td>
                                    <td class=maintext  align=left  width="40%"><?php echo htmlentities($row['vcat_desc']); ?></td>



                                    <?php
                                    $i++;
                                }
                                if ($i == 1) {
                                    echo "<td colspan='2'>&nbsp;</td></tr>";
                                } else if ($i == 2) {
                                    echo "</tr>";
                                }
                            } else {
                                ?>
                                <tr><td>No categories found</td></tr>
                                <?php
                            }
                            ?>
                            <tr><td class=subtext align=center colspan=4 width=100%><br></td></tr>
                            <tr>
                                <td colspan="6">
                                    <div class="category-display">
                                        <div class="category-box">
                                            <img src="themes/Coastal-Green/business-ico.png">
                                            <p>Business and Services</p>
                                        </div>
                                        <div class="category-box">
                                            <img src="themes/Coastal-Green/edu-ico.png">
                                            <p>Education, University etc</p>
                                        </div>
                                        <div class="category-box">
                                            <img src="themes/Coastal-Green/family-ico.png">
                                            <p>Families and Friends</p>
                                        </div>
                                        <div class="category-box">
                                            <img src="themes/Coastal-Green/simple-theme-ico.png">
                                            <p>Families and Friends</p>
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="30%" valign="bottom"	class="category"></td>
                                <td colspan="5" align="right">
                                    <div class="pagination ryt">
                                        <ul>
                                            <li><img src="themes/Coastal-Green/prev.png"></li>
                                            <li>Prev</li>
                                            <li><a href="#">1 </a>| </li>
                                            <li><a href="#" class="active">2 </a>| </li>
                                            <li>Next</li>
                                            <li><img src="themes/Coastal-Green/next.png"></li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <!-- Main section ends here-->
                    </td>
                </tr>
                <tr><td align=left>
                    <a href="buildtype.php" class=subtext ><img src="./images/back.gif" border="0" width="54px" height="15px"></a></td></tr>
                <tr><td>&nbsp;</td></tr>
            </table>
        </td>
    </tr>
</table>

<?php
include "includes/userfooter.php";
?>