<?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 feesrec_startdate = new Ext.form.DateField({
    id: 'feesrec_startdate',
	labelSeparator:'',	
	fieldLabel :labelArray[0] ,
	name: 'feesrec_startdate',
	allowBlank:false,
	value:new Date(),
	endDateField:'feesrec_enddate'
});	

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

var feesrec_startno = new Ext.form.NumberField({
    labelSeparator:'',	
	fieldLabel :labelArray[1] ,
	name: 'feesrec_startno',
	id:'feesrec_startno',
	width:95,
	allowBlank:false,
	disabled:true,
    allowNegative: false,
	allowDecimals: false
});	

var feesrec_endno = new Ext.form.NumberField({
    fieldLabel: '',
	name: 'feesrec_endno',
	id:'feesrec_endno',
	width:95,
	allowBlank:false,
	disabled:true,
	allowNegative: false,
	allowDecimals: false
});

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

var descriptive_type = new Ext.form.Radio({	
	hideLabel: 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('feesrec_startno').reset();
			Ext.getCmp('feesrec_endno').reset();
			Ext.getCmp('feesrec_startno').disable();	
			Ext.getCmp('feesrec_endno').disable();	
			Ext.getCmp('feesrec_startdate').enable();	
			Ext.getCmp('feesrec_enddate').enable();	
		}
	}
});

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

Ext.onReady(function(){
    Ext.QuickTips.init();
    
   	var student_feesreceipt = new Ext.FormPanel({
    	labelWidth: 75,
        url:'report-daily-fees-collection-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,
				items:[summarize_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:[feesrec_startdate]
			},{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:.37,
				labelWidth:1,
				items:[feesrec_enddate]
			}]
		}]
 	});
	
	 var FeesReceiptReportWindow = new Ext.Window({
        title: 'Daily Fee Collection Report',
        height: 170,
        width: 400,
		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 feesrec_startdate=student_feesreceipt.getForm().findField('feesrec_startdate').getValue().format('Y-m-d');
							var feesrec_enddate=student_feesreceipt.getForm().findField('feesrec_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-daily-exam-fees-collection-result.php?feesrec_startdate='+feesrec_startdate + '&feesrec_enddate='+feesrec_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";?>