<!-- Start -->


<section id="content">
	<section class="hbox stretch">
	
		<aside class="aside-md bg-white b-r" id="subNav">

			<header class="dk header b-b">			
			<div class="btn-group pull-right">
				<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">Filter
				<span class="caret"></span>
				</button>
				<ul class="dropdown-menu">				
				<li><a href="<?=base_url()?>clients/bugs/view_by_status/unconfirmed">Unconfirmed</a></li>
				<li><a href="<?=base_url()?>clients/bugs/view_by_status/confirmed">Confirmed</a></li>
				<li><a href="<?=base_url()?>clients/bugs/view_by_status/progress">In Progress</a></li>
				<li><a href="<?=base_url()?>clients/bugs/view_by_status/resolved">Resolved</a></li>
				<li class="divider"></li>
				<li><a href="<?=base_url()?>clients/bugs/view_by_status/verified">Verified</a></li>
				</ul>
			</div>




		<p class="h4"><?=lang('all_bugs')?></p>
		</header>


			<section class="vbox">
			 <section class="scrollable w-f">
			   <div class="slim-scroll" data-height="auto" data-disable-fade-out="true" data-distance="0" data-size="5px" data-color="#333333">
			<ul class="nav">
			<?php
								if (!empty($bugs)) {
				foreach ($bugs as $key => $bug) { 
					if ($bug->bug_status == 'Verified') { $label = 'bg-success'; }elseif ($bug->bug_status == 'Resolved') {
						$label = 'bg-primary'; }elseif ($bug->bug_status == 'In Progress') { $label = 'bg-dark'; }
						elseif ($bug->bug_status == 'Confirmed') { $label = 'bg-info'; }else{ $label = 'bg-danger';
					}
					if ($bug->priority == 'Critical') { $priority = 'danger'; }elseif ($bug->priority == 'High') {
						$priority = 'inverse'; }else{	$priority = 'dark';	}	?>

				<li class="b-b b-light <?php if($bug->bug_id == $this->uri->segment(4)){ echo "bg-light dk"; } ?>">
				<a href="<?=base_url()?>clients/bug_view/details/<?=$bug->bug_id?>">
				<?=ucfirst($this->user_profile->get_profile_details($bug->reporter,'fullname')? $this->user_profile->get_profile_details($bug->reporter,'fullname'):$this->user_profile->get_user_details($bug->reporter,'username'))?>
				<div class="pull-right">
				BUG#<?=$bug->issue_ref?>
				</div> <br>
				<small class="block small text-muted">PRO#<?=$bug->project_code?> | <i class="fa fa-circle text-<?=$priority?> pull-right m-t-xs"></i> <span class="label <?=$label?>"><?=$bug->bug_status?></span></small>

				</a> </li>
				<?php } } ?>
			</ul> 
			</div></section>
			</section>
			</aside> 
			
			<aside>
			<section class="vbox">

			<?php
								if (!empty($bug_details)) {
				foreach ($bug_details as $key => $bug) { ?>

				<header class="header bg-white b-b clearfix">
					<div class="row m-t-sm">
						<div class="col-sm-8 m-b-xs">
							
						<div class="btn-group">
						<a href="<?=base_url()?>clients/bug_view/add" data-toggle="ajaxModal" title="<?=lang('new_bug')?>" class="btn btn-sm btn-default"><i class="fa fa-plus"></i> <?=lang('new_bug')?></a>
						</div>
						<?php
						if ($bug->reporter == $this->tank_auth->get_user_id()) { ?>
						<a href="<?=base_url()?>clients/bug_view/edit/<?=$bug->bug_id?>" data-toggle="ajaxModal" title="<?=lang('edit_bug')?>" class="btn btn-sm btn-dark"><i class="fa fa-pencil"></i></a>
						<?php } ?>
						
						</div>
						<div class="col-sm-4 m-b-xs">
						<?php  echo form_open(base_url().'clients/bugs/search'); ?>
							<div class="input-group">
								<input type="text" class="input-sm form-control" name="keyword" placeholder="<?=lang('search')?>">
								<span class="input-group-btn"> <button class="btn btn-sm btn-default" type="submit">Go!</button>
								</span>
							</div>
							</form>
						</div>
					</div> </header>
					<section class="scrollable wrapper w-f">
					
					<div class="slim-scroll" data-height="auto" data-disable-fade-out="true" data-distance="0" data-size="5px" data-color="#333333">
					
					<?php  echo modules::run('sidebar/flash_msg');?>
					<!-- Start bug details -->
					

				

				<section class="panel ">


<ul class="nav nav-tabs" id="stats"> 
<li class="active"><a href="#comments" data-toggle="tab"><?=strtoupper(lang('comments'))?></a></li> 
<li class="">
<a href="<?=base_url()?>clients/bug_tabs/attachments/<?=$bug->bug_id?>" data-target="#attachments" data-toggle="tabajax" rel="tooltip">
<?=strtoupper(lang('attachments'))?></a>
</li> 
<li class="">
<a href="<?=base_url()?>clients/bug_tabs/activities/<?=$bug->bug_id?>" data-target="#activities" data-toggle="tabajax" rel="tooltip">
<?=strtoupper(lang('activities'))?></a>
</li> 
<li class="">
<a href="<?=base_url()?>clients/bug_tabs/details/<?=$bug->bug_id?>" data-target="#details" data-toggle="tabajax" rel="tooltip"><?=lang('bug_details')?></a>
</li> 
</ul> 

<div class="panel-body"> 

<div class="tab-content"> 

<div class="tab-pane active" id="comments">


<!-- Start Comments -->

									<section class="scrollable w-f">
										
											<div class="col-lg-12">
												<!-- .comment-list -->
												<section class="comment-list block">




					<!-- comment form -->

						<article class="comment-item media"> <a class="pull-left thumb-sm avatar"><img src="<?=base_url()?>resource/avatar/<?=$this->user_profile->get_profile_details($this->tank_auth->get_user_id(),'avatar')?>" class="img-circle"></a> <section class="media-body">
						<?php   
			$attributes = array('class' => 'm-b-none');
			echo form_open(base_url().'clients/bugs/comment?bug='.$bug->bug_id, $attributes); ?>
								<input type="hidden" name="bug" value="<?=$bug->bug_id?>">

								<section class="panel panel-default"> 
									<textarea class="form-control no-border" rows="3" name="comment" placeholder="Enter your message here"></textarea>
									<footer class="panel-footer bg-light lter">
									<button class="btn btn-success pull-right btn-sm" type="submit"><?=lang('post_comment')?></button> 
									<ul class="nav nav-pills nav-sm"> 
									<li><a href="<?=base_url()?>clients/bug_files/add/<?=$this->uri->segment(4)*1200?>" data-toggle="ajaxModal">
									<i class="fa fa-paperclip text-dark"></i> <?=lang('attach_file')?></a></li>  
									</ul> </footer> 
								</section>
						</form> </section> </article>



						<!-- End Comment Form -->


													<?php
					if (!empty($bug_comments)) {
					foreach ($bug_comments as $key => $comment) { ?>

													<article id="comment-id-1" class="comment-item">
														<a class="pull-left thumb-sm avatar">
														<img src="<?=base_url()?>resource/avatar/<?=$this->user_profile->get_profile_details($comment->comment_by,'avatar')?>" class="img-circle"> </a>
														<span class="arrow left"></span>
														<section class="comment-body panel panel-default">
															<header class="panel-heading bg-white">
																<a href="#"><?=ucfirst($this->user_profile->get_profile_details($comment->comment_by,'fullname')?$this->user_profile->get_profile_details($comment->comment_by,'fullname'):$this->user_profile->get_user_details($comment->comment_by,'username'))?></a>
																<?php if($comment->comment_by == $this->tank_auth->get_user_id()){ ?><label class="label bg-danger m-l-xs"><?=lang('you')?></label> <?php } ?>
																<span class="text-muted m-l-sm pull-right"> <i class="fa fa-clock-o"></i> <?php
																					$today = time();
																					$comment_day = strtotime($comment->date_commented) ;
																					echo $this->user_profile->get_time_diff($today,$comment_day);
															?> <?=lang('ago')?> </span> </header>
															<div class="panel-body">
																<div><small><?=$comment->comment?></small></div>
																<div class="comment-action m-t-sm">
																
																</div>
															</div>

															

														</section>
													</article>
													
													<?php } }else{ ?>
													<p><?=lang('no_comment_found')?></p>
													<?php } ?>
													



													
											</section>
										</div>
									
									<!-- / .comment-list -->


<!-- End Comments -->
</div> 

<div class="tab-pane" id="attachments"></div> 

<div class="tab-pane " id="activities"></div> 

<div class="tab-pane " id="details"></div>

</div> 
</div> </section>







				<?php } } ?>
				</section>
					 <!-- End bug details -->





</div>




		</section> </aside> </section> <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a> </section>



<!-- end -->




