<?php require "_header.php";?>
<div id="main-content">
<script type="text/javascript">
var labelArray;
labelArray = [
	['Date:<span class="comp">*</span>'],
	['Receipt-No:<span class="comp">*</span>']
];

var inquiry_startdate = new Ext.form.DateField({
    id: 'inquiry_startdate',
	labelSeparator:'',	
	fieldLabel :labelArray[0] ,
	name: 'inquiry_startdate',
	allowBlank:false,
	value:new Date(),
	endDateField:'inquiry_enddate'
});	

var inquiry_enddate = new Ext.form.DateField({
    id: 'inquiry_enddate',
	fieldLabel: '',
	name: 'inquiry_enddate',
	allowBlank:false,
	value:new Date(),
	startDateField: 'inquiry_startdate' 
});	


var descriptive_type = new Ext.form.Radio({	
	hideLabel: true,
		checked: true,	
	name: 'report_type',
	inputValue: 'descriptive_type',		
	boxLabel: 'Descriptive Report'
});

var date_selection = new Ext.form.Radio({	
	hideLabel: true,
	name: 'report_selection',
	inputValue: 'date_selection',
	checked: true,	
	handler:function(){
		if(this.checked){	
			Ext.getCmp('inquiry_startdate').enable();	
			Ext.getCmp('inquiry_enddate').enable();	
		}
	}
});

var recno_selection = new Ext.form.Radio({	
	hideLabel: true,
	name: 'report_selection',
	inputValue: 'recno_selection',
	handler:function(){
		if(this.checked){	
			Ext.getCmp('inquiry_startdate').reset();
			Ext.getCmp('inquiry_enddate').reset();
			Ext.getCmp('inquiry_startdate').disable();	
			Ext.getCmp('inquiry_enddate').disable();	
			
		}
	}
});

Ext.onReady(function(){
    Ext.QuickTips.init();
    
   	var student_feesreceipt = new Ext.FormPanel({
    	labelWidth: 75,
        url:'report-view-inquiry-result.php',
		frame:true,
		standardSubmit:true,
        title: '',
        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:.40,
				labelWidth:1,
				items:[descriptive_type]
			}]
		},{
			xtype:'container',
			autoEl:{},
			border:false,
			layout:'column',
			anchor:'100%',
			defaultType:'field',
			items:[{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:.08,
				items:[date_selection]
			},{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:.55,
				items:[inquiry_startdate]
			},{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:.37,
				labelWidth:1,
				items:[inquiry_enddate]
			}]
		},]
 	});
	
	 var FeesReceiptReportWindow = new Ext.Window({
        title: 'View Inquiry Report',
        height: 170,
        width: 360,
		modal:true,
        layout: 'fit',
		border: false,
		closeAction:'close',
		collapsible:'true',
		items: student_feesreceipt,
		buttonAlign: 'center',
	    buttons: [{
							text:'View Report',iconCls: 'new-tab',
							handler: function(b, e)
							{	
							
							var inquiry_startdate=student_feesreceipt.getForm().findField('inquiry_startdate').getValue().format('Y-m-d');
							var inquiry_enddate=student_feesreceipt.getForm().findField('inquiry_enddate').getValue().format('Y-m-d');
							
							var report_selection=student_feesreceipt.getForm().findField('report_selection').getGroupValue();
							var report_type=student_feesreceipt.getForm().findField('report_type').getGroupValue();
							//alert(report_type);
							
							
						
			
var redirect = 'report-view-inquiry-result.php?inquiry_startdate='+inquiry_startdate + '&inquiry_enddate='+inquiry_enddate 
 + '&report_type='+report_type + '&report_selection='+report_selection ; 
							window.location = redirect;
							}
						},
				  {
							text: 'Reset', iconCls: 'icon-reset',
							handler: function () {   
			                student_feesreceipt.getForm().reset();
							Ext.getCmp('section_name').focus(true,500);
								
		               }
			        },
				  {
		   		           text: 'Close',iconCls: 'icon-close',
					       handler: function () {    
						   FeesReceiptReportWindow.close();
						
				          }
                       }
				 ]
    });
	 var varWidth =  (screen.width - FeesReceiptReportWindow.width)/2;
FeesReceiptReportWindow.setPosition(varWidth,((screen.height/4)-85));
FeesReceiptReportWindow.show();
	
//Ext.getCmp('branch_name').focus(true,1000);

});
</script>
<div id="abcd" align="center"></div>
</div>
<?php require "_footer.php";?>