<td align="center"><input class="btn btn-success" type="submit" value="Open Form" id="OpenForm"></form></td></tr> </table></div> <div id="feedback_status" align="center"> <table class="table table-bordered table-condensed" style="width: auto;"> <th colspan=2 bgcolor="#06D206">Feedback Completed Subjects (<?php echo $completed_count; ?> /<?php echo --$n; ?> )</th> <?php //Show the subjects whose feedbacks have been completed $n = 1; while ($allocation["Data{$n}"]) { $FacID = strtolower(stripFacEmpCode($allocation["Data{$n}"])); //echo $FacID; $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); $row = mysql_fetch_assoc($res); if ($row['SubStat'] == 1) { echo "<tr><td>" . getSubname(stripSubcode($allocation["Data{$n}"])) . "</td><td align=right><span class=\"glyphicon glyphicon-ok-sign\" style=\"color:#06D206\"></span></td></tr>"; } $n = $n + 1; } ?> </table> </div>
//connect to database and load startup row $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 `table_data` WHERE ID='Startup'"; $res = mysql_query($qry); if (!mysql_query($qry, $bd)) { die("An unexpected error occured while saving the record, Please try again!"); } $Startup = mysql_fetch_assoc($res); $status = $Startup['Data1']; if ($status == 0) { header("location: index.php?e=1"); } $Subject = getSubName(stripSubCode($Allocation)); $FacName = getFacName(stripFacEmpCode($Allocation)); $FacCode = strtolower(stripFacEmpCode($Allocation)); $ClientIP = HashString($_SERVER['REMOTE_ADDR']); //echo $_SERVER['REMOTE_ADDR'];echo "<br>"; //echo $ClientIP; //echo $Subject; //echo $FacName;echo "<br>"; //echo $FacCode; //Create a new table if the table doesn't exists $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"); if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . $FacCode . "'")) == 0) { $query = "CREATE TABLE {$FacCode} LIKE `table_dummyfac`"; //$res=mysql_query($query); if (!mysql_query($query)) { die("An unexpected error occured while creating the new table"); }
<?php require_once '../CoreLib.php'; $reqClassID = $_POST['classID']; //loading faculty allocations //**************** USING THE NEW MYSQLI FUNCTIONS***************************** $db = new mysqli($mysql_hostname, $mysql_user, $mysql_password, $mysql_database); if ($db->connect_errno > 0) { die('<br>Unable to connect to database [' . $db->connect_error . ']</br>'); } $sql = "SELECT * FROM `table_data` WHERE ID='{$reqClassID}'"; //echo $sql; if (!($result = $db->query($sql))) { die('<br>Unable to execute the SQL Query [' . $db->error . ']</br>'); } $subFacMappings = $result->fetch_assoc(); $i = 1; while ($subFacMappings['Data' . $i]) { $facEmpID = stripFacEmpCode($subFacMappings['Data' . $i++]); echo "<br>"; } echo "<pre>"; print_r($subFacMappings); echo "</pre>"; //header("location: home.php?select=reportsTab&emailReportSuccess=no&emailReportClass=".$_POST['classID']."");
$facSubMapData["sub"]["5"]["subDep"] = getSubDep(stripSubCode($row['Data5'])); $facSubMapData["sub"]["5"]["subFacName"] = getFacName(stripFacEmpCode($row['Data5'])); $facSubMapData["sub"]["5"]["subSubName"] = getSubName(stripSubCode($row['Data5'])); if ($row['Data6'] != NULL) { $facSubMapData["sub"]["6"]["subDep"] = getSubDep(stripSubCode($row['Data6'])); $facSubMapData["sub"]["6"]["subFacName"] = getFacName(stripFacEmpCode($row['Data6'])); $facSubMapData["sub"]["6"]["subSubName"] = getSubName(stripSubCode($row['Data6'])); } if ($row['Data7'] != NULL) { $facSubMapData["sub"]["7"]["subDep"] = getSubDep(stripSubCode($row['Data7'])); $facSubMapData["sub"]["7"]["subFacName"] = getFacName(stripFacEmpCode($row['Data7'])); $facSubMapData["sub"]["7"]["subSubName"] = getSubName(stripSubCode($row['Data7'])); } if ($row['Data8'] != NULL) { $facSubMapData["sub"]["8"]["sub8Dep"] = getSubDep(stripSubCode($row['Data8'])); $facSubMapData["sub"]["8"]["sub8FacName"] = getFacName(stripFacEmpCode($row['Data8'])); $facSubMapData["sub"]["8"]["sub8SubName"] = getSubName(stripSubCode($row['Data8'])); } header('Content-Type:application/json'); echo json_encode($facSubMapData, JSON_PRETTY_PRINT); } else { echo "Something Went Wrong while Getting Faculty List!"; } } //To Return Faculty List of a Department $mapClassDep = $_REQUEST['mapClassDep']; if ($mapClassDep != NULL) { $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"); //For Faculty List $query = "SELECT name,empcode FROM `table_faculty_info` WHERE dep='" . $mapClassDep . "'";