<!--
Author       : Wahyu
Created Date : 2014/09/02
Revision     : 1) Hasan | 2015/02/25 | Design UI
-->

	<?php
				//---------Untuk privellege jika dia ada tombol save----------
				if($group_user->AddPrivillage == 1){
					$cek_autority_add 		= "";
				}
				else{
					$cek_autority_add 		= "disabled";
				}
				
				if($group_user->DeletePrivillage == 1){
					$cek_autority_delete 		= "";
				}
				else{
					$cek_autority_delete 		= "disabled";
				}
				
				if($group_user->EditPrivillage == 1){
					$cek_autority_edit 		= "";
				}
				else{
					$cek_autority_edit 		= "disabled";
				}
				
				//-------------end----------------------------
	?>	

<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'north',border:false" style="height:30px" id="button-top">
        
    </div>
    
    <div id="west-panel" data-options="region:'west',split:true,border:true" title="Filter" style="width:190px;background-color:#CCCCFF;">
        <div style="padding:5px">
        	<form>
            <table width="100%" cellpadding="0" cellspacing="0" id="tab_transstatus">
            <tr>
                <td width="190" align="left" style="padding-bottom:8px;">
                    <b>Find</b>
                </td>
            </tr>
            <tr>
                <td align="left">
                	<input id="txt_no" name="txt_no" placeholder="< Item Category Name >" style="margin:2px 0px 3px;width:172px;height:22px;border:1px solid #CCC;" />
                </td>
            </tr>
            <tr>
                <td align="left">
                	<input id="txt_desc" name="txt_desc" placeholder="< Description >" style="margin:2px 0px 3px;width:172px;height:22px;border:1px solid #CCC;" />
                </td>
            </tr>
            <tr><td><div class="tr-divider"></div></td></tr>
            </table>
            </form>
        </div>
    </div>
    
    <div data-options="region:'center',border:false,iconCls:'icon-ok'">
    	<!-- gaya table baru di grid -->
		<table id="grid" 
        	title="" iconCls="icon-edit" 
            singleSelect="true" rowNumbers="true" 
            pageSize="50" 
            fitColumns="true" remoteSort="false" 
            url="<?=base_url($menu_link.'/ajax')?>" 
            style="width:auto;height:560px" 
            data-options = "border:false,view:scrollview,autoRowheight:false"
        > 
            <thead>
            <tr>
                <th field="ItemCategoryName" width="250" halign="center" sortable="true">Item Category Name</th>
                <th field="InitialCategory" width="250" halign="center" sortable="true">Initial Category</th>
                <th field="ItemCategoryDesc" width="600" halign="center" sortable="true">Description</th>
                <th field="TransStatus" halign="center" width="125" align="left" sortable="true" hidden>Status</th>
                <th field="TransNumber" halign="center" width="125" align="left" sortable="true" hidden>Trans Number</th>
            </tr>
            </thead>
		</table>
    </div>
</div>

<script type="text/javascript">
$(document).ready(function(){
	var status_privelage_delete = '<?php echo $group_user->DeletePrivillage;?>';
    var status_privelage_edit 	= '<?php echo $group_user->EditPrivillage;?>';
    var status_privelage_add    = '<?php echo $group_user->AddPrivillage;?>';

    list_master_datagrid('ItemCat','<?=$menu_link;?>','Item Categories',status_privelage_edit,status_privelage_delete,status_privelage_add, 'Active');
});

/*
	jangan lupa ini ditaro dibawah di setaip list untuk search
	taro di luar documen ready jangan didalam doc ready
	jangan lupa hapus fungsi on key up di setiap find
	jangan lupa cek id gridnya
	created by : fachri 
*/
function searching_data(){
			var txt_no 			= $('#txt_no').val();
			var txt_desc 		= $('#txt_desc').val();
			
			var chk_status = new Array();
			$.each($('input[name="chk_TransStatus"]:checked'),function(){
				chk_status.push($(this).val());
			});
			
			$('#grid').datagrid('load',{
				ItemCategoryName 	: txt_no,
				ItemCategoryDesc 	: txt_desc,
				TransStatus 		: chk_status
			});	
}
//------------------end--------------------------------------
</script>