<? global $vis_language; 
$status=array(1 => $vis_language['TXTINPROGRESS'],2 => $vis_language['TXTOVERDUE'],3 => $vis_language['TXTCOMPLETED'],4 => $vis_language['TXTCANCELED'],5 =>$vis_language['TXTNOTSTARTED']);
$class='';$attached_id='';?>
<div  class="wrapper-sm m-b-none m-t">
	<?php if($total_task>0){ 
			for($i=0;$i<$total_task;$i++){
					if($attached_task[$i]['enddate_diff']<=0){ 
				if($attached_task[$i]['task_status']!=3 && $attached_task[$i]['task_status']!=4){
					$attached_task[$i]['task_status'] = 2;
				}
			}
				?>
				<div class="row">
					
					<div class="col-sm-4 m-t-xs">
						<span class="m-l-sm"><a class="link m-l-xs" href="#/home/view_update_tasks/1/<? echo $attached_task[$i]['task_id'];?>" title=""><? echo $attached_task[$i]['task_title'];?></a></span>
					</div>
					
					<div class="col-sm-4 m-t-xs">
					   <label><? echo $vis_language['TXTSTATUS']; ?></label>
					   <span class="m-l-sm"><? if($attached_task[$i]['task_status']==1 && $attached_task[$i]['enddate_diff']<=0 ){echo $status[2];}else
					   {echo $status[$attached_task[$i]['task_status']];}?></span>
					</div>
					<div class="col-sm-4 m-t-xs pull-right">
						<label><a class="text-muted link" href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=problem&vis_operation=confirm_detach_ci&vis_attach_type=8&vis_parent_id=<? echo $problems_details['problem_id'];?>&vis_detach_for=problem&vis_child_id=<? echo $attached_task[$i]['task_id'];?>" title="<? echo $vis_language['TXTITILDETACH']; ?>"><?= $vis_language['TXTITILDETACH'];?></a></label>
					</div>	
				</div>
			<?php
				$attached_id .=$attached_task[$i]['task_id'].',';
			}
		}?>
		<div class="row">
			<div class="col-sm-12 m-t-xs">
				<?php if($total_task==0){ $class="m-l-sm";?><label><? echo  $vis_language['TXTNOTASKATTACHED'];?></label><?php }?>
				<span class="<?php echo $class;?>"><a class="link"  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=problem&vis_operation=attach_task_to_problem&ci_for=problem&vis_problem_id=<? echo $problems_details['problem_id'];?>&attached_id=<?php echo $attached_id;?>" title="<? echo $vis_language['TXTLINKTASK']; ?>"><?= $vis_language['TXTLINKTASK'];?></a><?PHP echo ' '.$vis_language['TXTOR'];?>
    <a class="link"  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=home&vis_operation=new_task&vis_problem_id=<? echo $operation['vis_problem_id'];?>" title="<? echo $vis_language['TXTADDNWTASK']; ?>"><?= $vis_language['TXTADDNWTASK'];?></a>
    </span>
			</div>	
		</div>
</div>