<?php
$page = 'News';
?>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Admin</title>

    <!-- Bootstrap Core CSS -->
    <link href="<?php echo base_url(); ?>assets/Backend/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="<?php echo base_url(); ?>assets/Backend/css/sb-admin.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="<?php echo base_url(); ?>assets/Backend/css/plugins/morris.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/Backend/font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    </head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <?php
		include "include/header.php";
		?>
        

        <div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                         News 
                            <a href="<?php echo base_url(); ?>app/add_news" class="btn btn-primary pull-right">Add News</a>
                        </h1>
                    </div>
                </div>
                
                <!-- /.row -->

				<div class="row">
                <table class="table">
                <thead>
                <tr>
                <th width="10%">No.</th>
                <th width="">News Heading</th>
                <th width="">Date</th>
                <th width="11%"> Action</th>
                </tr>
                </thead>
                <tbody>
                <?php
				$cnt=0;
				foreach($news as $row):
				$n_id = $row->n_id;
				$cnt+=1;
				?>
                <tr>
                <td><?php echo $cnt; ?></td>
                <td><?php echo $row->n_heading;?></td>
                <td><?php echo $row->n_date;?></td>
                <td>
               <a href="<?php echo base_url(); ?>delete/del_news/<?php echo $n_id;?>" class="btn btn-sm btn-danger pull-right">Delete</a><a href="<?php echo base_url();?>app/edit_news/<?php echo $n_id;?>" class="btn btn-primary btn-sm">Edit</a></td>
                </tr>
                <?php
				endforeach;
				?>
                </tbody>
                </table>
                
            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery Version 1.11.0 -->
    <script src="<?php echo base_url(); ?>assets/Backend/js/jquery-1.11.0.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="<?php echo base_url(); ?>assets/Backend/js/bootstrap.min.js"></script>

    </body>

</html>
