<?php 	require "_headerhome_feedback.php";	
error_reporting(~E_ALL);
session_start();
?>

<style type=text/css>
	label.myBold
		{
		   font-weight: bold;
		   color:#600;
		   font-size: 11px;
		}
		label.myBold2
		{
		   font-weight: bold;
		   color:#F60;
		   font-size: 11px;
		}
		label.myBold3
		{
		   font-weight: bold;
		   color:#F00;
		   font-size: 11px;
		   margin-top:10px;
		}
		label.myBold4
		{
		   font-weight: bold;
		   color:green;
		   font-size: 11px;
		   margin-top:10px;
		}
</style>
<script type="text/javascript">

function disableBackButton()
{
	
window.history.forward();

}
setTimeout("disableBackButton()", 0);

	

Ext.onReady(function(){
	Ext.QuickTips.init();
	var code = new Ext.form.TextField({
		name: 'code',
		id:'code',
		labelSeparator:'',		
		fieldLabel :'Enter Code :<span class="comp">*</span>' ,
		allowBlank:false,		
		width: 150	
	});
var Tquestionform = new Ext.FormPanel({
		id:'Tquestionform',
		url: 'save-scheduledetail.php',
		autoHeight:true,    
		frame:true,
		labelWidth:100,
		items: [{
						xtype:'fieldset',
						border:true,
						title:'Enter secure code here which we have sent you ',
						layout:'column',
						labelWidth:50,
						items  : [code,{
									xtype:'label',
									name: 'exam_instruction',
									id:'exam_instruction',
									width:400,
									cls: 'x-form-item myBold3',
									html:"we have sent you secure code on you mobile no : <?php echo $_SESSION['f_student_mobile'];?>, Please enter that code here then you can start giving feedback. "},
						{
									xtype:'label',
									name: 'exam_instruction2',
									id:'exam_instruction2',
									width:400,
									cls: 'x-form-item myBold4',
									html:"Student Name : <?php echo ucwords($_SESSION['f_studentname']);?><br> Branch : <?php echo $_SESSION['f_branch_name'];?><br> Semester : <?php echo $_SESSION['f_semester_name'];?><br> code:<?php echo ucwords($_SESSION['f_code']);?>"}
						]
					    }]
    });
	
	/*<br> code:<?php //echo ucwords($_SESSION['f_code']);?>*/
	
									
	var TquestionWindow = new Ext.Window({
        title: 'Code Verification',
		width:450,	
		autoHeight:true,    
		modal:false,
		shadow:false,
		border: false,
		layout: 'fit',
		closeAction:'close',
		collapsible:true,
		items:Tquestionform,
		buttonAlign: 'center',
	    buttons: [{
				text: 'Verify & Continue', 
				name:'btnSave',
				iconCls:'icon-save',
				id:'btnSave',
				handler: function(){								
							if(code.isValid())
						{
					Ext.Ajax.request({
							loadMask: true,
							sync : true,
							url: 'data/verifycode.php',
							params: {code:Ext.getCmp('code').getValue()},
							success: function(resp){
								var value=Ext.decode(resp.responseText).success;
								var msg=Ext.decode(resp.responseText).msg;
								if(value=='true'){											
											window.location = 'give-feedback.php';							
								} else{
									alert(msg);
									
								}
													
							}	,
							failure: function () {
										Ext.MessageBox.show({
											title: 'Error',
											msg: 'Invalid Login',
											buttons: Ext.MessageBox.OK,
											icon:Ext.MessageBox.ERROR
										});
								}			
						}); 
			
		}	
					
				}	
			}
			
		]
	});

   	var varWidth =  (screen.width - TquestionWindow.width)/2;
	TquestionWindow.setPosition(varWidth,((screen.height/4)-30));
	TquestionWindow.show();
    Ext.getCmp('code').focus(true,500);

	
});
</script>
<div align="center">
	<div id="abcdhome" align="center" style="width:300px"></div>
</div>
<?php require "_footerhome.php";?>
