<?php require "_header.php";?>
 
<script language="javascript" type="text/javascript">
var labelArray;
labelArray = [
			 	['Section :<span class="comp">*</span>'],
				['Customer<span class="comp">*</span>'],
];
Ext.onReady(function() {
var districtsore = new Ext.data.Store({
			url: 'data/getdistrictcode.php',          
	        reader: new Ext.data.JsonReader({			
                fields: ['dist_id','dist_nameeng'],
                root: 'rows'
            }),autoLoad:true
 });	
	
var customerstore = new Ext.data.Store({
			url:'data/getcustomername.php', 
	        reader: new Ext.data.JsonReader({			
                fields: ['customer_id', 'customer_orgname'],
                root: 'rows'
            })
        });  
		customerstore.load();  
   var employeeidentity= new Ext.FormPanel({
        id: 'employeeidentity',
        frame: true,
        labelAlign: 'left',
		standardSubmit:true,
        bodyStyle: 'padding:5px',
        url:"customer-report.php",
	    draggable: true,
		layout:'column',
		items:[/*{
				columnWidth: .30,
               	layout: 'form',				
				items:[{
						xtype: 'radio',
						hideLabel: true,
						name: 'radiotype',
						checked:true,
						inputValue: '1',												  
						boxLabel: labelArray[1],
						handler:function(){
						  if(this.checked) {
							customerstore.load();	
							customerstore.removeAll();	
						  }													  	
						}												  
				}]
			},{
				columnWidth:.70,
		        labelWidth:1,  
				layout:'form',
				items:[{
				        xtype: 'combo',
						name:'customer',
						id:'customer',
						hiddenName:'ID',
						store:customerstore,
						displayField: 'customer_orgname',
						valueField: 'customer_id',
						editable:true,
						mode: 'local',
						allowBlank:false, 
						triggerAction: 'all',
						emptyText: 'Select Customer ...',
						width:180
				}]
			},*/{
			   	columnWidth: .17,
			   	layout: 'form',				
				items:[/*{
						xtype: 'radio',
						hideLabel: true,
						name: 'radiotype',
						inputValue: '2',
						boxLabel: 'All',
						handler:function(){
							if(this.checked) {
							employeeidentity.getForm().findField('customer').disable();	
							employeeidentity.getForm().findField('customer').reset();	
							}	
							else
							{
							employeeidentity.getForm().findField('customer').enable();	
							}										  	
						}	
				}*/]
			},{
				columnWidth: 1,
				layout: 'form',	
				labelWidth:80,			
				items:[{						      
						xtype: 'combo',
						name: 'district_id',
						id:'district_id',
						hiddenName: 'hiddendist_code',
						tabIndex:2,
						labelSeparator:'',	
						fieldLabel :'District :<span class="comp"></span>',
						displayField:'dist_nameeng',
						valueField: 'dist_id',
						width: 180,
						blankText: '',
						emptyText:'',
						value:'All',
						// allowBlank:false,
						triggerAction:'all',
						mode:'local',			
						selectOnFocus: true,	
						store: districtsore,
						forceSelection:true,
						editable:true
				}]
			}]
    });
	
	
	var EmpReportWindow = new Ext.Window({
        title: "Customer Information Report",
		width:300,		
		height:170,		
		border: false,
		modal:true,
		layout: 'fit',
		closeAction:'close',
		collapsible:true,
		
		items: employeeidentity,
		buttonAlign: 'center',
	    buttons: [ {
					text: 'View Report',
					iconCls:'icon-view',
					handler: function () { employeeidentity.getForm().submit();  }
                   },
				    {
					text: 'Reset', 
					iconCls:'icon-reset',
					handler: function () {   
											 employeeidentity.getForm().reset();
				                         }
			        },
   	 	            {
		   		text: 'Close',
				iconCls:'icon-close',
					handler: function () {   
						EmpReportWindow.close();
				                         }
                   }
			     ]

	});
	var varWidth =  (screen.width - EmpReportWindow.width)/2;
	EmpReportWindow.setPosition(varWidth,((screen.height/4)-38));
	EmpReportWindow.show();

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