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

Ext.onReady(function(){
    
	 var sectionliststore = new Ext.data.Store({
			url: 'data/getAccountName.php',          
	        reader: new Ext.data.JsonReader({			
                fields: ['account_id','account_name'],
                root: 'rows'
            }),autoLoad: true

        });
		
    var ProfitAndLose = new Ext.FormPanel({
        labelWidth: 100, // label settings here cascade unless overridden
        url:'report-form-account-master-ledger-result.php',
		method:'post',
        frame:true,
		standardSubmit:true,
        title: '',
        bodyStyle:'padding:6px 6px 0',
      
		defaultType: 'textfield',
        items :[ {xtype: 'combo',
										
				name: 'account_name',
				//hiddenName: 'accountname',
				id:'account_name',
				fieldLabel: 'Account Name',
				forceSelection:true,				
				displayField:'account_name',
				valueField: 'account_id',
				width: 260,
				emptyText:'Please select section',
				allowBlank:false,
				triggerAction:'all',
				mode:'local',
				selectOnFocus: true,			
				store: sectionliststore,
				editable:false },
		  	    {
					xtype:'textfield',
					name:'account_id',
					id:'account_id',
					hidden: true
				}
			   ]
		
			
    });	
	 var win = new Ext.Window({  
        title: 'General Account Ledger',
        height: 120,
        width: 425,
        layout: 'fit',
		closeAction:'hide',
   	 	collapsible:'true',
		maximizable:'true',
		items: ProfitAndLose,
		buttons: [{
							text:'View Report',
							handler: function()
							{ 
								
								Ext.getCmp('account_id').setValue(Ext.getCmp('account_name').getValue());
								
							   ProfitAndLose.getForm().submit();	
							}
				  },
				  {
							text: 'Reset', 
							handler: function () {   
			                ProfitAndLose.getForm().reset();
		                    }
			      },
				  {
		   		           text: 'Close',
					       handler: function () {    
						   window.location = 'loginhome.php';
				           }
                  }
				 ]
    });
	win.show();
});
</script>
<div align="center"><div id="main-content" style="width:600px" align="left"></div></div> 
<?php require "_footer.php";?>