<? global $vis_language; 
$class='';$attached_id='';?>
<div  class="wrapper-sm m-b-none m-t">
	<?php if($total_ci>0){
			for($i=0;$i<$total_ci;$i++){
				$is_expired ='';
				if($attached_ci[$i]['ci_type_id']==2 || $attached_ci[$i]['ci_type_id']==3){
					$total_month = ($attached_ci[$i]['warranty_year']*12)+$attached_ci[$i]['warranty_month'];
					$current_date = strtotime(date('Y-m-d h:i:s'));
					$expiry_date = strtotime(date('Y-m-d h:i:s', $attached_ci[$i]['installation_date']) . $total_month.' month');
					if($expiry_date <= $current_date){
						$is_expired='<div class="col-sm-1 m-t-xs"><span style="background-color: #e33244; color: #fff; font-weight: normal" class="btn btn-xs l-h-1x text-xs">'.$vis_language['TXTITILEXPIRED'].'</span></div>';
					}
				}?>
				<div class="row">
					<div class="col-sm-4 m-t-xs">
						<span class="m-l-sm"><a class="link m-l-xs" href="#/cmdb/cmdb_assets_details/<? echo $attached_ci[$i]['name'];?>/<? echo $attached_ci[$i]['child_id'];?>" title=""><? echo $attached_ci[$i]['name'];?></a></span>
					</div>
					<div class="col-sm-3 m-t-xs">
						<label><? echo $vis_language['TXTUSEDBY']; ?></label>
						<span class="m-l-sm"><? echo $attached_ci[$i]['usedby'];?></span>
					</div>
					<div class="col-sm-2 m-t-xs">
					   <label><? echo $vis_language['TXTIMPACT']; ?></label>
					   <span class="m-l-sm"><? echo $attached_ci[$i]['impact_name'];?></span>
					</div>
					<?php echo $is_expired;?>
					<div class="col-sm-1 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=9&vis_child_id=<? echo $attached_ci[$i]['child_id'];?>&vis_detach_for=changes&vis_parent_id=<? echo $changes_details['changes_id'];?>" title="<? echo $vis_language['TXTITILDETACH']; ?>"><?= $vis_language['TXTITILDETACH'];?></a></label>
					</div>	
				</div>
			<?php
				$attached_id .=$attached_ci[$i]['child_id'].',';
			}
		}?>
		<div class="row">
			<div class="col-sm-12 m-t-xs">
				<?php if($total_ci==0){ $class="m-l-sm";?><label><? echo  $vis_language['TXTITILNOCIASSOCIATED'];?></label><?php }?>
				<span class="<?php echo $class;?>"><a class="link"  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=changes&vis_operation=attach_ci&ci_for=changes&vis_department=<?=$changes_details['department_id']?>&vis_changes_id=<? echo $changes_details['changes_id'];?>&vis_domain_id=<? echo $changes_details['domain_id'];?>&attached_id=<?php echo $attached_id;?>" title="<? echo $vis_language['TXTATTACHCI']; ?>"><?= $vis_language['TXTATTACHCI'];?></a></span>
			</div>	
		</div>
</div>