<?php 
	require "_header.php";
	require "data/combo_employee.php";
	require "data/combo_student.php";
?>
<div id="main-content">
<script type="text/javascript">
var labelArray;


var feesrec_startdate = new Ext.form.DateField({
    id: 'feesrec_startdate',
	labelSeparator:'',	
	fieldLabel :'Date:<span class="comp"></span>' ,
	name: 'feesrec_startdate',
	allowBlank:true,
	//value:new Date(),
	maxValue:new Date(),
	endDateField:'feesrec_enddate'
});	

var feesrec_enddate = new Ext.form.DateField({
    id: 'feesrec_enddate',
	fieldLabel: '',
	name: 'feesrec_enddate',
	allowBlank:true,
	//value:new Date(),
	maxValue:new Date(),
	startDateField: 'feesrec_startdate' 
});
/*
var designationstore = new Ext.data.ArrayStore({
			fields:['designation_id','designation_nameeng','dept_type'],
			data:Ext.employee.designation
	});

var teachingstore = new Ext.data.ArrayStore({
    	fields: ['employee_isteaching'],
	    data: [['Teaching Staff'],['Non-Teaching Staff'],['Technical Staff'],['Hostel Staff']]
  	});
	
var branchstore = new Ext.data.ArrayStore({
		fields: ['branch_id','branch_name'],
		data: Ext.student.branch2
	});

var orderbystore = new Ext.data.ArrayStore({
	fields: ['order_by2','order_by1'],
	data: [['employee_name','Employee Name'],
		   ['employee_deptjoindate','Joining Date'],
		   ['designation_priority','Designation']]
}); 

var orderby = new Ext.form.ComboBox({
	name: 'orderby',
	id:'orderby',
	hiddenName:'hid_orderby',
	labelSeparator:'',	
	fieldLabel :'Order BY' ,
	displayField:'order_by1',
	valueField: 'order_by2',
	editable:true,
	width:158,
	forceSelection:true,
	triggerAction:'all',
	mode:'local',
	store:orderbystore
});*/


Ext.onReady(function(){
	Ext.QuickTips.init();
	
	var StudentListForm = new Ext.FormPanel({
    	labelWidth: 60,
        url:'report-left-employee-detail-result.php',
		frame:true,
		standardSubmit:true,
        title: '',
		autoHeight:true,
        bodyStyle:'padding:6px 6px 0',
        layout:'form',
		defaultType: 'textfield',
        items :[{
			xtype:'container',
			autoEl:{},
			border:false,
			layout:'column',
			anchor:'100%',
			defaultType:'field',
			items:[{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:.63,
				items:[feesrec_startdate]
			},{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:.37,
				labelWidth:1,
				items:[feesrec_enddate]
			}]
		}/*,{
						xtype: 'combo',
						name: 'employee_isteaching',
						id:'employee_isteaching',
						labelSeparator:'',	
						fieldLabel :'Dept. Type' ,
						forceSelection:true,				
						displayField:'employee_isteaching',
						valueField: 'employee_isteaching',
						width:158,
						tabIndex:2,
						allowBlank:true,
						triggerAction:'all',
						mode:'local',
						editable:false,
						store: teachingstore,
						listeners: {'select': function(cmb, rec, idx){
							Ext.getCmp('employee_designation').reset();
							designationstore.filter('dept_type',Ext.getCmp('employee_isteaching').getValue());
					}}},{
						xtype:'combo',
						name:'employee_designation',
						id:'employee_designation',
						labelSeparator:'',	
						hiddenName: 'employeedesignation',
						fieldLabel :'Designation' ,			
						displayField:'designation_nameeng',
						valueField: 'designation_id',
						blankText: 'Please enter or select Employee Designation',
						width:158,										
						tabIndex:3,
						allowBlank:true,
						triggerAction:'all',
						mode:'local',
						store: designationstore,
						editable:true,
						forceSelection:true
					},{				
						        xtype: 'combo',
								name: 'branch_name',
								id:'branch_name',
								labelSeparator:'',	
								fieldLabel :'Branch' ,
								displayField:'branch_name',
								valueField:'branch_id',
								hiddenName:'branch_name_hid',
								width:158,	
								tabIndex:4,	
								allowBlank:true,
								editable :true,
								triggerAction:'all',
								blankText : 'Please enter or select Branch Name.',
								mode:'local',
								forceSelection:true,
								store: branchstore
					},orderby,{
								xtype: 'radio',
								name: 'report_type',
								id:'report_type_list',
								checked:true,
								inputValue:'list',
								fieldLabel:'List Report'
								
					},{
								xtype: 'radio',
								name: 'report_type',
								id:'report_type_detail',
								inputValue:'detail',
								fieldLabel:'Detail Report'
								
					}*/]
 	});
	
	var StudentListWindow = new Ext.Window({
        title: 'Employee Detail List',
        autoHeight:true,
        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 feesrec_startdate=StudentListForm.getForm().findField('feesrec_startdate').getValue();

			var feesrec_enddate=StudentListForm.getForm().findField('feesrec_enddate').getValue();

			
			

			
var redirect = 'report-left-employee-detail-result.php?feesrec_startdate='+feesrec_startdate + '&feesrec_enddate='+feesrec_enddate; 
                window.location = redirect;
			}
		},{
			text: 'Reset', 
			iconCls: 'icon-reset',
			handler: function(){   
			  	StudentListForm.getForm().reset();
				Ext.getCmp('feesrec_startdate').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('feesrec_startdate').focus(true,1000);
});
</script>
<div id="abcd"></div>
</div>
<?php require "_footer.php";?>
