Mini Shell
<?php require_once('function-file.php');
require_once('function-menu.php');
require_once("config.php");
require_once('function-testo-footer.php');
$blog_id=$_GET['blogid'];
$blogs=$conn->prepare("select * from blogs where blog_id='$blog_id'");
$blogs->execute();$blogrow=$blogs->fetch();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Home | Lanka Virtual Academy</title>
<?php commoncss();?>
<style>.comment{padding: 15px; background: rgba(122, 170, 191, 0.27); border: 1px solid #86c2de;}
.comment-box{ border: 1px solid rgba(197, 45, 47, 0.49);border-radius: 15px;padding: 10px;background: rgba(197, 45, 47, 0.21); margin-bottom: 15px;}.comment-ans{ background: rgba(122, 170, 191, 0.27);
border: 1px solid #86c2de;
border-radius:15px;
padding: 15px;
margin-bottom: 10px;}</style>
</head><!--/head-->
<body class="homepage">
<?php headermenu();?>
<section class="header-title">
<div class="container">
<div class="row">
<div class="col-sm-12"><h2>BLOG</h2></div>
</div>
</div>
</section>
<section>
<div class="container news">
<div class="col-sm-7 col-xs-12">
<div class="row">
<div class="col-sm-9" style="padding-left: 0;"><h2><?php echo $blogrow['blog_title'];?></h2></div><div class="col-sm-3" align="right"><?php echo date('d M Y',strtotime($blogrow['blog_date']));?></div>
<div><h4><img src="admin/img/blogs/<?php echo $blogrow['blog_img'];?>" class="img-responsive"></h4></div>
<?php echo $blogrow['blog_desc'];?>
</div>
<hr>
<div class="row">
<?php $comment=$conn->prepare("select * from blog_comment where blog_id='$blog_id' order by postdate DESC");
$comment->execute();$comment=$comment->fetchall();
foreach($comment as $comrow){?>
<div class="comment-box">
<div class="pull-left"><b><?php echo $comrow['name'];?></b></div>
<div class="pull-right"><small><?php echo date('d M, Y',strtotime($comrow['postdate']))." - <i class='fa fa-clock-o'></i> ".date('h:i A',strtotime($comrow['postdate']));?></small></div><br>
<div><p><?php echo $comrow['message'];?></p></div>
</div>
<?php $answer=$conn->prepare("select * from blog_answer where comment_id='$comrow[commentid]'");
$answer->execute();$answer=$answer->fetchall();
foreach($answer as $ansrow){?>
<div class="comment-ans">
<div class="pull-left"><b>Admin</b></div>
<div class="pull-right"><small><?php echo date('d M, Y',strtotime($ansrow['replydate']))." - <i class='fa fa-clock-o'></i> ".date('h:i A',strtotime($ansrow['replydate']));?></small></div><br>
<div><p><?php echo $ansrow['reply'];?></p></div>
</div>
<?php }
}?>
</div>
<hr>
<div class="row comment">
<form action="#" method="post" id="form">
<input type="hidden" name="blog_id" value="<?php echo $blog_id;?>">
<div class="form-group col-sm-12">
<label>Name</label><input name="name" type="text" class="form-control" required>
</div>
<div class="form-group col-sm-12">
<label>Email</label><input name="email" type="email" class="form-control" required>
</div>
<div class="form-group col-sm-12">
<label>Message</label><textarea name="message" class="form-control" rows="5" required></textarea>
</div>
<div class="form-group col-sm-12">
<button type="submit" class="btn btn-primary" >Comment</button>
</div>
</form>
</div>
</div>
<div class="col-sm-5 col-xs-12 right">
<h4>LATEST NEWS</h4>
<?php $newsdata=$conn->prepare("select * from news limit 5");
$newsdata->execute();$newsres=$newsdata->fetchall();
foreach($newsres as $newsrow){?>
<div class="row">
<div class="col-sm-5 col-xs-12"><a href="news-details.php?newsid=<?php echo $newsrow['news_id'];?>"><img src="admin/img/news/<?php echo $newsrow['news_img'];?>" class="img-responsive"></a></div>
<div class="col-sm-7 col-xs-12 justify"><span class="small"><?php echo date('M Y', strtotime($newsrow['news_date']));?></span><h5><a href="news-details.php?newsid=<?php echo $newsrow['news_id'];?>"><?php echo substr($newsrow['news_title'],0,25);?></a></h5><!--<span class="small"><b>Jones Smith</b></span>-->
<p class="small"><?php echo substr($newsrow['news_desc'],0,80)."...";?></p><hr>
</div>
</div>
<?php }?>
</div>
</div>
</section>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="background-color:#0382a9;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel" align="center" style="color:#fff">Success</h4>
</div>
<div class="modal-body">
<p align="center" style="color:#0382a9;font-size:16px;line-height:1.1;">Your comment has been succesfully submitted<br><br/>
We will attend to it as soon as possible</p>
</div>
<div class="modal-footer" style="display:none;">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php newssletter(); ?>
<?php footer(); commonjs();?>
<script>
$('#form').on('submit', function (e) {
e.preventDefault();
$.ajax({
type: 'post',
url: 'comment-ajax.php',
data: $('form').serialize(),
success: function (data) {
$(".form-control").val('');
$('#myModal').modal()
}
});
});
</script>
</body>
</html>
Zerion Mini Shell 1.0