<?php 
	require "_header.php"; 
	require "data/combo_semester.php";
?>
<div id="main-content" >
<script type="text/javascript" src="jquery/ux/CheckColumn.js"></script>
<link href="jquery/ux/css/superboxselect.css" rel="Stylesheet" type="text/css" /> 
<link href="jquery/ux/css/summary.css"  rel="stylesheet" type="text/css"  />
<script type="text/javascript" src="jquery/ux/SuperBoxSelect.js"></script>
<script type="text/javascript" src="jquery/ux/GroupSummary.js"></script>
<script type="text/javascript" src="jquery/ux/RowExpander.js"></script>
<style type="text/css">
	.x-grid3-row-over .x-grid3-cell-inner {
		font-weight: bold;
	}		
	.row-preview 
	{
		padding: 2px 2px 5px 25px;
		border-top: dotted 1px #CCCCCC;
	}
	.tplmain {
		width:170px;
	}
	.tplleft {
		width:120px;
	}
	.tplright {
		width:50px;
		text-align:right;
	}
	
	.tblstyle{
		text-align:center;
		background-color:#CED9E7;
		border:1px solid #99BBE8;	
		color:#000;
	}
	.tblstyle th{
		text-align:center;
		font-weight:bold;
		color:#15428B;
	}
	.tblstyle td{
		padding:2px;
	}
</style>
<script type="text/javascript">
Ext.onReady(function(){
Ext.QuickTips.init();

var student_id,student_name;
var labelArray;
labelArray = [  
	['Receipt No:'],
	['Receipt Date:<span class="comp">*</span>'],
	['Enrollment No:<span class="comp">*</span>'],
	['Branch:<span class="comp">*</span>'],
	['Semester:<span class="comp">*</span>'],
	['Student:<span class="comp">*</span>'],
	['Paid by cheque:'],
	['Cheque No:<span class="comp">*</span>'],
	['Bank Name:<span class="comp">*</span>'],
	['Total Amount:'],
	['Comment Show:'],
	['comment:']
	];

var branchstore = new Ext.data.ArrayStore({		
	fields: ['branch_id','branch_name'],
	data:Ext.semester.branch
});

var routenamestore = new Ext.data.ArrayStore({		
	fields: ['route_id','route_name'],
	data:Ext.semester.route
});
var routeareastore = new Ext.data.ArrayStore({		
	fields: ['head_id','head_name'],
	data:Ext.semester.routearea
});
var semesterstore = new Ext.data.ArrayStore({		
	fields: ['semester_id','semester_name'],
	data:Ext.semester.semester
});

var divisionstore = new Ext.data.ArrayStore({
    	fields:['division_id','division_name'],
		data: Ext.semester.division
	});	  
	


var banknamestore = new Ext.data.ArrayStore({		
	fields: ['bank_name'],
	data:Ext.semester.bankname
});

var studentstore = new Ext.data.JsonStore({
	url:'data/getstudent-feesrecive.php',
    root: 'data',
	totalProperty: 'total',
	fields: [{
		name: 'student_id',
		type:'int'
	},{
		name: 'student_name',
		type: 'string'
	},{
		name: 'student_gturegno',
		type: 'int'
	},{
		name: 'adm_year',
		type: 'string'
	},{
		name: 'student_techcerti',
		type: 'string'
	}] 
});

var feetypestore = new Ext.data.ArrayStore({
	fields: ['type_value'],
	data: [['Regular'],['Exam'],['Library'],['Stationary'],['Transport']]
});

var feesreceive_id = new Ext.form.TextField({
	name: 'feesreceive_id',
	id:'feesreceive_id',
	hidden:true
});

var fees_type = new Ext.form.ComboBox({
	name:'fees_type',
	labelSeparator:'',	
	allowBlank:true,
	hiddenName:'fee_typehidden',
	id:'fees_type',
	fieldLabel:'Fee Type:<span class="comp">*</span>',
	forceSelection:true,
	displayField:'type_value',
	valueField:'type_value',
	width:210,
	tabIndex:1,
	triggerAction:'all',
	mode:'local',
	store:feetypestore,
	listeners: {'blur': function(cmb, rec, idx){
		var fees_type=Ext.getCmp('fees_type').getValue();
		if(fees_type == 'Transport')
		{
			     		Ext.getCmp('month_duration_from').enable();
			     		Ext.getCmp('month_duration_to').enable();
							Ext.getCmp('head_name').enable();
							Ext.getCmp('route_name').enable();
							get_ReceiptNo1();
		}
		else
		{
			     		Ext.getCmp('month_duration_from').disable();
			     		Ext.getCmp('month_duration_to').disable();
			     		Ext.getCmp('head_name').disable();
							Ext.getCmp('route_name').disable();
		}
		get_feeshead_data();
	}}
});

var feesrecno = new Ext.form.NumberField({
	id: 'receipt_no',
	name: 'receipt_no',
	width:210,
	tabIndex:16,
	labelSeparator:'',
	fieldLabel :labelArray[0] ,
	readOnly:true
});

var feesrecdate = new Ext.form.DateField({
	id: 'receipt_date',
	name: 'receipt_date',
	width:210,
	tabIndex:8,
	labelSeparator:'',
 	fieldLabel :labelArray[1],
	enableKeyEvents: true,
	allowBlank : true,
	maxValue:new Date(),
	value:new Date()
});	

var gtuno = new Ext.form.TextField({
	name: 'student_gturegno',
	id:'student_gturegno',
	labelSeparator:'',	
	tabIndex:4,
	fieldLabel :labelArray[2] ,
	allowBlank:true,
	allowNegative: false,
	allowDecimals: false,
	width: 210,
	listeners: {'blur': function(){
		var gturegno = this.getValue();
		if(gturegno!="" ){
			
			Ext.Ajax.request({
				loadMask: true,
				sync : true,
				url: 'data/getgtunodata.php',
				params: {gturegno:gturegno},
				success: function(resp){
					var value=Ext.decode(resp.responseText).count;
					if(value==',,,'){
						grid.stopEditing();
								
						Ext.getCmp('student_name').reset();
						Ext.getCmp('student_gturegno').reset();
						Ext.getCmp('cheque_no').reset();
						Ext.getCmp('cash').reset();
						Ext.getCmp('bank_name').reset();
						Ext.getCmp('division_id').reset();
						
						Ext.getCmp('adm_year').reset();
						Ext.getCmp('student_techcerti').reset();
						Ext.getCmp('receive_amt').reset();
						Ext.getCmp('comment').reset();
						Ext.getCmp('receipt_date').reset();
						Ext.getCmp('receipt_no').reset();
						Ext.getCmp('allsem').reset();
						Ext.getCmp('amount_discount').reset();
						feeshead_grid_store.removeAll();
						receivedfees_grid_store.removeAll();
						
						Ext.MessageBox.show({
							title: 'Message',
							msg: 'Enrollment Number '+gturegno +' Does Not Exist...',
							buttons: Ext.MessageBox.OK,
							icon:Ext.MessageBox.INFO
						});
						
					} else{
						var arr_data = new Array();
						arr_data =  value.split(",");
						student_id = arr_data[0];
						student_name = arr_data[1];
						branch_id = arr_data[2];
						semester_id = arr_data[3];
						division_id= arr_data[4];
						adm_year= arr_data[5];
						student_techcerti= arr_data[6];
						amount_discount=arr_data[7];
						
						Ext.getCmp('student_name').setValue(student_id);
						Ext.getCmp('student_name').setRawValue(student_name);
						
						Ext.getCmp('branch_name').setValue(branch_id);
						Ext.getCmp('semester_name').setValue(semester_id);
						Ext.getCmp('division_id').setValue(division_id);
						Ext.getCmp('adm_year').setValue(adm_year);
						Ext.getCmp('student_techcerti').setValue(student_techcerti);
							Ext.getCmp('comment').setValue(comment);
							Ext.getCmp('allsem').setValue(allsem);
							Ext.getCmp('amount_discount').setValue(amount_discount);
						divisionstore.filter('division_id',branch_id+semester_id,false,true,true);
						get_feeshead_data();
						get_receivedfees_data();
					}					
				}				
			});
			
		}
  	}}
});
var route_name = new Ext.form.ComboBox({
	name: 'route_name',
	id:'route_name',
	hiddenName:'route_hidden',
	labelSeparator:'',	
	fieldLabel :'Route Name',
	displayField:'route_name',
	valueField: 'route_id',
	editable:true,
	tabIndex:2,
	width:210,
	triggerAction:'all',
	mode:'local',
	allowBlank:true,
	store: routenamestore,

});
var head_name = new Ext.form.ComboBox({
	name: 'head_name',
	id:'head_name',
	hiddenName:'routearea_hidden',
	labelSeparator:'',	
	fieldLabel :'Route Area',
	displayField:'head_name',
	valueField: 'head_name',
	editable:true,
	tabIndex:3,
	width:210,
	triggerAction:'all',
	mode:'local',
	allowBlank:true,
	store: routeareastore,

});
var branch = new Ext.form.ComboBox({
	name: 'branch_name',
	id:'branch_name',
	hiddenName:'branch_hidden',
	labelSeparator:'',	
	fieldLabel :labelArray[3] ,
	displayField:'branch_name',
	valueField: 'branch_id',
	editable:true,
	tabIndex:5,
	width:210,
	triggerAction:'all',
	mode:'local',
	allowBlank:false,
	store: branchstore,
    listeners: {'select': function(cmb, rec, idx){
		
			Ext.getCmp('semester_name').reset();
			Ext.getCmp('student_name').reset();
			Ext.getCmp('student_gturegno').reset();
			Ext.getCmp('cheque_no').reset();
			Ext.getCmp('cash').reset();
			Ext.getCmp('bank_name').reset();
			Ext.getCmp('receive_amt').reset();
			Ext.getCmp('comment').reset();
			Ext.getCmp('receipt_date').reset();
			Ext.getCmp('receipt_no').reset();
			Ext.getCmp('division_id').reset();
			
			Ext.getCmp('adm_year').reset();
			Ext.getCmp('student_techcerti').reset();
			Ext.getCmp('allsem').reset();
			Ext.getCmp('amount_discount').reset();
			studentstore.removeAll();
			grid.stopEditing();
			feeshead_grid_store.removeAll();
			receivedfees_grid_store.removeAll();
		
  	}}
});

var semester = new Ext.form.ComboBox({
	name: 'semester_name',
	id:'semester_name',
	hiddenName:'semester_hidden',
	labelSeparator:'',	
	tabIndex:6,
	width:210,
	fieldLabel :labelArray[4] ,
	displayField:'semester_name',
	valueField: 'semester_id',
	editable:true,
	triggerAction:'all',
	mode:'local',
	allowBlank:true,
	store: semesterstore,
    listeners: {'select': function(cmb, rec, idx){
		
		Ext.getCmp('division_id').reset();
		var branch=Ext.getCmp('branch_name').getValue();
		var fees_type=Ext.getCmp('fees_type').getValue();
		divisionstore.filter('division_id',branch+cmb.getValue(),false,true,true);
		var cnt=divisionstore.getCount();
		if(cnt==1)
		{
			Ext.getCmp('division_id').setValue(divisionstore.getAt(0).data.division_name);
		}
		
		if(Ext.getCmp('branch_name').getValue()!=""){
			grid.stopEditing();
			feeshead_grid_store.removeAll();
			receivedfees_grid_store.removeAll();
			Ext.getCmp('student_name').reset();
			Ext.getCmp('student_gturegno').reset();
			Ext.getCmp('cheque_no').reset();
			Ext.getCmp('cash').reset();
			Ext.getCmp('bank_name').reset();
			Ext.getCmp('receive_amt').reset();
			Ext.getCmp('comment').reset();
			Ext.getCmp('receipt_date').reset();
			Ext.getCmp('receipt_no').reset();
				Ext.getCmp('allsem').reset();
				Ext.getCmp('amount_discount').reset();
			studentstore.load({params: {'fees_type':Ext.getCmp('fees_type').getValue(),'branch_id': Ext.getCmp('branch_name').getValue(),'semester_id': Ext.getCmp('semester_name').getValue()}});
			
		}else{
			alert('Select Branch First')
			this.reset();
		}
  	}}
});


var divisionCombo = {		
						xtype: 'combo',
						name: 'division_id',
						id:'division_id',
						labelSeparator:'',	
						fieldLabel :'Division :<span class="comp">*</span>' ,
						forceSelection:true,				
						displayField:'division_name',
						valueField: 'division_name'
						,tabIndex:7
						,lastQuery:''
						,allowBlank:false
						,triggerAction:'all'
						,mode:'local'
						,store:divisionstore
						,width:120
						,selectOnFocus: true,
						listeners: {'select': function(cmb, rec, idx) {
							
						if(Ext.getCmp('branch_name').getValue()!="" && Ext.getCmp('semester_name').getValue()!="" ){
						grid.stopEditing();
						feeshead_grid_store.removeAll();
						receivedfees_grid_store.removeAll();
						Ext.getCmp('student_name').reset();
						Ext.getCmp('student_gturegno').reset();
						Ext.getCmp('cheque_no').reset();
			Ext.getCmp('cash').reset();
			Ext.getCmp('bank_name').reset();
			Ext.getCmp('receive_amt').reset();
			Ext.getCmp('comment').reset();
			Ext.getCmp('receipt_date').reset();
			Ext.getCmp('receipt_no').reset();
				Ext.getCmp('allsem').reset();
						studentstore.load({params: {'fees_type':Ext.getCmp('fees_type').getValue(),'branch_id': Ext.getCmp('branch_name').getValue(),'semester_id': Ext.getCmp('semester_name').getValue(),'division_id': this.getValue()}});
						
						
					}else{
						alert('Select Branch And Semester First')
						this.reset();
					}
					
									}
				}
				  }

var student = new Ext.form.ComboBox({
	name: 'student_name',
	id:'student_name',
	hiddenName:'student_hidden',
	labelSeparator:'',	
	fieldLabel :labelArray[5] ,
	displayField:'student_name',
	valueField: 'student_id',
	editable:true,
	tabIndex:8,
	width:210,
	triggerAction:'all',
	mode:'local',
	allowBlank:true,
	forceSelection:false,
	store: studentstore,
	listeners: {'select': function(cmb, rec, idx){
	if(Ext.getCmp('branch_name').getValue()!="" && Ext.getCmp('semester_name').getValue()!=""){
			
			Ext.getCmp('student_gturegno').setValue(studentstore.getAt(idx).data.student_gturegno);
			Ext.getCmp('adm_year').setValue(studentstore.getAt(idx).data.adm_year);
			Ext.getCmp('student_techcerti').setValue(studentstore.getAt(idx).data.student_techcerti);
			
			get_feeshead_data();
			get_receivedfees_data();
			var fees_type=Ext.getCmp('fees_type').getValue();
			if(fees_type == 'Transport')
			{
				get_ReceiptNo1();
			}
			else
				{
					get_ReceiptNo();
				}
				
			student_id=this.getValue();
			student_name=this.getRawValue();
			
		}else{
			alert('Select Branch And Semester First')
			this.reset();
		}
	},
	'focus':function(cmb, rec, idx){
		student_id=this.getValue();
		student_name=this.getRawValue();
	
	},
	
	'blur':function(cmb, rec, idx){
		this.setValue(student_id);
		this.setRawValue(student_name);
	
	}}
});
	
	var month_duration_from = new Ext.form.DateField({
  
    displayField:'monthname',
    valueField:'monthid',
    typeAhead: true,
    mode: 'local',
    triggerAction: 'all',
    emptyText:'From',
    selectOnFocus:true,  
    lastQuery:'',
    tabIndex:9,
	name:'month_duration_from',
	id:'month_duration_from',
	hiddenName:'month_duration_from',
	allowBlank:true,
	labelSeparator:'',	
	fieldLabel :'Duration:' ,
	forceSelection:true,
	width: 100,
	editable:false
});
var month_duration_to = new Ext.form.DateField({
	
    displayField:'month_duration_to',
    valueField:'month_duration_to',
    typeAhead: true,
    mode: 'local',
    triggerAction: 'all',
    emptyText:'To',
    selectOnFocus:true,
    lastQuery:'',
    tabIndex:10,
	name:'month_duration_to',
	id:'month_duration_to',
	hiddenName:'month_duration_to',
	allowBlank:true,
	fieldLabel: '',
	forceSelection:true,
	width: 100,
	editable:false
});	
	
var allsem = new Ext.form.Checkbox({
	name:'allsem',
	id:'allsem',
	tabIndex:11,
	value:'on',
	labelSeparator:'',	
	fieldLabel :'Paid All Sem Fees:',
		 handler:function()
	{
			var is_teaching = receiveform.getForm().findField('semester_name').getValue();
		//	alert(is_teaching);
		if(Ext.getCmp('allsem').getValue(checked = true))
     {
     		if(is_teaching == "2")
     		{
     	//		alert("hello");
     			get_feeshead_data();
			get_receivedfees_data();
			}
     		Ext.getCmp('all_receive_amt').enable();
				Ext.getCmp('discount').enable();
     		Ext.getCmp('total_receive_amt').enable();
   //  		Ext.getCmp('receive_amt').disable();
   	 	
   	 }
   	 else
   	 	{
   	 //			Ext.getCmp('receive_amt').enable();
   	 		Ext.getCmp('all_receive_amt').disable();
   	 	}
	}	
});

var cash = new Ext.form.Checkbox({
	name:'cash',
	id:'cash',
	tabIndex:12,
	labelSeparator:'',	
	fieldLabel :labelArray[6]
});

var commentshow = new Ext.form.Checkbox({
	name:'comment_show',
	id:'comment_show',
	tabIndex:12,
	labelSeparator:'',	
	fieldLabel :labelArray[10]
});

var checkno = new Ext.form.NumberField({
	name: 'cheque_no',
	id:'cheque_no',
	labelSeparator:'',	
	tabIndex:13,
	fieldLabel :labelArray[7] ,
	allowNegative: false,
	allowDecimals: false,
	disabled:true,
	width: 210,
	autoCreate: {tag: 'input', type: 'text',  maxlength: '15'},
	allowBlank:true
});

var bankname = new Ext.form.ComboBox({
	name: 'bank_name',
	id:'bank_name',
	labelSeparator:'',	
	fieldLabel :labelArray[8] ,
	displayField:'bank_name',
	triggerAction:'all',
	hideTrigger: true,
	tabIndex:14,
	disabled:true,
	store: banknamestore,
	mode:'local',
	width:210,
	selectOnFocus: true,
	allowBlank:true
});

var totalamount = new Ext.form.NumberField({
 	name: 'receive_amt',
	id:'receive_amt',
	labelSeparator:'',	
	fieldLabel :labelArray[9] ,
	width:210,
	tabIndex:15,
	allowBlank:true,
	allowNegative:false,
	maxValue: 99999.993,
	decimalPrecision:0,
	autoCreate: {tag: 'input', type: 'text',  maxlength: '7'}
	//,readOnly:true
});
var allsemtotalamount = new Ext.form.NumberField({
 	name: 'all_receive_amt',
	id:'all_receive_amt',
	labelSeparator:'',	
	fieldLabel :'All Sem Amount' ,
	width:210,
	tabIndex:16,
	disabled:true,
	maxValue: 999999.993,
	decimalPrecision:0,
	allowBlank:true,
	allowNegative:false,
	autoCreate: {tag: 'input', type: 'text',  maxlength: '7'}
	//,readOnly:true

});
var discount = new Ext.form.NumberField({
 	name: 'discount',
	id:'discount',
	labelSeparator:'',	
	fieldLabel :'Discount' ,
	width:210,
	tabIndex:17,
	disabled:true,
	allowBlank:true,
	allowNegative:false,
	allowDecimals:true,
	maxValue: 99999.993,
	decimalPrecision:4,
	autoCreate: {tag: 'input', type: 'text',  maxlength: '8'},
	//,readOnly:true,
	listeners:
	{
			onBlur: function() {
				alert("hello");
			}
	}

});
var amount_discount = new Ext.form.NumberField({
 	name: 'amount_discount',
	id:'amount_discount',
	labelSeparator:'',	
	fieldLabel :'amount_discount ' ,
	width:210,
	tabIndex:18,
	allowBlank:true,
	allowNegative:false,
	maxValue: 99999.993,
	decimalPrecision:0,
	autoCreate: {tag: 'input', type: 'text',  maxlength: '7'}
	//,readOnly:true

});
var totalpayamount = new Ext.form.NumberField({
 	name: 'total_receive_amt',
	id:'total_receive_amt',
	labelSeparator:'',	
	allowDecimals:false,
	fieldLabel :'Total Pay Amount' ,
	width:210,
	tabIndex:19,
	disabled:true,
	allowBlank:true,
	allowNegative:false,
	allowDecimals:true,
	maxValue: 99999.993,
	decimalPrecision:0,
	autoCreate: {tag: 'input', type: 'text',  maxlength: '7'}
	//,readOnly:true

});
var comment = new Ext.form.TextField({
    id: 'comment',
 	name: 'comment',
 	width:210,
	tabIndex:20,
	fieldLabel:'Comment'
});	

/* START GRID */
var summary = new Ext.grid.GroupSummary();
	
var feeshead_fields = [{
	name:'head_id',
	type: 'int'
},{
	name:'feespaid',
	type:'bool'	
},{
	name:'selected',
	type:'bool'		
},{
	name: 'head_name',
	type: 'string'
},{
	name: 'fees_type',
	type: 'string'	
}, {
	name: 'branch_id',
	type: 'int'
},{
	name: 'branch_name',
	type: 'string'
},{
	name: 'semester_id',
	type: 'int'
},{
	name:'semester_name',
	type:'string'
},{
	name: 'fees_amount',
	type: 'float'
},{
	name: 'fees_recviced_amount',
	type: 'float'
},{
	name: 'fees_due_amount',
	type: 'float'
},
{
	name: 'amount_discount',
	type: 'string'
},
{
	name: 'all_receive_amt',
	type: 'string'
}
]

var reader = new Ext.data.JsonReader({
    idProperty: 'head_id',
    root: 'data',
    fields: feeshead_fields
});

var feeshead_grid_store = new Ext.data.GroupingStore({
    url:'data/view-feesreceive-data.php',
	reader:reader,
	successProperty:'success',
    sortInfo:{
		field:'head_id',
		autoLoad:true,
		direction:'ASC'
 	},
	groupField:'branch_name'
});

var feeshead_colModel = new Ext.grid.ColumnModel([
	new Ext.grid.RowNumberer,{ 
	header: "FeesHead ID",
	dataIndex: 'head_id',
	width: 50,
	sortable: true,
	hidden: true 
},{ 
	header: "Branch ID", 
	dataIndex: 'brancg_id', 
	sortable: true, 
	hidden: true
},{ 
	header: "Semester ID", 
	dataIndex: 'semester_id', 
	sortable: true, 
	hidden: true 
	
},{ 
	xtype: 'checkcolumn',
	id: 'present',
	dataIndex: 'selected',
	width:25	
},{
	header: "Head Name",
	dataIndex: 'head_name', 
	sortable: true,
	width: 170,
	summaryType: 'count',
	summaryRenderer: function(v, params, data){
		return ((v === 0 || v > 1) ? + v +' Fees' : '1 Fees');
	}
},{ 
	id: 'branch_name',
	header: "Branch Name",
	width: 190,
	dataIndex: 'branch_name',
	align: 'left',
	sortable: true,
	hidden:true
},
{
	header: 'Receiveble Amount',
	id:'fees_amount',
	dataIndex: 'fees_amount',
	width: 110,
	align: 'left',
	summaryType: 'sum',
	summaryRenderer: function(v, params, data) {
		return  v;
	},
	groupName:'fees_amount' 
},{
	header: 'Received Amount',
	id:'fees_recviced_amount',
	dataIndex: 'fees_recviced_amount',
	width: 100,
	align: 'left',
	summaryType: 'sum',
	summaryRenderer: function(v, params, data) {
		return v;
	},
	groupName:'fees_recviced_amount'    
},
{
header: 'Discount Amount',
	id:'amount_discount',
	dataIndex: 'amount_discount',
	width: 100,
	align: 'right',
	renderer: change,

	
},

{
	header: 'Due Amount',
	id:'fees_due_amount',
	dataIndex: 'fees_due_amount',
	width: 100,
	align: 'right',
	renderer: change,
	editor: {
		xtype: 'numberfield',
		allowBlank: true,
		style: 'text-align: right;'
	},
	summaryType: 'sum',
	summaryRenderer: function(v, params, data, record) {
		Ext.getCmp('receive_amt').setValue(v);
		return v;
	},
	groupName:'fees_due_amount'    
}

]);
	
var grid = new Ext.grid.EditorGridPanel({
	ds: feeshead_grid_store,
	cm: feeshead_colModel,
	height: 280,
	title:'',
	border: true,
	loadMask:true,
	columnLines:true,
	stripeRows:true,
	clicksToEdit:1,
	enableHdMenu: false,
	tbar: [{text: 'Fees Types'}],
	view: new Ext.grid.GroupingView({
		forceFit:true,
		showGroupName: false,
		enableNoGroups:false,
		hideGroupedColumn: true
	}),
	plugins:summary
});

grid.getStore().on('update', function(store, record, action){
	var receive_amt = Ext.getCmp('receive_amt').getValue();

	var temp = record.data.fees_amount - record.data.fees_recviced_amount;
	//alert(temp);
	var temp1 = record.data.fees_due_amount;
	

	if(record.data.selected == true){
		if(temp1 > 0){
			record.set('fees_due_amount',temp1);
		} 
		else{
			record.set('fees_due_amount',temp);	
		}
	}
	else{
		record.set('fees_due_amount',0);
	}
});
	
grid.on('render', function() {
	grid.tip = new Ext.ToolTip({
		view: grid.getView(),
		target: grid.getView().mainBody,
		delegate: '.x-grid3-row',
		trackMouse: true,
		renderTo: document.body,
		listeners: {
			beforeshow: function updateTipBody(tip) {
				tip.body.dom.innerHTML = "Click On Due Amount Column To Edit Amount.";
			}
		}
	});
});
	
Ext.override(Ext.Editor, {
	onBlur: function() {
		if (this.allowBlur === true && this.editing) {
			this.completeEdit();
		}
	}
});
/* END GRID */
	
/* START BELOW GRID */
var rowExpander = new Ext.grid.RowExpander({
	tpl: new Ext.Template(
    	'<div class="row-preview "><p>{feeshead_detail}</p></div>'
    )
}); 

var receivedfees_fields = [{
	name:'feesreceive_id',
	type: 'int'
},
{
	name:'semester_id',
	type: 'int'
},

{
	name: 'receipt_no',
	type: 'int'
},{
	name: 'receipt_date',
	type: 'date',
	dateFormat: 'Y-m-d'
},{
	name: 'receive_amt',
	type: 'float'
},
{
	name: 'discount',
	type: 'float'
},
{
	name: 'month_duration_from',
	type: 'date',
	dateFormat: 'Y-m-d'
},

{
	name: 'month_duration_to',
	type: 'date',
	dateFormat: 'Y-m-d'
},
{
	name: 'amount_discount',
	type: 'float'
},
{
	name: 'feeshead_detail',
	type: 'string'
},{
	name: 'cheque_no',
	type: 'int'
},{
	name: 'bank_name',
	type: 'string'
},{
	name: 'comments',
	type: 'string'
},
{
	name: 'year_name',
	type: 'string'
},
{
	name: 'all_receive_amt',
	type: 'string'
},
{
	name: 'total_receive_amt',
	type: 'string'
}
]	
	
var reader1 = new Ext.data.JsonReader({
    idProperty: 'feesrec_no',
    root: 'data1',
    fields: receivedfees_fields
});

var receivedfees_grid_store = new Ext.data.Store({
    url:  'data/view-receivedfees-data.php',
	reader: reader1,
    sortInfo: {
    	field: 'semester_id',
        direction: 'DESC'
    }
});
	
var receivedfees_colModel = new Ext.grid.ColumnModel([
	rowExpander,
	{ 
	header: "Semester",
	dataIndex: 'semester_id',
	width: 60,
	align:'center'
},
	
	{ 
	header: "Receipt No",
	dataIndex: 'receipt_no',
	width: 80,
	align:'center'
},{
	header: "Receipt Date",
	dataIndex: 'receipt_date',
	renderer: Ext.util.Format.dateRenderer('d/m/Y'),
	width: 80
},
{
	header: "Month Duration From",
	dataIndex: 'month_duration_from',
	renderer: Ext.util.Format.dateRenderer('d/m/Y'),
	width: 80,
	hidden:true
},
{
	header: "Month Duation To",
	dataIndex: 'month_duration_to',
	renderer: Ext.util.Format.dateRenderer('d/m/Y'),
	width: 80,
	hidden:true
},
{
	header: 'Rec. Amount',
	id:'receive_amt',
	align: 'right',
	dataIndex: 'receive_amt',
	width: 90
},
{
	header: 'Year',
	id:'year_name',
	align: 'right',
	dataIndex: 'year_name',
	width: 80
},
{
	header: 'Discount',
	id:'discount',
	align: 'right',
	dataIndex: 'discount',
	width: 90
},
{
	header: 'Discount Amount',
	id:'amount_discount',
	align: 'right',
	dataIndex: 'amount_discount',
	width: 90
},
{
	header: 'Total Amount',
	id:'all_receive_amt',
	align: 'right',
	dataIndex: 'all_receive_amt',
	width: 90
},
{
	header: 'Total Rec. Amount',
	id:'total_receive_amt',
	align: 'right',
	dataIndex: 'total_receive_amt',
	width: 90
},

{
	header: 'Check No',
	id:'cheque_no',
	align: 'right',
	dataIndex: 'cheque_no',
	width: 80
},{
	header: 'Bank Name',
	id:'bank_name',
	align: 'right',
	dataIndex: 'bank_name',
	width: 120
},
{
  header: 'Comment',
  id:'comments',
  dataIndex:'comments',
  width:100
}]);
	
var grid1 = new Ext.grid.GridPanel({
	ds:receivedfees_grid_store,
	cm:receivedfees_colModel,
//	store: feeshead_grid_store,
	loadMask:true,
	columnLines:true,
	stripeRows:true,
	sm:new Ext.grid.RowSelectionModel({
		singleSelect:true,
		listeners:{
			rowselect: function(sm, row, rec) {
				Ext.getCmp("receiveform").getForm().loadRecord(rec);
				Ext.getCmp('all_receive_amt').enable();
				Ext.getCmp('discount').enable();
     		Ext.getCmp('total_receive_amt').enable();
			
				if(flgEdit == "true"){
					Ext.getCmp('btnSave').enable();
				}
				else{
					Ext.getCmp('btnSave').disable();
					alert('You do not have access to edit the record.');
				}
						
			//	Ext.getCmp("feeshead_add_edit_form").disable();
			//	grid.stopEditing();
				feeshead_grid_store.removeAll();
				feeshead_grid_store.load({params:{
					task:'getdata',
					student_id :Ext.getCmp('student_name').getValue(),
					branch_id :Ext.getCmp('branch_name').getValue(),
					semester_id:Ext.getCmp('semester_name').getValue(),
					division_id:Ext.getCmp('division_id').getValue(),
					recipt_no:Ext.getCmp('receipt_no').getValue(),
					fees_type:Ext.getCmp('fees_type').getValue(),
					head_name:Ext.getCmp('head_name').getValue(),
					adm_year:Ext.getCmp('adm_year').getValue(),
					amount_discount:Ext.getCmp('amount_discount').getValue(),
			//		comment:Ext.getCmp('comment').getValue(),
								
							month_duration_to:Ext.getCmp('month_duration_to').getValue(),
					month_duration_from:Ext.getCmp('month_duration_from').getValue(),

					student_techcerti:Ext.getCmp('student_techcerti').getValue(),
					
					//gtu no
					student_gturegno:Ext.getCmp('student_gturegno').getValue(),
				allsem:Ext.getCmp('allsem').getValue(),
		//		amount_discount:Ext.getCmp('amount_discount').getValue(),
				}});	
			}
		}
	}),
    height: 180,
    title:'',
    border: true,
	tbar: [{text: 'Fees Receipt'}],
	enableHdMenu: false,
    plugins: rowExpander
});

/* END BELOW GRID */

var DebitDetail = new Ext.form.Label({
	name: 'DebitDetail',
	id:'DebitDetail'
});

var receiveform = new Ext.FormPanel({
	id:'receiveform',
	frame: true,
	url:'save-feesrecive.php',
	labelAlign:'left',
	bodyStyle:'padding:5px',
	layout: 'column', 
	items: [{
		columnWidth: 0.36,
		xtype: 'fieldset',
		id:'feeshead_add_edit_form',
		labelWidth: 90,
		title:'',
		defaults: {border:false},    
		autoHeight: true,
		border: false,
		items: [
			fees_type,
			{
				xtype:'textfield',
				id:'adm_year',
				name:'adm_year',
				hidden:true			
			},{
				xtype:'textfield',
				id:'student_techcerti',
				name:'student_techcerti',
				hidden:true
			},
			
			
			gtuno,
			branch,
			semester,
			divisionCombo,
			student,
					
			totalamount,
			
			
			
			
			
			feesrecno,
			feesrecdate,
			
			cash,
			checkno,
			bankname,
			commentshow,
			comment,
			feesreceive_id,
			{height:10},
			DebitDetail
		]
	},{
		columnWidth:0.63,
		xtype:'container',
		border:false,
		layout:'column',
		defaultType:'field',
		items:[{
			xtype:'container',
			columnWidth:1,
			items:[grid]
		},{
			xtype:'container',
			columnWidth:1,
			items:[grid1]
		}]
	}]
});

function change(val){
	if(val > 0){
    	return '<span style="color:red;">' + val + '</span>';
   	}
	else if(val <= 0){
        return '<span style="color:green;">' + val + '</span>';
   	}
    return val;}

function get_receivedfees_data(){
	
	var student_id 	= Ext.getCmp('student_name').getValue();
	//gtu no
	var student_gturegno 	= Ext.getCmp('student_gturegno').getValue();
	var adm_year = Ext.getCmp('adm_year').getValue();
	var student_techcerti = Ext.getCmp('student_techcerti').getValue();
	var branch_id 	= Ext.getCmp('branch_name').getValue();
	var semester_id = Ext.getCmp('semester_name').getValue();
	var allsem = Ext.getCmp('allsem').getValue();
	var amount_discount = Ext.getCmp('amount_discount').getValue();
	
		
	receivedfees_grid_store.removeAll();
	receivedfees_grid_store.load({params:{
		student_id:student_id,
		branch_id:branch_id,
		semester_id:semester_id,
		discount:discount,
		//student_gturegno:student_gturegno,
		//adm_year:adm_year
	}}); 									          
	
	Ext.Ajax.request({
		loadMask: true,
		sync : true,
		url: 'data/getpastsemfees.php',
		params: {student_id:student_id,student_gturegno:student_gturegno,adm_year:adm_year,student_techcerti:student_techcerti},
		success:function(resp){
			resbool = Ext.decode(resp.responseText).success;
			if(resbool == "true"){
				var DispStr = Ext.decode(resp.responseText).DispStr;
				Ext.getCmp('DebitDetail').update(DispStr);
			}
		}				
	});
	
	
}
	
function get_feeshead_data(){
 	grid.stopEditing();
	feeshead_grid_store.removeAll();
	feeshead_grid_store.load({params:{
		task:'getdata',
		student_id :Ext.getCmp('student_name').getValue(),
		branch_id :Ext.getCmp('branch_name').getValue(),
		semester_id:Ext.getCmp('semester_name').getValue(),
		division_id:Ext.getCmp('division_id').getValue(),
		fees_type:Ext.getCmp('fees_type').getValue(),
		head_name:Ext.getCmp('head_name').getValue(),
		adm_year:Ext.getCmp('adm_year').getValue(),
	month_duration_to:Ext.getCmp('month_duration_to').getValue(),
					month_duration_from:Ext.getCmp('month_duration_from').getValue(),
		student_techcerti:Ext.getCmp('student_techcerti').getValue(),
		//gtu no
		student_gturegno:Ext.getCmp('student_gturegno').getValue(),
		allsem:Ext.getCmp('allsem').getValue(),
		amount_discount:Ext.getCmp('amount_discount').getValue()
	}});	
	
	
	}	
var a=Ext.getCmp('fees_type').getValue()
	if(a != 'Transport')
	{
	get_ReceiptNo();
	}
else
	{
			get_ReceiptNo1();

	}
function get_ReceiptNo1(){	
	Ext.Ajax.request({
		loadMask: true,
		sync : true,
		url: 'data/getReceiptno1.php',
		success: function(resp){
			var value=Ext.decode(resp.responseText).count;
			if(value==','){
			receiveform.getForm().reset();
			feeshead_grid_store.removeAll();
			receivedfees_grid_store.removeAll();
			Ext.getCmp('branch_name').focus(true,500);
			studentstore.removeAll();
			Ext.MessageBox.show({
					title: 'Error',
					msg: 'Recipt No Not Found for this number.',
					buttons: Ext.MessageBox.OK,
					icon:Ext.MessageBox.ERROR
				});
			} else{
				var arr_data = new Array();
				arr_data =  value.split(",");
				Ext.getCmp('receipt_no').setValue(arr_data[0]);
				
			}					
		}				
	});	}


function get_ReceiptNo(){	
	Ext.Ajax.request({
		loadMask: true,
		sync : true,
		url: 'data/getReceiptno.php',
		success: function(resp){
			var value=Ext.decode(resp.responseText).count;
			if(value==','){
			receiveform.getForm().reset();
			feeshead_grid_store.removeAll();
			receivedfees_grid_store.removeAll();
			Ext.getCmp('branch_name').focus(true,500);
			studentstore.removeAll();
			Ext.MessageBox.show({
					title: 'Error',
					msg: 'Recipt No Not Found for this number.',
					buttons: Ext.MessageBox.OK,
					icon:Ext.MessageBox.ERROR
				});
			} else{
				var arr_data = new Array();
				arr_data =  value.split(",");
				Ext.getCmp('receipt_no').setValue(arr_data[0]);
				
			}					
		}				
	});	}


function toggleflag(btn){
	flag = true ;}

function deleteallowances(btn){
	if(btn=='yes'){			  			
		//window.location='fees-receipt-report.php?receipt_no=' + Ext.getCmp('receipt_no').getValue();
		window.location='fees-receipt-report.php';
	}
	else{
		receiveform.getForm().reset();	
		feeshead_grid_store.removeAll();
		receivedfees_grid_store.removeAll();
		Ext.getCmp("feeshead_add_edit_form").enable();
		//Ext.getCmp('branch_name').focus(true,500);
		Ext.getCmp('fees_type').focus(true,500);
		Ext.getCmp('fees_type').setValue('Regular');	
		
		
	get_ReceiptNo();
	
	}}		
	function deleteallowances2(btn){
	if(btn=='yes'){			  			
		//window.location='fees-receipt-report.php?receipt_no=' + Ext.getCmp('receipt_no').getValue();
		window.location='fees-receipt-report2.php';
	}
	else{
		receiveform.getForm().reset();	
		feeshead_grid_store.removeAll();
		receivedfees_grid_store.removeAll();
		Ext.getCmp("feeshead_add_edit_form").enable();
		//Ext.getCmp('branch_name').focus(true,500);
		Ext.getCmp('fees_type').focus(true,500);
		Ext.getCmp('fees_type').setValue('Transport');	
	
	get_ReceiptNo();
	
			get_ReceiptNo1();

	
	}}		
function deleteallowances1(btn){
	if(btn=='yes'){			  			
		//window.location='fees-receipt-report.php?receipt_no=' + Ext.getCmp('receipt_no').getValue();
		window.location='fees-receipt-report1.php';
	}
	else{
		receiveform.getForm().reset();	
		feeshead_grid_store.removeAll();
		receivedfees_grid_store.removeAll();
		Ext.getCmp("feeshead_add_edit_form").enable();
		//Ext.getCmp('branch_name').focus(true,500);
		Ext.getCmp('fees_type').focus(true,500);
		Ext.getCmp('fees_type').setValue('Regular');	
	get_ReceiptNo();

	}}		
var SetupWindow = new Ext.Window({
	title: 'Fees Receipt Master',
	width:1100,		
	height:550,
	frame: true,
	border: false,
	modal:true,
	layout: 'fit',
	closeAction:'close',
	collapsible:true,
	items: receiveform,
	buttons:[{
		text: 'Save', 
		tabIndex:13,
		name:'btnSave',
		iconCls:'icon-save',
		id:'btnSave',
		handler: function(){
			var flag=0;
			var student_id=Ext.getCmp('student_name').getValue();
			Ext.Ajax.request({
				loadMask: true,
				sync : true,
				url: 'data/checknewadmission.php',
				params: {student_id:student_id},
				success: function(resp){
				var feesflag=Ext.decode(resp.responseText).feesflag;
					
					if(feesflag == '0')
					{
						
						Ext.MessageBox.show({
							title: 'Message',
							msg: 'Please Contact to director to verify the documents of this student!',
							buttons: Ext.MessageBox.OK,
							icon:Ext.MessageBox.INFO
						});
						Ext.getCmp("btnreset").handler.call(Ext.getCmp("btnreset").scope);
							//Ext.getCmp('btnreset').fireEvent('click',Ext.getCmp('btnreset'));
							
					}
					else
					{
						var check =	Ext.getCmp('allsem').getValue(checked = true)
						
						if(check == true)
						{									
							if(Ext.getCmp('total_receive_amt').getValue()>0){
							grid.stopEditing();
						var headids = new Array();
						var recivedamt = new Array();
						var l=0;
						for(var i = 0, len = grid.store.getCount(); i < len; i++){
							record = grid.store.getAt(i);
							headids[l] =  record.data.head_id;
							if(record.data.fees_due_amount!=null){
								recivedamt[l] = record.data.fees_due_amount;
							}
							else{
								recivedamt[l] = 0;
							}
							l++;
						}
				//if(Ext.getCmp('feesreceive_id')==0)
			//	{
			//	get_ReceiptNo();
			//	}
				receiveform.getForm().submit({
					waitMsg: 'Saving...',
					timeout: 3000,
					params :{
						headids: Ext.util.JSON.encode(headids),
						recivedamt:Ext.util.JSON.encode(recivedamt),
						
						
					},
					
					success: function () {	
						
						if(headids == 27 || headids == 28 || headids == 29 || headids == 30 || headids == 31 || headids == 32 || headids == 33)
						{
							 Ext.MessageBox.confirm('Confirmation',' Do U Want To Print Receipt..?',deleteallowances2);
						}
					else
						{	
						
					  if(headids == 23 || headids == 24)
					  {
						  Ext.MessageBox.confirm('Confirmation',' Do U Want To Print Receipt..?',deleteallowances);
						}
						
							
						else
						{
							Ext.MessageBox.confirm('Confirmation',' Do U Want To Print Receipt..?',deleteallowances1);
						}
					}
					},
					failure: function () {
						Ext.MessageBox.show({
							title: 'Error',
							msg: 'Please fill up complete form.',
							buttons: Ext.MessageBox.OK,
							icon:Ext.MessageBox.ERROR
						});									
					}
				});							
			}
		}
			if(check == false)
			{									
				if(Ext.getCmp('receive_amt').getValue()>0){
							grid.stopEditing();
						var headids = new Array();
						var recivedamt = new Array();
						var l=0;
						for(var i = 0, len = grid.store.getCount(); i < len; i++){
							record = grid.store.getAt(i);
							headids[l] =  record.data.head_id;
							if(record.data.fees_due_amount!=null){
								recivedamt[l] = record.data.fees_due_amount;
							}
							else{
								recivedamt[l] = 0;
							}
							l++;
						}
				//if(Ext.getCmp('feesreceive_id')==0)
			//	{
			//	get_ReceiptNo();
			//	}
				receiveform.getForm().submit({
					waitMsg: 'Saving...',
					timeout: 3000,
					params :{
						headids: Ext.util.JSON.encode(headids),
						recivedamt:Ext.util.JSON.encode(recivedamt)
					},
					success: function () {
						
						if(headids == 27 || headids == 28 || headids == 29 || headids == 30 || headids == 31 || headids == 32 || headids == 33)
						{
							 Ext.MessageBox.confirm('Confirmation',' Do U Want To Print Receipt..?',deleteallowances2);
						}
					else
						{						
							
					  if(headids == 23 || headids == 24)
					  {
						  Ext.MessageBox.confirm('Confirmation',' Do U Want To Print Receipt..?',deleteallowances);
						}
					
						
						else
						{
							Ext.MessageBox.confirm('Confirmation',' Do U Want To Print Receipt..?',deleteallowances1);
						}
					}
					},
					failure: function () {
						Ext.MessageBox.show({
							title: 'Error',
							msg: 'Please fill up complete form.',
							buttons: Ext.MessageBox.OK,
							icon:Ext.MessageBox.ERROR
						});									
					}
				});							
			}
			else{
				alert("No Dabit Amount For this Record...")	
			
			}
		}
			}
										
				}});
				
	/*		if(flag==1)
			{
		
			if(Ext.getCmp('receive_amt').getValue()>0){
				grid.stopEditing();
				var headids = new Array();
				var recivedamt = new Array();
				var l=0;
				for(var i = 0, len = grid.store.getCount(); i < len; i++){
					record = grid.store.getAt(i);
					headids[l] =  record.data.head_id;
					if(record.data.fees_due_amount!=null){
						recivedamt[l] = record.data.fees_due_amount;
					}
					else{
						recivedamt[l] = 0;
					}
					l++;
				}
				//if(Ext.getCmp('feesreceive_id')==0)
			//	{
			//	get_ReceiptNo();
			//	}
				receiveform.getForm().submit({
					waitMsg: 'Saving...',
					params :{
						headids: Ext.util.JSON.encode(headids),
						recivedamt:Ext.util.JSON.encode(recivedamt)
					},
					success: function () {	
					
						Ext.MessageBox.confirm('Confirmation',' Do U Want To Print Receipt..?',deleteallowances);
					},
					failure: function () {
						Ext.MessageBox.show({
							title: 'Error',
							msg: 'Please fill up complete form.',
							buttons: Ext.MessageBox.OK,
							icon:Ext.MessageBox.ERROR
						});									
					}
				});							
			}
			else{
				alert("No Dabit Amount For this Record...")	
			}
			}
			else
			{
				Ext.MessageBox.show({
							title: 'Message',
							msg: 'Wrong Password!Contact to admin to take the fees of new admission!',
							buttons: Ext.MessageBox.OK,
							icon:Ext.MessageBox.INFO
						});
			}*/
		}	
	},{
		text: 'Reset', 
		name:'btnreset',
		tabIndex:14,
		iconCls:'icon-reset',
		id:'btnreset',
		handler: function (){
			
			receiveform.getForm().reset();
			grid.stopEditing();
			feeshead_grid_store.removeAll();
			receivedfees_grid_store.removeAll();
			Ext.getCmp("feeshead_add_edit_form").enable();
	get_ReceiptNo();
			if(flgAdd == "true"){
				Ext.getCmp('btnSave').enable();
			}
			Ext.getCmp('fees_type').focus(true,500);
			Ext.getCmp('fees_type').setValue('Regular');
		}
	},{
		text:'Close', 
		name:'btnclose',
		tabIndex:15,
		iconCls:'icon-close',
		id:'btnclose',
		handler: function (){
			SetupWindow.close();
		}
	}]
});


Ext.getCmp('cash').on('check',function (){
	if(Ext.getCmp('cash').getValue()==false){
		Ext.getCmp('bank_name').reset();
		Ext.getCmp('cheque_no').reset();
		Ext.getCmp('bank_name').disable();
		Ext.getCmp('cheque_no').disable();
	} 
	else{
        Ext.getCmp('bank_name').enable();
		Ext.getCmp('cheque_no').enable();
	}
}); 



Ext.getCmp('receipt_date').on('select',function (){
	if(Ext.getCmp('receipt_no').getValue()!=""){  
		Ext.Ajax.request({
			loadMask: true,
			sync : true,
			url: 'data/getfeesreceiptdaterange.php',
			params: { 
				semester_id :Ext.getCmp('semester_name').getValue(),
				feesrec_no : Ext.getCmp('receipt_no').getValue(),
				date   : Ext.getCmp('receipt_date').getValue(),
				    
			},
			waitMsg:'Loading',
			success: function(resp){
				if(Ext.decode(resp.responseText).valid == "true"){ 
					flag = true;
				}
				else{
					flag = false ;
					var date=Ext.decode(resp.responseText).valid;
					var feesrec_no= Ext.getCmp('receipt_no').getValue();
					feesrec_no=feesrec_no-1;
					Ext.MessageBox.alert("Error","Recipt Date Should Not Less than "+date + " See Receipt No "+feesrec_no,toggleflag); 
					Ext.getCmp('receipt_date').reset();
				}
			}				
		});
	} 
	else {
		alert("Select Semester First");
		Ext.getCmp('receipt_date').reset();
	}}); 

feeshead_grid_store.on({'load': {fn: function(){
	if(feeshead_grid_store.getCount() <= 0){
		Ext.MessageBox.show({
			title: 'Error',
			msg: 'Fees Setup Not found Fro This Selection.',
			buttons: Ext.MessageBox.OK,
			icon:Ext.MessageBox.ERROR
		});
	} 
	else{
		grid.startEditing(0,8);
	}}}});	
	
var varWidth =  (screen.width - SetupWindow.width)/2;
SetupWindow.setPosition(varWidth,((screen.height/4)-190));
SetupWindow.show();

if(flgAdd == "true"){
	Ext.getCmp('btnSave').enable();}
else{
	Ext.getCmp('btnSave').disable();
}

Ext.getCmp('fees_type').focus(true,500);
Ext.getCmp('fees_type').setValue('Regular');
});
</script>
</div>
<?php require "_footer.php";?>


