<?php

$id = $_GET["c_id"];
require_once '../Model/dbclass.php';
$dbObj = new Model_DBClass();
$getCat = "SELECT * FROM sub_category_master WHERE status = 1 AND parent_category_id={$id} ORDER BY sub_category_name";
$resultCat = $dbObj->doQuery($getCat);
$num = $dbObj->numRows($resultCat);
if ($num > 0) {
    ?>
	<select name="sub_cat_id" id="sub_cat_id" class="input_field" style="width:365px">
		<option value="0">Select Sub-Category</option>
		<?php 
    while ($rowCat = $dbObj->fetchObject($resultCat)) {
        ?>
			<option value="<?php 
        echo $rowCat->sub_category_id;
        ?>
"><?php 
        echo ucfirst($rowCat->sub_category_name);
        ?>
</option>
		<?php 
    }
    ?>
	</select>

<?php 
}
?>
            
            <div class="content_box">
            <?php 
require_once 'Controller/indexController.php';
?>
            </div>
        </div>
        <div class="clear">
        </div>
        <!-------------------------------content Section--------------------------------->
        <div id="action_bar">
            <div class="ad_bar_box">
                <div class="home_sec_ad">
                <?php 
$query = "SELECT * FROM advertise_master WHERE ad_id = 1 AND ad_position = 'bottom' AND status = 1";
$result = $dbObj->doQuery($query);
$row = $dbObj->fetchObject($result);
?>
                <div class="colms_2" style="border-right:1px solid #ddd">
                    <a href="<?php 
echo $row->ad_url;
?>
" title=""><img src="advertise/<?php 
echo $row->ad_file_path;
?>
" /></a>
                 </div>
                 <?php 
$query = "SELECT * FROM advertise_master WHERE ad_id = 2 AND ad_position = 'bottom' AND status = 1";
$result = $dbObj->doQuery($query);
$row = $dbObj->fetchObject($result);
?>