<!---- 
    Author 	: Herpan
    Tanggal : 12-08-2014	
    Revisi 	: Muslih / Tanggal 27-08-2015
-->

	<?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%" height="100%" border="0">
            <tr>
                <td align="left">
                    <a href="#" class="easyui-linkbutton" iconCls="icon-document" plain="true" onclick="parent.tab_add('New Item Categories','<?=$menu_link?>','icon-add','add')">New</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 of top view -->
    
    <div id="form-body" data-options="region:'center',border:false">
		<div id="form-wrapper" class="easyui-panel" style="width:1180%;height:526px;padding:5px;" fit='true'>
        	<form id="fm_item_categories" name="fm_item_categories" method="post">
            	<table class="form-detail" width="100%" cellspacing="0" cellpadding="0">
                <tr>
                    <td><b>Item Category Name</b></td>
                    <td width="850" style="padding:1px 0px 2px;">
                        <input type="text" name="txt_name" class="easyui-validatebox td_input_min" data-options="required:true" style="width:850px;text-transform:uppercase" />
                    </td>
                </tr>
                <tr>
                    <td><b>Name Initial</b></td>
                    <td width="850" style="padding:1px 0px 2px;">
                        <input type="text" name="txt_name_initial" id="txt_name_initial" class="easyui-validatebox td_input_min" data-options="required:true" style="width:850px;text-transform:uppercase" MAXLENGTH="4"/>
                    </td>
                </tr>
                <tr>
                    <td valign="top" style="padding-top:4px;"><b>Description</b></td>
                    <td style="padding:1px 0px 2px;">
                        <textarea name="txt_desc" rows="4" style="width:846px;resize:none;white-space:normal;"></textarea>
                    </td>
                </tr>
                </table>
            </form>
        </div>
    </div>
    <div id="form-footer" data-options="region:'south',border:false">
        <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td>&nbsp;</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)" class="easyui-linkbutton form-button" iconCls="icon-save" onclick="save();" <?php echo $cek_autority_save;?>>Save</a>
                     <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-cancel" onclick="parent.tab_close('tt')">Cancel</a>	   		
                </td>
             </tr>
         </table>
    </div>
</div>
<!-- Pembatas huruf / Muslih -->
<script type='text/javascript'>
function save() {
	var name_initial = $('#txt_name_initial').val();
	var leng = name_initial.length;
	if(leng == 4){
		save_data('<?php echo $menu_link?>','#fm_item_categories', 1);
	}
	else{
	$.messager.alert('Error','Name initial tidak boleh lebih dan kurang dari (4) karakter','error',function(){	
		});
	}
}
</script>
<!-- End Muslih -->