<?php 
	require "_header.php"; 

	/* START ACTIVE YEAR */
	$SQL = "SELECT year_name FROM cms_yearmaster WHERE year_active = 1";
	$RES = dbQuery($SQL);
	$REC = dbArray($RES);
	$active_year = $REC['year_name'];
	/* END ACTIVE YEAR */
?>
<style type="text/css">
	label.myBold
	{
	   font-weight:bold;
	   color:#600;
	   font-size:11px;
	   padding-left:10px;
	   text-align:center;
	}
	label.AlertMsg
	{
	   font-weight:bold;
	   color:#F00;
	   font-size:11px;
	   padding-left:10px;
	   text-align:center;
	}
	label.myBold1
	{
	   font-weight: bold;
	   color:#15428B;
	   font-size: 12px;
	   padding-top:3px;
	}
	label.myBold2
	{
	   font-weight: bold;
	   color:#C00;
	   font-size: 12px;
	   padding-top:3px;
	}
</style>
<div id="main-content">
<script type="text/javascript">

Ext.onReady(function(){
 	Ext.QuickTips.init();
    
	var loginyear = new Ext.form.Label({
		name:'loginyear',
		id:'loginyear',
		cls: 'x-form-item myBold',
		text:'Login Year : <?php echo $_SESSION["VedantnrYearName"]; ?> '
	});
	
	var activeyear = new Ext.form.Label({
		name: 'activeyear',
		id:'activeyear',
		cls: 'x-form-item myBold',
		text:'Active Year : <?php echo $active_year; ?> '
	});
	
	var simpleForm = new Ext.FormPanel({
    	layout:'form',
       	url:'',
		method:'post',
		standardSubmit:true,
		frame:true,
        bodyStyle:'padding:5px 5px 5px 5px',
        width: 340,
		buttonAlign:'center',
        items:[{
				xtype:'label',
				cls: 'x-form-item AlertMsg',
				text:'First Transfer All Semester Data. Then Transferd Year Data.'
				},{
			xtype:'container',
			autoEl:{},
			border:false,
			layout:'column',
			anchor:'100%',
			defaultType:'field',
			items:[{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:1,
				items:[loginyear]
			},{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:1,
				items:[activeyear]
			},{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:1,
				items:[{height:20}]	
			},{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:1,
				items:[{
					xtype:'button',
					name:'transfer_student',
					id:'transfer_student',
					text:'Transfer Data',
					width:190,
					iconCls:'icon-search',
					fieldLabel:'',
					handler: function(){
						Ext.Ajax.request({
							loadMask: true,
							sync: true,
							waitMsg:'Pleas Wait...',
							url:'data/transfer-data.php',
							success: function(resp) {
								resbool=Ext.decode(resp.responseText).success;
								resmsg=Ext.decode(resp.responseText).msg;
								if(resbool=='false'){
									Ext.MessageBox.show({
										title: 'Error',
										msg:resmsg,
										buttons: Ext.MessageBox.OK,
										icon:Ext.MessageBox.ERROR
									});
								} else{
									Ext.MessageBox.show({
										title: 'Message',
										msg: resmsg,
										buttons: Ext.MessageBox.OK,
										icon:Ext.MessageBox.INFO
									});
								}	
							}				
						});
					}
				}]
			},{
				xtype:'container',
				autoEl:{},
				layout:'form',
				columnWidth:1,
				items:[{height:30}]	
			}]
		}]
	});
   
   	var districtWindow = new Ext.Window({
    	title: 'Year Transfer',
		width:230,		
		height:160,		
		border: false,
		modal:true,
		layout: 'fit',
		closeAction:'close',
		collapsible:true,
		items: simpleForm
	});

	var varWidth =  (screen.width - districtWindow.width)/2;
    districtWindow.setPosition(varWidth,((screen.height/4)-85));
	districtWindow.show();
});
</script>
<!-- end custom CSS/JS -->
<div id="abcd"></div>
</div>
<?php require "_footer.php";?>