Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 17.16 KB | None | 0 0
  1. <section class="oth-articleNews ">
  2. <!-- Breadcrumbs -->
  3. <?php
  4.    if ( ! isset($_GET['page'])){
  5.        $_GET['page'] = 1;
  6.    }  
  7. ?>
  8.  
  9.     <div class="container-fluid container-custom-deep">
  10.         <nav aria-label="breadcrumb " class="d-none d-sm-flex">
  11.                 <ol class="breadcrumb breadcrumb-transparent" style="padding-left: 0;">
  12.                     <li class="breadcrumb-item"><a href="<?= base_url() ?>">Home</a></li>
  13.                     <li class="breadcrumb-item active" aria-current="page">Orthodontic Article</li>
  14.                 </ol>
  15.             </nav>
  16.             <!-- End of Breadcrumbs -->
  17.  
  18.         <div class="row" style="display: <?= (count($article_headline) > 0) ? 'block': 'none' ; ?>">
  19.             <div class="col-md-12">
  20.                 <h1 class="oth-articleNews-heading  mt-30-resp d-none d-sm-flex">Headline News</h1>
  21.                 <div class="owl-carousel owl-theme oth-article-featured">
  22.                     <?php foreach ($article_headline as $z): ?>
  23.                     <section class="oth-articleNews-featured">
  24.                         <div class="row">
  25.                             <div class="col-sm-12 col-md-6">
  26.                                 <div class="row mtb-15-resp d-md-block d-xl-none" >
  27.                                     <?php
  28.                                        $q = "select * from post_tag a inner join tag b on a.tag_id = b.tag_id where a.post_id = ".$z->post_id;
  29.                                         $single_tag = $this->my_query->query($q);
  30.  
  31.                                         if ( $single_tag->num_rows() > 0) {
  32.                                             foreach( $single_tag->result() as $tag ){
  33.                                     ?>
  34.                                     <label class="oth-sorting-cat" style="background-color: <?= $tag->tag_color; ?>;"><?php echo $tag->tag_title  ?></label>
  35.                                     <?php
  36.                                        } }
  37.                                    ?>
  38.                                 </div>
  39.                                 <h2 class="oth-articleNews-featuredTitle d-md-block d-xl-none"><?= $z->post_header ?></h2>
  40.                                 <img src="<?= base_url() ?>assets/article/<?= $z->post_picture ?>" alt="" class="img-fluid">
  41.                             </div>
  42.                             <div class="col-sm-12 col-md-6">
  43.                                 <div class="row d-none d-sm-flex" style="margin: 0 0 30px;">
  44.                                     <?php
  45.                                        $q = "select * from post_tag a inner join tag b on a.tag_id = b.tag_id where a.post_id = ".$z->post_id;
  46.                                         $single_tag = $this->my_query->query($q);
  47.  
  48.                                         if ( $single_tag->num_rows() > 0) {
  49.                                             foreach( $single_tag->result() as $tag ){
  50.                                     ?>
  51.                                     <label class="oth-sorting-cat" style="background-color: <?= $tag->tag_color; ?>;"><?php echo $tag->tag_title  ?></label>
  52.                                     <?php
  53.                                        } }
  54.                                    ?>
  55.                                 </div>
  56.                                 <a href="<?= base_url() ?>Web/post?post_id=<?= $z->post_id ?>">
  57.                                     <h2 class="oth-articleNews-featuredTitle d-none d-sm-flex"><?= $z->post_header ?></h2>
  58.                                 </a>
  59.                                     <h4 class="oth-articleNews-featuredDate"><?php echo set_date($z->post_date) ?></h4>
  60.                                
  61.                                 <p class="oth-articleNews-featuredText">
  62.                                     <?php
  63.                                        $string     =   $z->post_content;
  64.                                         $string = strip_tags($string);
  65.                                         if (strlen($string) > 300) {
  66.  
  67.                                             // truncate string
  68.                                             $stringCut = substr($string, 0, 300);
  69.                                             $endPoint = strrpos($stringCut, ' ');
  70.  
  71.                                             //if the string doesn't contain any space then it will cut without word basis.
  72.                                             $string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);
  73.                                            
  74.                                             $string .= " .............";
  75.                                         }
  76.                                         echo $string;
  77.                                     ?>
  78.                                 </p>
  79.                                 <a href="<?= base_url() ?>Web/post?post_id=<?= $z->post_id ?>" class="oth-articleNews-featuredMore">Read More</a>
  80.                             </div>
  81.                         </div>
  82.                     </section>
  83.                 <?php endforeach ?>
  84.                 </div>
  85.             </div>
  86.         </div>
  87.     </div>
  88. </section>
  89.  
  90. <section class="oth-searchTopic">
  91.     <div class="container-fluid container-custom-deep">
  92.         <div class="row">
  93.             <div class="col-md-12">
  94.                 <div class="input-group">
  95.                     <input class="form-control py-2 border-right-0 border" placeholder="Search Topics" id="example-search-input">
  96.                    <a href="article-search.php"> <span class="input-group-append">
  97.                         <div class="input-group-text bg-transparent search-custom"><i class="fa fa-search"></i></div>
  98.                     </span></a>
  99.                 </div>
  100.             </div>
  101.         </div>
  102.         <div class="row justify-content-center mt-15-resp" style="margin-top: 40px;">
  103.             <div class="col-md-12">
  104.                 <div class="row">
  105.                     <div class="col-md-3">
  106.                         <h4>Popular Search</h4>
  107.                     </div>
  108.                     <div class="col-12 col-md-8" style="padding-left:30px;">
  109.                         <ul id="tags-list">
  110.                             <?php
  111.                                $tagnumber = count($tags);
  112.                                if ($tagnumber >0) {
  113.                                     foreach ($tags as $result ) {
  114.                             ?>
  115.                             <a href="<?= base_url() ?>Web/search?tag_id=<?= $result->tag_id ?>" class="oth-sorting-cat" style="color:white;background-color:<?= $result->tag_color ?>; ">
  116.                                 <?= $result->tag_title ?>
  117.                             </a>
  118.                             <?php
  119.                                }
  120.                            }
  121.                            ?>
  122.                         </ul>
  123.                      </div>
  124.                 </div>
  125.             </div>
  126.         </div>
  127.     </div>
  128. </section>
  129. <div class="container-fluid container-custom d-none d-sm-block" style="padding-top: 0; padding-bottom: 30px;">
  130. <hr class="oth-hr">
  131. </div>
  132.  
  133. <!-- WEB ONLY -->
  134.  
  135. <section class="oth-popularArticle d-none d-sm-flex">
  136.     <div class="container-fluid container-custom-deep">
  137.         <div class="row">
  138.             <div class="col-md-12">
  139.                 <div class="row">
  140.                     <div class="col-md-12">
  141.                         <div class="row" style="margin-bottom: 30px;">
  142.                         <?php foreach ($article as $zxc){ ?>
  143.                             <div class="col-md-6">
  144.                                 <div class="oth-popularArticle-card">
  145.                                     <div class="row no-gutters">
  146.                                         <div class="col-sm-12 col-md-7" style="padding-right:15px;">
  147.                                             <img style="height:201px;width:288px" src="<?= base_url() ?>assets/article/<?= $zxc->post_picture ?>" alt="" class="img-fluid">
  148.                                         </div>
  149.                                         <div class="col-sm-12 col-md-5" style="padding-top:15px;padding-right: 15px;">
  150.                                            <h4>
  151.                                             <a href="<?= base_url() ?>Web/post?post_id=<?= $zxc->post_id ?>" style="color:black">
  152.                                                 <?= $zxc->post_header ?>
  153.                                             </a>
  154.                                             </h4>
  155.                                             <p class="popularArticle-card-date"><?= set_date($zxc->post_date) ?></p>
  156.                                             <p class="popularArticle-card-text">
  157.                                                 <?php
  158.                                                    $string     =   $zxc->post_content;
  159.                                                     $string = strip_tags($string);
  160.                                                     if (strlen($string) > 75) {
  161.  
  162.                                                         // truncate string
  163.                                                         $stringCut = substr($string, 0, 75);
  164.                                                         $endPoint = strrpos($stringCut, ' ');
  165.  
  166.                                                         //if the string doesn't contain any space then it will cut without word basis.
  167.                                                         $string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);
  168.                                                        
  169.                                                         $string .= " .............";
  170.                                                     }
  171.                                                     echo $string;
  172.                                                  ?>
  173.                                             </p>
  174.                                             <a  href="<?= base_url() ?>Web/post?post_id=<?= $zxc->post_id ?>" class="popularArticle-card-more">Read More</a>
  175.                                             <?php
  176.                                                $q = "select * from post_tag a inner join tag b on a.tag_id = b.tag_id where a.post_id = ".$zxc->post_id.' limit 1';
  177.                                                 $single_tag = $this->my_query->query($q);
  178.  
  179.                                                 if ( $single_tag->num_rows() > 0) {
  180.                                             ?>
  181.                                             <label class="float-right oth-sorting-cat " style="background-color: <?= $single_tag->row()->tag_color; ?>;"><?php echo $single_tag->row()->tag_title  ?></label>
  182.                                             <?php
  183.                                                }
  184.                                            ?>
  185.                                         </div>
  186.                                     </div>
  187.                                 </div>
  188.  
  189.                                 &nbsp;
  190.  
  191.                             </div>
  192.                         <?php } ?>
  193.                         </div>
  194.  
  195.                         <div class="oth-pagination d-flex justify-content-center">
  196.                             <?php if ($_GET['page'] != 1){ ?>
  197.                                 <a class="oth-pagination-jumper" href="<?= base_url('Web/article') ?>"> First </a>
  198.                                 <a class="oth-pagination-jumper" href="<?= base_url('Web/article?page=').($_GET['page'] - 1); ?>">Prev</a>
  199.                             <?php }  ?>
  200.                              <?php for ($i=1; $i<=$pages ; $i++){ ?>
  201.                                 <a class="page-item <?php echo ($_GET['page'] == $i) ? '' : ''; ?>" href="<?= base_url('Web/article?page=').$i ?>"><?= $i ?></a>
  202.                             <?php } ?>
  203.                             <?php if ($_GET['page'] != $pages){ ?>
  204.                                 <a class="oth-pagination-jumpe" href="<?= base_url('Web/article?page=').($_GET['page'] + 1); ?>">Next</a>
  205.                                 <a class="oth-pagination-jumpe oth-pagination-jumperLast" href="<?= base_url('Web/article?page=').$pages ?>"> Last </a>
  206.                             <?php }  ?>
  207.                         </div>
  208.                     </div>
  209.                 </div>
  210.             </div>
  211.            
  212.         </div>
  213.     </div>
  214. </section>
  215.  
  216. <!--  END OF WEB ONLY-->
  217.  
  218. <!-- MOBILE ONLY -->
  219.  
  220. <section class="oth-popularArticle d-md-block d-xl-none">
  221.     <div class="container-fluid container-custom-deep">
  222.         <div class="row">
  223.             <div class="col-md-12">
  224.                 <div class="row" style="margin-bottom: 30px;">
  225.                     <div class="col-md-12">
  226.                         <?php foreach ($article as $zxc){ ?>
  227.                         <div class="oth-popularArticle-card" style="margin-bottom:30px;">
  228.                             <div class="row no-gutters">
  229.                                 <div class="col-sm-12 col-md-3" style="padding-right:0px;">
  230.                                     <img src="<?= base_url() ?>assets/article/<?= $zxc->post_picture ?>" alt="" class="img-fluid">
  231.                                 </div>
  232.                                 <div class="col-sm-12 col-md-9" style="padding: 15px 30px 20px 30px;">
  233.                                     <h4><a href="<?= base_url() ?>Web/post?post_id=<?= $zxc->post_id ?>" style="color:black"><?= $zxc->post_header ?></a></h4>
  234.                                     <p class="popularArticle-card-date"><?= set_date($zxc->post_date) ?></p>
  235.                                     <p class="popularArticle-card-text mb-3">
  236.                                                 <?php
  237.                                                    $string     =   $zxc->post_content;
  238.                                                     $string = strip_tags($string);
  239.                                                     if (strlen($string) > 75) {
  240.  
  241.                                                         // truncate string
  242.                                                         $stringCut = substr($string, 0, 75);
  243.                                                         $endPoint = strrpos($stringCut, ' ');
  244.  
  245.                                                         //if the string doesn't contain any space then it will cut without word basis.
  246.                                                         $string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);
  247.                                                        
  248.                                                         $string .= " .............";
  249.                                                     }
  250.                                                     echo $string;
  251.                                                  ?>
  252.                                                  </p>
  253.                                     <a href="<?= base_url() ?>Web/post?post_id=<?= $zxc->post_id ?>" class="popularArticle-card-more">Read More</a>
  254.                                     <?php
  255.                                        $q = "select * from post_tag a inner join tag b on a.tag_id = b.tag_id where a.post_id = ".$zxc->post_id.' limit 1';
  256.                                         $single_tag = $this->my_query->query($q);
  257.  
  258.                                         if ( $single_tag->num_rows() > 0) {
  259.                                     ?>
  260.                                     <label class="float-right oth-sorting-cat " style="background-color: <?= $single_tag->row()->tag_color; ?>;"><?php echo $single_tag->row()->tag_title  ?></label>
  261.                                     <?php } ?>
  262.                                 </div>
  263.                             </div>
  264.                         </div>
  265.                         <?php } ?>
  266.                        
  267.                         <div class="oth-pagination d-flex justify-content-center">
  268.                             <?php if ($_GET['page'] != 1){ ?>
  269.                                 <a class="oth-pagination-jumper" href="<?= base_url('Web/article') ?>"> First </a>
  270.                                 <a class="oth-pagination-jumper" href="<?= base_url('Web/article?page=').($_GET['page'] - 1); ?>">Prev</a>
  271.                             <?php }  ?>
  272.                              <?php for ($i=1; $i<=$pages ; $i++){ ?>
  273.                                 <a class="page-item <?php echo ($_GET['page'] == $i) ? '' : ''; ?>" href="<?= base_url('Web/article?page=').$i ?>"><?= $i ?></a>
  274.                             <?php } ?>
  275.                             <?php if ($_GET['page'] != $pages){ ?>
  276.                                 <a class="oth-pagination-jumpe" href="<?= base_url('Web/article?page=').($_GET['page'] + 1); ?>">Next</a>
  277.                                 <a class="oth-pagination-jumpe oth-pagination-jumperLast" href="<?= base_url('Web/article?page=').$pages ?>"> Last </a>
  278.                             <?php }  ?>
  279.                         </div>
  280.                     </div>
  281.                    
  282.                 </div>
  283.             </div>
  284.            
  285.         </div>
  286.     </div>
  287. </section>
  288. <script type="text/javascript">
  289.     $("#example-search-input").on('keyup', function (e) {
  290.         if (e.keyCode === 13) {
  291.             var data = $(this).val();
  292.             window.location.href="<?= base_url() ?>Web/search?key_search="+data;
  293.  
  294.         }
  295.     });
  296. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement