<?php $vis_last_audit_date = ($operation['vis_last_audit_date']!='0' && $operation['vis_last_audit_date']!='')?date(VIS_EDITDATETIMEPICKER_FORMAT,$operation['vis_last_audit_date']):'';
    	$vis_expiry_date = ($operation['vis_last_audit_date']!='0' && $operation['vis_expiry_date']!='')?date(VIS_EDITDATETIMEPICKER_FORMAT,$operation['vis_expiry_date']): '';
    	$vis_installation_date = ($operation['vis_last_audit_date']!='0' &&  $operation['vis_installation_date']!='')?date(VIS_EDITDATETIMEPICKER_FORMAT,$operation['vis_installation_date']):'';	
?>
<? if($operation['vis_section']=='software'){?>
<div class="line b-b line-lg pull-in"></div>
<br/> 
<div class="form-group"><label class="col-sm-2 control-label"><strong><? echo $vis_language['TXTITILSOFTWAREPROPERTY']; ?></strong></label></div>

<div class="form-group">
    <label class="col-sm-2 control-label"><? echo $vis_language['TXTCIPRODUCT']; ?></label>
    <div class="col-sm-10">
        <select name="vis_product_id" id="vis_product_id" onchange="get_vendor(this.value);" class="form-control input-sm selectpicker"<? if(count($product_details)>10) echo ' data-live-search="true"';?>>
        <option value="0"> <? echo $vis_language['TXTSELECT']; ?> </option>
        <? if($product_details!=-1) 
            for($i=0;$i<count($product_details); $i++){
				if($operation['vis_product_id']==$product_details[$i]['product_id']) $chk='selected="selected"'; else $chk='';
				echo '<option '.$chk.' value="'.$product_details[$i]['product_id'].'">'.$product_details[$i]['name'].'</option>';
			}?>
        </select>
    </div>
</div>
<div id="vendor_list" class="form-group" style="display:none;">
</div>
<? if($operation['vis_vendor_id']!='' && $operation['vis_vendor_id']!=0){?>
<div class="form-group" id="vendor_edit">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTVENDOR']; ?></label>
    <div class="col-sm-10">
        <select name="vis_vendor_id" id="vis_vendor_id" onchange="get_vendor(this.value);" class="form-control input-sm selectpicker"<? if(count($vendor_details)>10) echo ' data-live-search="true"';?>>
        <? if($vendor_details!=-1) 
            for($v=0;$v<count($vendor_details); $v++){
				echo '<option value="'.$vendor_details[$v]['vendor_id'].'">'.$vendor_details[$v]['vendor_name'].'</option>';
			}?>
        </select>
    </div>
</div>
<? }?>
<div class="form-group">
    <label for="vis_firstname" class="col-sm-2 control-label"><? echo $vis_language['TXTITILWARRANTY']; ?></label>
    <div class="col-sm-5">
        <select name="vis_warranty_year" id="vis_warranty_year" class="form-control input-sm selectpicker" data-live-search="true">
        <? for($y=0;$y<11;$y++){
			if($operation['vis_warranty_year']==$y) $chk='selected="selected"'; else $chk='';
             echo '<option '.$chk.' value="'.$y.'"> '.$y.' '.$vis_language['TXTYEAR'].' </option>';
		   }
		?>	 
         
        </select> 
    </div>
    <div class="col-sm-5">
        <select name="vis_warranty_month" id="vis_warranty_month" class="form-control input-sm selectpicker" data-live-search="true">
        <? for($m=0;$m<12;$m++){
			if($operation['vis_warranty_month']==$m) $chk='selected="selected"'; else $chk='';
             echo '<option '.$chk.' value="'.$m.'"> '.$m.' '.$vis_language['TXTMONTH'].' </option>';
		   }
		?>	 
        </select> 
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label m-t-xs"><?= $vis_language['TXTITILINSTALLATIONDATE'];?></label>
    <div class="col-sm-10">
     <span class="input-group-addon no-padder no-borders date">
        <input id="vis_installation_date" name="vis_installation_date" class="form-control input-sm" type="text" value="<?= $vis_installation_date;?>">
    </span>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label m-t-xs"><?= $vis_language['TXTITILLICENSEEXPDATE'];?></label>
    <div class="col-sm-10">
     <span class="input-group-addon no-padder no-borders date">
        <input id="vis_expiry_date" name="vis_expiry_date" class="form-control input-sm" type="text" value="<?= $vis_expiry_date;?>">
    </span>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label"><? echo $vis_language['TXTITILLICENSETYPE']; ?></label>
    <div class="col-sm-10">
        <select name="vis_assets_state" id="vis_assets_state" class="form-control input-sm selectpicker"<? if(count($license_type_details)>10) echo ' data-live-search="true"';?>>
         <option value=""> <? echo $vis_language['TXTSELECT']; ?> </option>
            <? if($license_type_details!=-1) 
            for($l=0;$l<count($license_type_details); $l++){
				if($operation['vis_assets_state']==$license_type_details[$l]['license_type_id']) $chk='selected="selected"'; else $chk='';
				echo '<option '.$chk.' value="'.$license_type_details[$l]['license_type_id'].'">'.$license_type_details[$l]['name'].'</option>';
			}?>
        </select>
    </div>
</div>
<div class="form-group">
   <label class="col-sm-2 control-label"><? echo $vis_language['TXTCOST']; ?></label>
   <div class="col-sm-10">
      <input class="form-control input-sm" type="text" name="vis_asset_tag" id="vis_asset_tag" value="<?= $operation['vis_asset_tag']?>">
   </div>
</div>
<div class="form-group">
   <label class="col-sm-2 control-label"><? echo $vis_language['TXTITILLICENSEKEY']; ?></label>
   <div class="col-sm-10">
      <input class="form-control input-sm" type="text" name="vis_licence_key" id="vis_licence_key" value="<?= $operation['vis_licence_key']?>">
   </div>
</div>
<div class="form-group">
   <label class="col-sm-2 control-label"><? echo $vis_language['TXTITILINSTALLATIONPATH']; ?></label>
   <div class="col-sm-10">
      <input class="form-control input-sm" type="text" name="vis_installation_path" id="vis_installation_path" value="<?= $operation['vis_installation_path']?>">
   </div>
</div>            
<div class="form-group">
    <label class="col-sm-2 control-label m-t-xs"><?= $vis_language['TXTITILLASTAUDITDATE'];?></label>
    <div class="col-sm-10">
     <span class="input-group-addon no-padder no-borders date">
        <input id="vis_last_audit_date" name="vis_last_audit_date" class="form-control input-sm" type="text" value="<?= $vis_last_audit_date;?>">
    </span>
    </div>
</div>
<input id="vis_ci_property_type" name="vis_ci_property_type" class="form-control input-sm" type="hidden" value="2" >
<? }elseif($operation['vis_section']=='hardware'){?>
<div class="line b-b line-lg pull-in"></div>
<br/> 
<div class="form-group"><label class="col-sm-2 control-label"><strong><? echo $vis_language['TXTITILHARDWAREPROPERTY']; ?></strong></label></div>

<div class="form-group">
    <label class="col-sm-2 control-label"><? echo $vis_language['TXTCIPRODUCT']; ?></label>
    <div class="col-sm-10">
        <select name="vis_product_id" id="vis_product_id" onchange="get_vendor(this.value);" class="form-control input-sm selectpicker"<? if(count($product_details)>10) echo ' data-live-search="true"';?>>
        <option value=""> <? echo $vis_language['TXTSELECT']; ?> </option>
        <? if($product_details!=-1) 
            for($i=0;$i<count($product_details); $i++){
				if($operation['vis_product_id']==$product_details[$i]['product_id']) $chk='selected="selected"'; else $chk='';
				echo '<option '.$chk.' value="'.$product_details[$i]['product_id'].'">'.$product_details[$i]['name'].'</option>';
			}?>
        </select>
    </div>
</div>
<div id="vendor_list" class="form-group" style="display:none;">
</div>
<? if($operation['vis_vendor_id']!='' && $operation['vis_vendor_id']!=0){?>
<div class="form-group" id="vendor_edit">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTVENDOR']; ?></label>
    <div class="col-sm-10">
        <select name="vis_vendor_id" id="vis_vendor_id" onchange="get_vendor(this.value);" class="form-control input-sm selectpicker"<? if(count($vendor_details)>10) echo ' data-live-search="true"';?>>
        <? if($vendor_details!=-1) 
            for($v=0;$v<count($vendor_details); $v++){
				echo '<option value="'.$vendor_details[$v]['vendor_id'].'">'.$vendor_details[$v]['vendor_name'].'</option>';
			}?>
        </select>
    </div>
</div>
<? }?>
<div class="form-group">
    <label for="vis_firstname" class="col-sm-2 control-label"><? echo $vis_language['TXTITILWARRANTY']; ?></label>
    <div class="col-sm-5">
        <select name="vis_warranty_year" id="vis_warranty_year" class="form-control input-sm selectpicker" data-live-search="true">
        <? for($y=0;$y<11;$y++){
			if($operation['vis_warranty_year']==$y) $chk='selected="selected"'; else $chk='';
             echo '<option '.$chk.' value="'.$y.'"> '.$y.' '.$vis_language['TXTYEAR'].' </option>';
		   }
		?>	 
         
        </select> 
    </div>
    <div class="col-sm-5">
        <select name="vis_warranty_month" id="vis_warranty_month" class="form-control input-sm selectpicker" data-live-search="true">
        <? for($m=0;$m<12;$m++){
			if($operation['vis_warranty_month']==$m) $chk='selected="selected"'; else $chk='';
             echo '<option '.$chk.' value="'.$m.'"> '.$m.' '.$vis_language['TXTMONTH'].' </option>';
		   }
		?>	 
        </select> 
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label m-t-xs"><?= $vis_language['TXTITILACQUISITIONDATE'];?></label>
    <div class="col-sm-10">
     <span class="input-group-addon no-padder no-borders date">
        <input id="vis_installation_date" name="vis_installation_date" class="form-control input-sm" type="text" value="<?= $vis_installation_date;?>">
    </span>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label m-t-xs"><?= $vis_language['TXTITILWARRANTYEXPDATE'];?></label>
    <div class="col-sm-10">
     <span class="input-group-addon no-padder no-borders date">
        <input id="vis_expiry_date" name="vis_expiry_date" class="form-control input-sm" type="text" value="<?= $vis_expiry_date;?>">
    </span>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label"><? echo $vis_language['TXTASSETSTATE']; ?></label>
    <div class="col-sm-10">
        <select name="vis_assets_state" id="vis_assets_state" class="form-control input-sm selectpicker"<? if(count($asset_state_details)>10) echo ' data-live-search="true"';?>>
        <option value=""> <? echo $vis_language['TXTSELECT']; ?> </option>
        <? if($asset_state_details!=-1) 
            for($i=0;$i<count($asset_state_details); $i++){
				if($operation['vis_assets_state']==$asset_state_details[$i]['asset_id']) $chk='selected="selected"'; else $chk='';
				echo '<option '.$chk.' value="'.$asset_state_details[$i]['asset_id'].'">'.$asset_state_details[$i]['name'].'</option>'; 
			}?>
        </select>
    </div>
</div>
<div class="form-group">
   <label class="col-sm-2 control-label"><? echo $vis_language['TXTITILASSETTAG']; ?></label>
   <div class="col-sm-10">
      <input class="form-control input-sm" type="text" name="vis_asset_tag" id="vis_asset_tag" value="<?= $operation['vis_asset_tag']?>">
   </div>
</div>
<div class="form-group">
   <label class="col-sm-2 control-label"><? echo $vis_language['TXTITILSERIALNUMBER']; ?></label>
   <div class="col-sm-10">
      <input class="form-control input-sm" type="text" name="vis_licence_key" id="vis_licence_key" value="<?= $operation['vis_licence_key']?>" >
   </div>
</div>            
<div class="form-group">
    <label class="col-sm-2 control-label m-t-xs"><?= $vis_language['TXTITILLASTAUDITDATE'];?></label>
    <div class="col-sm-10">
     <span class="input-group-addon no-padder no-borders date">
        <input id="vis_last_audit_date" name="vis_last_audit_date" class="form-control input-sm" type="text" value="<?= $vis_last_audit_date;?>">
    </span>
    </div>
</div>
<div class="line b-b line-lg pull-in"></div>
<br/> 
<div class="form-group"><label class="col-sm-2 control-label"><strong><? echo $vis_language['TXTITILDEPRECIATIONDETAILS']; ?></strong></label></div>
<div class="form-group">
   <label class="col-sm-2 control-label"><? echo $vis_language['TXTCOST']; ?></label>
   <div class="col-sm-10">
      <input class="form-control input-sm" type="text" name="vis_installation_path" id="vis_installation_path" value="<?= $operation['vis_installation_path'];?>">
   </div>
</div>
<div class="form-group">
   <label class="col-sm-2 control-label"><? echo $vis_language['TXTITILSALVAGE']; ?></label>
   <div class="col-sm-10">
      <input class="form-control input-sm" type="text" name="vis_salvage" id="vis_salvage" value="<?= $operation['vis_salvage']?>">
   </div>
</div>
<div class="form-group">
	<label class="col-sm-2 control-label"><? echo $vis_language['TXTITILDEPRECIATIONTYPE']; ?></label>
    <div class="col-sm-10">
        <select name="vis_depreciation_type" id="vis_depreciation_type" class="form-control input-sm selectpicker"<? if(count($depreciation_details)>10) echo ' data-live-search="true"';?>>
        <? if($depreciation_details!=-1) 
            for($v=0;$v<count($depreciation_details); $v++){
				if($operation['vis_depreciation_type']==$depreciation_details[$v]['finance_id'])
				   $chk = 'selected="selected"';
				else
				   $chk = '';   
				echo '<option '.$chk.' value="'.$depreciation_details[$v]['finance_id'].'">'.$depreciation_details[$v]['name'].'</option>';
			}?>
        </select>
    </div>
</div>
<input id="vis_ci_property_type" name="vis_ci_property_type" class="form-control input-sm" type="hidden" value="1" >
<? }?>
<script type="application/javascript">
var d = new Date();
var curr_time = d.getHours()+":"+d.getMinutes();
var curr_date= '<? echo date("M-d, Y")?> '+curr_time+'';
$('.date').datetimepicker({ format: "<?php echo VIS_DATETIMEPICKER_FORMAT;?>",defaultDate: curr_date});

function get_vendor(vis_product_id){
		$('#vendor_edit').show();
		$('#vendor_list').show();
		$('#vendor_list').visExecution('load_operations', {'vis_module':'cmdb', 'vis_operation':'get_product_vendor','vis_product_id':''+vis_product_id+''});
}
</script>