<div class="row">
	<div class="col-md-12">
		<div class="box box-primary">
			<div class="box-header with-border">
				<h3 class="box-title"><?= !empty(lang('posts'))?lang('posts'):"posts";?></h3>
				<div class="box-tools pull-right">
					<div class="add_post_btn text-right">
						<a href="<?php echo base_url('admin/post-add'); ?>" class="btn btn-success btn-flat"><i class="fa fa-plus"></i>  <?= !empty(lang('add_new'))?lang('add_new'):"Add New";?></a>
					</div>
				</div>
			</div>
			<!-- /.box-header -->
			<div class="box-body" >
				
			<div class="user_table table-responsive">
					<table class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th width="4%"><?= !empty(lang('sl'))?lang('sl'):"sl";?></th>
                  <th ><?= !empty(lang('image'))?lang('image'):"image";?></th>
                  <th width="20%"> <?= !empty(lang('name'))?lang('name'):"name";?></th>
                  <th width="20%"><?= !empty(lang('slug'))?lang('slug'):"slug";?></th>
                  <th width="15%"><?= !empty(lang('categories'))?lang('categories'):"categories";?></th>
                  <th width="15%"><?= !empty(lang('tags'))?lang('tags'):"tags";?></th>
                  <th width="15%"><?= !empty(lang('type'))?lang('type'):"type";?></th>
                  <th width="15%"><?= !empty(lang('action'))?lang('action'):"action";?></th>
                </tr>
                </thead>
                <tbody>
                <?php $i=1; foreach ($blogs as $key => $row): ?>
	                <tr>
	                  <td><?= $i; ?></td>
	                  <td><!-- post_type -->
						<div class="post_imgae" style="position: relative;">
							<label class="post_label label label-<?= $row['post_type']==1?"success":($row['post_type']==2?"info":"danger");?>" data-toggle="tooltip" data-placement="top" title="<?= $row['post_type']==1?"Public Post":($row['post_type']==2?"User+Public":"User Post");?>"><i class="fa fa-<?= $row['post_type']==1?"globe":($row['post_type']==2?"sign-language":"lock");?>"></i></label>
	                  			<!-- post_type -->
	                  	<?php if($row['is_video']==0): ?>
	                  		<img src="<?= base_url($row['thumb'])?>" alt="" style="height: 50px; width: 100px;">
	                  	<?php else: ?>
	                  		<i class="fa fa-play-circle fa-4x video_play"></i>
	                  	<?php endif;?>
						</div>
	                  			
	                  </td>
	                  <td title="<?= $row['title'];?>"><?php echo character_limiter($row['title'],30); ?></td>
	                  <td><?php echo $row['slug']; ?></td>

	                  <td>
	                  	<label class="label label-info" data-toggle="tooltip" data-placement="top" title="Category"><?= $row['cat_name']; ?></label>
	                  </td>


	                  <td>
	                  	<?php foreach ($row['tags'] as $tag): ?>
	                  		<label class="label label-info"><?= $tag['tag_name']; ?></label> 
	                  	<?php endforeach ?>
	                  	
	                  </td>

						<td>
							<!-- features -->
		                  	<?php if($row['is_features']==1){ ?>
		                  		<label class="label label-primary"><?= !empty(lang('features'))?lang('features'):"features";?></label>
		                  	<?php } ?>
		                  	<!-- features -->

		                  	<!-- schedule -->
		                  	<?php if($row['is_schedule']==1){ ?>
		                  		<label class="label label-default" data-toggle="tooltip" data-placement="top" title="<?= $row['schedule_time']?>">Schedule</label>
								<label class="label label-success" data-toggle="tooltip" data-placement="top" title="<?= $row['schedule_time']?>"><?= day_left(d_time(),$row['schedule_time']);?></label>
		                  	<?php } ?>
	                  		<!-- schedule -->	
	                  		<div class="">
	                  			<a href="<?= base_url('change-status/'.$row['id']."/")?><?= $row['status']==1?"0":"1"; ?>/post" class="label label-flat  <?= $row['status']==1?"label-success":"label-danger"; ?>"><?= $row['status']==1?(!empty(lang('live'))?lang('live'):"Live"): (!empty(lang('hide'))?lang('hide'):"Hide"); ?></a>
	                  		</div>

						</td>

	                  <td>
	                  	<a href="<?php echo base_url('admin/blog/edit/'.$row['id']) ?>" class="btn btn-flat btn-info btn-sm" data-toggle="tooltip" data-placement="top" title="<?= !empty(lang('edit'))?lang('edit'):"edit";?>"><i class="fa fa-pencil"></i></a>

	                  	<a href="<?php echo base_url('admin/blog/post_delete/'.$row['id']) ?>" class="btn btn-flat btn-danger action_btn btn-sm" data-toggle="tooltip" data-placement="top" title="Delete" data-msg="<?= !empty(lang('want_to_delete'))?lang('want_to_delete'):'Want to delete?' ;?>"><i class="fa fa-trash-o"></i></a>
	               
	                  </td>
	                </tr>
            	<?php $i++; endforeach ?>
                </tbody>
              </table>
				</div>
			</div><!-- /.box-body -->
			<div class="box-footer" >
			
			</div>
		</div>
	</div>
</div>

