<?php 
	require "_header.php";
?>
<div id="main-content">
<script type="text/javascript">
var labelArray;
labelArray = [
	['Group name :<span class="comp">*</span>'],
	['Designation :'],
	['Order by :']
];

var GroupStore = new Ext.data.ArrayStore({
           fields: ['group_name'],
	       data: [['All'],['Director'],['Admin'],['Mechanical'],['Electrical'],['Civil'],['EC'],['Computer'],['Auto Mobile']]
        }); 
var DesignationStore = new Ext.data.ArrayStore({
           fields: ['designation'],
	       data: [['All'],['Lecturer'],['Lab Assistant'],['Peon']]
        });


var group_name = new Ext.form.ComboBox({
	name: 'group_name',
	id:'group_name',
	hiddenName:'group_name',
	labelSeparator:'',	
	fieldLabel :labelArray[0] ,
	displayField:'group_name',
	valueField: 'group_name',
	editable:true,
	triggerAction:'all',
	width:198,
	mode:'local',
	value:'All',
	allowBlank:false,
	store: GroupStore
});



var designation = new Ext.form.ComboBox({
	name: 'designation',
	id:'designation',
	hiddenName:'designation',
	labelSeparator:'',	
	fieldLabel :labelArray[1] ,
	displayField:'designation',
	valueField: 'designation',
	editable:true,
	triggerAction:'all',
	width:198,
	mode:'local',
	value:'All',
	store: DesignationStore
});


var orderbystore = new Ext.data.ArrayStore({
	fields: ['order_by2','order_by1'],
	data: [['group_name','Group Name'],
		   ['joining_date','Joining Date'],
		   ['designation','Designation']]
}); 

var orderby = new Ext.form.ComboBox({
	name: 'orderby',
	id:'orderby',
	hiddenName:'hid_orderby',
	labelSeparator:'',	
	fieldLabel :labelArray[2] ,
	displayField:'order_by1',
	valueField: 'order_by2',
	editable:true,
	width:198,
	forceSelection:true,
	triggerAction:'all',
	mode:'local',
	store:orderbystore
});

Ext.onReady(function(){
	Ext.QuickTips.init();
	
	var StudentListForm = new Ext.FormPanel({
    	labelWidth: 85,
        url:'report-employee-list-result.php',
		frame:true,
		standardSubmit:true,
        title: '',
        bodyStyle:'padding:6px 6px 0',
        layout:'form',
		defaultType: 'textfield',
        items :[group_name,designation,orderby]
 	});
	
	var StudentListWindow = new Ext.Window({
        title: 'Contact Detail List',
        height: 180,
        width: 330,
		modal:true,
        layout: 'fit',
		border: false,
		closeAction:'close',
		collapsible:'true',
		items: StudentListForm,
		buttonAlign: 'center',
	    buttons: [{
			text:'View Report',
			iconCls: 'new-tab',
			handler: function(b, e){	
				var group_name=StudentListForm.getForm().findField('group_name').getValue();
			var designation=StudentListForm.getForm().findField('designation').getValue();
			var hid_orderby=StudentListForm.getForm().findField('hid_orderby').getValue();
			
		
			
		//	alert(show_mobile_no);
			
var redirect = 'report-employee-list-result.php?group_name='+group_name + '&designation='+designation + 
'&hid_orderby='+hid_orderby   ; 
                window.location = redirect;
			}
		},{
			text: 'Reset', 
			iconCls: 'icon-reset',
			handler: function(){   
			  	StudentListForm.getForm().reset();
				Ext.getCmp('group_name').focus(true,500);
			}
		},{
		  	text: 'Close',
			iconCls: 'icon-close',
			handler: function () {    
				StudentListWindow.close();
			}
      	}]
	});
	
	var varWidth =  (screen.width - StudentListWindow.width)/2;
	StudentListWindow.setPosition(varWidth,((screen.height/4)-85));
	StudentListWindow.show();
	Ext.getCmp('group_name').focus(true,1000);
});
</script>
<div id="abcd"></div>
</div>
<?php require "_footer.php";?>
