<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description">
<meta name="author" content="">
<meta name="keyword">
<title>Admin | Admin_Panel</title>
<!-- Bootstrap CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- bootstrap theme -->
<link href="css/bootstrap-theme.css" rel="stylesheet">
<!-- font icon -->
<link href="css/elegant-icons-style.css" rel="stylesheet" />
<link href="css/font-awesome.css" rel="stylesheet" />
<!-- css-->
<link href="css/style.css" rel="stylesheet">
<link href="css/style-responsive.css" rel="stylesheet" />
</head>
<body>
<!-- container section start -->
<section id="container" class="">
<header class="header dark-bg">
<div class="toggle-nav">
<div class="icon-reorder tooltips" data-original-title="Toggle Navigation" data-placement="bottom"><i class="icon_menu"></i></div>
</div>
<!--logo start-->
<a href="#" class="logo">Latest <span class="lite">News</span></a>
<!--logo end-->
<div class="top-nav notification-row">
<!-- notificatoin dropdown start-->
<ul class="nav pull-right top-menu">
<!-- task notificatoin start -->
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<span class="profile-ava">
<img alt="" src="">
</span>
<span class="username">
<?php
session_start();
$name=$_SESSION['username'];
include("connection.php");
$query=mysql_query("SELECT * FROM login WHERE username='$name'");
$row=mysql_fetch_array($query);
echo $row[0];
?>
</span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu extended logout">
<div class="log-arrow-up"></div>
<li class="eborder-top">
<a href="admin.php"><i class="icon_profile"></i> My Profile</a>
</li>
<li>
<a href="change_password.php"><i class="icon_clock_alt"></i> Change Password</a>
</li>
<li>
<a href="logout.php"><i class="icon_key_alt"></i> Logout</a>
</li>
</ul>
</li>
<!-- user login dropdown end -->
</ul>
<!-- notificatoin dropdown end-->
</div>
</header>
<!--header end-->
<!--sidebar start-->
<?php
include("menu.php");
?>
<!--main content start-->
<section id="main-content">
<section class="wrapper">
<!--overview start-->
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 style="text-align:center;">
Breaking News
</h3>
</div>
<style>
#imgbox{
width:100px;
height:100px;
}
</style>
<div class="container">
<div class="row">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th> Contents </th>
<th> Edit </th>
<th> Delete </th>
</tr>
</thead>
<?php
include("connection.php");
$query=mysql_query("SELECT * FROM b_news ORDER BY `id` DESC LIMIT 5");
$img_url = "news_ticker/";
while( $row=mysql_fetch_array($query))
{
echo '<tbody><tr class="record">
<td>'.$row['contents'].'</td>
<td><a href="edit_b_news.php?id='.$row[0].'" class="btn btn-info">Edit</a></td>
<td><a id="'.$row[0].'" class="btn btn-danger delbutton">Delete </a></td>
</tr>
</tbody>';
}
?>
<!-- modal starts -->
<div id="myModaledit" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Edit Contents</h4>
</div>
<div class="modal-body">
<form name="" method="post" action="">
<p>
<span>Contents</span>: <textarea name="contents" rows="5" class="form-control"><?php echo $row['contents']; ?></textarea>
</p>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" value="Change">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</form>
<!--modal ends -->
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
<!-- container section start -->
<!-- javascripts -->
<script src="js/jquery.js"></script>
<script src="js/jquery-ui-1.10.4.min.js"></script>
<script src="js/jquery-1.8.3.min.js"></script>
<!-- bootstrap -->
<script src="js/bootstrap.min.js"></script>
<!-- nice scroll -->
<script src="js/jquery.scrollTo.min.js"></script>
<script src="js/jquery.nicescroll.js" type="text/javascript"></script>
<!--custome script for all page-->
<script src="js/scripts.js"></script>
<script src="js/datetimepicker_css.js"></script>
<script type="text/javascript">
$(function() {
$(".delbutton").click(function(){
//Save the link in a variable called element
var element = $(this);
//Find the id of the link that was clicked
var del_id = element.attr("id");
//Built a url to send
var info = 'id=' + del_id;
if(confirm("Sure you want to delete this entry? There is NO undo!"))
{
$.ajax({
type: "GET",
url: "del_b_val.php",
data: info,
success: function(){
}
});
$(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
.animate({ opacity: "hide" }, "slow");
}
return false;
});
});
</script>
</body>
</html>