
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<?php include '../news/news_menu.php' /** calling of header(to make it uniform in all template file) **/?>
<div class="container home">
		<h3> View all the news</h3>
		<?php include "../connection.php" /** calling of connection.php that has the connection code **/ ?>
		<table class="table table-bordered">
              <thead>
                <tr>
                  <th width="60px">News ID</th>
                  <th>Title</th>
                  <th>Details</th>
                  <th>Image</th>
				  <th>&nbsp;</th>
				  <th>&nbsp;</th>
                </tr>
              </thead>
              <tbody>
			  <?php 
				$result = mysql_query("SELECT * FROM news ORDER BY created_at DESC");
				
				while($data = mysql_fetch_object($result) ):
			  ?>
                <tr>
                  <td><?php echo $data->news_id ?></td>
                  <td><?php echo $data->news_title ?></td>
                  <td><?php echo $data->news_detail?></td>
				  <td><img src="../news/news_img/<?php echo $data->news_image?>" style="padding:5px"  width="150px"/></td>
				    <td>
					<a href="updatebyId_news.php?news_id=<?php echo $data->news_id ?>">
						<button class="btn btn-info"> Edit </button>
					</a>
				  </td>
				  <td>
					<a href="deleteById_news.php?news_id=<?php echo $data->news_id ?>">
						<button class="btn btn-danger"> Delete </button>
					</a>
				  </td>
				</tr>
			  <?php
				endwhile;
				
			  ?>
              </tbody>
		</table>
		
</div>	
</div>
</body>
</html>
