| Current Path : /var/www/html/venkat/check/ |
| Current File : //var/www/html/venkat/check/copyindex.php |
<?php
?>
<html>
<body bgcolor="#F0F8FF"> <center>
<h2> <font color="blue"> Similarity Details</font> </h2>
<form enctype="multipart/form-data" name="r" action="copyindex.php" method="post">
<table width="35%" height="15%" cellspacing="1" cellpadding="1" border="1">
<tr>
<td>
Choose the section You belongs to
</td>
<td>
<select name="section">
<option value="sec_a">Section: A</option>
<option value="sec_b">Section: B</option>
<option value="sec_c">Section: C</option>
<option value="rgiit">Section: RGIIT</option>
</select>
</td>
</tr>
</tr>
<tr>
<td>
<input type="submit" value="Submit">
</td>
<td>
</td>
</tr>
</table>
</center> </body>
</html>
<?php
if($_POST["section"])
{
$section = $_POST["section"];
$section1 = $section."copy.txt";
$result = shell_exec("sort -f $section1");
$result = explode("\n", $result);
$sectionU = strtoupper($section);
$i = 0;
echo "<h3> <center> <font color='red'> ". $sectionU. "</font> </color> </h3>";
echo "<table width='40%' height = '35%' align ='center' border='1'>";
echo "<tr> <td> <center><b>Sl. No. </b> </center> </td>";
echo "<td> <center> <b> File Name </b> </center> </td>";
// echo "<td> <center> <b> Output </b> </center> </td>";
echo "<td> <center> <b> Copied from </b> </center> </td>";
echo "<td> <center> <b> Match % </b> </center> </td>";
while ($result[$i])
{
$result1 =explode('|', $result[$i]);
$j = $i+1;
$result1[0]= trim(preg_replace('/\s+/','', $result1[0]));
$section2 = $section.":".$result1[0];
$k = 1;
$percdisplay = "";
$rolldisplay = "";
while(isset($result1[$k]))
{
$result12 =explode(':', $result1[$k]);
$k++;
$rollno[$k][0]= $result12[0];
$rollno[$k][1]= $result12[1];
$rollno[$k][0]= trim(preg_replace('/\s+/','', $rollno[$k][0]));
$section2 = $section2."|".$rollno[$k][0];
$rolldisplay = $rolldisplay . $rollno[$k][0]."<br>";
$percdisplay = $percdisplay . $rollno[$k][1]."<br>";
}
echo "<tr> <td> <center> ".$j." </center> </td>";
echo "<td><a href = 'copymain.php?match=$section2' target='_blank'>". $result1[0]. "</td>";
echo "<td>".$rolldisplay."</td>";
echo "<td> <center> ". $percdisplay." </center> </td>";
echo "</tr>";
$i++;
}
echo "</table><br><center> <img src = 'file/$section/graph.png'></center>";
}
?>