Advertisement
Guest User

Untitled

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