// Include the main TCPDF library (search for installation path). require_once 'tcpdf/tcpdf.php'; session_start(); date_default_timezone_set('Asia/Kolkata'); $Timestamp = date('d-m-Y h:i:s A'); //Main Logic Starts here if ($_SESSION['LoginStatus'] == 0 || $_SESSION['LoginStatus'] == NULL) { header("location: index.php"); exit; } if (!($_REQUEST['facID'] || $_REQUEST['classID'])) { header("location: ../error.php"); exit; } $FacID = strtolower($_POST['facID']); $FacName = GetFacName($_POST['facID']); $Class = $_POST['classID']; $ClassName = GetClassName($Class); //******************************************************************Generation of PDF Starts Here******************************************************* //****************************************************************************************************************************************************** $BUILDInfo = GetBUILD(); //set the name of the file generated; $Filename = $FacName . "-" . $ClassName . " (Feedback Report).pdf"; //$Filename=rawurlencode($Filename); //check for the feedbacks in the database if none found return back $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database"); mysql_select_db($mysql_database, $bd) or die("Could not select database"); $qry = "SELECT * FROM {$FacID} WHERE Class='" . $Class . "'"; $result = mysql_query($qry); $num = mysql_num_rows($result); if ($num == 0) {
<?php require_once './CoreLib.php'; date_default_timezone_set('Asia/Kolkata'); $Timestamp = date('d-m-Y h:i:s'); session_start(); $Class = $_SESSION['Class']; $ClientIP = HashString($_SERVER['REMOTE_ADDR']); $FacID = $_POST['FacID']; $FacName = GetFacName($FacID); if ($FacID == NULL) { header("location: error.php"); exit; } //echo $_POST['FacID']; //echo $_POST['21']; //echo $_SESSION['Class'];echo "<br>"; //echo $_POST['20'];echo "<br>"; //echo $ClientIP; //Check if questions were not answered if (!$_POST['1'] || !$_POST['2'] || !$_POST['3'] || !$_POST['4'] || !$_POST['5'] || !$_POST['6'] || !$_POST['7'] || !$_POST['8'] || !$_POST['9'] || !$_POST['10'] || !$_POST['11'] || !$_POST['12'] || !$_POST['13'] || !$_POST['14'] || !$_POST['15'] || !$_POST['16'] || !$_POST['17'] || !$_POST['18'] || !$_POST['19'] || !$_POST['20']) { echo "<div class=\"modal fade bs-example-modal-lg\" id=\"feedbackStatus\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel2\" aria-hidden=\"true\">\n\t\t\t\t\t<div class=\"modal-dialog\">\n\t\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t\t\t\t<h4 class=\"modal-title \" id=\"myModalLabel2\">Feedback Submission Status</h4>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"modal-body text-center\">\n\t\t\t\t\t\t\t\t\t<h2>Your Feedback</font> for <b>{$FacName}</b> <br>was not saved,<br> Since you haven't answered all the questions.</h2>\n\t\t\t\t\t\t\t\t\t<h1 style=\"color:red\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span></h1>\n\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t <div class=\"modal-footer\">\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-info\" data-dismiss=\"modal\">Try Again</button>\n\t\t\t\t\t\t<button type=\"button\" data-toggle=\"tooltip\" data-placement=\"right\" title=\"Goto Subject Lists Page\" onclick=\"location.href='startsession.php'\" class=\"btn btn-warning\">Go Back To Subjects List</button>\n\t\t\t\t\t </div>\n\t\t\t\t\t</div>\n\t\t\t\t </div>\n\t\t\t\t</div>"; goto end; } //Check if feedback was already submitted once $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database"); mysql_select_db($mysql_database, $bd) or die("Could not select database"); $qry = "SELECT * FROM {$FacID} WHERE ClientIP='" . $ClientIP . "' AND Class='" . $_SESSION['Class'] . "'"; $res = mysql_query($qry); if (!mysql_query($qry, $bd)) { die("An unexpected error occured while checking some things, Please try again!");