Current File : /home/inlingua/public_html/noida/icentex/admin_cert/ingl_student.form.php |
<?php
// Copyright, Panalink Infotech Limited. Created on: 27-11-2010
// Include header
include "header_cert.php";
?>
<style type="text/css">
#h1 {width:2%; height:23px; text-align:left; float:left; border: #F0F0F0 solid 1px;}
#h2 {width:35%; height:23px; text-align:left; float:left; border:#F0F0F0 solid 1px;}
#h3 {width:35%; 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;}
</style>
<h3> Students</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_cert.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>
<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
//$query="select * from ingl_course order by courseid";
if($currentMode!="Add")
{
if($currentdate > $check_enddate['enddate'])
{
$query="select * from ingl_course order by courseid";
}
else
{
$query="select * from ingl_course where enddate>='".$currentdate."' order by courseid";
}
}
if($currentMode=="Add")
{
$query="select * from ingl_course where enddate>='".$currentdate."' 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"> <b>Student Name</b><br>
</div>
<div id="h3"> <b>Login Id</b></div>
<div id="h4"> </div>
<br>
</div>
<div align="center" style=" width:100%;">
<div id="h1"> <br>
</div>
<div id="h2"><input type='text' name='studentName[]' id='studentName'/><br>
</div>
<div id="h3"><input type='text' name='login[]' id='login' /></div>
<input type='hidden' name='password[]' value="<?php echo randompassword();?>" id='password' />
<div id="h4"> </div>
<br>
</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>
<?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_cert.php";
?>