Current File : /home/inlingua/www/icentex/addcertificate3.php |
<?php
session_start();
ob_start();
// Copyright, Panalink Infotech Limited. Created on: 09-07-2010
// Include the database connection details
require('dbConnection.php');
// Include common functions
require('commonFunc.php');
// Include common functions
require('globalVars.php');
// Setup table name, configuration and data entry form
$tableName = "level_3";
$tableConf = $tableName . ".conf.php";
$dataForm = $tableName . ".form.php";
$viewForm = $tableName . ".view.php";
// Include table configuration details
require($tableConf);
// Include the table handler class
require('dbHandler.class.php');
$dbObject = new dbHandler();
$dbObject->setTableName($tableName);
$dbObject->setDbFieldList($dbFieldList);
$dbObject->setKeyFieldName("recNo");
$dbObject->connect();
// Retrieve parameters from request
$dbObject->getDbFieldsFromRequest();
function checkstudent($id)
{
$sqlQuery = "SELECT recNo FROM level_1 where student_recNo='".$id."' ";
//echo $sqlQuery;
$result=mysqli_query($conn,$sqlQuery) or die();
if(mysqli_num_rows($result)) $return =false;
else $return =true;
return $return;
}
$action = $_REQUEST['aC'];
if($action=="Save")
{
$recNo=0;
$language=$_REQUEST[language];;
$courseId=$_REQUEST[courseId];
$student_recNo=$_REQUEST[studeid];
$level=$_REQUEST[level];
$startDate=$_REQUEST[startDate];
$endDate=$_REQUEST[endDate];
$name_student=addslashes($_REQUEST[name_student]);
$cerification_comment="This is to certify that {STUDENT_NAME} completed the GPP".$level." course on the above dates and can communicate effectively in English at this level. General grades are shown below.";
$cerification_comment=str_replace('{STUDENT_NAME}',"<strong>".ucfirst($name_student)."</strong>",$cerification_comment);
$useStructures=addslashes($_REQUEST[useStructures]);
$pronFluency=addslashes($_REQUEST[pronFluency]);
$listening_skill=addslashes($_REQUEST[listening_skill]);
$lexical_skill=addslashes($_REQUEST[lexical_skill]);
$general_comment=addslashes($_REQUEST[general_comment]);
$general_comment=addslashes(str_replace('{STUDENT_NAME}',"<strong>".ucfirst($name_student)."</strong>",$general_comment));
$overall_grade=addslashes($_REQUEST[overall_grade]);
$eligibility=addslashes($_REQUEST[eligibility]);
$othereligibility=addslashes($_REQUEST[othereligibility]);
$createdBy=$_SESSION[id];;
$createDate=date("Y-m-d H:i:s");;
$dbObject->setDbField("recNo",$recNo);
$dbObject->setDbField("language",$language);
$dbObject->setDbField("courseId",$courseId);
$dbObject->setDbField("level",$level);
$dbObject->setDbField("startDate",$startDate);
$dbObject->setDbField("endDate",$endDate);
$dbObject->setDbField("name_student",$name_student);
$dbObject->setDbField("cerification_comment",$cerification_comment);
$dbObject->setDbField("useStructures",$useStructures);
$dbObject->setDbField("pronFluency",$pronFluency);
$dbObject->setDbField("listening_skill",$listening_skill);
$dbObject->setDbField("lexical_skill",$lexical_skill);
$dbObject->setDbField("general_comment",$general_comment);
$dbObject->setDbField("overall_grade",$overall_grade);
$dbObject->setDbField("eligibility",$eligibility);
$dbObject->setDbField("othereligibility",$othereligibility);
$dbObject->setDbField("createdBy",$createdBy);
$dbObject->setDbField("createDate",$createDate);
$dbObject->setDbField("student_recNo",$student_recNo);
if($name_student!="")
{
$dbObject->Save();
echo "<font color='#99CCFF'><b>Details of ".$name_student." Saved successfully.</b></font>";
}
}
?>