<!---- 
    Author			: Hasan
    Created Date	: 03 Feb 2015
    Revision		: 1) 
-->
<style>
table td{
	height: 20px;
}
</style>

	<?php
			//---------Untuk privellege jika dia ada tombol save----------
			if($group_user->SavePrivillage == 1){
				$cek_autority_save 		= "";
			}
			else{
				$cek_autority_save 		= "disabled";
			}
			//-------------end----------------------------
	?>

<div class="easyui-layout" data-options="fit:true,border:false">

        <!-- top view-->
        <div id="form-header" data-options="region:'north',border:false" >
            <div id="form-header-wrapper">
                <table cellpadding="0" cellspacing="0" width="100%" border="0">
                <tr>
                    <td align="left">
                       <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload'" onclick="location.reload();">Refresh</a>
                    </td>					
        
                    <td height="25" align="right" valign="middle">
                        <span class="form-title" style="margin-left:7px;">
                            <?=$menu_label?>
                        </span>							
                    </td>
                </tr>
                </table>		     	
            </div>			
        </div>
        <!-- end top view -->	

    	<!-- center view -->
		<div id="form-body" data-options="region:'center',border:false">
            <div id="form-wrapper" class="easyui-panel"  style="width:1180px;height:526px;padding:5px;" fit='true'>
                	<form id="fm_fix_list" name="fm_fix_list" method="post">
                    <table class="form-detail" width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="234"><b>Asset Code</b></td>
                        <td width="934" style="padding:1px 0px 2px;">
                            <input type="text" name="txt_asset_code" id="txt_asset_code" value="<?php echo $detail->AssetCode;?>" style="width:100px;text-transform:uppercase;background-color:#E3E2E2;" readonly /> 
                            <strong>Item Code</strong>
                            <input type="text" name="txt_item_code" id="txt_item_code" value="<?php echo $detail->ItemCode;?>" style="width:120px;text-transform:uppercase;background-color:#E3E2E2;" readonly />
                        </td>
                    </tr>
                    <tr>
                        <td><b>Asset Type </b></td>
                        <td style="padding:1px 0px 2px;">
                            <select class="easyui-combogrid" name="cmb_depreciate_method" 
                                style="height:22px;width:300px;" 
                                required="required" editable="false" readonly
                                data-options="
                                    value:'<?php echo $detail->FixedAssetTypeID;?>',
                                    panelWidth: 300,
                                    idField: 'FixedAssetTypeID',
                                    textField: 'FixedAssetType',
                                    url:'<?=base_url()?>list/fixed_asset_list/get_asset_type',
                                    method: 'get',
                                    columns: [[
                                    {field:'FixedAssetType',title:'Fixed Asset Type',width:190}
                                    ]],
                                    fitColumns: true
                                "
                            >
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td><b>Acquisition Date</b></td>
                        <td style="padding:1px 0px 2px;">
                        	<input name="txt_purchase_date" value="<?php echo $detail->ReceiptDate;?>" id="txt_purchase_date" type="text" class="easyui-datebox" data-options="panelWidth:302" style="width:302px;height:20px" readonly="readonly"/>
                        </td>
                    </tr>
                    <tr>
                    	<td><b>Usage Date</b></td>
                        <td style="padding:1px 0px 2px;">
                        	<input name="txt_usage_date" editable='false' value="<?php echo $detail->UsageDate;?>" id="txt_usage_date" type="text" class="easyui-datebox" data-options="panelWidth:302" style="width:302px;height:20px" />
                        </td>
                    </tr>
                    <tr>
                    	<td><b>Asset Description</b></td>
                        <td style="padding:1px 0px 2px;">
                        	<input name="txt_asset_desc" editable='false' value="<?php echo $detail->ItemDesc;?>" id="txt_asset_desc" type="text" data-options="panelWidth:302" style="width:302px;height:20px" readonly/>
                        </td>
                    </tr>
                    <tr>
                    	<td><b>Qty</b></td>
                        <td style="padding:1px 0px 2px;">
                        	<input type="text" name="txt_qty" id="txt_qty" value="<?php echo $detail->ItemQty;?>" style="width:300px;text-transform:uppercase;background-color:#E3E2E2;" readonly />
                        </td>
                    </tr>
                    <!--<tr>
                    	<td><b>Department</b></td>
                        <td style="padding:1px 0px 2px;">
                        	
                            <select class="easyui-combogrid" name="cmb_department" 
                                style="height:22px;width:300px;" 
                                required="required" editable="false" 
                                data-options="
                                    value:'<?php echo $detail->DepartmentCode; ?>',
                                    panelWidth: 300,
                                    idField: 'DepartmentCode',
                                    textField: 'DepartmentName',
                                    url:'<?=base_url()?>custom/get_data/department',
                                    method: 'post',
                                   
                                    fitColumns: true
                                "
                            >
                            </select>
                        </td>
                    </tr>-->
                    </table>
                    <hr />
                    <div id="wrapptabs" name="" class="easyui-tabs">
						<div id="tab_addres" title="General" style="padding:10px">	
                        	<table width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="224"><b>Estimated Life</b></td>
                                    <td width="924" style="padding:1px 0px 2px;">
                                        <input type="text" name="txt_estimated_life" id="txt_estimated_life" data-options="required:true" value="<?php echo $detail->EstimatedLife;?>" style="width:300px;text-transform:uppercase;background-color:#E3E2E2;" readonly /> <b>Month</b>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="224"><b>Asset Cost</b></td>
                                    <td width="924" style="padding:1px 0px 2px;">
                                    	<input type="text" name="txt_asset_cost" id="txt_asset_cost" class="easyui-numberbox" style="width:300px;text-align:left;" readonly value="<?php echo $detail->ItemAverage;?>"
                                            data-options="precision:2,groupSeparator:'.',decimalSeparator:','"
                                        />
                                    </td>
                                </tr>
                                <tr>
                                    <td width="224"><b>Deprecition Method</b></td>
                                    <td width="924" style="padding:1px 0px 2px;">
                                        <input type="text" name="txt_estimated_life" id="txt_estimated_life" data-options="required:true" value="<?php echo get_depreciate_method($detail->DepMethodID);?>" style="width:300px;text-transform:uppercase;background-color:#E3E2E2;" readonly /> 
                                        <strong>Rate : </strong><input type="text" name="txt_estimated_life" id="txt_estimated_life" data-options="required:true" value="<?php echo $detail->DepriciateRate;?>" style="width:70px;text-transform:uppercase;background-color:#E3E2E2;" readonly /> 
                                    </td>
                                </tr>
                                <tr>
                                    <td width="224"><b>Invoice Number</b></td>
                                    <td width="924" style="padding:1px 0px 2px;">
                                        <input type="text" name="txt_invoice" data-options="required:true" value="<?php echo $detail->ReceiptNumber;?>" style="width:300px;text-transform:uppercase;background-color:#E3E2E2;" readonly />
                                    </td>
                                </tr>
                                <!--<tr>
                                    <td><b>Fixed Asset Type</b></td>
                                    <td width="924" style="padding:1px 0px 2px;">
                                        <input type="text" name="txt_asset_type" data-options="required:true" value="" style="width:300px;text-transform:uppercase;background-color:#E3E2E2;" readonly />
                                    </td>
                                </tr>-->
                                 <tr>
                                    <td><b>Depreciation Amount</b></td>
                                    <td width="924" style="padding:1px 0px 2px;">
                                        <input type="text" name="txt_depreciation" data-options="precision:2,decimalSeparator:',',groupSeparator:'.'" class="easyui-numberbox" value="<?php echo $detail->PaymentAmount;?>" style="width:300px;text-transform:uppercase;background-color:#E3E2E2;" readonly />
                                    </td>
                                </tr>
                                 <tr>
                                    <td><b>Accounting Book Value</b></td>
                                    <td width="924" style="padding:1px 0px 2px;">
                                        <input type="text" name="txt_book_val" data-options="precision:2,decimalSeparator:',',groupSeparator:'.'" class="easyui-numberbox" value="<?php echo $detail->AmountBookValues;?>" style="width:300px;" />
                                    </td>
                                </tr>
                                <tr>
                                    <td><b>Category Name</b></td>
                                    <td width="924" style="padding:1px 0px 2px;">
                                    	
                                        <select name="cbg_vendor" class="easyui-combogrid" id="cmbg_kategori" style="width:300px;height:20px" required readonly
                                            data-options="
                                                panelWidth: 445,
                                                value:'<?php echo $detail->ItemCategoryID;?>',
                                                idField: 'ItemCategoryID',
                                                textField: 'ItemCategoryName',
                                                fitColumns: true,
                                                url: '<?php echo base_url(); ?><?php echo"list/fixed_asset_list"; ?>/get_categori',
                                                method: 'post',
                                                columns: [[
                                                    {field:'ItemCategoryID', title:'Item Category Id', halign:'center', align:'center', width:110},
                                                    {field:'ItemCategoryName',title:'Item Category Name', halign:'center', width:250}
                                                ]],
                                            ">
                                        </select>


                                        
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="tab_notes" title="Notes">
                    		<textarea name="txa_notes" style="resize:none;width:99.5%;" rows="12"><?php echo $detail->Description;?></textarea>
                    	</div>
                    </div>
                </div>
            </div>
            <div id="form-footer" data-options="region:'south',border:false">
                <table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
                     <tr>
                       <td align="left">
                            
                       </td>
                        <td align="right">                              
                             <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-help" onclick="" plain="true">Help</a>								
                            <a href="javascript:void(0)" id="save_button" class="easyui-linkbutton form-button" iconCls="icon-save" onClick="save_me();" <?php echo $cek_autority_save;?>>Save</a> 								
                            <!-- <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-print" onclick="link_print('<?=$menu_link?>/to_print_detail/');">Preview & Print</a> -->
                            <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-cancel" onclick="location.reload();">Cancel</a>	
                        </td>
                     </tr>
                </table>				
		</div>
    </form>
    
</div>
<script>
function save_me(){
	edit_data('<?php echo $menu_link?>','#fm_fix_list');
}
</script>