Exemplo n.º 1
0
    <div class="row">
        <div class="col-md-12" style="border:10px solid #BF8F94;">
            <div><h2>List a new Category</h2></div>
            <table class="table">
                <thead>
                <tr>
                    <th>Category Name</th>
                    <th>Created At</th>
                    <th>Edit</th>
                    <th>Delete</th>
                </tr>
                </thead>
                <tbody>
                <?php 
$blog = new blogClass();
$allCategory = $blog->selectCategory();
while ($category = $allCategory->fetch_assoc()) {
    ?>
                    <tr class="success">
                        <td><?php 
    echo $category["category_name"];
    ?>
</td>
                        <td><?php 
    echo $category["created_at"];
    ?>
</td>
                        <td><a href="editCategory.php?id=<?php 
    echo $category["category_id"];
    ?>
" class="btn btn-info">Edit</a></td>
Exemplo n.º 2
0
">
                </div>
                <div class="form-group">
                    <label for="input_2"> Article Subtitle:</label>
                    <input type="text" class="form-control" id="article_subtitle" name="article_subtitle" value="<?php 
echo $article['article_subtitle'];
?>
">
                </div>

                <div class="form-group">
                    <label for="category_id"> Category Name</label>
                    <select name="category_id" class="form-control">
                        <?php 
$blog1 = new blogClass();
$allCat = $blog1->selectCategory();
//print_r($allCat);
while ($Cat = $allCat->fetch_assoc()) {
    ?>
                            <option value="<?php 
    echo $Cat['category_id'];
    ?>
" <?php 
    if ($Cat["category_id"] == $article['category_id']) {
        echo "selected='selected'";
    }
    ?>
 > <?php 
    echo $Cat['category_name'];
    ?>
</option>