<?php
 require_once("blog.php"); ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Blog - Teacher Training Bangalore</title> 
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">

<!-- Latest compiled and minified CSS -->
<?php include('common/script.php');?>
 <script type="text/javascript">
	function SearchBlogs()
	{
		//frmNews.txtAction.value = "search_news";
		frmBlogs.submit();
	}
</script>
</head>
<body id="boxed">
<!--Header start-->
 <?php include('common/header.php');?> 
<!--Header End-->
<section id="sub-header">
    <div class="container">
        <div class="row">
            <div class="col-md-10 col-md-offset-1 text-center">
                <h1>BLOGS</h1>             	
               
            </div>
        </div><!-- End row -->
    </div><!-- End container -->
    <div class="divider_top"></div>
    </section>
<!--Body start-->
<section id="main_content">
    	<div class="container">
        
        <ol class="breadcrumb">
          <li><a href="../">Home</a></li>
          <li class="active">Blog</li>
        </ol>
        <br>
  <div class="row">
   <div class="col-md-8" id="rp">  	
         <?php  for($i=0; $i<$no_of_blogs; $i++)  {  ?>
		 <?php $blog_title_org[$i] = $blog_title[$i];
		 	  //$blog_title[$i] = str_replace("-","",$blog_title[$i]);
		  	  $blog_title[$i] = str_replace(" ","-",$blog_title[$i]);
			  $blog_title[$i] = str_replace("?","",$blog_title[$i]);
			  $blog_title[$i] = str_replace("!","",$blog_title[$i]);
			  $blog_title[$i] = str_replace("'","",$blog_title[$i]);
			  $blog_title[$i] = str_replace(":","",$blog_title[$i]);
			  $blog_title[$i] = str_replace(";","",$blog_title[$i]);
			  $blog_title[$i] = str_replace("’","",$blog_title[$i]);
			  $blog_title[$i] = str_replace("_","",$blog_title[$i]);
			  $blog_title[$i] = str_replace("–","",$blog_title[$i]);
			  $blog_title[$i] = str_replace("/","",$blog_title[$i]); 
			  $blog_title[$i] = str_replace("&","-",$blog_title[$i]); 
			  $blog_title[$i] = str_replace("(","",$blog_title[$i]); 
			  $blog_title[$i] = str_replace(")","",$blog_title[$i]); 
			  $blog_title[$i] = str_replace(",","",$blog_title[$i]);
			  $blog_title[$i] = str_replace("”","",$blog_title[$i]); 
			  $blog_title[$i] = str_replace("“","",$blog_title[$i]);?>
		 <article class="post excerpt">
        
        <div class="post-date-ribbon"><div class="corner"></div><?php echo date('jS F Y',strtotime($posting_dt[$i])); ?></div>
                          
            <h3 class="title">
           
               <a href="<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ","",$blog_title[$i]); ?>-blog.php"><?php echo $blog_title_org[$i]; ?></a>
            </h3>
         
      
			 <?php if($blog_image_path[$i] != "")  {  ?>
              <?php $image_path = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);?>
                <div class="featured-thumbnail">
                 <img src="https://www.asiancollegeofteachers.com/admin_act/blog_images/<?php echo basename($blog_image_path[$i]);  ?>" alt="Blogs" class="img-responsive"  style="width:200px;">              
                </div>
              <?php  }  ?>                     
                     
                   <div class="post-content">
                  <?php if($blog_pre_desc[$i] == "") {
				  $text = str_ireplace('<p>','<br>',$blog_desc[$i]);  $text = str_ireplace('</p>','',$text); 
				  //echo "Pre Desc";
				  }
				  else {
				  $text = str_ireplace('<p>','<br>',$blog_pre_desc[$i]);  $text = str_ireplace('</p>','',$text);
				  //echo "Post Desc";
				  } ?>
			<?php echo substr(strip_tags($text),0,500); ?> ...
             <br><br>
             </div>
             <div style="float:left;">
             <?php if($written_by[$i]!=""){ ?><b>Written By :</b> <?php echo $written_by[$i]; ?><?php } ?>
            
               	 </div>
                        <div class="readMore">
             <a href="<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ","",$blog_title[$i]); ?>-blog.php" style="color:#fff;">
                                   <button class="btn btn-danger pull-right">Read More</button></a> 
        </div>
         </article>  
          <?php  }//end of loop for $i  ?>
       
  
 	
            <!--PAGINATION START-->
        	<div class="paginate"><!-- The "wrapper" is just a comestic addition. You don't need this for the pagination to work. -->
                <ol>
                    <li><a href="./">First</a></li>
                    <li><a <?php if($page == 1) { ?>href="./" <?php } else { ?> href="./?page=<?php echo $page-1; ?>" <?php } ?>>Prev</a></li>
                    
                    <?php  for ($x=$s; $x<=$e; $x++) {  //echo $page; echo $i; ?>
                    <li><a <?php if($page == $x) { ?> class="active" <?php } else { ?> class="inactive" <?php } ?><?php if($x == 1) { ?> href="./" <?php } else { ?> href="./?page=<?php echo $x; ?>" <?php } ?> ><?php echo $x; ?></a></li>
                    <?php  }  ?>
                    
                    <!--<li><a href="" class="more">&hellip;</a></li>-->
                    <li><a <?php if($page == $total_pages) { ?>href="./?page=<?php echo $total_pages; ?>" <?php } else { ?> href="./?page=<?php echo $page+1; ?>" <?php } ?>>Next</a></li>
                    <li><a href="./?page=<?php echo $total_pages; ?>">Last</a></li>
                </ol>
            </div>
            
            <!--PAGINATION END-->	           
        </div>  <!--col-d-8 END-->
	
     <?php include("common/sidebar.php"); ?> 
 
     
  
    <div class="clearfix"></div>
    
    
  </div>
  </div>
  </section>
 <?php include("common/footer.php"); ?> 
  
<!--Footer End-->
</body>
</html>
