<?php 
	require "_header.php";
	require "includeLanguageBar.php";	
	require "data/combo_student.php";
	require "data/combo_semester.php";
	
if ($_SESSION["VedantnrUserName"]!="" && isset($_SESSION["VedantnrUserName"]) != "") 
{
  $username= $_SESSION["VedantnrUserName"];
 
}

	if ($_REQUEST["ID"] != "" && isset($_REQUEST["ID"])) { 
		$student_id = Escape($_REQUEST["ID"]);
		$mode = "edit";
		$limit = 1;
		$start = 0;
		$condition = " and student_inquiry_id = '$student_inquiry_id' ";
		$order_field = "";
		$order_type = "";    			
		$objStudent = new StudentMgmt();
		$out = $objStudent->getStudentRecordsinquiry($limit,$start,$condition,$order_field,$order_type);
		if (dbRows($out)){
			$row=dbArray($out);
			extract($row);		
		}    
	} else{
		$mode="add";
		$student_id=0;
	}
?>
<div id="main-content">
<script type="text/javascript" src="webcamjs/webcam.js"></script>

    <!--<script src="cropjs/prototype.js" type="text/javascript"></script>
	<script src="cropjs/scriptaculous.js?load=effects,builder,dragdrop" type="text/javascript"></script>
	<script src="cropjs/cropper.js" type="text/javascript"></script>-->
    <script src="js/photocapture.js" type="text/javascript"></script>
    <script type="text/javascript" src="jquery/ux/CheckColumn.js"></script>
<link rel="stylesheet" type="text/css" href="css/Ext.css">
<script type="text/javascript" src="js/Ext.js"></script>
<script type="text/javascript" src="js/Ext_002.js"></script>	
    
<script type="text/javascript" language="javascript"> 
Ext.override(Ext.ux.form.LovCombo, {
	beforeBlur: Ext.emptyFn
});
var fflag=1;
var formMode = '<?php echo $mode;?>';
var add = '<?php echo $_REQUEST["add"]; ?>';
var dt = new Date();
var student_id = '<?php  echo $student_id; ?>';
var user_name = '<?php echo $username;?>';	
	if(student_id==""){
		student_id = 0;
	}

	Ext.onReady(function(){
    Ext.QuickTips.init(); 	
	
 var store = new Ext.data.ArrayStore({
           fields: ['student_admby'],
	       data: [['ACPC'],['M.Q'],['V.Q']]
        }); 
  var categorystore = new Ext.data.ArrayStore({
    	fields: ['category'],
	    data: [['GENERAL'],['OBC'], ['SC'], ['ST'], ['MINORITY']]
  	});
		
   var genderstore = new Ext.data.ArrayStore({
           fields: ['gender'],
	       data: [['Male'],['Female']]
        }); 
		var monthstore = new Ext.data.ArrayStore({
           fields: ['month'],
	       data: [['Jannuary'],['February'],['March'],['April'],['May'],['June'],['July'],['Auguest'],['September'],['Octmber'],['November'],['December']]
        }); 
        	var pyearstore = new Ext.data.ArrayStore({
           fields: ['year'],
	       data: [['1980'],['1981'],['1982'],['1983'],['1984'],['1985'],['1986'],['1987'],['1988'],['1989'],['1990'],['1991'],['1992'],['1993'],['1994'],['1995'],['1996'],['1997'],['1998'],['1999'],['2000'],['2001'],['2002'],['2003'],['2004'],['2005'],['2006'],['2007'],['2008'],['2009'],['2010'],['2011'],['2012'],['2013'],['2014'],['2015'],['2016']]
        }); 
        
     var schlorshipestore = new Ext.data.ArrayStore({		
	fields: ['scholarship_id','scholarship_name'],
	data:Ext.semester.scholarship
});   
        
   var bloodgroupstore = new Ext.data.ArrayStore({
           fields: ['bloodgroup'],
	       data: [['O+'],['A+'],['B+'],['AB+'],['O-'],['A-'],['B-'],['AB-']]
        });
		var districtstore = new Ext.data.ArrayStore({
	   
	   fields: ['dist_nameeng'],
		data: [['Ahmedabad'],['Amreli'],['Anand'],['Aravalli'],['Banaskantha'],['Bharuch'],['Bhavnagar'],['Botad'],['Chhota Udaipur'],['Diu'],['Daman'],['Dahod'],['Dang'],['Devbhoomi Dwarka'],['Gandhinagar'],['Gir Somnath'],['Jamnagar'],['Junagadh'],['Kutch'],['Kheda'],['Mahisagar'],['Mehsana'],['Morbi'],['Narmada'],['Navsari'],
		['Panchmahal'],['Patan'],['Porbandar'],['Rajkot'],['Sabarkantha'],['Surat'],['Surendranagar'],['Silvasa'],['Tapi'],['Vadodara'],['Valsad']]
	});
	var shiftstore = new Ext.data.ArrayStore({
           fields: ['shift'],
	       data: [['Shift-1'],['Shift-2']]
        });
  
  var branchstore = new Ext.data.ArrayStore({
		fields: ['branch_id', 'branch_name'],
		data: Ext.student.branch
  	}); 
	
  var semesterstore = new Ext.data.ArrayStore({
		fields: ['semester_id', 'semester_name'],
		data: Ext.student.semester
  	}); 
	
	var caststore = new Ext.data.ArrayStore({
    	fields:['student_cast'],
		data: Ext.student.cast
	});	  
	
	var divisionstore = new Ext.data.ArrayStore({
    	fields:['division_id','division_name'],
		data: Ext.student.division
	});	   

	




   var studententry = new Ext.FormPanel({
        labelWidth: 110,
		url:'save-inquiry-form.php?ID=<?php echo $student_id ; ?>',
		method:'post',
		frame:true,
		autoHeight:true,       
		 fileUpload: true, 
        bodyStyle:'padding:5px 5px',
	//	layout:'accordion',
		items:[
		{		xtype:'fieldset', 
		       title: 'Admission Details',
			   collapsible: true,
    		   collapsed  : false,
			   forceLayout:true, 
			   autoHeight : true,
			   layout : 'column',
     	    	   items: [{columnWidth: .5,
                            layout:'form',	
							labelWidth:130,				
							items:[
							{		
										xtype: 'lovcombo',
										name: 'branch_id',
										id:'branch_id',
										hiddenName: 'branch_hidden',
										labelSeparator:'',	
										fieldLabel :'Branch :<span class="comp">*</span>' ,
										forceSelection:true,				
										displayField:'branch_name',
										valueField: 'branch_id'
										,allowBlank: false
										,triggerAction:'all'
										,mode:'local'
										,store: branchstore
										,lastQuery:''
										,width:170
										,selectOnFocus: true,
										tabIndex:1,
										listeners:{'select': function(cmb, rec, idx){
												
												Ext.getCmp('branch_disp').setValue(this.getRawValue());
										}}
								   },
							{
											xtype:'textfield',
											name: 'reference',
											id:'reference',
											width:170,
											tabIndex:44,
											fieldLabel :'Reference<span class="comp">*</span>',
											tabIndex:2,
											allowBlank: true,
											readOnly:true,
											value:user_name
										  }	 ,  
								   
								   {
									   xtype: 'textfield',
									   name: 'branch_disp',
										 id:'branch_disp',
										 hidden:true
									 },
								   {  height:10
								   },
						 ]},
					  

			   ]},
			   {
			   	xtype: 'fieldset',
			  title: 'Last Education Details',
			  collapsible: true,
    		  collapsed: false,
			  forceLayout:true, 
			  autoHeight: true,			  
			  id:'lasteducetiondetails',  
			  autoHeight: true,
			  hideBorders: true,
			  layout: 'column',
			  items : [
			 
						 {			
									columnWidth: 1,
									layout:'column',	
									items:[
								{
										columnWidth: 0.30,
									labelWidth:90,	
									layout:'form',
										
									items:[{height:-1},
									{
													html:'<b>12th Detail</b>',       // My Label
													
												},
										] 
								  },
								 
								 
								  
								  ]
						},
						{			
									columnWidth: 1,
									layout:'column',	
									items:[
									 {columnWidth: 0.20,
									labelWidth:60,	
                            		layout:'form',
									items:[{height:10},
									
									{
											xtype:'textfield',
											name: 'twle_seat',
											width:70,
											tabIndex:3,
											fieldLabel :'Seat No<span class="comp">*</span>',
											
											allowBlank: true	
										  }
									
									
									] 
								  },
									
									{columnWidth: 0.25,
									labelWidth:60,	
									layout:'form',
									
									items:[{height:10},
										{
											xtype:'textfield',
											name: 'twle_total_mark',
											labelSeparator:'',	
											fieldLabel :'Total :<span class="comp">*</span>',
											width:70,
											tabIndex:4,
											
											allowBlank: true	
									}										
										  
										  ] 
								  },{columnWidth: 0.25,
									labelWidth:90,	
                            		layout:'form',
									items:[{height:10},
									
									{
											xtype:'textfield',
											name: 'obtain_mark',
											width:60,
											tabIndex:5,
											fieldLabel :'Obtain Mark <span class="comp">*</span>',
											
											allowBlank: true	
									}
										  
										  ] 
								  },{columnWidth: 0.30,
									labelWidth:95,	
                            		layout:'form',
									items:[{height:10},
									{
											xtype:'textfield',
											name: 'twle_percentage',
											width:70,
											tabIndex:6,
											fieldLabel :'Percentage<span class="comp">*</span>',
											allowBlank: true	
									}
										  
										  ] 
								  },
								  
								  
								  
								  ]
						},
						
						

							{			
									columnWidth: 1,
									layout:'column',	
									items:[
									 {columnWidth: 0.25,
									labelWidth:70,	
                            		layout:'form',
									items:[{height:10},									
									{
											xtype:'textfield',
											name: 'twle_maths',
											width:70,
											tabIndex:7,
											fieldLabel :'Maths<span class="comp">*</span>',
											allowBlank: true	
										  }
									] 
								  },
									{columnWidth: 0.25,
									labelWidth:70,	
									layout:'form',
									items:[{height:10},
										{
											xtype:'textfield',
											name: 'twle_chemistry',
											labelSeparator:'',	
											fieldLabel :'Chemistry :<span class="comp">*</span>',
											width:70,
											tabIndex:8,
											allowBlank: true	
										}										  
										  ] 
								  },{columnWidth: 0.25,
									labelWidth:70,	
                            		layout:'form',
									items:[{height:10},
									{
											xtype:'textfield',
											name: 'twle_physics',
											width:60,
											tabIndex:9,
											fieldLabel :'Physics <span class="comp">*</span>',
											allowBlank: true	
									}
										  ] 
								  },
								  {columnWidth: 0.25,
									labelWidth:70,	
                            		layout:'form',
									items:[{height:10},
									{
											xtype:'textfield',
											name: 'twle_other',
											width:70,
											tabIndex:10,
											fieldLabel :'Other<span class="comp">*</span>',
											allowBlank: true	
									}	  
										  ] 
								  },
								  ]
						},
						{			
									columnWidth: 1,
									layout:'column',	
									items:[
								{
										columnWidth: 0.25,
									labelWidth:90,	
									layout:'form',
										
									items:[{height:-1},
									{
													html:'<b>Gujcet</b>',       // My Label
													
												},
									
									{
											xtype:'textfield',
											name: 'gujcet_seat',
											labelSeparator:'',	
											fieldLabel :'Seat No :<span class="comp">*</span>',
											width:70,
											tabIndex:11,
											
											allowBlank: true	
										  }		
									
										] 
								  },{columnWidth: 0.25,
									labelWidth:90,	
                            		layout:'form',
									items:[{height:10},
									
																		{
											xtype:'textfield',
											name: 'gujcet_physics',
											width:60,
											tabIndex:12,
											fieldLabel :'Physics <span class="comp">*</span>',
											
											allowBlank: true	
										  }
									

										  ] 
								  },{columnWidth: 0.25,
									labelWidth:70,	
                            		layout:'form',
									items:[{height:10},
									
									{
											xtype:'textfield',
											name: 'gujcet_chemistry',
											width:70,
											tabIndex:13,
											fieldLabel :'Chemistry<span class="comp">*</span>',
											
											allowBlank: true	
									}
									
									
									] 
								  },
								 
								 {columnWidth: 0.25,
									labelWidth:70,	
                            		layout:'form',
									items:[{height:10},
									
									{
											xtype:'textfield',
											name: 'gujcet_maths',
											width:70,
											tabIndex:14,
											fieldLabel :'Maths<span class="comp">*</span>',
											
											allowBlank: true	
									}
									
									
									] 
								  },
								  
								  ]
						},
						
						{			
									columnWidth: 1,
									layout:'column',	
									items:[
									 {columnWidth: 0.33,
									labelWidth:115,	
                            		layout:'form',
									items:[{height:10},									
									{
											xtype:'textfield',
											name: 'gujcet_total',
											width:70,
											tabIndex:15,
											fieldLabel :'Total<span class="comp">*</span>',
											allowBlank: true	
										  }
									] 
								  },
									{columnWidth: 0.33,
									labelWidth:105,	
									layout:'form',
									items:[{height:10},
										{
											xtype:'textfield',
											name: 'gujcet_obtain',
											labelSeparator:'',	
											fieldLabel :'Obtain :<span class="comp">*</span>',
											width:70,
											tabIndex:16,
											allowBlank: true	
										}										  
										  ] 
								  },{columnWidth: 0.33,
									labelWidth:100,	
                            		layout:'form',
									items:[{height:10},
									{
											xtype:'textfield',
											name: 'gujcet_percentage',
											width:60,
											tabIndex:17,
											fieldLabel :'Percentage <span class="comp">*</span>',
											allowBlank: true	
									}
										  ] 
								  },
								  
								  ]
						},
						
						{			
									columnWidth: 1,
									layout:'column',	
									items:[
								{
										columnWidth: 0.25,
									labelWidth:90,	
									layout:'form',
										
									items:[{height:-1},
									{
													html:'<b>JEE</b>',       // My Label
													
												},
									
									{
											xtype:'textfield',
											name: 'jee_seat',
											labelSeparator:'',	
											fieldLabel :'Seat No :<span class="comp">*</span>',
											width:70,
											tabIndex:18,
											
											allowBlank: true	
										  }		
									
										] 
								  },{columnWidth: 0.25,
									labelWidth:90,	
                            		layout:'form',
									items:[{height:10},
									
																		{
											xtype:'textfield',
											name: 'jee_physics',
											width:60,
											tabIndex:19,
											fieldLabel :'Physics <span class="comp">*</span>',
											
											allowBlank: true	
										  }
									

										  ] 
								  },{columnWidth: 0.25,
									labelWidth:70,	
                            		layout:'form',
									items:[{height:10},
									
									{
											xtype:'textfield',
											name: 'jee_chemistry',
											width:70,
											tabIndex:20,
											fieldLabel :'Chemistry<span class="comp">*</span>',
											
											allowBlank: true	
									}
									
									
									] 
								  },
								 
								 {columnWidth: 0.25,
									labelWidth:70,	
                            		layout:'form',
									items:[{height:10},
									
									{
											xtype:'textfield',
											name: 'jee_maths',
											width:70,
											tabIndex:21,
											fieldLabel :'Maths<span class="comp">*</span>',
											
											allowBlank: true	
									}
									
									
									] 
								  },
								  
								  ]
						},
						{			
									columnWidth: 1,
									layout:'column',	
									items:[
									 {columnWidth: 0.33,
									labelWidth:115,	
                            		layout:'form',
									items:[{height:10},									
									{
											xtype:'textfield',
											name: 'jee_total',
											width:70,
											tabIndex:22,
											fieldLabel :'Total<span class="comp">*</span>',
											allowBlank: true	
										  }
									] 
								  },
									{columnWidth: 0.33,
									labelWidth:105,	
									layout:'form',
									items:[{height:10},
										{
											xtype:'textfield',
											name: 'jee_obtain',
											labelSeparator:'',	
											fieldLabel :'Obtain :<span class="comp">*</span>',
											width:70,
											tabIndex:23,
											allowBlank: true	
										}										  
										  ] 
								  },{columnWidth: 0.33,
									labelWidth:100,	
                            		layout:'form',
									items:[{height:10},
									{
											xtype:'textfield',
											name: 'jee_percentage',
											width:60,
											tabIndex:24,
											fieldLabel :'Percentage <span class="comp">*</span>',
											allowBlank: true	
									}
										  ] 
								  },
								  
								  ]
						},

			]
			  },
			
		      {
			  xtype: 'fieldset',
			  title: 'Personal Details',
			  collapsible: true,
    		  collapsed: false,
			  forceLayout:true, 
			 
			//  id:'personaldetails',  
			  autoHeight: true,
			 // hideBorders: true,
			  layout: 'column',
		      items : [{columnWidth: 1,
                              collapsible: true,
							collapsed: false,
							forceLayout:true, 
							layout:'column',	
							items:[{columnWidth: 0.40,
									labelWidth:95,	
                            		layout:'form',
									items:[{height:10},{
											xtype:'textfield',
											name: 'student_surname',
											labelSeparator:'',	
											fieldLabel :'Student Name :<span class="comp">*</span>',
											width:170,
											tabIndex:25,
											emptyText:'Surname',
											allowBlank: false	
										  }] 
								  },{columnWidth: 0.28,
									labelWidth:1,	
                            		layout:'form',
									items:[{height:10},{
											xtype:'textfield',
											name: 'student_firstname',
											width:180,
											tabIndex:26,
											emptyText:'First Name',
											allowBlank: false	
										  }] 
								  },{columnWidth: 0.30,
									labelWidth:1,	
                            		layout:'form',
									items:[{height:10},{
											xtype:'textfield',
											name: 'student_lastname',
											width:170,
											tabIndex:27,
											emptyText:'Last Name',
											allowBlank: false	
										  }] 
								  }]
						},
					   {columnWidth: 0.4,
						labelWidth:95,	
                        layout:'form',
						items:[{height:10},
							    {
											xtype: 'textfield',
											name: 'student_mother',
											id:'student_mother',
											labelSeparator:'',	
											fieldLabel :'Mother : <span class="comp">*</span>' ,
											forceSelection:true,				
											width: 160,
											allowBlank: false,
											triggerAction:'all',
											mode:'local',
											//store: genderstore,
											tabIndex:28
								},
							    {
											xtype: 'combo',
											name: 'student_gender',
											id:'student_gender',
											labelSeparator:'',	
											fieldLabel :'Gender: <span class="comp">*</span>' ,
											forceSelection:true,				
											displayField:'gender',
											valueField: 'gender',
											allowBlank: false
											,triggerAction:'all'
											,mode:'local'
											,store: genderstore
											,width:160
											,selectOnFocus: true,
											tabIndex:29
								},
						 		{
											xtype: 'combo',
											name: 'student_category',
											id:'student_category',
											labelSeparator:'',	
											fieldLabel :'Category:',
											forceSelection:true,				
											displayField:'category',
											valueField:'category',
											width: 160,	
											allowBlank:false,
											triggerAction:'all',
											mode:'local',
											store: categorystore,
											tabIndex:30
								},
							  
								{	
										 xtype: 'textarea',
										 name: 'student_address',
										 id: 'student_address',
										 width:160,
										 labelSeparator:'',	
										 fieldLabel :'Address: ' ,
										allowBlank:false,
										tabIndex:31
							     },
							    
							   ] 
						},
						{columnWidth: 0.4,
						labelWidth:90,	
                        layout:'form',
						items:[{height:10},
						{	
												 xtype: 'textfield',
												 name: 'occupation',
												 id: 'occupation',
												 width:150,
												  tabIndex:32,
												 labelSeparator:'',	
												 fieldLabel :'Occupation: ' ,
												 allowBlank:true,
												 
						},
						 		{	
										 xtype: 'datefield',
										 name: 'student_birthdate',
										 id: 'student_birthdate',
										 width:150,
										 tabIndex:33,
										 labelSeparator:'',	
										 format:JSDateFormat,
										 fieldLabel :'Birth Date :<span class="comp">*</span>' ,
										 vtype: 'daterange',
										 allowBlank: true
							     },
										   {	
												 xtype: 'textfield',
												 name: 'student_phoneo',
												 id: 'student_phoneo',
												 width:150,
												  tabIndex:34,
												 labelSeparator:'',	
												 fieldLabel :'Phone(O): ' ,
												 allowBlank:true,
												 autoCreate: {tag: 'input', type: 'text',  maxlength: '13'}
															,enableKeyEvents: true
															,listeners:{
																keyup: validphoneno
															}
										 },{	
												 xtype: 'textfield',
												 name: 'student_phoner',
												 id: 'student_phoner',
												 width:150,
												  tabIndex:35,
												 labelSeparator:'',	
												 fieldLabel :'Phone(R): ' ,
												 allowBlank:true,
												 autoCreate: {tag: 'input', type: 'text',  maxlength: '13'}
															,enableKeyEvents: true
															,listeners:{
																keyup: validphoneno
															}
										 },
								 ] 
						},

					  ]
			},
			
		   
			]
	
	 });	 

	var StudentWindow = new Ext.Window({
        title: 'Student Inquiry Form',
		width:750,		
		height:460,
		modal:true,
		autoHeight:true,
		shadow: false,
		border: false,
		layout: 'fit',
		closeAction:'close',
		collapsible:true,
		items: studententry,
		buttonAlign: 'center',
	    buttons: [ {
            text: 'Save',
			tabIndex:88,
			iconCls:'icon-save',		
			handler: function () {

					studententry.getForm().submit({
					waitMsg: 'Saving...',		
					success: function () {	
					
						Ext.MessageBox.show({
							title: 'Message',
							msg: 'Data has been saved..',
							buttons: Ext.MessageBox.OK,
							icon:Ext.MessageBox.INFO
						});
						studententry.getForm().reset();
						
						document.getElementById('upload_results').innerHTML ='<img src="images/webcamsend.png" id="images/webcamsend.png" "Width="100px" height="100px"">';
						
						if(formMode=='edit'){
							window.location = 'manage-student.php'; 
						}
						Ext.getDom('pic').src = '<?php print $StudentImagePath.$SiteDefaultImage; ?>';
						
					},
					failure: function () {	
						
								Ext.MessageBox.show({
									   title: 'Error',
									   msg: 'Please fill complete form!',
									   buttons: Ext.MessageBox.OK,
									   icon:Ext.MessageBox.ERROR
				                      });
			
					      if(formMode=='edit')
							  {
								studententry.getForm().findField('sectionid_id').disable(); 
								studententry.getForm().findField('grno').disable();
  							  }
					}
				});
			
			}
          },
		           {
            text: 'Reset',
			tabIndex:89,
			iconCls:'icon-reset',
			handler: function () {
							
			  if(formMode!='edit')
			  {
  			  		studententry.getForm().reset();							   
					Ext.getDom('pic').src = '<?php print $StudentImagePath.$SiteDefaultImage; ?>';
			  }
			  Ext.getCmp('branch_id').focus(true,1000);
		
			}
        },
	 	           {
            text: 'Close',
			iconCls:'icon-close',
			tabIndex:90,
			handler: function () {
				StudentWindow.close();
			}
        }
		         ]

	});
	
	
	
		studententry.getForm().findField('obtain_mark').on('blur',function (){
	
		var twle_total_mark =studententry.getForm().findField('twle_total_mark').getValue();
		
		var obtain_mark =studententry.getForm().findField('obtain_mark').getValue();
		
	
	var total_mark=(obtain_mark * 100);
	
	var per = total_mark/twle_total_mark ; 
	
	var set =studententry.getForm().findField('twle_percentage').setValue(per);
		
	});
	
	
	
	
		studententry.getForm().findField('gujcet_total').on('blur',function (){
	
		var gujcet_physics =Number(studententry.getForm().findField('gujcet_physics').getValue());
		var gujcet_chemistry =Number(studententry.getForm().findField('gujcet_chemistry').getValue());
		var gujcet_maths =Number(studententry.getForm().findField('gujcet_maths').getValue());

		
		var total = gujcet_physics + gujcet_chemistry + gujcet_maths ;
		var settotal =studententry.getForm().findField('gujcet_obtain').setValue(total);
	
		var gujcet_total =Number(studententry.getForm().findField('gujcet_total').getValue());
	
	var total_mark=(total * 100);
	
	var per = total_mark/gujcet_total ; 
	
	var set =studententry.getForm().findField('gujcet_percentage').setValue(per);
		
	});
	
	
	
	
	
	var varWidth =  (screen.width - StudentWindow.width)/2;
	StudentWindow.setPosition(varWidth,((screen.height/4)-180));
	StudentWindow.show();
	
	
	
	
	
	
	var inquiryForm = new Ext.FormPanel({
        frame: true,
		bodyStyle: 'padding:5px',
		autoHeight: true,
			fileUpload: true,   
		width:350,	
			defaults: {
            border: false
           },	
            items: [
			    {
					columnWidth: 1,
					layout: 'column',
					labelWidth:60,
					items:[{
							columnWidth:0.7,
							layout: 'form',	
							items:[{ 
					   		xtype: 'textfield',
							labelSeparator:'',
				            fieldLabel: 'Password :<span class="comp"></span>',
				            name: 'pass',
							 id: 'pass',
							inputType:'password',
							width:150,
							listeners: {
							specialkey: function(f,e){
								if (e.getKey() == e.ENTER){
									winserial.hide();
									
									
									//alert(Ext.getCmp('pass').getValue());
									var pass =Ext.getCmp('pass').getValue();
									var pass1='<?php echo $FeesAdminPassword ?>';
									if(pass == pass1)
										flag=0;
									else 
										flag=1;
								
								if(flag==0)
								{
									
								}
								else
								{
									if(Ext.getCmp('fees_flag').getValue()==1)
										{
										fflag=1;
										Ext.getCmp('fees_flag').setValue(false);
										
										}
									else
										{
										fflag=1;
										Ext.getCmp('fees_flag').setValue(true);
										
										}
									alert('sorry,Wrong Password!');
									flag=0;
								}
								
								}
							}
						}
							
						   					
					   }]
						  },
					 	{
							columnWidth:0.3,
							layout: 'form',	
							labelWidth:0.1,
							
							items:[{
								xtype:'button',
								text: 'Enter', 
								name:'btnEnter',
								iconCls:'icon-save',
								id:'btnEnter',
								handler: function(){
									winserial.hide();
									
									
									//alert(Ext.getCmp('pass').getValue());
									var pass =Ext.getCmp('pass').getValue();
									var pass1='<?php echo $FeesAdminPassword ?>';
									if(pass == pass1)
										flag=0;
									else 
										flag=1;
								
								if(flag==0)
								{
									
								}
								else
								{
									if(Ext.getCmp('fees_flag').getValue()==1)
										{
										fflag=1;
										Ext.getCmp('fees_flag').setValue(false);
										
										}
									else
										{
										fflag=1;
										Ext.getCmp('fees_flag').setValue(true);
										
										}
									alert('sorry,Wrong Password!');
									flag=0;
								}
								
								}
						
			 						}]
						}]
				}
			
			           ]
    });	
	var winserial = new Ext.Window({
				title: 'Enter password',
				layout: 'fit',
				modal:true,
				closeAction:'hide',
				autoHeight: true,
				autoDestroy :true,
				items: inquiryForm
	});

	if(formMode=='edit'){<?php 
		$student_address = replaceSpecial($student_address);
		$student_remarks  = replaceSpecial($student_remarks); ?>
	  	
		Ext.getDom('pic').src = '<?php print $StudentImagePath.$student_photo; ?>';
	   	studententry.getForm().findField('branch_id').setValue(<?php echo $cur_branchid; ?>);					
		studententry.getForm().findField('semester_id').setValue(<?php echo $cur_semesterid; ?>);
			<?php
		if($cur_mysem != '1')	
		{?>
	//		Ext.getCmp('branch_id').disable();
	//		Ext.getCmp('semester_id').disable();
	<?php	}	?>						
//	studententry.getForm().findField('allsem').setValue('<?php echo $allsem ; ?>');
	
		studententry.getForm().findField('student_mother').setValue('<?php echo $student_mother ; ?>');
	

		studententry.getForm().findField('student_formno').setValue('<?php echo $student_formno ; ?>');
		studententry.getForm().findField('student_surname').setValue('<?php echo $student_surname ; ?>');
		studententry.getForm().findField('student_firstname').setValue('<?php echo $student_firstname ; ?>');
		studententry.getForm().findField('student_lastname').setValue('<?php echo $student_lastname ; ?>');
		studententry.getForm().findField('student_category').setValue('<?php echo $student_category ; ?>');
	
		studententry.getForm().findField('student_gender').setValue('<?php echo $student_gender ; ?>');
	
		studententry.getForm().findField('student_birthdate').setValue('<?php echo $student_birthdate ; ?>');
		studententry.getForm().findField('student_category').setValue('<?php echo $student_category ; ?>');
	
		
	}
	else
	{
	
	//Ext.getCmp('fees_flag').setValue('0');
	}
	if(Ext.getCmp('fees_flag').getValue()==0)
		{
			fflag=0;
		}
	Ext.getCmp('branch_id').focus(true,1000);
	
	

	
	
});
</script>


 
	  
    
	</script>
    
<div align="center"><div id="abcd" align="left"></div></div> 
</div> 
<?php require "_footer.php";?>
