<?php require "_header.php"; ?>
<?php require "includeGridFilters.php";?>
<?php 
 

if ($_SESSION["cUserName"]!="" && isset($_SESSION["cUserName"]) != "") 
{
  $username= $_SESSION["cUserName"];
  $user_id= $_SESSION["cUserId"]; 
}
 
if ($_REQUEST["customer_id"]!="" && isset($_REQUEST["customer_id"]) != "") 
	{ 
		$customer_id1 = $_REQUEST["customer_id"]; 
		$mode="edit";	
		
	}
	
?> 

<style type="text/css">
.img-contact
{
	vertical-align: middle;
	margin: 0px 0px 0px 0px;
	width:75px;
	height:100px;
}
.x-fieldset
{
	border-style: solid none none none;
	border-width: 1px;
	border-color: #B5B8C8;
	padding: 10px;
	margin-bottom: 10px;
	margin-right: 20px;
	display: block;
}
label.myBold
{
   font-weight: bold;
   color:#666667;
   font-size: 12px;
   
}
    </style>	 
 <script type="text/javascript" language="javascript"> 
var formMode = '<?php echo $mode;?>';
var user_name = '<?php echo $username;?>';
var user_id = '<?php echo $user_id;?>';
</script>
<script type="text/javascript" src="jquery/ux/CheckColumn.js"></script>
 <script type="text/javascript" src="js/addedit-customer.js"></script>
<script type="text/javascript" language="javascript"> 
 
  
var userstore = new Ext.data.Store({
		url: 'data/getusername.php',          
		reader: new Ext.data.JsonReader({			
			fields: ['user_id','user_name'],
			root: 'rows'
		}),autoLoad:true
	}); 

var customerstore = new Ext.data.Store({
		url: 'data/getcust.php',          
		reader: new Ext.data.JsonReader({			
	fields: ['customer_id','cust_id','date1','customer_orgname','address','commu_person','mobno','phoneNo','problem_det','completed_det','status','pending_reason','pending_work','user_id','customer_id','user_name','amount_desc','dueamount','assign_user_id'],
			root: 'rows1'
		}),autoLoad:true
	}); 

 

var custname_store = new Ext.data.Store({
		url: 'data/getcustomername1.php',          
		reader: new Ext.data.JsonReader({			
		fields: ['customer_id','customer_orgname','address','date1','commu_person','mobno','phoneNo','problem_det','completed_det','status','pending_reason','pending_work','user_id','customer_id','user_name','amount_desc','dueamount','assign_user_id'],
		root: 'rows'
		})
	});

var labelArray;
	
	labelArray = [
		['Date :<span class="comp">*</span>'],
		['Customer Name :<span class="comp">*</span>'],
		['Address : '],
		['Communicated Person <span class="comp">*</span>'],
		['Mobile No '],
		['Landline No '],		
		['Problem Detail'],
		['Completed Work Detail'],
		['Status:'],
		['User Name:'],	
		['Assign To:'],
		['Amount Desc. :']	
		
	];
	
var xg = Ext.grid;	
	
Ext.QuickTips.init();
	
Ext.onReady(function() {
 
	var customer_id = '<?php  echo $customer_id1 ?>'; 
	var formMode = '<?php echo $mode;?>'; 
	if(formMode =='edit')
	{  
	
		custname_store.load({
							params: {customer_id:customer_id}	
							}); 
		custname_store.on('load', function(store, records) 
		{
			if(custname_store.getCount() > 0)
			{  
				supportinquiryForm.getForm().findField('customer_id').setValue(custname_store.data.items[custname_store.getCount()-1].data.customer_id); 
				supportinquiryForm.getForm().findField('customer_id').setRawValue(custname_store.data.items[custname_store.getCount()-1].data.customer_orgname);
				
				supportinquiryForm.getForm().findField('address').setValue(custname_store.data.items[custname_store.getCount()-1].data.customer_address);
				
				
				supportinquiryForm.getForm().findField('commu_person').setValue(custname_store.data.items[custname_store.getCount()-1].data.commu_person);
				
				supportinquiryForm.getForm().findField('mobno').setValue(custname_store.data.items[custname_store.getCount()-1].data.mobno);
				supportinquiryForm.getForm().findField('phoneNo').setValue(custname_store.data.items[custname_store.getCount()-1].data.phoneNo);
				  supportinquiryForm.getForm().findField('dueamount').setValue(custname_store.data.items[custname_store.getCount()-1].data.dueamount);
				  
				// supportinquiryForm.getForm().findField('dueamount').setValue(custname_store.data.items[custname_store.getCount()-1].data.phoneNo);
				 supportinquiryForm.getForm().findField('status').setValue(custname_store.data.items[custname_store.getCount()-1].data.status);
			
				 supportinquiryForm.getForm().findField('user_id').setValue(custname_store.data.items[custname_store.getCount()-1].data.user_id);
				 supportinquiryForm.getForm().findField('user_id').setRawValue(custname_store.data.items[custname_store.getCount()-1].data.user_name);
				 
				 supportinquiryForm.getForm().findField('assign_user_id').setValue(custname_store.data.items[custname_store.getCount()-1].data.assign_user_id);
				 supportinquiryForm.getForm().findField('assign_user_id').setRawValue(custname_store.data.items[custname_store.getCount()-1].data.user_name);
			
				 supportinquiryForm.getForm().findField('problem_det').setValue(custname_store.data.items[custname_store.getCount()-1].data.problem_det);
				 supportinquiryForm.getForm().findField('completed_det').setValue(custname_store.data.items[custname_store.getCount()-1].data.completed_det);
				 
				 supportinquiryForm.getForm().findField('date1').setValue(custname_store.data.items[custname_store.getCount()-1].data.date1);
				 
				 supportinquiryForm.getForm().findField('pending_reason').setValue(custname_store.data.items[custname_store.getCount()-1].data.pending_reason);
				 supportinquiryForm.getForm().findField('pending_work').setValue(custname_store.data.items[custname_store.getCount()-1].data.pending_work);
				  supportinquiryForm.getForm().findField('amount_desc').setValue(custname_store.data.items[custname_store.getCount()-1].data.amount_desc);
				
					try
					{
						supportinquiryForm.getForm().findField('address').setValue(custname_store.data.items[custname_store.getCount()-1].data.address);
						
						supportinquiryForm.getForm().findField('commu_person').setValue(custname_store.data.items[custname_store.getCount()-1].data.commu_person);
				
						
						supportinquiryForm.getForm().findField('mobno').setValue(custname_store.data.items[custname_store.getCount()-1].data.mobno);
						supportinquiryForm.getForm().findField('phoneNo').setValue(custname_store.data.items[custname_store.getCount()-1].data.phoneNo);
						
						supportinquiryForm.getForm().findField('dueamount').setValue(custname_store.data.items[custname_store.getCount()-1].data.dueamount);
				  
					// supportinquiryForm.getForm().findField('dueamount').setValue(custname_store.data.items[custname_store.getCount()-1].data.phoneNo);
						 supportinquiryForm.getForm().findField('status').setValue(custname_store.data.items[custname_store.getCount()-1].data.status);
					
						 supportinquiryForm.getForm().findField('user_id').setValue(custname_store.data.items[custname_store.getCount()-1].data.user_id);
						 supportinquiryForm.getForm().findField('user_id').setRawValue(custname_store.data.items[custname_store.getCount()-1].data.user_name);
						 
						 supportinquiryForm.getForm().findField('assign_user_id').setValue(custname_store.data.items[custname_store.getCount()-1].data.assign_user_id);
						 supportinquiryForm.getForm().findField('assign_user_id').setRawValue(custname_store.data.items[custname_store.getCount()-1].data.user_name);
					
						 supportinquiryForm.getForm().findField('problem_det').setValue(custname_store.data.items[custname_store.getCount()-1].data.problem_det);
						 supportinquiryForm.getForm().findField('completed_det').setValue(custname_store.data.items[custname_store.getCount()-1].data.completed_det);
						 
						 supportinquiryForm.getForm().findField('date1').setValue(custname_store.data.items[custname_store.getCount()-1].data.date1);
						 
						 supportinquiryForm.getForm().findField('pending_reason').setValue(custname_store.data.items[custname_store.getCount()-1].data.pending_reason);
						 supportinquiryForm.getForm().findField('pending_work').setValue(custname_store.data.items[custname_store.getCount()-1].data.pending_work);
						 supportinquiryForm.getForm().findField('amount_desc').setValue(custname_store.data.items[custname_store.getCount()-1].data.amount_desc);
					}
					catch(exception)
					{	}
					 
			} 
			 
		});	
	} 
// var xg = Ext.grid;	 
//var encode = false;
	var local = false; 
	var createColModel = function (finish, start) {
        var columns = [ 
		{
			width:180,
            dataIndex: 'customer_orgname',
			header: 'customer name'
        },
		{
			width:73,
			dataIndex: 'mobno',
			header: 'Mobile No'
            
        },
		{
			width:73,
            
			dataIndex: 'phoneNo',
			header: 'Phone No'
        } ];
		return new Ext.grid.ColumnModel({
            columns: columns.slice(start || 0, finish),
            defaults: {
                sortable: true
            }
        });
    };
	var grid1 = new Ext.grid.GridPanel({
    	store: customerstore,		 
        colModel: createColModel(40), 
        loadMask: true, 
		frame:true,
		height: 420,    
        width: 350, 
		stripeRows: true,
		columnLines:true,
    	selModel: new Ext.grid.RowSelectionModel({
		singleSelect:true, 
				 listeners: {
					rowselect: function(sm, row, rec)  
					{  						
						Ext.getCmp("supportinquiryForm").getForm().loadRecord(rec); 
						Ext.getCmp('btnDelete').enable();						  
					}
				 }
		 }) ,
		 tbar: [
		  new Ext.form.TriggerField({
                xtype: 'triggerfield',
				id:'searchtrigger',
                triggerClass: 'x-form-clear-trigger',
               	emptyText:'Search Customer Name',
				width:165,
				enableKeyEvents: true,
				listeners: {
							 keyup: function(){
								 customerstore.filter('customer_orgname',this.getValue(),true);}
				 },
				onTriggerClick : function(){
					this.reset();
					customerstore.filter('customer_orgname','',true)			
				  } 
            }),
		 new Ext.form.TriggerField({
                xtype: 'triggerfield',
                triggerClass: 'x-form-clear-trigger',
               	emptyText:'Search Mobile no',
				width:160,
				enableKeyEvents: true,
				listeners: {
							 keyup: function(){
									 customerstore.filter('mobno',this.getValue(),true); 
								 }
				},
				onTriggerClick : function(){
					this.reset();
					customerstore.filter('mobno','',true) 
				  } 
            }) ] 
    });
	
	var supportclosestore = new Ext.data.ArrayStore({
           fields: ['status'],
	       data: [['Pending'],['Completed'],['on work']]
	}); 
 
var nameAndCompany = {
	columnWidth: 1,
    layout: 'column',
	labelWidth: 140,
    style: 'padding:0px 10px',
    items: [{
			columnWidth: .55,
			layout: 'form',	
			items:[{
				xtype: 'hidden',
				name: 'cust_id',
				id:'cust_id',
				hidden:true,
				dataIndex: 'cust_id',
			}, {
				xtype:'hidden',
				id:'returnId',
				name:'returnId',
				hidden:true
			},{
				columnWidth: 1, 
				xtype: 'datefield',
				name: 'date1',
				labelSeparator:'',	
				fieldLabel :labelArray[0], 
				width:170,
				allowBlank:false,
				tabIndex:3,
				id: 'date1',
				vtype: 'daterange',
				value:new Date() 
				
			},{ 
				columnWidth: 1,
			     layout: 'column',	
			     items:[{
					 columnWidth: .90,
					 layout: 'form',	
					 items:[{	
						xtype: 'combo',
						name: 'customer_id', 
						//dataIndex:'customer_id',
						id:'customer_id',
						autoLoad:true,
						hiddenName: 'customer_idhedden',
						forceSelection:true,
						tabIndex:2,
						labelSeparator:'',	
						fieldLabel :labelArray[1] ,
						displayField:'customer_orgname',
						valueField: 'customer_id', 
						width: 145,
						blankText: '',
						emptyText:'Customer Name',
						allowBlank:false,
						triggerAction:'all', 
						mode:'local',			
						selectOnFocus: true,	
						store:custname_store ,
						autoLoad:true, 
						editable:false,	
						listeners:{select:{fn:function(combo, value) 
						{	  	 			 
							 var varcustid=0; 
							 varcustid=combo.getValue('customer_id'); 											      
							 var custid = supportinquiryForm.getForm().findField('customer_id').getValue(); 
							 Ext.Ajax.request({
											  loadMask: true,
											  sync : true,
											  url:'data/getaddress.php',
											  params: {customer_id: custid},
											  waitMsg:'Loading',
											  failure: function() {
													 Ext.MessageBox.show({
														   title: 'Error',
														   msg: 'Invalid ',
														   buttons: Ext.MessageBox.OK,
														   icon:Ext.MessageBox.ERROR
														  });
											  },
											  success: function(resp) 
													{ 
														varcsno=Ext.decode(resp.responseText).add;
														if(varcsno != "")
														{ 
														supportinquiryForm.getForm().findField('address').setValue(varcsno); 			
														}
														else
														{	  
															 Ext.getCmp("address").reset();											     
														}
														
														varper=Ext.decode(resp.responseText).per;
														if(varper != "")
														{ 
														supportinquiryForm.getForm().findField('commu_person').setValue(varper); 			
														}
														else
														{	 
															 Ext.getCmp("commu_person").reset();											     
														} 
														
														varmob=Ext.decode(resp.responseText).mob1;
														if(varmob != "")
														{ 
														supportinquiryForm.getForm().findField('mobno').setValue(varmob); 			
														}
														else
														{	  
															 Ext.getCmp("mobno").reset(); 
														}
														 
														varphoneNo=Ext.decode(resp.responseText).ph;
														if(varphoneNo != "")
														{ 
														supportinquiryForm.getForm().findField('phoneNo').setValue(varphoneNo); 			
														}
														else
														{	
															   Ext.getCmp("phoneNo").reset(); 
														} 
													}				
										});
										customerstore.reload(); 
								}	
							}
						} 
					   }]
				 	},{
						columnWidth: .10,
						layout: 'form',	
						items:[{		
								xtype:'button',
								id:'Add',
								iconCls:'icon-add',
								handler: function()
								{  
								   returnId = 1;
								   window.location = 'addedit-customer.php?returnId='+ returnId;  										   
								   CustomergridForm.getForm().reset();
								   grid.getSelectionModel().clearSelections();
										//grid.removeButton.disable();
								   store.load(); 
								   custname_store.reload();
								}
						}]
				}]
				
			},{
				columnWidth: 1, 
				width:170,
				xtype: 'textarea',
				name: 'address',
				id: 'address',
				growAppend: "",
				// allowBlank:false,
				fieldLabel :labelArray[2] ,
				tabIndex:10,	
				labelSeparator:'' 
			},{ 
				columnWidth: 1, 
				width:170,
				xtype: 'textfield',
				name: 'commu_person',
				id: 'commu_person',
				fieldLabel :labelArray[3],
				allowBlank:false,
				tabIndex:4 
			},{
				columnWidth: 1, 
				width:170,
				xtype: 'textfield',
				name: 'mobno',
				id: 'mobno',
				fieldLabel:labelArray[4], 
				tabIndex:5,
				minLength:10,
				maxLength:10,					
				autoCreate: {tag: 'input', type: 'text', maxlength: '13'},
				enableKeyEvents: true,
				listeners:{
								keyup: validphoneno
						   }  													
			},{
				columnWidth: 1, 
				width:170,
				xtype: 'textfield',
				name: 'phoneNo',
				id: 'phoneNo',
				//allowBlank:false,
				fieldLabel:labelArray[5],
				autoCreate: {tag: 'input', type: 'text',  maxlength: '13'},
				enableKeyEvents: true,
				minLength:8,						 
				maxLength:11,						 
				tabIndex:6,
				listeners:{
								keyup: validphoneno
							}   
			},{
				columnWidth: 1,  
				xtype: 'combo', 
				name: 'user_id',
				id:'user_id',
				autoLoad:true, 
				hiddenName: 'user_idhedden',
				forceSelection:true,
				tabIndex:9,
				labelSeparator:'',	
				fieldLabel :labelArray[9] , 
				displayField:'user_name',
				valueField: 'user_id',				
				width: 170, 
				//value:user_name,
				allowBlank:false,
				triggerAction:'all',
				mode:'local',			
				selectOnFocus: true,	
				store:userstore, 
				editable:false						 
			},{
				columnWidth: 1,  
				xtype: 'combo', 
				name: 'assign_user_id',
				id:'assign_user_id',
				autoLoad:true, 
				hiddenName: 'assign_user_idhedden',
				forceSelection:true,
				tabIndex:9,
				labelSeparator:'',	
				fieldLabel :labelArray[10] , 
				displayField:'user_name',
				valueField: 'user_id',				
				width: 170, 
				//value:user_name,
				allowBlank:false,
				triggerAction:'all',
				mode:'local',			
				selectOnFocus: true,	
				store:userstore, 
				editable:false						 
			},{
				xtype: 'textfield',
				name: 'dueamount',
				id: 'dueamount',
				width:170,
				readOnly:true,
				allowBlank:false,
				fieldLabel:'Dueamount',
				//autoCreate: {tag: 'input', type: 'text',  maxlength: '13'},
				listeners: {
					   beforeRender: function(e) {
							   e.style = "font-weight: bold; color:#f40925;";
						  
					   }
				}
             }]
		},{
			columnWidth: .45,
			labelWidth: 91,
			layout: 'form',	
			items:[{  
				columnWidth: 1,  
				width:170,
				xtype: 'combo',
				name: 'status',
				id:'status',
				labelSeparator:'',	
				fieldLabel :labelArray[8],
				forceSelection:true,				
				displayField:'status',
				emptyText:'',
				//allowBlank:false,
				triggerAction:'all',
				mode:'local',
				store: supportclosestore,
				tabIndex:7,
				listeners:{select:{fn:function(combo, value) 
				{
					if(combo.getValue()=='Pending')
					{
							Ext.getCmp('pending_reason').enable();
							Ext.getCmp('pending_work').enable();
							Ext.getCmp('completed_det').disable();		
					}
					else
					{
						Ext.getCmp('pending_reason').disable();
						Ext.getCmp('pending_work').disable();
						Ext.getCmp('completed_det').enable();		
					}
					}	
				}} 
			},{ 
				columnWidth: 1,							 
				 width:170,
				xtype: 'textarea',
				name: 'problem_det',
				id: 'problem_det',
				//allowBlank:false,
				fieldLabel:labelArray[6],
				tabIndex:8						
			},{
				columnWidth: 1, 
				width:170,
				xtype: 'textarea',
				name: 'completed_det',
				id: 'completed_det',
				//allowBlank:false,
				fieldLabel:labelArray[7],
				tabIndex:12
			},{	
				columnWidth: 1, 
				xtype: 'textarea',
				width:170,
				height:80,
				name: 'pending_work',
				fieldLabel:'Pending work',
				id:'pending_work',
				tabIndex:11
			},{	
				columnWidth: 1, 
				xtype: 'textarea',
				width:170,
				//height:40,
				name: 'pending_reason',
				fieldLabel:'Pending Reason',
				id:'pending_reason',
				tabIndex:13
		}]
		},{columnWidth: 1,
			layout: 'form',	
			items:[{
				columnWidth: 1, 
				width:450,
				labelWidth: 140,
				xtype: 'textarea',
				name: 'amount_desc',
				id: 'amount_desc',
				growAppend: "",
				height:100,				
				fieldLabel :labelArray[11] ,
				tabIndex:10,
				readOnly:true,	
				labelSeparator:'' 
			}]
			
	}]
	
			
}
var supportinquiryForm = new Ext.FormPanel({
       
		id:'supportinquiryForm',	
        frame: true,
		url:'save-cust.php',
		layout: 'column',
        bodyStyle: 'padding:5px',
		autoHeight: true,
        width: 800,
		//height:700,
		defaults: {
            border: false
           },	 
        items: [ grid1 ,nameAndCompany]
    });
  
var supportinquiryWindow = new Ext.Window({
		title: 'ADD Customer Suppoert Detail',
		width:1000,		
		//height:650,
		modal:true,
		scrollable:true,
		autoHeight: true,
		shadow: false,
		border: false,
		layout: 'fit',
		closeAction:'close',
		collapsible:true,
		items: supportinquiryForm,
		buttonAlign: 'center',
	    buttons: [{
            text: 'Save',	
			iconCls: 'icon-save',
			tabIndex:14,
			id:'siSavebtn',	
			handler: function () {	
						 		supportinquiryForm.getForm().submit({		
								         
						                  
										  waitMsg: 'Saving...',										   	
										  	success: function () {
												//alert(Ext.getCmp('user_id').getValue());
												 //alert(Ext.getCmp('user_name').getValue());
											Ext.MessageBox.show({
															   title: 'Message',
															   msg: 'Data has been saved..',
															   buttons: Ext.MessageBox.OK,
															   icon:Ext.MessageBox.INFO
															  });															  
															 customerstore.load(); 
															 supportinquiryForm.getForm().reset();
															// window.location = 'addedit-custsupport.php';
											},				 
											failure: function () {	
												
														Ext.MessageBox.show({
															   title: 'Error',
															   msg: 'Please fill complete form!',
															   buttons: Ext.MessageBox.OK,
															   icon:Ext.MessageBox.ERROR
															  });
									 
											}
										}); 
				}
			   	
			},
		   {
            text: 'Reset',
			iconCls: 'icon-reset',
			id:'siResetbtn',	
			handler: function () {
			supportinquiryForm.getForm().reset();
			}
        },{
			text: 'Delete',
			iconCls:'remove',
			disabled:true,
			id: 'btnDelete',
			name: 'btnDelete',
			handler: function(){
				Ext.MessageBox.confirm('Confirmation', ' Are you sure want to delete This Record.?', deleterecord);
			}
		},{
            text: 'Close',
			iconCls: 'icon-close',
			id:'siClosebtn',	
			handler: function () {
				supportinquiryWindow.close();
				 window.location = 'loginhome.php';
			
			}
        }
	 ]

	});	
	var varWidth =  (screen.width - supportinquiryWindow.width)/2;
	supportinquiryWindow.setPosition(varWidth,((screen.height/4)-110));	
	supportinquiryWindow.show();
	Ext.getCmp('user_id').setValue(user_id);
	Ext.getCmp('user_id').setRawValue(user_name);
	
	function deleterecord(btn) {
		
			if (btn == 'yes') {
				supportinquiryForm.getForm().submit({
					waitMsg : 'Deleting...',
					params : {
						act : 'del'
					},
					success : function() {
						supportinquiryForm.getForm().reset();
						customerstore.load();
						//Ext.getCmp('dept_name').focus(true, 200);
						//grid.getSelectionModel().clearSelections();

						Ext.getCmp('btnDelete').disable();

					}
				});
			}
		}
/*if(formMode=='edit')
{
	alert("sss");
	
	 supportinquiryForm.getForm().findField('cust_id').setValue('<?php //echo $cust_id; ?>');
	

	 supportinquiryForm.getForm().findField('customer_orgname').setValue('<?php //echo $customer_id; ?>');
	 supportinquiryForm.getForm().findField('customer_orgname').setRawValue('<?php //echo $customer_orgname; ?>');

     supportinquiryForm.getForm().findField('address').setValue('<?php //print $address; ?>');

     supportinquiryForm.getForm().findField('commu_person').setValue('<?php //print $commu_person; ?>');
     supportinquiryForm.getForm().findField('commu_person').setRawValue('<?php //print  $commu_person; ?>');

     supportinquiryForm.getForm().findField('mobno').setValue('<?php //print $mobno; ?>');
     supportinquiryForm.getForm().findField('phoneNo').setValue('<?php //print $phoneNo; ?>');		

     supportinquiryForm.getForm().findField('dueamount').setValue('<?php //print $dueamount; ?>');
	 supportinquiryForm.getForm().findField('dueamount').setValue('<?php //print $amount_desc; ?>');
     supportinquiryForm.getForm().findField('status').setValue('<?php //print $status; ?>');

     supportinquiryForm.getForm().findField('user_id').setValue('<?php //print $user_id; ?>');
     supportinquiryForm.getForm().findField('user_id').setRawValue('<?php //print  $user_name; ?>');

     supportinquiryForm.getForm().findField('problem_det').setValue('<?php //print $problem_det; ?>');
     supportinquiryForm.getForm().findField('completed_det').setValue('<?php //print $completed_det; ?>');
     
	 //supportinquiryForm.getForm().findField('date1').setValue('<?php //print $date1; ?>');
     
     supportinquiryForm.getForm().findField('pending_reason').setValue('<?php //print $pending_reason; ?>');
	 supportinquiryForm.getForm().findField('pending_work').setValue('<?php //print $pending_work; ?>');
	
}*/
 
 });
</script>
<div align="center"><div id="main-content" align="center"></div></div> 
<?php require "_footer.php";?>