Current File : /home/inlingua/public_html/icentex/admin_fd/ingl_student.form.php
<?php
// Copyright, Panalink Infotech Limited. Created on: 27-11-2010

// Include header
include "header_fd.php";
?>
<style type="text/css">
				  #h1   {width:2%; height:23px; text-align:left; float:left; border: #F0F0F0 solid 1px;}
				  #h2   {width:25%; height:23px; text-align:left; float:left; border:#F0F0F0 solid 1px;}
				  #h3   {width:25%; height:23px; text-align:left; float:left; border:#F0F0F0 solid 1px;}
				  #h4   {width:26%; height:23px; text-align:left; float:left; border:#F0F0F0 solid 1px;}
				  #h5   {width:20%; height:23px; text-align:left; float:left; border:#F0F0F0 solid 1px;}
      </style>
<h3>&nbsp;&nbsp;&nbsp;Add Student</h3>


<?php
$currentdate=date('Y-m-d');
if($currentMode!="Add")
{
 $qu="select enddate from ingl_course where recNo='".$dbObject->getDbField('courseId')."' ";
$re=mysqli_query($conn,$qu);
$check_enddate=mysqli_fetch_array($re);

}
echo '<h4>'.$succFailMesg.'</h4>'; 

// Show result of a form submission?
if ($showResult == "Y")
{	//echo "<br><a href='ingl_student.select.php'>Back</a><br>";
 $_SESSION[msgE]=$msgE;
   header("Location:ingl_student.select.php?courseId=".$_REQUEST[courseIdS]."&studentName=".$_REQUEST[studentNameS]."");
  // print_r($_SESSION);
   
  
	// Include footer
	include "footer_fd.php";
	echo"</div>";
	return; 
}
?>

<script language="javascript">
<!--
function validate(form) 
{	if (form.recNo.value=="")
	{	alert("recNo cannot be blank. Please enter it.");
		form.recNo.focus(); return false;
	}
	if (form.courseId.value=="")
	{	alert("Please select Course ID.");
		form.courseId.focus(); return false;
	}
	if (document.getElementById("studentName").value=="")
	{	alert("Student Name cannot be blank. Please enter it.");
		document.getElementById("studentName").focus(); return false;
	}
	
	if (document.getElementById("login").value=="")
	{	alert("Login id cannot be blank. Please enter it.");
		document.getElementById("login").focus(); return false;
	}
	return true;
}
-->
</script>
<script type="text/javascript" src="js/student.js"></script> 
<?php if($currentMode=="Add")
{?>

<table>
<tr>
<!--<td><input type="radio" class="Serch" name="Search" id="Name" value="Name"  onchange="invoice_customerSerch(this.value)"/>Name</td>-->
<td><input type="radio" class="Serch" name="Search" id="ref_No" value="ref_No" />Ref. No</td>
<td><input type="radio" class="Serch" name="Search" id="mobile_s" value="mobile" checked="checked" />Mobile</td>
<td><input type="radio" class="Serch" name="Search" id="Email" value="Email" />Email</td>
<td>
<input list="SerchOption" placeholder="Search" class="Searchtext" id="Browsers" onchange="invoice_customer(this.value)"><datalist id="SerchOption"  name="Browsers"></datalist>
</td></tr>
</table>

<?php } ?>
<form method='post' action='ingl_student.main.php' onsubmit="return validate(this)">
<input type='hidden' name='recNo' value="<?php echo $dbObject->getDbField('recNo');?>">
<input type='hidden' name='kV' value="<?php echo $_REQUEST['kV'];?>">
<div style="margin-left:10px;">
<table border='0' class='pa-nor' width="100%" >

<tr valign='top'><td>Course ID</td><td><?php 
if($currentMode!="Add")
{
if($currentdate > $check_enddate['enddate'])
{

 $query="select * from ingl_course where branch='".$_SESSION['branch']."' order by recNo desc";
}
else
{
$query="select * from ingl_course where branch='".$_SESSION['branch']."' and enddate>='".$currentdate."' order by recNo desc";
}
}

if($currentMode=="Add")
{
$query="select * from ingl_course where branch='".$_SESSION['branch']."'  order by recNo desc";  //and enddate>='".$currentdate."'
}
// $query="select * from ingl_course where branch='".$_SESSION[branch]."' order by courseid";
$res=mysqli_query($conn,$query);
if(mysqli_num_rows($res)>0)
{
echo "<select name='courseId' onchange='displaystudent(this.value)'>";
echo"<option value=''>Select Course ID</option>";
while($rsult=mysqli_fetch_array($res))
	{
	
	echo"<option value='".$rsult['recNo']."'" ;
	if($dbObject->getDbField('courseId')==$rsult['recNo'])
	{
	echo "selected";
	}
	echo">".$rsult['courseid']."</option>";
	}
	echo"</select>";
}
else
{
echo "Please enter the Course ID ";
}
?></td></tr>
<tr><td></td><td  id="student_display_id"></td></tr>

<?php
if($currentMode=="Add")
{
?>
<tr>
<td colspan="2">
<div id='myDiv' style="width:100%"><div align="center" style=" width:100%; background:#CCCCCC">
                <div id="h1"><br>
                </div>
                <div id="h2">&nbsp;<b>Student Name</b><br>
                </div>
                <div id="h3">&nbsp;<b>Email</b></div>				
				<div id="h4">&nbsp;</div>                
				<div id="h5">&nbsp;</div>                
                <br>
                </div>
                  <div align="center" style=" width:100%;">
                  <div id="h1">&nbsp;</div>
                  <div id="h2" ><input type='text' readonly="readonly" name='studentName[]'  id='studentName'/></div>
                  <div id="h3"><input  type='text' name='email[]' id='email' />
                   <input type="hidden"  name='ref_No[]' id='ref_No' />
                  <input type="hidden"  name='login[]' id='login' />
                  <input type="hidden"  name='mobile[]' id='mobile' />			
                  <input type='hidden' name='password[]' value="<?php echo  randompassword();?>" id='password' />	</div>				
                   <div id="h4">
                  <input type="checkbox" name="course_type[]" value="part1" /> Part A
                  <input type="checkbox" name="course_type[]" value="part2" /> Part B
                  <input type="checkbox" name="course_type[]" checked="checked" value="complete" /> Complete
				 
				 
				 </div>
				   
                  
				  <div id="h5">&nbsp;</div> 
 </div>				
				</div>
				<br />
				<input type="hidden" value="2" id="theValue" />
				<div id="sub"><a href='javascript:displayStu("1")'>Add New Student</a></div>
	<div id="sub1" style="display:none;"><font color="red">Please Wait</font></div>
</td>

</tr>
<?php
}
else
{
?>

<tr valign='top'><td width="23%">Student Name</td>
<td width="77%"><input type='text' name='studentName' value="<?php echo $dbObject->getDbField('studentName');?>" size='20' maxlength='250'></td></tr>
<tr valign='top'><td>Login Id</td><td><input type='text' name='login' value="<?php echo $dbObject->getDbField('login');?>" size='20' maxlength='250'></td></tr>
<tr valign='top'><td>Password</td><td><input type='text' name='password' value="<?php echo $dbObject->getDbField('password');?>" size='20' maxlength='250'></td></tr>
<tr valign='top'><td>Course Type</td><td>                  <input type="radio" name="course_type" value="part1" <?php if($dbObject->getDbField('course_type')=='part1') echo"checked='checked'"; ?> /> Part A
                  <input type="radio" name="course_type" value="part2" <?php if($dbObject->getDbField('course_type')=='part2') echo"checked='checked'"; ?> /> Part B
                  <input type="radio" name="course_type"  value="complete" <?php if($dbObject->getDbField('course_type')=='complete') echo"checked='checked'"; ?>/> Complete</td></tr>
<?php
}
?>



<tr valign='top'><td></td><td><input type='hidden' name='createdBy' value="<?php echo $_SESSION['id'] ;?>" size='20' maxlength='250'></td></tr>
<tr valign='top'><td></td><td><input type='hidden' name='createDate' value="<?php echo date('Y-m-d H:i:s');?>" size='19' maxlength='19'></td></tr>
<?php 
if($currentMode=="Add")
{
echo"<input type='hidden' name='branch' value='".$_SESSION['branch']."' size='19' maxlength='19'>";
}
else
{
echo"<input type='hidden' name='branch' value='".$dbObject->getDbField('branch')."' size='19' maxlength='19'>";
}
?>
<input type='hidden' name='courseIdS' value='<?php echo $_REQUEST['courseId']; ?>' size='19' maxlength='19'>

<input type='hidden' name='studentNameS' value='<?php echo $_REQUEST['studentName']; ?>' size='19' maxlength='19'>
<tr><td colspan='2'>
<?php if($currentMode=="Add")
{
echo"<input class='submit1' type='submit' name='aC' value='".$currentMode."'>";
}
else
{
if($currentdate > $check_enddate['enddate'])
{
echo"You cannot modify because course date has been ended";
}
else
{
echo"<input class='submit1' type='submit' name='aC' value='".$currentMode."'>";
}
}

?>
</td></tr>
</table>
</form>

</div>

<?php
// Include footer
include "footer_fd.php";
?>