<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>">
<!----Banner Start---->
	<div class="fd_bread_wrapper">
		<div class="container">
			<div class="row">
				<div class="col-lg-12">
					<div class="fd_bread">
						<h1 class="fd_page_title"><span><?php if(!empty($single_blog)){ echo $single_blog[0]->blog_title; } ?></span></h1>
						<nav aria-label="breadcrumb">
						  <ol class="breadcrumb">
							 
							<li class="breadcrumb-item" aria-current="page"><a href="<?php echo base_url('blogs'); ?>">blogs</a></li>
							<li class="breadcrumb-item active" aria-current="page"><?php if(!empty($single_blog)){ echo $single_blog[0]->blog_title; } ?></li>
						  </ol>
						</nav>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!----Blog Section Start---->
	 
	<?php if(!empty($single_blog)){ ?> 
	<div class="fd_blog_wrapper fd_blog_page">
		<div class="container">
			<div class="row">
				<div class="col-lg-9" id="show_blog">
					<div class="fd_blog_slider btm_padder60">
						<div class="fd_post_box">
							<div class="fd_post_img">
								<img src="<?php echo base_url(). $single_blog[0]->blogsingle_image; ?>" alt="">
								<div class="fd_post_date_box">
									<div class="fd_date_inner">
									<?php $blogdate = strtotime($single_blog[0]->blog_date);
														 $day = date('d', $blogdate);
														 $month = date('M', $blogdate);
									?>
										<span class="pst_date"><?php echo $day; ?></span>
										<span class="pst_month"><?php echo $month; ?></span>
									</div>
								</div>
							</div>
							<div class="fd_post_data">
								<h2><a><?php echo $single_blog[0]->blog_title; ?></a></h2>
								<ul class="fd_pst_info">
									<li><a><img src="<?php echo base_url(); ?>themeassets/images/userpic.png" alt=""> - <?php echo $this->hs->get_userdetails('user_name',$single_blog[0]->blog_userid); ?></a></li>
									<li><a><i class="fa fa-commenting-o" aria-hidden="true"></i> <?php if(!empty($singleblog_comment)){ echo count($singleblog_comment); }else{ echo 0; } ?> Comment</a></li>
									 
								</ul>
								<?php echo $single_blog[0]->blog_longcontent; ?>
							 
							</div>
						</div>
					</div>
					 
   					<!----Comments Area Start---->	
					<?php if(!empty($singleblog_comment)){ ?>
					<div class="fd_cmnt_area">
					<h2 class="widget-title"><?php if($this->hs->getwebsettings('commentheading_show') == 1){  ?><?php echo $this->hs->getwebsettings('commentheading_text'); ?> <span class="dot_border"></span><?php  } ?></h2>
			 
						<div class="fd_cmnt_list">
							<ul class="commentlist">
							<?php foreach($singleblog_comment as $comment){  
							        if($comment->comment_status == 1){
							?>
								<li class="comment" >
									<div class="fd_cmnt_img">
										<img src="<?php echo base_url(); ?>themeassets/images/blog/author1.png" alt="">
									</div>
									<div class="fd_cmnt_data">
										<div class="fd_cmnt_info">
											<h3><a><?php echo $comment->comment_name; ?></a></h3>
											<?php $commentdate = strtotime($comment->comment_date);
														 $day = date('d',$commentdate);
														 $month = date('M',$commentdate);
														 $year =date('Y',$commentdate);
											?>
											<span class="fd_cmnt_date"><a><?php echo  $day.' '.$month.' '.$year; ?></a></span>
											 
										</div>
										<div class="fd_cmnt_para">
											 <?php echo $comment->comment_content; ?>
										</div>
									</div>
								</li>
							<?php }
							   }	
							?>
						</ul>
					</div>
				</div>
					<?php } ?>
					<!----Comment Respond---->
					<div class="comment-respond">
						<h2 class="widget-title"><?php if($this->hs->getwebsettings('commentformheading_show') == 1){  ?><?php echo $this->hs->getwebsettings('commentformheading_text'); ?> <span class="dot_border"></span><?php } ?></h2>
					
						<form id="comment_form" method="post">
							<div class="row">
							    <?php if(!empty($single_blog)){ ?> 
									<input name="commentblog_id" type="hidden" id="commentblog_id"   value="<?php echo $single_blog[0]->blog_id; ?>">
							    <?php } ?>
								<div class="col-lg-6 col-md-6">
									<div class="comment_input_wrapper" <?php if(isset($_SESSION['userid'])){ ?> style="display:none;"  <?php } ?>>
										<input name="comm_name" id="comment_name"   type="text" class="cmnt_field form-control" placeholder="Name" value="<?php if(isset($_SESSION['userid'])){ 
										echo $this->hs->get_userdetails('user_name',$_SESSION['userid']); } ?>">
									</div>
								</div>
								<div class="col-lg-6 col-md-6">
									<div class="comment_input_wrapper" <?php if(isset($_SESSION['userid'])){ ?> style="display:none;"  <?php } ?>>
										<input name="comm_email" id="comment_email"   type="text" class="cmnt_field form-control" placeholder="Email" value="<?php if(isset($_SESSION['userid'])){
											echo $this->hs->get_userdetails('user_email',$_SESSION['userid']); } ?>">
									</div>
								</div>
								<div class="col-lg-12 col-md-12">
									<div class="comment_input_wrapper">
										<textarea id="comment" name="comm_content" class="cmnt_field form-control" placeholder="Comment" ></textarea>
									</div>
								</div>
								<div class="col-lg-12 col-md-12">
									<div class="comment-form-submit">
										<input name="submit" type="submit" id="comment-submit" class="submit fd_btn" value="Post Comment">
									</div>
								</div>
							</div>
						</form>
                      </div>
				</div>
				<!----Sidebar Start---->
				<div class="col-lg-3">	
					<div class="fd_sidebar">
						 
						<!----Category Start---->
						<?php if(!empty($all_blogcategory)){ ?>
						<div class="widget widget_categories">
							<h2 class="widget-title">Category <span class="dot_border"></span></h2>
							<ul>
								<?php foreach($all_blogcategory as $blogcategory){ ?>
								<li><a href="javascript:;" onclick="show_blog_bycategory(<?php echo $blogcategory->cate_id; ?>)"><?php echo $blogcategory->cate_name; ?><span class="cat_count">(<?php echo $blogcategory->countblog; ?>)</span></a></li>
							     <?php } ?></span></a></li>
							</ul>
						</div>
						<?php } ?>
						 
						<!----Advertisment Start---->
						<?php if(!empty($all_offer)){ ?>
						<div class="widget widget_search">
							<?php foreach($all_offer as $offers){
									if($offers->offer_image !==''){
							?>
							<h2 class="widget-title"><?php echo $offers->offer_heading; ?><span class="dot_border"></span></h2>
							<div class="widget_offer_box">
								<a href="javascript:;"><img src="<?php echo base_url().$offers->offer_image; ?>" alt="" class="img-fluid"></a>
							</div>
							<br>
							<?php }
								}	
							?>
						</div>
						<?php } ?>
					</div>
				</div>			
			</div>
		</div>
	</div>
	<?php } ?> 
