<?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">
	
	
	<link href="<?php echo base_url(); ?>assets/Backend/bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
	<link href="<?php echo base_url(); ?>assets/Backend/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">
	<link href="<?php echo base_url(); ?>assets/Backend/bower_components/datatables-responsive/css/dataTables.responsive.css" rel="stylesheet">
	<link href="<?php echo base_url(); ?>assets/Backend/dist/css/sb-admin-2.css" rel="stylesheet">
	<link href="<?php echo base_url(); ?>assets/Backend/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
	<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
	
	<script language="javascript" type="text/javascript">
		function checkDelete()
		{
          return confirm('Delete News Details. Are you Sure?');
        }
		
	</script>
	
</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">
                            <i class="glyphicon glyphicon-globe"></i> News
                            <a href="<?php echo base_url(); ?>App/add_news" class="btn btn-primary pull-right"><i class="glyphicon glyphicon-plus"></i> Add News</a>
                        </h1>
                    </div>
                </div>
                
                <!-- /.row -->

				<div class="row">
					<div class="panel-body">
				<div class="dataTable_wrapper">
                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                <thead>
                <tr style="background-color:#fff;">
                <th width="8%">Sr No.</th>
                <th width="">News Heading</th>
                <th width="">Date</th>
                <th width="9%"> Action</th>
                </tr>
                </thead>
                <tbody>
                <?php
				$cnt=0;
				foreach($news as $row):
				$n_id = $row->n_id;
				$cnt+=1;
				?>
                <tr>
                <td style="text-align: center;"><?php echo $cnt; ?></td>
                <td><?php echo $row->n_title;?></td>
                <td><?php echo date("d-m-Y",strtotime($row->n_date));?></td>
                <td>
				  <a href="<?php echo base_url(); ?>Delete/del_news/<?php echo $n_id;?>" onclick="return checkDelete()" class="btn btn-sm btn-danger pull-right"><i class="fa fa-fw fa-trash-o"></i></a>
				  <a href="<?php echo base_url();?>App/edit_news/<?php echo $n_id;?>" class="btn btn-primary btn-sm"><i class="fa fa-fw fa-pencil"></i></a>
				</td>
                </tr>
                <?php
				endforeach;
				?>
                </tbody>
                </table>
				</div>
					</div>
            </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>
	
	<script src="<?php echo base_url(); ?>assets/Backend/bower_components/jquery/dist/jquery.min.js"></script>
	<script src="<?php echo base_url(); ?>assets/Backend/bower_components/metisMenu/dist/metisMenu.min.js"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="<?php echo base_url(); ?>assets/Backend/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
	
	<script src="<?php echo base_url(); ?>assets/Backend/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/Backend/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>
	<script>
    $(document).ready(function() {
        $('#dataTables-example').DataTable({
                responsive: true
        });
    });
    </script>
    </body>

</html>
