Ich möchte, wenn die Mitarbeiter auf die Anwendungsseite gehen, um die Liste der Anwendung von Studenten zu sehen. Es wird nur der Status von apply_status = 'PENDING' angezeigt. Status, der bereits zuvor genehmigt wurde, wird auf der Seite nicht angezeigt. ................................................. ...............................Zeilen nach Feldern in Mysql filtern
Dies ist mein Code, wenn nur der apply_status = 'PENDING' nur angezeigt wird auf der Seite. ... füge ich die if else Aussage hinzu ... aber funktioniert nicht. wenn mehrere apply_status = genehmigt sind. Es wird nicht die ausstehende angezeigt. Aber wenn es keinen apply_status = aprroved gibt. Es wird alle Anwendungen angezeigt.
<?php
include("connection.php");
$sql="SELECT * FROM application";
$record = mysqli_query($con, $sql) or die ("error".mysqli_error($con));
$apply = mysqli_fetch_assoc($record);
$status1 = $apply["apply_status"];
if ($status1 == "APPROVED") {
echo "<br>";
echo "No application from student yet.<br>";
echo "<br>";
}
else {
echo "<table border='1'><tr>
<td><strong>Student ID</strong></td>
<td><strong>Student Name</strong></td>
<td><strong>Kelompok</strong></td>
<td><strong>Block</strong></td>
<td><strong>Level</strong></td>
<td><strong>House</strong></td>
<td><strong>Status</strong></td>
</tr>";
$i=0;
while ($ww=mysqli_fetch_array($query))
{
if ($i%2==0)
$class="evenRow";
else
$class="oddRow";
$id=$ww[0];
$studentid=$ww[1];
$name=$ww[2];
$kelompok=$ww[8];
$block=$ww[9];
$level=$ww[10];
$house=$ww[11];
$status=$ww[14];
echo '<tr>
<input type="hidden" name="applyid['.$i.']" value="'.$id.'"/>
<td>'.$studentid.'</td>
<td>'.$name.'</td>
<td>'.$kelompok.'</td>
<td>'.$block.'</a></td>
<td>'.$level.'</td>
<td>'.$house.'</td>
<td>
<input type="checkbox" name="status['.$i.']" value="approved" checked> APPROVED <br>
</td>
</tr>';
$i++;
}
echo '</table>';
}
Ich denke, der Fehler bei der else if-Anweisung ist, aber ich weiß nicht, wie die apply_status zu unterscheiden = genehmigt und apply_status = anhängig.
'print_r ($ gelten);' und schauen in die Ausgabe gedruckt ... – Naga