<?php $this->load->view('header_front'); 
//code for to get web logo			
error_reporting(0);
?>

<form name="blog_order_form" method="request" action="<?php echo base_url();?>front_end/blog">
  <div class="vacancies-section">
    <div class="container">
      <div class="section-welcome nav-welcome">
        <ol class="breadcrumb">
          <li><a href="<?php echo base_url();?>">Home</a></li>
          <li><a href="<?php echo base_url();?>front_end/Blog">Blog </a></li>
        </ol>
        <a class="menubtn" href="#"><i class="fa fa-bars"></i></a> </div>
      <div class="row">
        <div class="col-md-3">
          <div class="vacancies-contan">
            <ul class="specialisms-section">
              <h2>Categories</h2>
              <?php  
			//code to get jobs cateories
			foreach($blogscategory as $val_cat)
			{	
			?>
              <li onclick="window.location='<?php echo base_url();?>front_end/blog?blogs_cat_id=<?php echo $val_cat->blogs_cat_id;?>';" style="cursor:pointer;text-decoration:underline;width:109%"><?php echo $val_cat->blogs_category_title;?></li>
              <?php }?>
            </ul>
          </div>
        </div>
        <div class="col-md-9">
          <div class="jobs-vacancies-section">
            <h3>JNJ Blog</h3>
          </div>
          <div class="row margin-top-45">
            <div class="col-md-10">
              <ul class="customer-bg">
                <?php 
				foreach($blogs as $val) {?>
                <li>
                  <div class="col-md-12">
                    <div class="customer-service-section">
                      <h3><?php echo $val->blog_title; ?></h3>
                      <br/>
                      <div style="border-top: 1px solid #ececec; border-bottom: 1px solid #ececec; margin-bottom: 20px; font-size: 11px; font-style: italic; padding-top: 7px;"> <span style=" color: #cd0329 !important; font-size: 11px; font-family: Droid Serif;">
                        <?php
					$white_space = '&nbsp'.'&nbsp'.'&nbsp'.'&nbsp'.'&nbsp'.'&nbsp'.'&nbsp'.'&nbsp';
					$admin_id = $val->	created_by;
					$sel_admin = mysql_query("SELECT `name` FROM `njobn_users` WHERE `user_id` ='".$admin_id."'");
					 while ($data = mysql_fetch_array($sel_admin)) 
				  	{
						$name[] = $data['name'];
				  	}
					$cat_id = $val->blog_category_id;
					$sel_category = mysql_query("SELECT `blogs_category_title` FROM `blogs_category` WHERE `blogs_cat_id` ='".$cat_id."'");
				  while ($data = mysql_fetch_array($sel_category)) 
				  {
					$category[] = $data['blogs_category_title'];
				  
				  ?>
                        <i class="fa fa-tags" aria-hidden="true"></i> <?php echo $category[0].$white_space;?> <i class="fa fa-user" aria-hidden="true"></i> <?php echo $name[0].$white_space;?>
                        <?php $title = array();
					}?>
                        <i class="fa fa-calendar" aria-hidden="true">&nbsp</i><?php echo $val->post_date;?></i> </span> </div>
                      <br/>
                      <br/>
                      <img style="margin:auto; max-width:75%" src="<?php echo base_url();?>assets/upload/<?=$val->blog_image;?>" class="img-responsive"> </div>
                  </div>
                </li>
                <p style="color: #757575;font-size: 15px;padding: 4px 0;"> <?php echo $val->blog_content;?> </p>
                <div style="border-top: 1px solid #ececec; border-bottom: 1px solid #ececec; margin-bottom: 20px; font-size: 11px; font-style: italic; padding-top: 7px; color: #cd0329">
                  <h6>Share this:</h6>
                  <br/>
                  <a href="https://twitter.com/share" class="twitter-share-button" data-show-count="false">Tweet</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> 
                  <?php echo '&nbsp';?> 
                  <script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script> 
                  <script type="IN/Share" data-url="<?php echo base_url();?>front_end/blog_post?blog_id=<?php echo $val->blog_id?>"></script> 
                  <?php echo '&nbsp';?> 
                   
                  
                  <br/>
                </div>
                <?php } ?>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</form>
<?php $this->load->view('footer_front'); ?>
