<?php 
	require "_header.php";
	
?>
<script type="text/javascript">

var labelArray;
labelArray = [
			 	
				['Date :<span class="comp"></span>']
		];	

var Receipt_Fields = [
	{name:'receipt_id',type: 'int'},
	{name:'receipt_no'}
]		
/*var Receiptstore = new Ext.data.JsonStore({
    url: 'data/receipt-grid-data.php',
    root: 'data',
    fields: Receipt_Fields,
    autoLoad: true
});*/
/*var customersore = new Ext.data.Store({
		url: 'data/getcustomername.php',          
		reader: new Ext.data.JsonReader({			
			fields: ['customer_id','customer_orgname'],
			root: 'rows'
		}),autoLoad:true
	});*/
	
var bill_startdate = new Ext.form.DateField({
    id: 'bill_startdate',
	labelSeparator:'',	
	fieldLabel :labelArray[0] ,
	name: 'bill_startdate',
	emptyText :'From',
	//allowBlank:false,
	vtype: 'daterange',
	endDateField:'bill_enddate'
});	


var bill_enddate = new Ext.form.DateField({
    id: 'bill_enddate',
	fieldLabel: '',
	name: 'bill_enddate',
	emptyText :'To',
	//allowBlank:false,
	vtype: 'daterange',
	startDateField: 'bill_startdate' 
});	

	
	
Ext.onReady(function(){
    Ext.QuickTips.init();
    
  
 	
    var customerbill_summary = new Ext.FormPanel({
        labelWidth: 100, // label settings here cascade unless overridden
        url:'report-customer-receipt-result.php',
		method:'post',
        frame:true,
		standardSubmit:true,
        autoHeight: true,
        items :[{
					xtype       : 'container',
					autoEl      : {},
					border      : false,
					layout      : 'column',
					anchor      : '100%',
					defaultType : 'field',
					items       : [{
									xtype  : 'container',
									autoEl : {},
									layout : 'form',
									columnWidth : .65,
									items  : [bill_startdate]
								   },
								   {
									xtype       : 'container',
									autoEl      : {},
									layout      : 'form',
									columnWidth : .35,
									labelWidth  : 1,
									items       : [bill_enddate]
					}]
				 }/*,{
					 	xtype: 'combo',
						name: 'customer_id',
						id:'customer_id',
						hiddenName: 'customer_idhedden',
						tabIndex:3,
						labelSeparator:'',	
						fieldLabel :'Customer Name :<span class="comp"></span>' ,
						displayField:'customer_orgname',
						tabIndex:3,
						valueField: 'customer_id',
						width: 195,
						blankText: '',
						emptyText:'',
						allowBlank:true,
						triggerAction:'all',
						mode:'local',			
						selectOnFocus: true,	
						store: customersore,
						forceSelection:true,
						editable:true,
						/*listeners:{select:{fn:function(combo, value) 
						{
							Ext.getCmp('cust_name').setValue(combo.getRawValue());
						
							
						}}}*/
					/*},{
					 	xtype: 'combo',
						name:'receipt_no',
						id:'receipt_no',
						hiddenName:'receipt_no_hidden',
						store:Receiptstore,
						displayField: 'receipt_no',
						valueField: 'receipt_no',
						editable:true,
						fieldLabel:'ReceptNo',
						mode: 'local',
						//allowBlank:false, 
						triggerAction: 'all',
						emptyText: 'Select Receipt No.',
						width:100
				 }*/
				 
		   ]		
	});
	
	 var customerbillWindow = new Ext.Window({
        title: 'Payment Receipt Report Datewise',
        autoHeight: true,
        width: 340,
		border: false,
		modal:true,
        layout: 'fit',
		closeAction:'close',
   	 	collapsible:'true',
		items: customerbill_summary,
		buttonAlign: 'center',
	    buttons: [{
							text:'View Report',
							iconCls:'icon-view',
							handler: function()
							{ 
							   customerbill_summary.getForm().submit();	
							}
				  },
				  {
							text: 'Reset', 
							iconCls:'icon-reset',
							handler: function () {   
			                customerbill_summary.getForm().reset();
							Ext.getCmp('section_name').focus(true,500);
		                    }
			      },
				  {
		   		           text: 'Close',
						   iconCls:'icon-close',
					       handler: function () {    
						   
						   customerbillWindow.close();
				           }
                  }
				 ]
    });



var varWidth =  (screen.width - customerbillWindow.width)/2;
customerbillWindow.setPosition(varWidth,((screen.height/4)-110));
customerbillWindow.show();

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