{source}
<!-- You can place html anywhere within the source tags -->


<script language="javascript" type="text/javascript">
// You can place JavaScript like this

</script>
<?php

include $_SERVER['DOCUMENT_ROOT']."/Apps/db.php";

// Check connection

if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
// Change character set to utf8
mysqli_set_charset($con,"utf8");

$sql = "SELECT alumni.fid , faculties.fname_ar , faculties.Fid FROM alumni , faculties where alumni.fid=faculties.Fid group BY alumni.fid";
$result = $con->query($sql);

 

if ($result->num_rows > 0) {
// output data of each row
?>
<form method="post">


<?php

echo "<select name='price' id='mySelect'>";
echo "<option selected='selected' value=0>إختر الكلية</option>";

while($row = $result->fetch_assoc()) {
echo "<option value=" . $row["Fid"]. ">" . $row["fname_ar"]. "</option>";
}

echo "</select>
<input type='submit' value='بحث'>
</form>


";

} else {
//echo "0 results";
}
?>
<?php
if (isset($_POST['price'])) {
$facultyid= htmlspecialchars($_POST['price']);
}
?>


<?php

$sqldep = "SELECT    `alumni_name`, `alumni_dep`, `graduation_year`, `birthdate`, `birthplace`, `gender`FROM `alumni` WHERE `fid`=$facultyid";
$resultdep = mysqli_query($con, $sqldep);

if ($resultdep->num_rows > 0) {

// output data of each row
echo "<table border='1'>";
echo "<tr>
<td>الإسم</td>
<td> القسم</td>

<td> سنه التخرج</td>

 

<td>تاريخ الميلاد</td>
<td> مكان الميلاد </td>
<td> النوع</td>
</tr>";
while($rowdep = $resultdep->fetch_assoc()) {

echo "<tr>
<td>" . $rowdep["alumni_name"]. "</td>
<td>" . $rowdep["alumni_dep"]. "</td>

<td>" . $rowdep["graduation_year"]. "</td>

<td>" . $rowdep["birthdate"]. "</td>

<td>" . $rowdep["birthplace"]. "</td>

<td>" . $rowdep["gender"]. "</td>
</tr>";

}

echo "</table>";
} else {
//echo "0 results";
}


$con->close();
?>


{/source}