<!doctype html>
<html lang="en">
    <head>
    </head>

    <body>
        <!-- home -->
        <div id="left-list">
            <div>

                <form action="includes/search_product.php" method="post">
                    <div style="padding:5px" class="controls input-group">
                        <input type="text" name="name" class="form-control" placeholder="">
                        <div class="input-group-addon">
                            <input style="background-color:   transparent;   border:   0px" type="submit" name="submit" value="搜索">
                        </div>
                    </div>
                </form>

                <div class="left-list-home">
                    <a href="e-shop.php">
                        <h1>
                            主頁
                        </h1>
                    </a>
                </div>
            </div>
            <!-- end home -->

            <!-- ategorie -->
            <ul>
                <li>
                    <a style="text-decoration:none" data-toggle="collapse" href="#collapseOne">
                        <h1>
                            熱門推廣
                        </h1>
                    </a>

                    <div id="collapseOne" class="collapse in">
                        <ul>
                            <?php
$sql = "select * from ategories where belong='hot' and `status` != 'delete'";
$result = mysqli_query($conn, $sql);
if ($result->num_rows > 0) {
	while ($row = $result->fetch_assoc()) {
		echo '<a href="e-shop.php?ategory=' . str_replace(' ', '_', $row["zh_category"]) . '">';
		echo "<li>" . $row['zh_category'] . "</li>";
		echo '</a>';
	}
}
?>
                        </ul>
                    </div>
                </li>

                <li>
                    <a style="text-decoration:none" data-toggle="collapse" href="#collapsetwo">
                        <h1>
                            產品類別
                        </h1>
                    </a>

                    <div id="collapsetwo" class="collapse in">
                        <ul>
                            <?php
$sql = "select * from ategories where belong='category' and `status` != 'delete'";
$result = mysqli_query($conn, $sql);
if ($result->num_rows > 0) {
	while ($row = $result->fetch_assoc()) {
		echo '<a href="e-shop.php?ategory=' . str_replace(' ', '_', $row["zh_category"]) . '">';
		echo "<li>" . $row['zh_category'] . "</li>";
		echo '</a>';
	}
}
?>
                        </ul>
                    </div>
                </li>

                <li>
                    <a style="text-decoration:none" data-toggle="collapse" href="#collapsethree">
                        <h1>
                            肌膚關注
                        </h1>
                    </a>

                    <div id="collapsethree" class="collapse in" >
                        <ul>
                            <?php
$sql = "select * from ategories where belong='skin' and `status` != 'delete'";
$result = mysqli_query($conn, $sql);
if ($result->num_rows > 0) {
	while ($row = $result->fetch_assoc()) {
		echo '<a href="e-shop.php?ategory=' . str_replace(' ', '_', $row["zh_category"]) . '">';
		echo "<li>" . $row['zh_category'] . "</li>";
		echo '</a>';
	}
}
?>
                        </ul>
                    </div>
                </li>
            </ul>
        </div>
        <!-- end ategorie -->
    </body>
</html>