<?php
require_once("blog.php");
require_once("common_slug_functions.php"); // ✅ added 
?>
<!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.0">
  <meta name="msvalidate.01" content="8026CCB448135A89AE92E6F854B6DA95" />

  <title>Blog on Special Educational Needs</title>
  <meta name="title" content="Blog on Special Educational Needs" />
  <meta name="description" content="Read this ACT’s SEN Blog to know more about special kids, their thinking processes, and activities. Parents and teachers can learn tips to handle special kids.">

  <link rel="canonical" href="https://www.senteachertraining.com/blog/" />

  <?php include('common/script-new.php'); ?>


  <style type="text/css">
    .article-block-in {
      padding: 10px 20px;
      margin: 10px 0px;
      border-bottom: 1px dashed #666;
    }

    .news-dt {
      color: #dd4415;
      font-weight: bold;
      font-family: "Open sans";
    }

    .head_gry_sm2 {
      font-size: 20px !important;
      color: #1e1e1e;
      text-transform: capitalize;
    }

    .article-block-in p {
      font-size: 15px !important;
      line-height: 20px;
      padding: 5px 0px 5px 0;
      margin: 0;
      text-align: justify;
    }

    .readmore-3 a {
      color: #f25526;
      background: url(images/read-more.png) no-repeat right top;
      padding: 11px 21px;
      width: 110px;
      height: 39px;
      text-indent: -5;
    }

    .readmore-3 a:hover {
      color: #f25526;
      background: url(images/read-more-hover.png) no-repeat right top;
      padding: 11px 21px;
      width: 110px;
      height: 39px;
      text-indent: -5;
    }
  </style>

  <script type="text/javascript">
    function SearchBlogs() {
      //frmNews.txtAction.value = "search_news";
      frmBlogs.submit();
    }
  </script>
</head><!--/head-->

<body>

  <?php include('common/header1.php'); ?>

  <section class="inner-banner-sec blog-banner">
    <div class="inner-overlay">
      <div class="container">
        <div class="inbanner-text-bx">
          <h1>Blog</h1>
          <p>Blog on Special Educational Needs - Asian College of Teachers</p>
        </div>
      </div>
    </div>
  </section>

  <div class="breadcrumb-sec">
    <div class="container">
      <ul class="breadcrumbs-custom">
        <li><a href="../">Home</a></li>
        <li class="active">Blog</li>
      </ul>
    </div>
  </div>
  <section id="blog" class="container">
    <div class="container">
      <div class="row">
        <div class="col-md-8">

          <?php for ($i = 0; $i < $no_of_blogs; $i++) {  ?>
            <?php $blog_title_org[$i] = $blog_title[$i];
            /* ✅ REPLACED ALL str_replace WITH FUNCTION */
            $blog_title[$i] = createSlug($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]);
            ?>
            <div class="article-block-in">
              <?php /*?><p class="news-dt"><?php echo date('jS F Y',strtotime($posting_dt[$i])); ?></p><?php */ ?>
              <h2 class="head_gry_sm2"><a href="<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ", "", $blog_title[$i]); ?>-blog.php"><?php echo $blog_title_org[$i]; ?></a></h2>

              <p class="head_gry_sm2"><?php echo date('jS F Y', strtotime($posting_dt[$i])); ?></p>
              <p>
                <?php if ($blog_image_path[$i] != "") {  ?>
                  <?php $image_path = substr($_SERVER["SCRIPT_NAME"], strrpos($_SERVER["SCRIPT_NAME"], "/") + 1); ?>
                  <img src="https://www.asiancollegeofteachers.com/admin_act/blog_images/<?php echo basename($blog_image_path[$i]);  ?>" alt="Blogs" style="float:left; margin:15px 15px 15px 0px; border:1px solid #ccc; padding:2px;" width="180" height="110">
                <?php  }  ?>
              </p>
              <p><?php //echo substr($blog_desc[$i],0,500)."...";  
                  ?>
                <?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); ?> ... </p><br />
              <?php if ($written_by[$i] != "") { ?><p><b>Written By :</b> <?php echo $written_by[$i]; ?></p><?php } ?>
              <div class="clearfix"></div>
              <ul class="pull-left blog-hm-social">
                <li><span style="font-size:23px;color:#000;"><i class="fas fa-share-alt"></i></span></li>
                <li><a href="http://www.facebook.com/sharer.php?u=https://www.senteacherstraining.com/blog/<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ", "", $blog_title[$i]); ?>-blog.php" target="_blank"><i class="fab fa-facebook-square"></i></a></li>
                <li><a href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.senteacherstraining.com/blog/<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ", "", $blog_title[$i]); ?>-blog.php" target="_blank" style="color:#3abff1;"><i class="fab fa-linkedin"></i></a></li>
                <li><a href="whatsapp://send?text=https://www.senteacherstraining.com/blog/<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ", "", $blog_title[$i]); ?>-blog.php" + message, '_blank' style="color:#22d533;"><i class="fab fa-whatsapp-square"></i></a></li>
              </ul>
              <p class="readmore-3 pull-right"><a href="<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ", "", $blog_title[$i]); ?>-blog.php" style="color:#fff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></p>
              <div class="clearfix"></div>
            </div>
          <?php  } //end of loop for $i  
          ?>

          <!--PAGINATION START-->
          <div class="paginate wrapper"><!-- The "wrapper" is just a comestic addition. You don't need this for the pagination to work. -->
            <ul>
              <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>
            </ul>
          </div>

          <!--PAGINATION END-->



        </div><!--/.col-md-8-->


        <div class="col-md-4">
          <br><br>
          <form class="form" role="form" name="frmBlogs" id="frmBlogs" method="post" style="padding:0;">
            <div class="form-group">

              <input type="text" class="form-control" id="txtBlogs" placeholder="Enter Your Search Option" style="width:75%;float:left;" name="txtBlogs" value="<?php echo $blogs; ?>">
              &nbsp;
              <button type="submit" class="btn btn-info btn-md" onClick="SearchBlogs()">Search</button>
              <input name="txtAction" id="txtAction" type="hidden">
            </div>
          </form>


          <p style="font-size: 24px; margin-top: 20px; margin-bottom: 10px; font-weight: 500;">Recent Posts</p>

          <?php for ($i = 0; $i < $no_of_blogs; $i++) {  ?>


            <?php /*?><p class="news-dt"><?php echo date('jS F Y',strtotime($posting_dt[$i])); ?></p><?php */ ?>
            <span style="font-size:16px; display:block; margin:10px 0; font-weight: 500; line-height: 1.1;"><a href="<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ", "", $blog_title[$i]); ?>-blog.php" style="color:#5bc0de;"><?php echo $blog_title_org[$i]; ?></a></span>
          <?php } ?>

        </div>

      </div>
    </div><!--/.blog-->
  </section><!--/#blog-->


  <?php include('common/footer.php'); ?>
</body>

</html>